/* ============================================================
   AI 头绪导航 · 浅色清新科技主题
   主色：青碧 + 晴蓝，白底通透，柔和光晕
   ============================================================ */
:root {
  --bg: #f4f8fb;
  --bg-soft: #eef4f9;
  --panel: rgba(255, 255, 255, 0.85);
  --panel-solid: #ffffff;
  --border: rgba(23, 78, 122, 0.10);
  --border-strong: rgba(20, 160, 155, 0.45);
  --text: #1d2b3a;
  --muted: #6b7f96;
  --accent: #0fb5a6;
  --accent-2: #3d8bfd;
  --accent-soft: rgba(15, 181, 166, 0.10);
  --warn: #e8871e;
  --danger: #e5484d;
  --radius: 14px;
  --maxw: 1760px;
  --font: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans SC", -apple-system, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", "SF Mono", Consolas, monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}
::selection { background: rgba(15, 181, 166, 0.22); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #c9d8e4; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #a9bfd2; }

/* ---------- 背景氛围（浅色柔光） ---------- */
.aurora {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background:
    radial-gradient(40% 34% at 10% -4%, rgba(15, 181, 166, 0.14), transparent 62%),
    radial-gradient(44% 38% at 90% 2%, rgba(61, 139, 253, 0.13), transparent 62%),
    radial-gradient(50% 42% at 50% 106%, rgba(120, 160, 255, 0.10), transparent 60%);
  animation: auroraDrift 22s ease-in-out infinite alternate;
}
@keyframes auroraDrift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(-2%, 3%, 0) scale(1.06); }
}
.grid-bg {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(61, 139, 253, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(61, 139, 253, 0.055) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 78%);
}

/* ---------- 公告栏 ---------- */
.announce-bar {
  display: flex; align-items: center; gap: 10px;
  max-width: var(--maxw); margin: 16px auto 18px; padding: 8px 16px;
  background: linear-gradient(90deg, rgba(15, 181, 166, 0.09), rgba(61, 139, 253, 0.09));
  border: 1px solid rgba(15, 181, 166, 0.25); border-radius: 10px;
  font-size: 13px; color: var(--muted);
  animation: fadeDown 0.5s ease both;
}
.announce-dot {
  width: 7px; height: 7px; border-radius: 50%; flex: none;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(15, 181, 166, 0.7);
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.35; } }
.announce-close {
  margin-left: auto; background: none; border: none; color: var(--muted);
  cursor: pointer; font-size: 13px; padding: 2px 6px; border-radius: 6px;
}
.announce-close:hover { color: var(--text); background: rgba(23, 78, 122, 0.08); }

/* ---------- 头部 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  transition: transform 0.32s ease;
  will-change: transform;
}
/* 顶栏智能隐藏：向下滚收起，向上滚滑回 */
body.nav-hide .site-header { transform: translateY(-100%); }
.header-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 16px 20px 12px;
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
}
.brand {
  display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text);
  flex: none;
}
.brand-mark { width: 34px; height: 34px; color: var(--accent); filter: drop-shadow(0 0 8px rgba(15,181,166,0.45)); }
.brand-logo { width: 40px; height: 40px; object-fit: contain; border-radius: 8px; }
.brand-name { font-size: 21px; font-weight: 700; letter-spacing: 1px; }
.brand-badge {
  font-family: var(--mono); font-size: 10px; letter-spacing: 1px;
  color: var(--accent); border: 1px solid rgba(15, 181, 166, 0.4);
  padding: 2px 7px; border-radius: 5px; background: var(--accent-soft);
}

.search-wrap { position: relative; flex: 1 1 300px; min-width: 240px; }
.search-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.stab {
  font-size: 12px; color: var(--muted); cursor: pointer; user-select: none;
  padding: 2px 12px; border-radius: 14px; border: 1px solid transparent; transition: all 0.15s;
}
.stab:hover { color: var(--text); border-color: var(--border); }
.stab.active {
  color: #ffffff; font-weight: 600; background: linear-gradient(135deg, var(--accent), #35c9ff);
  border-color: transparent; box-shadow: 0 2px 8px rgba(15,181,166,0.3);
}
.search-bar { position: relative; }
.search-bar .search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  width: 17px; height: 17px; color: var(--muted); pointer-events: none;
}
.search-bar #searchInput {
  width: 100%; padding: 11px 76px 11px 40px;
  background: var(--panel-solid); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  font-size: 14px; font-family: var(--font); outline: none;
  box-shadow: 0 2px 8px rgba(23, 78, 122, 0.05);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-bar #searchInput::placeholder { color: #9db0c4; }
