/* =============================================================
   作·品 — 后台管理
   沿用前台的深色色板，但偏工具化：信息密度高、控件明确
   ============================================================= */

:root {
  --bg:        #0b0b0d;
  --panel:     #141419;
  --panel-2:   #101014;
  --line:      rgba(255, 255, 255, .08);
  --line-2:    rgba(255, 255, 255, .16);
  --text:      #ece9e4;
  --muted:     #8b8782;
  --muted-2:   #5f5c58;
  --accent:    #c8a45c;
  --danger:    #d9705f;
  --ok:        #6fbf8c;
  --radius:    3px;
  --font-sans: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei",
               "Hiragino Sans GB", system-ui, sans-serif;
  --font-display: "Songti SC", "STSong", "Source Han Serif SC", "SimSun", Georgia, serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ---------- 顶栏 ---------- */
.abar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(11,11,13,.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.abar__in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: 58px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 26px;
}
.abar__brand {
  font-family: var(--font-display);
  font-size: 17px;
  letter-spacing: .16em;
}
.abar__nav { display: flex; align-items: center; gap: 6px; }
.abar__nav a {
  font-size: 13px;
  color: var(--muted);
  padding: 7px 13px;
  border-radius: var(--radius);
  transition: color .2s, background .2s;
}
.abar__nav a:hover { color: var(--text); background: rgba(255,255,255,.05); }
.abar__nav a.is-on { color: var(--accent); background: rgba(200,164,92,.12); }
.abar__spacer { flex: 1; }
.abar__who { font-size: 12px; color: var(--muted-2); }

/* ---------- 版心 ---------- */
.awrap { max-width: 1440px; margin: 0 auto; padding: 28px 26px 80px; }

.ahead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 22px;
}
.ahead h1 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: .1em;
  margin: 0;
}
.ahead__sub { font-size: 12px; color: var(--muted-2); letter-spacing: .06em; }

/* ---------- 按钮 ---------- */
.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  padding: 9px 17px;
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .2s, background .2s, color .2s;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #12100c; font-weight: 600; }
.btn--primary:hover { background: #d8b673; color: #12100c; }
.btn--danger { border-color: rgba(217,112,95,.4); color: var(--danger); }
.btn--danger:hover { border-color: var(--danger); background: rgba(217,112,95,.1); color: var(--danger); }
.btn--sm { padding: 5px 11px; font-size: 12px; }
.btn[disabled] { opacity: .45; cursor: default; }
.btn--primary[disabled]:hover { background: var(--accent); color: #12100c; }
/* 按钮版的「不可用」（<a> 没法用 disabled 属性），如全景链接空着时的「打开」 */
.btn.is-off { opacity: .35; pointer-events: none; }

/* ---------- 卡片 / 面板 ---------- */
.panel {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 22px;
}
.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  letter-spacing: .16em;
  color: var(--muted-2);
}
.panel__body { padding: 18px; }

/* ---------- 表格 ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--accent); vertical-align: middle; cursor: pointer; }
.tbl th {
  text-align: left;
  font-weight: 400;
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--muted-2);
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.tbl td {
  padding: 11px 12px;
  border-bottom: 1px solid rgba(255,255,255,.045);
  vertical-align: middle;
}
.tbl tr:hover td { background: rgba(255,255,255,.018); }
.tbl__thumb {
  width: 68px; height: 51px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--panel);
}
.tbl__title { font-size: 13.5px; }
.tbl__no { font-size: 11px; color: var(--muted-2); font-variant-numeric: tabular-nums; }
.tbl__acts { display: flex; gap: 6px; justify-content: flex-end; }

/* 列表页的封面格：鼠标停在这一行时浮出「Ctrl+V」提示，一望即知粘到哪一行 */
.covercell { position: relative; width: 68px; height: 51px; }
.covercell__box { width: 100%; height: 100%; }
.covercell__box.is-busy { opacity: .35; }
.covercell__box.is-fresh { animation: coverflash .9s ease; }
@keyframes coverflash {
  0%   { box-shadow: 0 0 0 0 rgba(200,164,92,.85); }
  100% { box-shadow: 0 0 0 9px rgba(200,164,92,0); }
}
.covercell__hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2px;
  border: 1px dashed var(--accent);
  border-radius: var(--radius);
  background: rgba(10,10,12,.74);
  color: var(--accent);
  font-size: 10px;
  line-height: 1.3;
  letter-spacing: .04em;
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s;
}
tr[data-id]:hover .covercell__hint { opacity: 1; }
tr[data-id]:hover { background: rgba(200,164,92,.06); }
.tbl__empty { text-align: center; color: var(--muted-2); padding: 54px 0; }
/* 网址和 UA 都可能很长，一律截断，原文放在 title 里 */
.tbl__path,
.tbl__ua {
  display: block;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tbl__path { font-size: 11px; color: var(--muted-2); }
.tbl__ua   { font-size: 12px; color: var(--muted-2); }
/* IP 下面那行地区 */
.tbl__geo  { display: block; font-size: 11px; color: var(--muted-2); margin-top: 2px; }

/* 面板底部的一行说明（如「还有几个 IP 没查完」） */
.panel__note {
  padding: 11px 18px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted-2);
}

