/* 首次来华准备清单 · 样式 */

/* Dark-only theme */
:root {
  --bg: #14161a;
  --surface: #1c1f25;
  --surface-2: #23272e;
  --text: #e7eaee;
  --text-soft: #c7ccd4;
  --muted: #98a1ad;
  --border: #2c313a;
  --border-strong: #3a414c;
  --accent: #ff6f5e;
  --accent-soft: #33221f;
  --star: #ffc14d;
  --star-off: #3d444e;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 28px rgba(0, 0, 0, .28);
  --radius: 14px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  transition: background-color .25s ease, color .25s ease;
}

.wrap {
  max-width: 940px;
  margin: 0 auto;
  padding: 0 16px;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 顶栏 ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.brand { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }

.brand-zh {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .02em;
}

.brand-en {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: .04em;
}

/* ---------- 社交分享（右上角） ---------- */

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.share {
  display: flex;
  align-items: center;
  gap: 5px;
}

.share-btn {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color .2s ease, background-color .2s ease, border-color .2s ease, transform .15s ease;
}

.share-btn svg { width: 18px; height: 18px; }

.share-btn:hover,
.share-btn:focus-visible {
  color: #fff;
  background: var(--c, var(--accent));
  border-color: var(--c, var(--accent));
  outline: none;
  transform: translateY(-1px);
}

.share-btn.copy.copied {
  color: var(--star);
  background: var(--surface);
  border-color: var(--star);
}

.share-toggle {
  display: none;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.share-toggle svg { width: 18px; height: 18px; }

/* ---------- 作者说明（顶部引言） ---------- */

.note {
  position: relative;
  margin: 22px 0 4px;
  padding: 20px 22px 20px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.note::before {
  content: "\201C";
  position: absolute;
  top: -2px;
  left: 12px;
  font: 700 56px/1 Georgia, "Times New Roman", serif;
  color: var(--accent);
  opacity: .18;
  pointer-events: none;
}

.note-kicker {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
}

.note-body {
  margin: 0 0 10px;
  color: var(--text-soft);
  font-size: 16px;
  line-height: 1.65;
}

.note-body:last-child { margin-bottom: 0; }

/* ---------- 说明区 ---------- */

.intro { padding: 22px 2px 6px; }

.intro-lead {
  margin: 0 0 12px;
  color: var(--text-soft);
  font-size: 15px;
}

.intro-lead b { color: var(--accent); }

.intro-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.legend { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- 星星 ---------- */

.stars { display: inline-flex; gap: 2px; font-size: 15px; line-height: 1; }

.stars .s {
  font-style: normal;
  color: var(--star-off);
}

.stars .s.on { color: var(--star); }

.stars-sm { font-size: 12px; }

/* ---------- 表格 ---------- */

.cl-table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.cl-table thead th {
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--muted);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  white-space: nowrap;
}

.cl-table .c-name { width: 20%; }
.cl-table .c-star { width: 120px; }
.cl-table .c-desc { width: auto; }

.cl-table tbody tr.row { border-bottom: 1px solid var(--border); }

.cl-table tbody tr.row td {
  padding: 14px 16px;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.cl-table tbody tr.row:hover { background: var(--surface-2); }

.cl-table tbody tr.row.open {
  background: var(--surface-2);
}

.cl-table tbody tr.row.open td { border-bottom-color: transparent; }

.name-zh {
  display: block;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: .01em;
}

.name-en {
  display: block;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: .03em;
}

.c-star { white-space: nowrap; }

.summary {
  margin: 0;
  color: var(--text-soft);
  font-size: 15px;
}

.more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  min-height: 32px;
  padding: 2px 4px;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.more:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.more-arrow {
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  transition: transform .25s ease;
}

.row.open .more-arrow { transform: rotate(180deg); }

/* 明细行 */

.detail-row td {
  padding: 0;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}

.detail-wrap {
  max-height: 0;
  overflow: hidden;
  transition: max-height .32s cubic-bezier(.4, 0, .2, 1);
}

.detail-card {
  padding: 2px 18px 18px;
  border-left: 3px solid var(--accent);
  margin: 0 16px 16px;
  background: var(--surface);
  border-radius: 0 10px 10px 0;
}

.detail-card p {
  margin: 0 0 12px;
  font-size: 14.5px;
  color: var(--text-soft);
}

.detail-card p:last-child { margin-bottom: 0; }

/* 内文链接：用品牌强调色，避免浏览器默认绿色 */
.detail-card a,
.summary a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.detail-card a:hover,
.summary a:hover { opacity: .85; }

.item-img {
  display: block;
  max-width: 260px;
  width: 100%;
  height: auto;
  margin-top: 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

/* ---------- 页脚 ---------- */

.foot {
  padding: 22px 2px 40px;
  font-size: 13px;
  color: var(--muted);
}

.foot p { margin: 0 0 6px; }

.foot-em b { color: var(--accent); }

/* ---------- 工具栏：搜索 / 筛选 / 进度 ---------- */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 16px 0 4px;
}

.search-wrap {
  position: relative;
  flex: 1 1 220px;
  min-width: 0;
}

.search {
  width: 100%;
  height: 44px;
  padding: 0 40px 0 40px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .2s ease, background-color .2s ease;
}

.search:focus {
  outline: none;
  border-color: var(--accent);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 17px;
  height: 17px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  pointer-events: none;
}

.search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-soft);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color .2s ease, color .2s ease, background-color .2s ease;
}

.chip:hover { border-color: var(--accent); }

.chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

[data-theme="dark"] .chip.is-active { color: #14161a; }

.progress {
  flex: 1 1 100%;
  display: flex;
  align-items: center;
  gap: 10px;
}

.progress-track {
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
  border: 1px solid var(--border);
}

.progress-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--star));
  transition: width .35s ease;
}