.search-bar #searchInput:focus {
  border-color: var(--border-strong);
  box-shadow: 0 0 0 3px rgba(15, 181, 166, 0.12), 0 4px 14px rgba(15, 181, 166, 0.12);
}
.search-bar .search-clear {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(23, 78, 122, 0.08); color: var(--muted); font-size: 11px;
}
.search-clear:hover { background: rgba(23, 78, 122, 0.16); color: var(--text); }

.header-actions { display: flex; align-items: center; gap: 12px; flex: none; }
.bookmark-link {
  display: flex; flex-direction: column; align-items: center; line-height: 1.2;
  text-decoration: none; color: var(--muted); font-size: 13px; font-weight: 600;
  padding: 4px 10px; border: 1px dashed rgba(23, 78, 122, 0.25); border-radius: 8px;
  cursor: grab; transition: all 0.2s;
}
.bookmark-link:hover { color: var(--accent); border-color: rgba(15, 181, 166, 0.5); background: var(--accent-soft); }
.bk-hint { font-size: 10px; font-weight: 400; color: #9db0c4; }
.header-feedback-btn {
  flex: none; font-family: var(--font); font-size: 13px; font-weight: 600;
  padding: 8px 15px; border-radius: 9px; cursor: pointer;
  background: var(--panel-solid); color: var(--accent);
  border: 1px solid rgba(15, 181, 166, 0.45); transition: all 0.2s;
}
.header-feedback-btn:hover { background: var(--accent-soft); box-shadow: 0 0 0 2px rgba(15,181,166,0.15); }
.admin-link {
  text-decoration: none; color: var(--muted); font-size: 17px;
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  border-radius: 8px; border: 1px solid transparent; transition: all 0.2s;
}
.admin-link:hover { color: var(--accent); border-color: var(--border); background: var(--panel-solid); }
.submit-btn {
  flex: none; font-family: var(--font); font-size: 13px; font-weight: 700;
  padding: 8px 15px; border-radius: 9px; border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--accent), #35c9ff); color: #ffffff;
  box-shadow: 0 3px 12px rgba(15, 181, 166, 0.35); transition: all 0.2s;
}
.submit-btn:hover { transform: translateY(-1px); box-shadow: 0 5px 18px rgba(15, 181, 166, 0.5); }

