/* Operial 分享站 — 视觉系统（沿自客户端 operial-light 色系，榜单形态已定稿） */
:root {
  --bg-base: #eceef1;
  --bg-panel: #ffffff;
  --bg-row-hover: #f7f8fa;
  --bg-control: #f1f2f4;
  --bg-control-hover: #e5e7eb;
  --text-primary: #16181d;
  --text-secondary: #6b7079;
  --text-faint: #a1a5ad;
  --accent: #e8263b;
  --accent-hover: #d11f33;
  --accent-press: #b81a2c;
  --accent-soft: #fbe9eb;
  --on-accent: #ffffff;
  --danger: #c2410c;
  --ok: #15803d;
  --divider: rgba(16, 24, 40, .08);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg-base);
  color: var(--text-primary);
  font-family: Inter, "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── 顶栏 ── */
header { background: var(--bg-panel); border-bottom: 1px solid var(--divider); }
.header-inner {
  max-width: 980px; margin: 0 auto; padding: 0 24px; height: 56px;
  display: flex; align-items: center; gap: 28px;
}
.brand { font-size: 15px; font-weight: 700; letter-spacing: .14em; color: var(--text-primary); text-decoration: none; white-space: nowrap; }
.brand em { font-style: normal; color: var(--accent); }
nav { display: flex; gap: 4px; flex: 1; }
nav a { padding: 6px 12px; border-radius: 6px; color: var(--text-secondary); text-decoration: none; font-weight: 600; }
nav a:hover { background: var(--bg-control); color: var(--text-primary); }
nav a.active { background: var(--bg-control); color: var(--text-primary); }
.header-cta {
  padding: 7px 16px; background: var(--accent); color: var(--on-accent);
  border-radius: 7px; font-weight: 700; text-decoration: none; transition: background .15s;
}
.header-cta:hover { background: var(--accent-hover); }

/* ── 主体 ── */
main { flex: 1; width: 100%; max-width: 980px; margin: 0 auto; padding: 36px 24px 64px; }
.hero { margin-bottom: 20px; }
.hero h1 { font-size: 26px; font-weight: 800; letter-spacing: .01em; }
.hero p { margin-top: 4px; color: var(--text-secondary); font-size: 14px; }
.hero p strong { color: var(--text-primary); font-weight: 600; }