.progress-text {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

/* ---------- 复选框 / 完成态 ---------- */

.chk-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.chk-item {
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
  flex: 0 0 auto;
}

.row.item-checked .name-zh {
  text-decoration: line-through;
  opacity: .6;
}

.row.item-checked .summary { opacity: .6; }

/* ---------- 行内按钮（More / Copy） ---------- */

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 2px 4px;
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color .2s ease;
}

.copy-btn:hover { color: var(--accent); }
.copy-btn.copied { color: var(--star); }

/* ---------- 隐藏（搜索/筛选不匹配） ---------- */

.row.hidden,
.detail-row.hidden { display: none !important; }

/* ---------- 移动端：表格转卡片 ---------- */

@media (max-width: 720px) {
  body { font-size: 16px; }

  .wrap { padding: 0 12px; }

  .brand-zh { font-size: 16px; }
  .brand-en { font-size: 11px; }

  .share-toggle { display: inline-flex; }
  .share {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: 232px;
    gap: 8px;
    padding: 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
    z-index: 30;
  }
  .share.open { display: flex; }
  .share-btn { width: 42px; height: 42px; }

  .intro { padding: 16px 2px 4px; }
  .intro-lead { font-size: 14.5px; }
  .intro-meta { gap: 6px 12px; font-size: 12px; }

  .note { padding: 18px 18px 18px 20px; }
  .note-body { font-size: 15px; }

  .cl-table,
  .cl-table tbody,
  .cl-table tr,
  .cl-table td {
    display: block;
    width: 100%;
  }

  .cl-table {
    border: 0;
    background: none;
    box-shadow: none;
    overflow: visible;
  }

  .cl-table thead {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .cl-table tbody tr.row {
    margin: 0 0 0;
    padding: 14px 14px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    border-bottom-left-radius: var(--radius);
    border-bottom-right-radius: var(--radius);
    box-shadow: var(--shadow);
  }

  .cl-table tbody tr.row + .detail-row { margin-top: 8px; }

  .cl-table tbody tr.row.open {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom-color: transparent;
  }

  .cl-table tbody tr.row td {
    padding: 0;
    border: 0;
  }

  .cl-table tbody tr.row td + td { margin-top: 6px; }

  .cl-table tbody tr.row:hover { background: var(--surface); }

  .cl-table .c-name,
  .cl-table .c-star,
  .cl-table .c-desc { width: auto; }

  .name-zh { font-size: 17px; }
  .name-en { font-size: 12px; }

  .stars { font-size: 17px; gap: 3px; }

  .summary { font-size: 15px; }

  .more { min-height: 44px; font-size: 15px; }

  .copy-btn { min-height: 44px; }

  .search { height: 48px; font-size: 16px; }
  .chip { min-height: 44px; }

  .detail-row { margin: -1px 0 14px; }

  .detail-row td {
    padding: 0;
    background: none;
    border: 0;
  }

  .detail-card {
    margin: 0;
    padding: 2px 14px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 0;
    border-left: 3px solid var(--accent);
    border-radius: 0 0 var(--radius) var(--radius);
  }

  .detail-card p { font-size: 14.5px; }

  .foot { padding: 16px 2px 32px; }
}

@media (prefers-reduced-motion: reduce) {
  .detail-wrap { transition: none; }
  .more-arrow { transition: none; }
}