/* 热门搜索 + 境外过滤 */
.hot-wrap {
  max-width: var(--maxw); margin: 0 auto; padding: 0 20px 12px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.hot-label {
  font-size: 12px; color: var(--warn); font-weight: 600; letter-spacing: 1px;
  border: 1px solid rgba(232, 135, 30, 0.35); padding: 1px 8px; border-radius: 5px;
  background: rgba(232, 135, 30, 0.07);
}
.hot-list { display: flex; gap: 8px; flex-wrap: wrap; }
.hot-tag {
  font-size: 12.5px; color: var(--muted); text-decoration: none;
  padding: 2px 10px; border-radius: 20px; border: 1px solid transparent;
  transition: all 0.18s; cursor: pointer;
}
.hot-tag:hover { color: var(--accent); border-color: rgba(15, 181, 166, 0.4); background: var(--accent-soft); }
.filter-toggle {
  margin-left: auto; font-size: 12.5px; color: var(--muted); cursor: pointer;
  padding: 4px 12px; border-radius: 20px; border: 1px solid var(--border);
  background: var(--panel-solid); user-select: none; transition: all 0.18s;
  display: inline-flex; align-items: center; gap: 6px;
}
.filter-toggle:hover { border-color: var(--border-strong); color: var(--text); }
.filter-toggle.on { color: var(--accent); border-color: rgba(15,181,166,0.5); background: var(--accent-soft); }

/* ---------- 分类导航 ---------- */
.cat-nav {
  position: sticky; top: var(--head-h, 72px); z-index: 40;
  background: rgba(244, 248, 251, 0.82);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: top 0.32s ease;
  will-change: top;
}
/* 顶栏收起后，分类导航吸顶到窗口顶部 */
body.nav-hide .cat-nav {
  top: 0;
  background: rgba(248, 251, 253, 0.96);
  box-shadow: 0 6px 18px rgba(23, 78, 122, 0.08);
}
.cat-nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 6px 20px;
  display: flex; flex-wrap: wrap; gap: 6px;
}
.cat-pill.pinned {
  color: #04120f; font-weight: 700;
  background: linear-gradient(135deg, var(--accent), #35c9ff);
  box-shadow: 0 3px 12px rgba(15, 181, 166, 0.32);
  border-color: transparent;
  cursor: default;
}
.cat-pill.dragging { opacity: 0.5; }
.cat-pill.drop-here { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 2px rgba(15,181,166,0.25); }
.cat-pill {
  flex: none; font-size: 13.5px; color: var(--muted);
  padding: 4px 13px; border-radius: 20px; cursor: pointer; user-select: none;
  border: 1px solid transparent; transition: all 0.2s; white-space: nowrap;
}
.cat-pill:hover { color: var(--text); border-color: var(--border); background: var(--panel-solid); }
.cat-pill.active {
  color: #ffffff; font-weight: 700;
  background: linear-gradient(135deg, var(--accent), #35c9ff);
  box-shadow: 0 4px 14px rgba(15, 181, 166, 0.35);
}

/* ---------- 内容 ---------- */
.content { max-width: var(--maxw); margin: 0 auto; padding: 18px 20px 48px; }
.section { margin-bottom: 26px; scroll-margin-top: var(--sticky-offset, 150px); }
.section-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
  padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.section-icon { font-size: 22px; }
.section-title { font-size: 20px; font-weight: 700; letter-spacing: 1px; }
.section-title::after {
  content: ""; display: inline-block; width: 5px; height: 5px; margin-left: 8px;
  border-radius: 50%; background: var(--accent); vertical-align: middle;
  box-shadow: 0 0 8px rgba(15, 181, 166, 0.6);
}
.section-count {
  margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--muted);
  border: 1px solid var(--border); padding: 2px 9px; border-radius: 20px;
  background: var(--panel-solid);
}

.cards {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px;
}
@media (max-width: 1280px) { .cards { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (max-width: 1024px) { .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 820px)  { .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px)  { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.card {
  display: flex; align-items: center; gap: 10px;
  min-height: 62px;
  background: var(--panel-solid); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 9px 11px; text-decoration: none; color: var(--text);
  position: relative; overflow: hidden;
  box-shadow: 0 2px 10px rgba(23, 78, 122, 0.05);
  transition: transform 0.22s, border-color 0.22s, box-shadow 0.22s;
  animation: cardIn 0.5s ease both;
}
.card::before {
  content: ""; position: absolute; inset: 0; opacity: 0; pointer-events: none;
  background: radial-gradient(120% 90% at 0% 0%, rgba(15, 181, 166, 0.07), transparent 55%);
  transition: opacity 0.25s;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: 0 10px 26px rgba(23, 78, 122, 0.12), 0 0 0 1px rgba(15, 181, 166, 0.10);
}
.card:hover::before { opacity: 1; }
.card.hide { display: none; }
@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- 子分类手风琴折叠 ---------- */
.accordion { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.acc-item {
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  background: var(--panel-solid); transition: border-color 0.2s, box-shadow 0.2s;
}
.acc-item:hover { border-color: var(--border-strong); }
.acc-head {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; background: none; border: none; cursor: pointer;
  text-align: left; font-family: var(--font); color: var(--text); transition: background 0.18s;
}
.acc-head:hover { background: var(--accent-soft); }
.acc-name { font-size: 14.5px; font-weight: 600; letter-spacing: 0.3px; }
.acc-count {
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  border: 1px solid var(--border); border-radius: 20px; padding: 1px 8px; background: var(--bg-soft);
}
.acc-arrow { margin-left: auto; color: var(--muted); font-size: 13px; transition: transform 0.2s; }
.acc-item:not(.open) .acc-arrow { transform: rotate(-90deg); }
.acc-body { padding: 10px 12px 12px; }
.acc-item:not(.open) .acc-body { display: none; }

.card-fav {
  width: 40px; height: 40px; flex: none; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(23, 78, 122, 0.05);
  border: 1px solid var(--border);
  font-size: 22px; font-weight: 700; overflow: hidden;
}
.card-fav img { width: 30px; height: 30px; object-fit: contain; }
.card-fav.letter { color: var(--accent); font-family: var(--mono); }

.card-body { min-width: 0; flex: 1; }
.card-name {
  font-size: 14.5px; font-weight: 700; line-height: 22px;
  display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; min-width: 0;
}
.card-name-text {
  flex: 1 1 auto; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fav-remove {
  background: rgba(23, 78, 122, 0.08); border: none; color: var(--muted);
  width: 18px; height: 18px; border-radius: 50%; font-size: 12px; line-height: 1;
  cursor: pointer; flex: none; transition: all 0.15s;
}
.fav-remove:hover { background: var(--danger); color: #fff; }
/* 卡片悬停出现的「＋常用」收藏按钮 */
.fav-add {
  flex: none; height: 18px; padding: 0 6px; border: none; border-radius: 9px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 11px; font-weight: 700; line-height: 18px; white-space: nowrap;
  cursor: pointer; opacity: 0; pointer-events: none;
  transition: opacity 0.18s ease, background 0.15s ease, color 0.15s ease;
}
.card:hover .fav-add { opacity: 1; pointer-events: auto; }
.fav-add:hover { background: var(--accent); color: #fff; }
.fav-add.fav-added {
  cursor: default; font-weight: 600;
  background: rgba(23, 78, 122, 0.07); color: var(--muted);
}
.fav-add.fav-added:hover { background: rgba(23, 78, 122, 0.07); color: var(--muted); }
/* 触屏没有 hover，直接常显 */
@media (hover: none) { .fav-add { opacity: 1; pointer-events: auto; } }

/* 操作提示条 */
.navi-toast {
  position: fixed; left: 50%; bottom: 34px; z-index: 9999;
  transform: translate(-50%, 12px);
  background: rgba(28, 39, 51, 0.94); color: #fff;
  font-size: 13px; font-weight: 600; padding: 9px 18px; border-radius: 22px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.navi-toast.show { opacity: 1; transform: translate(-50%, 0); }
.drop-hint { font-size: 11px; color: var(--accent); font-family: var(--mono); }
.fav-drop { transition: background 0.2s, border-color 0.2s; }
.fav-drop.drop-active {
  outline: 2px dashed var(--accent); outline-offset: 4px;
  background: var(--accent-soft); border-radius: var(--radius);
}
.fav-empty { padding: 26px 0; }
.overseas-tag {
  flex: none; font-size: 10px; font-weight: 600; color: #b45309;
  background: #fef3c7; border: 1px solid #fcd34d;
  padding: 0 5px; border-radius: 5px; line-height: 1.5;
  white-space: nowrap;
}
.card-desc {
  font-size: 12px; color: var(--muted); line-height: 18px; margin-top: 3px; min-height: 18px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* 卡片悬浮提示框：显示被 … 截断的名称/简介 */
.card-tip {
  position: fixed; z-index: 99999; max-width: 320px; box-sizing: border-box;
  background: rgba(28, 39, 51, 0.96); color: #fff;
  padding: 9px 12px; border-radius: 10px;
  font-size: 12.5px; line-height: 1.55;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  pointer-events: none; opacity: 0; visibility: hidden; transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}
.card-tip.show { opacity: 1; visibility: visible; transform: translateY(0); }
.card-tip-name { font-weight: 700; font-size: 13px; margin-bottom: 3px; word-break: break-word; }
.card-tip-desc { color: #d7e3ef; word-break: break-word; }


.empty-tip {
  text-align: center; padding: 60px 0; color: var(--muted); font-size: 14px;
}
.empty-tip b { color: var(--text); }

/* ---------- 页脚 ---------- */
.site-footer {
  border-top: 1px solid var(--border); margin-top: 20px;
  background: var(--bg-soft);
}
.footer-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 20px;
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--muted);
}
.footer-icp a { color: var(--muted); text-decoration: none; display: inline-block; vertical-align: middle; }
.footer-icp a:hover { color: var(--accent); }
.footer-gongan {
  display: inline-block; vertical-align: middle;
  margin-left: 10px;
}
.footer-gongan-icon {
  width: 20px; height: 20px;
  vertical-align: middle; display: inline-block;
  margin-right: 4px;
}
.footer-extra { font-family: var(--mono); font-size: 11.5px; }
.footer-extra a { color: var(--muted); text-decoration: none; }
.footer-extra a:hover { color: var(--accent); }
.feedback-btn {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 12.5px; font-family: var(--font); text-decoration: underline; padding: 0;
}
.feedback-btn:hover { color: var(--accent); }

/* ---------- 回到顶部 ---------- */
.back-top {
  position: fixed; right: 26px; bottom: 30px; z-index: 60;
  width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--panel-solid); color: var(--accent); font-size: 18px; cursor: pointer;
  box-shadow: 0 6px 20px rgba(23, 78, 122, 0.15);
  transition: all 0.2s;
}
.back-top:hover { border-color: var(--accent); box-shadow: 0 0 18px rgba(15, 181, 166, 0.25); }

.noscript { text-align: center; padding: 40px; color: var(--warn); }

/* ---------- 通栏广告 ---------- */
.ad-banner {
  display: block; position: relative; overflow: hidden;
  margin: 18px auto 4px; max-width: var(--maxw); border-radius: 16px;
  text-decoration: none;
  background: linear-gradient(100deg, #0a1f3a 0%, #0e2f4a 48%, #0b4a55 100%);
  border: 1px solid rgba(120, 200, 255, 0.18);
  box-shadow: 0 4px 18px rgba(23, 78, 122, 0.10);
}
.ad-glow {
  position: absolute; inset: -30%; pointer-events: none;
  background: radial-gradient(34% 55% at 18% 30%, rgba(15, 181, 166, 0.35), transparent 60%),
              radial-gradient(30% 50% at 82% 65%, rgba(61, 139, 253, 0.30), transparent 60%);
  animation: auroraDrift 14s ease-in-out infinite alternate;
}
.ad-inner {
  position: relative; display: flex; align-items: center; gap: 14px;
  padding: 16px 24px; color: #fff; flex-wrap: wrap;
}
.ad-tag {
  flex: none; font-size: 11px; letter-spacing: 2px; color: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.35); padding: 2px 9px; border-radius: 4px;
}
.ad-title { font-size: 17px; font-weight: 700; letter-spacing: 0.5px; }
.ad-title em { color: var(--accent); font-style: normal; }
.ad-cta {
  margin-left: auto; flex: none; font-size: 13.5px; font-weight: 700;
  color: #04120f; background: linear-gradient(135deg, var(--accent), #35c9ff);
  padding: 7px 18px; border-radius: 30px; box-shadow: 0 4px 14px rgba(15,181,166,0.35);
}
.ad-banner:hover { border-color: rgba(15, 181, 166, 0.5); }
.ad-banner:hover .ad-cta { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(15,181,166,0.5); }
.ad-banner:hover .ad-title em { text-decoration: underline; }
@media (max-width: 720px) { .ad-title { font-size: 14px; } .ad-cta { margin-left: 0; } }

/* ---------- 弹窗（前台提交/反馈复用） ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(29, 43, 58, 0.35); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  width: 100%; max-width: 440px; max-height: 86vh; overflow-y: auto;
  background: #ffffff; border: 1px solid var(--border-strong);
  border-radius: 16px; padding: 22px; box-shadow: 0 24px 70px rgba(23, 78, 122, 0.18);
  animation: cardIn 0.25s ease both;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-head h3 { font-size: 16px; letter-spacing: 1px; }
.modal-close { background: none; border: none; color: var(--muted); font-size: 15px; cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.modal-close:hover { color: var(--text); background: rgba(23, 78, 122, 0.08); }
.modal label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.modal input, .modal textarea, .modal select {
  width: 100%; padding: 9px 12px; margin-top: 5px; background: #f4f8fb; color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; font-size: 13.5px; font-family: var(--font); outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.modal input:focus, .modal textarea:focus, .modal select:focus { border-color: var(--border-strong); box-shadow: 0 0 0 3px rgba(15, 181, 166, 0.10); }
.modal label.check-line { display: flex; align-items: center; gap: 8px; color: var(--text); }
.modal label.check-line input { accent-color: var(--accent); }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }

/* ---------- 顶部双栏：优惠专区 + AI 新闻（各占一半） ---------- */
.top-panels {
  max-width: var(--maxw); margin: 16px auto 2px; padding: 0 20px;
  display: flex; gap: 16px; align-items: stretch;
  animation: fadeDown 0.5s ease both;
}
.deals-zone, .news-zone { flex: 1 1 0; min-width: 0; }

.deals-inner {
  position: relative; overflow: hidden; border-radius: 16px; padding: 13px 15px 15px;
  height: 100%; display: flex; flex-direction: column;
  background: linear-gradient(118deg, rgba(255, 145, 61, 0.13), rgba(255, 88, 88, 0.07) 42%, rgba(61, 139, 253, 0.09));
  border: 1px solid rgba(255, 145, 61, 0.38);
  box-shadow: 0 10px 30px rgba(255, 122, 60, 0.12);
}
.deals-inner::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 32%, rgba(255, 255, 255, 0.55) 50%, transparent 68%);
  transform: translateX(-100%);
  animation: dealShine 7s ease-in-out infinite;
}
@keyframes dealShine { 0%, 62% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

.deals-head { position: relative; display: flex; align-items: center; gap: 9px; margin-bottom: 11px; flex-wrap: wrap; }
.deals-title {
  display: flex; align-items: center; gap: 6px;
  font-size: 16px; font-weight: 800; letter-spacing: 0.5px; color: #d9541a;
}
.deals-flame { display: inline-block; animation: flameBeat 1.6s ease-in-out infinite; }
@keyframes flameBeat { 50% { transform: scale(1.2) rotate(-4deg); } }
.deals-badge {
  font-size: 11px; font-weight: 600; color: #fff; letter-spacing: 0.5px;
  padding: 2px 9px; border-radius: 20px;
  background: linear-gradient(135deg, #ff8a3d, #ff5a5f);
  box-shadow: 0 3px 10px rgba(255, 110, 60, 0.35);
}
.deals-updated { margin-left: auto; font-size: 12px; color: var(--muted); font-family: var(--mono); }

.deals-track {
  position: relative; display: flex; gap: 12px;
  flex: 1 1 auto; min-height: 0; align-items: stretch;
  overflow-x: auto; padding-bottom: 6px;
  scroll-snap-type: x mandatory; scrollbar-width: thin;
}
.deals-track::-webkit-scrollbar { height: 6px; }
.deals-track::-webkit-scrollbar-thumb { background: rgba(255, 145, 61, 0.35); border-radius: 4px; }

.deal-card {
  flex: 1 1 160px; min-width: 160px; align-self: stretch; justify-content: center;
  scroll-snap-align: start;
  display: flex; flex-direction: column; gap: 3px;
  padding: 12px 13px; border-radius: 12px; text-decoration: none; color: var(--text);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 145, 61, 0.30);
  box-shadow: 0 4px 14px rgba(23, 78, 122, 0.06);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  animation: dealIn 0.45s ease both;
}
.deal-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 145, 61, 0.65);
  box-shadow: 0 12px 26px rgba(255, 122, 60, 0.20);
}
@keyframes dealIn { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }

.deal-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 2px; }
.deal-tag {
  flex: none; font-size: 11px; font-weight: 600; white-space: nowrap;
  padding: 2px 9px; border-radius: 20px;
  background: rgba(255, 145, 61, 0.14); color: #d9541a;
}
.deal-tag.t-free  { background: rgba(15, 181, 166, 0.15); color: #0b8f84; }
.deal-tag.t-new   { background: rgba(61, 139, 253, 0.14); color: #2b6fd6; }
.deal-tag.t-sale  { background: rgba(232, 135, 30, 0.18); color: #c2680a; }
.deal-tag.t-cash  { background: rgba(229, 72, 77, 0.14); color: #cf3f44; }
.deal-expire { font-size: 11px; color: var(--muted); font-family: var(--mono); white-space: nowrap; }
.deal-hl {
  font-size: 17px; font-weight: 800; line-height: 1.35; color: #e0561d;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.deal-brand { font-size: 11.5px; font-weight: 600; color: var(--accent); }
.deal-title {
  font-size: 13px; font-weight: 600;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.deal-sum {
  font-size: 12px; color: var(--muted); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.deal-go { margin-top: 7px; font-size: 12px; font-weight: 700; color: #d9541a; }
.deal-card:hover .deal-go { text-decoration: underline; }

/* ---------- AI 新闻（右半栏，标明出处） ---------- */
.news-inner {
  position: relative; overflow: hidden; border-radius: 16px; padding: 13px 15px 15px;
  height: 100%; display: flex; flex-direction: column;
  background: linear-gradient(118deg, rgba(61, 139, 253, 0.13), rgba(120, 160, 255, 0.08) 42%, rgba(15, 181, 166, 0.09));
  border: 1px solid rgba(61, 139, 253, 0.38);
  box-shadow: 0 10px 30px rgba(61, 139, 253, 0.12);
}
.news-inner::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 32%, rgba(255, 255, 255, 0.5) 50%, transparent 68%);
  transform: translateX(-100%);
  animation: dealShine 7s ease-in-out infinite;
}
.news-head { position: relative; display: flex; align-items: center; gap: 9px; margin-bottom: 9px; flex-wrap: wrap; }
.news-title {
  display: flex; align-items: center; gap: 6px;
  font-size: 16px; font-weight: 800; letter-spacing: 0.5px; color: #2b6fd6;
}
.news-flash { display: inline-block; animation: newsBeat 1.8s ease-in-out infinite; }
@keyframes newsBeat { 50% { transform: scale(1.15) rotate(-5deg); } }
.news-badge {
  font-size: 11px; font-weight: 600; color: #fff; letter-spacing: 0.5px;
  padding: 2px 9px; border-radius: 20px;
  background: linear-gradient(135deg, #3d8bfd, #35c9ff);
  box-shadow: 0 3px 10px rgba(61, 139, 253, 0.35);
}
.news-updated { margin-left: auto; font-size: 12px; color: var(--muted); font-family: var(--mono); }
/* 国内 / 国外 切换标签 */
.news-tabs { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border-radius: 20px; background: rgba(61, 139, 253, 0.10); }
.ntab {
  font-size: 12px; font-weight: 600; line-height: 1.7; color: #4a7fc1;
  padding: 0 10px; border-radius: 18px; cursor: pointer; user-select: none;
  transition: background 0.18s ease, color 0.18s ease;
}
.ntab:hover { color: #2b6fd6; background: rgba(61, 139, 253, 0.14); }
.ntab.active {
  color: #fff; background: linear-gradient(135deg, #3d8bfd, #2b6fd6);
  box-shadow: 0 3px 10px rgba(61, 139, 253, 0.35);
}

.news-list {
  position: relative; flex: 1 1 auto; min-height: 0;
  list-style: none; display: flex; flex-direction: column;
  overflow-y: auto; padding-right: 4px;
}
.news-list::-webkit-scrollbar { width: 6px; }
.news-list::-webkit-scrollbar-thumb { background: rgba(61, 139, 253, 0.32); border-radius: 4px; }
.news-item { border-top: 1px dashed rgba(61, 139, 253, 0.20); }
.news-item:first-child { border-top: none; }
.news-link {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 4px; text-decoration: none; color: var(--text);
  transition: background 0.15s ease;
}
.news-link:hover { background: rgba(61, 139, 253, 0.08); border-radius: 8px; }
.news-source {
  flex: none; font-size: 11px; font-weight: 600; color: #2b6fd6;
  background: rgba(61, 139, 253, 0.12); border: 1px solid rgba(61, 139, 253, 0.28);
  padding: 0 6px; border-radius: 5px; line-height: 1.7; white-space: nowrap;
}
.news-text {
  flex: 1 1 auto; min-width: 0; font-size: 13px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.news-link:hover .news-text { color: #2b6fd6; }
.news-date { flex: none; font-size: 11px; color: var(--muted); font-family: var(--mono); }

@media (max-width: 900px) {
  .top-panels { flex-direction: column; }
}
@media (max-width: 640px) {
  .top-panels { padding: 0 12px; }
  .deal-card { flex-basis: 200px; }
  .deals-updated, .news-updated { margin-left: 0; width: 100%; }
  .news-date { display: none; }
}

/* ---------- 动效 ---------- */
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ---------- 响应式 ---------- */
@media (max-width: 720px) {
  .header-inner { gap: 14px; }
  .brand-name { font-size: 18px; }
  .bookmark-link { display: none; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

/* ---------- 站内 AI 对话面板（底部居中 · 横版）---------- */
.chat-drawer {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(1200px, 96vw); height: min(46vh, 460px);
  display: grid; grid-template-columns: 1fr 320px; grid-template-rows: auto 1fr;
  grid-template-areas: "head head" "msgs input";
  background: var(--panel-solid); border: 1px solid var(--border); border-radius: 18px 18px 0 0;
  box-shadow: 0 18px 50px rgba(15, 40, 70, 0.28); z-index: 1000; overflow: hidden;
  animation: chatIn 0.18s ease-out;
}
@keyframes chatIn { from { opacity: 0; transform: translateX(-50%) translateY(12px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
.chat-head {
  grid-area: head; display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(15,181,166,0.10), rgba(53,201,255,0.10));
}
.chat-title { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text); font-size: 14px; }
.chat-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(15,181,166,0.18); }
.chat-tools { display: flex; align-items: center; gap: 6px; }
.chat-clear, .chat-close {
  border: none; background: rgba(23,78,122,0.08); color: var(--muted); cursor: pointer;
  border-radius: 8px; font-size: 12px; padding: 4px 10px; transition: all 0.15s;
}
.chat-clear:hover, .chat-close:hover { color: var(--text); background: rgba(23,78,122,0.16); }
.chat-msgs { grid-area: msgs; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.chat-empty { color: var(--muted); font-size: 13px; line-height: 1.7; margin: auto; text-align: center; padding: 20px; }
.chat-row { display: flex; }
.chat-row.me { justify-content: flex-end; }
.chat-row.ai { justify-content: flex-start; }
.chat-bubble {
  max-width: 88%; padding: 10px 13px; border-radius: 14px; font-size: 14px; line-height: 1.65;
  white-space: pre-wrap; word-break: break-word;
}
.chat-row.me .chat-bubble { background: linear-gradient(135deg, var(--accent), #35c9ff); color: #fff; border-bottom-right-radius: 4px; }
.chat-row.ai .chat-bubble { background: rgba(23,78,122,0.07); color: var(--text); border-bottom-left-radius: 4px; }
.chat-think { color: var(--muted); font-size: 12px; opacity: 0.8; }
/* Markdown 富文本在气泡内的排版（修复 DeepSeek 回复中 * 等符号原样显示） */
.chat-bubble > :first-child { margin-top: 0; }
.chat-bubble > :last-child { margin-bottom: 0; }
.chat-bubble p { margin: 0 0 8px; }
.chat-bubble ul, .chat-bubble ol { margin: 0 0 8px; padding-left: 22px; }
.chat-bubble li { margin: 2px 0; }
.chat-bubble h1, .chat-bubble h2, .chat-bubble h3, .chat-bubble h4 { margin: 10px 0 6px; line-height: 1.3; }
.chat-bubble h1 { font-size: 18px; } .chat-bubble h2 { font-size: 16px; } .chat-bubble h3 { font-size: 15px; }
.chat-bubble a { color: var(--accent); text-decoration: underline; word-break: break-all; }
.chat-bubble strong { font-weight: 700; }
.chat-bubble code { font-family: Consolas, "SFMono-Regular", monospace; font-size: 12.5px; background: rgba(0,0,0,.08); padding: 1px 5px; border-radius: 4px; }
.chat-bubble pre { background: rgba(0,0,0,.08); padding: 10px 12px; border-radius: 8px; overflow: auto; margin: 0 0 8px; }
.chat-bubble pre code { background: none; padding: 0; font-size: 12.5px; }
.chat-bubble blockquote { margin: 0 0 8px; padding: 2px 10px; border-left: 3px solid var(--accent); color: var(--muted); }
.chat-bubble table { border-collapse: collapse; margin: 0 0 8px; font-size: 13px; }
.chat-bubble th, .chat-bubble td { border: 1px solid rgba(0,0,0,.14); padding: 4px 8px; }
.chat-bubble hr { border: none; border-top: 1px solid rgba(0,0,0,.14); margin: 8px 0; }
.chat-input {
  grid-area: input; display: flex; flex-direction: column; gap: 8px; padding: 12px;
  border-left: 1px solid var(--border); align-items: stretch;
}
.chat-input textarea {
  flex: 1; resize: none; max-height: none; min-height: 60px; padding: 10px 12px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--panel-solid); color: var(--text);
  font: inherit; font-size: 14px; line-height: 1.5; outline: none; transition: border-color 0.2s;
}
.chat-input textarea:focus { border-color: var(--border-strong); box-shadow: 0 0 0 3px rgba(15,181,166,0.12); }
.chat-send {
  border: none; cursor: pointer; padding: 10px 16px; border-radius: 10px; font-size: 14px; font-weight: 600;
  color: #fff; background: linear-gradient(135deg, var(--accent), #35c9ff); white-space: nowrap; transition: opacity 0.15s;
  width: 100%;
}
.chat-send:active { opacity: 0.85; }
@media (max-width: 720px) {
  .chat-drawer {
    width: 100%; height: 72vh; border-radius: 16px 16px 0 0;
    grid-template-columns: 1fr; grid-template-rows: auto 1fr auto;
    grid-template-areas: "head" "msgs" "input";
  }
  .chat-input { border-left: none; border-top: 1px solid var(--border); flex-direction: row; }
  .chat-send { width: auto; }
}