/* ---------- 统计卡（访客流量） ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 22px; }
.stat {
  display: block;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  transition: border-color .2s, background .2s;
}
.stat:hover { border-color: var(--line-2); }
.stat.is-on { border-color: rgba(200,164,92,.5); background: rgba(200,164,92,.05); }
.stat__k { font-size: 11px; letter-spacing: .16em; color: var(--muted-2); }
.stat.is-on .stat__k { color: var(--accent); }
.stat__v {
  font-family: var(--font-display);
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: .04em;
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
}
.stat__u { font-family: var(--font-sans); font-size: 11px; letter-spacing: .1em; color: var(--muted-2); margin-left: 6px; }
.stat__sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.stat__sub b { color: var(--text); font-weight: 500; }

.chip {
  display: inline-block;
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--line-2);
  border-radius: 2px;
  padding: 1px 7px;
  margin: 1px 3px 1px 0;
  white-space: nowrap;
}
.chip--kong { color: var(--accent); border-color: rgba(200,164,92,.45); }
.chip--off { color: var(--muted-2); border-color: var(--line); }
.chip--on { color: var(--ok); border-color: rgba(111,191,140,.45); }

/* ---------- 表单 ---------- */
.frow { margin-bottom: 18px; }
.frow > label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: .1em;
  margin-bottom: 7px;
}
.frow small { display: block; color: var(--muted-2); font-size: 11px; margin-top: 6px; }
/* 输入框右边挂个按钮（如全景链接的「打开」）：输入框吃掉剩余宽度，按钮不缩 */
.frow__row { display: flex; gap: 10px; align-items: stretch; }
.frow__row > input { flex: 1 1 auto; min-width: 0; }
.frow__row > .btn { flex: 0 0 auto; display: inline-flex; align-items: center; }

