@layer pages {
  /* ---------- Tabs ---------- */
  .tabs {
    display: flex; gap: 22px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 20px;
  }
  .tab {
    position: relative;
    padding: 0 0 11px;
    border: none; background: none;
    font-size: 13px; color: var(--ink-500);
    letter-spacing: 0.01em;
    transition: color .18s;
  }
  .tab:hover { color: var(--ink-900); }
  .tab.on { color: var(--ink-900); font-weight: 600; }
  .tab.on::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: -1px;
    height: 2px; border-radius: 1px; background: var(--ink-900);
  }

  /* ---------- 列表 ---------- */
  .list { display: flex; flex-direction: column; gap: 10px; }
  .vote-card {
    position: relative;
    display: grid; grid-template-columns: 34px 1fr 18px; align-items: start;
    gap: 14px; padding: 20px 20px 18px;
    background: var(--panel); border: 1px solid var(--line);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
  }
  .vote-card:hover {
    border-color: var(--line-strong);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
  }
  .vc-index {
    font-family: var(--mono); font-size: 12px; color: var(--ink-300);
    letter-spacing: .04em; padding-top: 3px; font-variant-numeric: tabular-nums;
  }
  .vc-body { min-width: 0; }
  .vc-head { display: flex; align-items: center; gap: 10px; justify-content: space-between; }
  .vc-title {
    margin: 0; font-size: 16.5px; font-weight: 600;
    letter-spacing: -0.015em; line-height: 1.35; color: var(--ink-900);
  }
  .vc-desc { margin: 7px 0 0; font-size: 12.5px; color: var(--ink-500); line-height: 1.6; }
  .vc-meta {
    margin-top: 13px; display: flex; align-items: center; gap: 9px;
    font-size: 11.5px; color: var(--ink-400); flex-wrap: wrap;
  }
  .vc-meta b { font-weight: 500; color: var(--ink-600); }
  .vc-mine { color: var(--running); }
  .vc-arrow { color: var(--ink-300); padding-top: 2px; transition: color .2s, transform .2s; }
  .vote-card:hover .vc-arrow { color: var(--ink-700); transform: translateX(2px); }

  /* ---------- 详情 ---------- */
  .topic {
    padding: 30px 28px 26px;
    background: var(--panel); border: 1px solid var(--line);
    border-radius: 20px; box-shadow: var(--shadow-sm);
  }
  .topic-state { margin-bottom: 14px; }
  .topic-title {
    margin: 0; font-size: 26px; font-weight: 600;
    letter-spacing: -0.03em; line-height: 1.22;
  }
  .topic-desc { margin: 10px 0 0; font-size: 13px; color: var(--ink-500); line-height: 1.7; }
  .topic-meta {
    margin-top: 16px; display: flex; align-items: center; gap: 9px;
    font-size: 11.5px; color: var(--ink-400); flex-wrap: wrap;
  }
  .topic-meta b { font-weight: 500; color: var(--ink-600); }

  /* ---------- 选项（结果条内嵌在选项内） ---------- */
  .options { margin-top: 26px; display: flex; flex-direction: column; gap: 8px; }
  .option {
    position: relative; overflow: hidden;
    display: flex; align-items: center; gap: 11px; width: 100%;
    padding: 15px 16px; text-align: left;
    background: #fff; border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    font-size: 13.5px; color: var(--ink-900); letter-spacing: 0.005em;
    transition: border-color .18s ease, background .18s ease;
  }
  .option:hover { border-color: rgba(11, 18, 32, 0.26); }
  .option.on { border-color: var(--ink-900); background: #fbfcfd; }
  .option.readonly { cursor: default; }
  .option.readonly:hover { border-color: var(--line-strong); }
  .option.on.readonly:hover { border-color: var(--ink-900); }

  .opt-fill {
    position: absolute; left: 0; top: 0; bottom: 0;
    background: rgba(11, 18, 32, 0.055);
    transition: width .5s cubic-bezier(.22, 1, .36, 1);
    pointer-events: none;
  }
  .option.on .opt-fill { background: rgba(11, 18, 32, 0.1); }
  .option.leading .opt-fill { background: rgba(11, 18, 32, 0.085); }

  .opt-mark, .opt-label, .opt-stat, .opt-lead { position: relative; z-index: 1; }
  .opt-mark {
    width: 17px; height: 17px; flex-shrink: 0;
    border: 1.5px solid var(--ink-300); border-radius: 50%;
    transition: border-color .18s, background .18s;
  }
  .option[data-multi="1"] .opt-mark { border-radius: 5px; }
  .option.on .opt-mark { border-color: var(--ink-900); }
  .option.on .opt-mark::after {
    content: ''; position: absolute; inset: 3.5px; border-radius: 50%; background: var(--ink-900);
  }
  .option.on[data-multi="1"] .opt-mark::after {
    content: '✓'; inset: 0; background: transparent; color: var(--ink-900);
    font-size: 10px; line-height: 1;
    display: flex; align-items: center; justify-content: center;
  }
  .opt-label { flex: 1; min-width: 0; }
  .opt-lead {
    font-size: 10px; letter-spacing: .08em; color: var(--amber);
    padding: 2px 6px; border: 1px solid rgba(180, 83, 9, 0.28); border-radius: 5px;
  }
  .opt-stat {
    font-family: var(--mono); font-size: 11.5px; color: var(--ink-500);
    font-variant-numeric: tabular-nums; white-space: nowrap;
  }
  .option.on .opt-stat { color: var(--ink-700); }

  /* ---------- 操作区 ---------- */
  .actions { margin-top: 26px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
  .hint { font-size: 11.5px; color: var(--ink-400); }
  .back {
    display: inline-flex; align-items: center; gap: 5px;
    margin-top: 22px; font-size: 12px; color: var(--ink-400);
    transition: color .18s;
  }
  .back:hover { color: var(--ink-900); }

  .result-hidden {
    margin-top: 24px; padding: 14px 16px;
    border-radius: var(--radius); background: #f8fafc;
    border: 1px dashed var(--line-strong);
    font-size: 12px; color: var(--ink-500);
  }

  /* ---------- 空 / 加载 ---------- */
  .empty { padding: 64px 16px; text-align: center; font-size: 12.5px; color: var(--ink-400); }
  .empty a { color: var(--ink-700); text-decoration: underline; text-underline-offset: 3px; }

  /* ---------- 登录弹窗 ---------- */
  .mask {
    position: fixed; inset: 0; z-index: 60;
    background: rgba(8, 12, 20, 0.44); backdrop-filter: blur(2px);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
  }
  .mask[hidden] { display: none; }
  .dialog {
    width: 352px; max-width: 100%;
    background: #fff; border-radius: 16px; padding: 22px;
    box-shadow: 0 32px 80px -20px rgba(8, 12, 20, 0.5);
  }
  .dialog h3 { margin: 0 0 4px; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
  .dialog .sub { margin: 0 0 18px; font-size: 11.5px; color: var(--ink-400); }
  .field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 13px; }
  .field span { font-size: 11.5px; color: var(--ink-500); }
  .field input {
    height: 38px; padding: 0 12px; border-radius: 9px;
    border: 1px solid var(--line-strong); background: #fff;
    font-size: 13px; color: var(--ink-900); outline: none;
    font-family: inherit; transition: border-color .18s;
  }
  .field input:focus { border-color: var(--ink-900); }
  .dialog-acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
  .toast {
    position: fixed; left: 50%; bottom: 44px; transform: translateX(-50%);
    padding: 9px 15px; border-radius: 10px; z-index: 80;
    background: var(--ink-900); color: #fff; font-size: 12px; letter-spacing: .01em;
    box-shadow: 0 16px 40px -16px rgba(8, 12, 20, 0.6);
  }

  @media (max-width: 640px) {
    .wrap { padding: 26px 16px 56px; }
    .page-head h1 { font-size: 24px; }
    .vote-card { grid-template-columns: 26px 1fr; padding: 16px 16px 15px; }
    .vc-arrow { display: none; }
    .vc-title { font-size: 15.5px; }
    .topic { padding: 22px 18px; border-radius: 16px; }
    .topic-title { font-size: 21px; }
    .option { padding: 13px 14px; font-size: 13px; }
    .actions { gap: 10px; }
    .btn-lg { width: 100%; }
  }
}