/* ── 榜单工具行 ── */
.board-tools { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.board-tools .count { color: var(--text-secondary); margin-right: auto; font-size: 13px; }
select {
  appearance: none; padding: 6px 30px 6px 12px;
  background: var(--bg-panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236b7079' fill='none' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 11px center;
  border: 1px solid var(--divider); border-radius: 7px; font: inherit; font-size: 13px; color: var(--text-primary); cursor: pointer;
}
select:hover { background-color: var(--bg-control); }

/* ── 榜单面板 ── */
.board { background: var(--bg-panel); border-radius: 12px; border: 1px solid var(--divider); overflow: hidden; }
.board-head, .row { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 0 20px; }
.board-head { height: 42px; color: var(--text-faint); font-size: 12px; font-weight: 600; border-bottom: 1px solid var(--divider); }
.board-head .col-side { display: flex; gap: 18px; padding-left: 4px; }
.board-head .col-side span { width: 64px; text-align: center; }
.board-head .col-side span.w-copy { width: auto; }
.row { min-height: 64px; border-bottom: 1px solid var(--divider); transition: background .12s; }
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--bg-row-hover); }
.row.plain { grid-template-columns: minmax(0,1fr) auto; }
.rank { font-size: 17px; font-weight: 800; color: var(--text-faint); font-variant-numeric: tabular-nums; text-align: center; }
.rank.top { color: var(--accent); }
.row-main { min-width: 0; padding: 10px 0; }
.title-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.row h3 { font-size: 15px; font-weight: 700; line-height: 1.4; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row h3:hover { color: var(--accent-hover); }
.row.static h3 { cursor: default; }
.row.static h3:hover { color: inherit; }
.badges { display: flex; gap: 6px; flex-shrink: 0; }
.badge { font-size: 12px; font-weight: 600; color: var(--text-secondary); background: var(--bg-control); padding: 1px 8px; border-radius: 99px; white-space: nowrap; line-height: 1.5; }
.badge.character { background: var(--accent-soft); color: var(--accent); }
.badge.status-pending { background: #fef3c7; color: #92400e; }
.badge.status-approved { background: #dcfce7; color: #166534; }
.badge.status-rejected { background: #fee2e2; color: #991b1b; }
.sub-line { margin-top: 1px; font-size: 13px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub-line .author { color: var(--text-secondary); font-weight: 600; }
.sub-line .dot::before { content: "·"; margin: 0 5px; }
.row-side { display: flex; align-items: center; gap: 8px; }
button { font: inherit; border: 0; cursor: pointer; border-radius: 7px; transition: background .15s, color .15s, border-color .15s; }
.like {
  display: inline-flex; flex-direction: column; align-items: center; gap: 1px; width: 56px; padding: 6px 0 5px;
  background: transparent; color: var(--text-faint); font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; line-height: 1.2;
}
.like:hover { background: var(--bg-control); color: var(--accent); }
.like.on { color: var(--accent); }
.like.on:hover { background: var(--accent-soft); }
.like svg { width: 15px; height: 15px; }
.like.on svg path { fill: var(--accent); stroke: var(--accent); }
.copy { width: 88px; padding: 8px 0; background: transparent; color: var(--text-secondary); font-weight: 700; font-size: 13px; border: 1px solid var(--divider); }
.copy:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.copy:active { background: var(--accent-press); border-color: var(--accent-press); }
.copy.done { background: var(--bg-control); border-color: transparent; color: var(--text-secondary); pointer-events: none; }
button.primary { padding: 9px 20px; background: var(--accent); color: var(--on-accent); font-weight: 700; }
button.primary:hover { background: var(--accent-hover); }
button.primary:active { background: var(--accent-press); }
button.primary:disabled { background: var(--bg-control); color: var(--text-faint); cursor: default; }
button.ghost { padding: 8px 16px; background: var(--bg-control); color: var(--text-secondary); font-weight: 600; }
button.ghost:hover { background: var(--bg-control-hover); color: var(--text-primary); }
button.ok-btn { padding: 8px 16px; background: var(--ok); color: #fff; font-weight: 700; }
button.ok-btn:hover { background: #166534; }
button.danger-btn { padding: 8px 16px; background: transparent; border: 1px solid var(--divider); color: var(--danger); font-weight: 700; }
button.danger-btn:hover { background: #fee2e2; border-color: #fecaca; }

/* ── 空态 / 提示块 ── */
.empty { text-align: center; color: var(--text-faint); padding: 72px 0; }
.empty .big { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.notice {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%) translateY(8px);
  background: var(--text-primary); color: #fff; padding: 9px 18px; border-radius: 8px;
  font-size: 13px; font-weight: 600; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; box-shadow: 0 6px 24px rgba(16,24,40,.25); max-width: 80vw;
}
.notice.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.notice.error { background: var(--danger); }

/* ── 表单（提交/管理）── */
.panel { background: var(--bg-panel); border-radius: 12px; border: 1px solid var(--divider); padding: 28px; }
.panel h2 { font-size: 17px; font-weight: 800; margin-bottom: 4px; }
.panel .lead { color: var(--text-secondary); font-size: 13px; margin-bottom: 20px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.field label .hint { color: var(--text-faint); font-weight: 400; margin-left: 6px; }
.field input, .field textarea {
  width: 100%; padding: 9px 12px; background: var(--bg-panel);
  border: 1px solid var(--divider); border-radius: 7px; font: inherit; color: var(--text-primary);
}
.field textarea { min-height: 140px; resize: vertical; font-family: ui-monospace, Consolas, monospace; font-size: 12px; line-height: 1.5; }
.field input:focus, .field textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.field .error { color: var(--danger); font-size: 12px; margin-top: 5px; min-height: 1em; }
.form-ok { display: flex; align-items: center; gap: 10px; padding: 20px; background: #dcfce7; border-radius: 8px; color: #14532d; font-weight: 600; }
.steps { margin: 0 0 20px; padding-left: 20px; color: var(--text-secondary); font-size: 13px; }
.steps li { margin-bottom: 6px; }
.steps strong { color: var(--text-primary); }

/* ── 管理页 ── */
.admin-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.admin-bar input { width: 240px; padding: 8px 12px; border: 1px solid var(--divider); border-radius: 7px; font: inherit; }
.admin-tabs { display: flex; gap: 4px; margin-bottom: 14px; }
.admin-tabs button { padding: 6px 14px; background: var(--bg-control); color: var(--text-secondary); font-weight: 600; font-size: 13px; border-radius: 99px; }
.admin-tabs button.active { background: var(--text-primary); color: #fff; }
.expand { padding: 10px 20px 14px 62px; background: var(--bg-row-hover); border-bottom: 1px solid var(--divider); font-size: 13px; color: var(--text-secondary); }
.expand .topics { margin-top: 6px; color: var(--text-primary); }

/* ── 页脚 ── */
footer { border-top: 1px solid var(--divider); background: var(--bg-panel); padding: 26px 24px; text-align: center; color: var(--text-faint); font-size: 12px; }
footer a { color: var(--text-secondary); text-decoration: none; font-weight: 600; }
footer a:hover { color: var(--accent); }

@media (max-width: 640px) {
  .header-inner { padding: 0 16px; gap: 12px; }
  .header-cta span { display: none; }
  main { padding: 22px 16px 48px; }
  .board-head { display: none; }
  .board-head, .row { grid-template-columns: 34px minmax(0, 1fr) auto; padding: 0 12px; gap: 10px; }
  .rank { font-size: 14px; }
  .sub-line { white-space: normal; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
  .copy { width: 64px; }
  .like { width: 44px; }
}