input[type=text], input[type=password], input[type=number], input[type=url], select, textarea {
  width: 100%;
  background: #0e0e12;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  padding: 10px 12px;
  transition: border-color .2s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; min-height: 96px; line-height: 1.8; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

.switch { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; color: var(--muted); cursor: pointer; }
.switch input { width: auto; }

/* ---------- 图片管理 ---------- */
.cover-box {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.cover-box__preview {
  width: 180px; height: 135px;
  border: 1px solid var(--line);
  background: var(--panel);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: 0 0 auto;
}
.cover-box__preview img { width: 100%; height: 100%; object-fit: cover; }
.cover-box__preview span { color: var(--muted-2); font-size: 12px; }

/* 封面被换过（选了图 / 粘贴了图）时的提示条 */
.cover-note { display: none; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--ok); }
.cover-note.is-on { display: flex; }

.ph-mini { width: 100%; height: 100%; }
.ph-mini.ph-0 { background: linear-gradient(140deg,#1a1f2b,#0d0f14); }
.ph-mini.ph-1 { background: linear-gradient(140deg,#241d13,#0e0c09); }
.ph-mini.ph-2 { background: linear-gradient(140deg,#14201c,#0c110f); }
.ph-mini.ph-3 { background: linear-gradient(140deg,#201a24,#0e0c10); }
.ph-mini.ph-4 { background: linear-gradient(140deg,#1e1c1a,#0d0c0b); }
.ph-mini.ph-5 { background: linear-gradient(140deg,#12201f,#0b1211); }
.ph-mini.ph-6 { background: linear-gradient(140deg,#1b1a2a,#0d0d14); }
.ph-mini.ph-7 { background: linear-gradient(140deg,#17171a,#0b0b0d); }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.gitem { position: relative; border: 1px solid var(--line); background: var(--panel); }
.gitem img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
/* PDF 的格子。它生不出缩略图，硬塞 <img> 就是一格裂图，
   所以改成一块写死的「PDF」，点开在新窗口看原件。 */
.gitem__pdf {
  display: flex;
  width: 100%;
  aspect-ratio: 4/3;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  letter-spacing: .24em;
  text-indent: .24em;
  color: var(--muted-2);
  text-decoration: none;
  background: repeating-linear-gradient(45deg, #16161a, #16161a 7px, #1d1d22 7px, #1d1d22 14px);
  transition: color .2s;
}
.gitem__pdf:hover { color: var(--text); }
.gitem__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 7px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted-2);
}
.gitem__bar button {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--muted-2);
  cursor: pointer;
  font-size: 13px;
  padding: 0 4px;
  line-height: 1;
}
.gitem__bar button:hover { color: var(--danger); }

/* ---------- 提示 ---------- */
.alert { padding: 12px 16px; font-size: 13px; border: 1px solid; border-radius: var(--radius); margin-bottom: 20px; }
.alert--err  { border-color: rgba(217,112,95,.5);  background: rgba(217,112,95,.08);  color: #e8a196; }
.alert--ok   { border-color: rgba(111,191,140,.5); background: rgba(111,191,140,.08); color: #9ad4b0; }
.alert--info { border-color: var(--line-2); background: rgba(255,255,255,.03); color: var(--muted); }

/* ---------- 登录页 ---------- */
.login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login__box { width: 100%; max-width: 360px; }
.login__brand {
  font-family: var(--font-display);
  font-size: 30px;
  letter-spacing: .18em;
  text-align: center;
  margin-bottom: 6px;
}
.login__sub {
  text-align: center;
  font-size: 11px;
  letter-spacing: .3em;
  color: var(--muted-2);
  margin-bottom: 38px;
}
.login .btn { width: 100%; justify-content: center; margin-top: 6px; padding: 13px; }

/* ---------- 右下角的轻提示（列表页粘封面用） ---------- */
.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: min(440px, calc(100vw - 44px));
  padding: 12px 16px;
  border: 1px solid var(--line-2);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  background: #16161b;
  color: var(--text);
  font-size: 13px;
  box-shadow: 0 14px 40px rgba(0,0,0,.5);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.is-on { opacity: 1; transform: none; pointer-events: auto; }
.toast--ok   { border-left-color: #6fbf8c; }
.toast--err  { border-left-color: var(--danger); }
.toast--warn { border-left-color: var(--accent); }
.toast__act {
  flex: 0 0 auto;
  appearance: none;
  background: transparent;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  color: var(--accent);
  font-family: inherit;
  font-size: 12px;
  padding: 5px 12px;
  cursor: pointer;
  white-space: nowrap;
}
.toast__act:hover { background: rgba(200,164,92,.14); }

/* ---------- 移动端 ---------- */
@media (max-width: 860px) {
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .stat__v { font-size: 26px; }
  .abar__in { padding: 0 16px; }
  .awrap { padding: 20px 16px 60px; }
  .tbl--scroll { display: block; overflow-x: auto; white-space: nowrap; }
  .abar__who { display: none; }
}
