:root {
  --bg: #f3f5fa;
  --panel: #fff;
  --line: #e7ebf3;
  --line-2: #f0f2f7;
  --text: #1d2640;
  --sub: #5d6883;
  --mute: #98a1b6;
  --brand: #3b6cf6;
  --brand-2: #6c5cff;
  --brand-soft: #edf2ff;
  --red: #f0473a;
  --orange: #ff8a1f;
  --amber: #f3b21b;
  --green: #12b76a;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(20, 32, 70, .04), 0 4px 16px rgba(20, 32, 70, .04);
  --side-w: 228px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
.ic { width: 18px; height: 18px; flex: none; }
.spin { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 框架 ---------- */
.app { display: flex; height: 100vh; }
.side {
  width: var(--side-w); flex: none; display: flex; flex-direction: column;
  background: var(--panel); border-right: 1px solid var(--line);
  transition: width .2s ease;
}
.brand { display: flex; align-items: center; gap: 10px; height: 60px; padding: 0 14px 0 18px; }
.logo {
  width: 32px; height: 32px; border-radius: 9px; flex: none;
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 17px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 4px 10px rgba(59, 108, 246, .3);
}
.brand-name { font-weight: 700; font-size: 16px; letter-spacing: .5px; flex: 1; white-space: nowrap; }
.icon-btn {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  color: var(--mute); transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--line-2); color: var(--text); }

#nav { flex: 1; overflow-y: auto; padding: 6px 10px 12px; }
.grp { margin-bottom: 2px; }
.grp-hd {
  width: 100%; height: 44px; display: flex; align-items: center; gap: 11px;
  padding: 0 10px; border-radius: 9px; color: #3a4460; font-size: 14.5px;
}
.grp-hd:hover { background: var(--line-2); }
.grp-hd .lbl { flex: 1; text-align: left; white-space: nowrap; }
.grp.here > .grp-hd { color: var(--brand); font-weight: 600; }
.chev { width: 16px; height: 16px; color: var(--mute); transition: transform .2s; }
.grp.open .chev { transform: rotate(180deg); }
.grp-bd { display: none; padding: 2px 0 6px; }
.grp.open .grp-bd { display: block; }
.nav-it {
  position: relative; display: flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 10px 0 39px; margin: 1px 0; border-radius: 8px;
  color: var(--sub); font-size: 13.5px; white-space: nowrap;
}
.nav-it:hover { background: var(--line-2); color: var(--text); }
.nav-it.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.nav-it.on::before {
  content: ""; position: absolute; left: 24px; top: 50%; width: 5px; height: 5px;
  margin-top: -2.5px; border-radius: 50%; background: var(--brand);
}
.nav-it .lbl { flex: 1; }
.soon { font-style: normal; font-size: 11px; color: var(--mute); }
.side-ft { padding: 12px 20px 16px; font-size: 11.5px; color: var(--mute); white-space: nowrap; }

/* 收起侧栏：只留图标 */
body.folded { --side-w: 68px; }
body.folded .side .lbl, body.folded .chev, body.folded .grp-bd, body.folded .side-ft { display: none; }
body.folded .grp.open .grp-bd { display: none; }   /* .grp.open .grp-bd 比上一行权重高，展开过的组折叠后会留一截空白 */
body.folded .brand { flex-direction: column; justify-content: center; gap: 6px; height: 92px; padding: 0; }
body.folded .grp-hd { justify-content: center; padding: 0; }
body.folded .grp.here > .grp-hd { background: var(--brand-soft); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top {
  height: 60px; flex: none; display: flex; align-items: center; gap: 12px;
  padding: 0 24px; background: var(--panel); border-bottom: 1px solid var(--line);
}
.burger { display: none; }
.crumb { flex: 1; display: flex; align-items: center; gap: 8px; color: var(--sub); min-width: 0; white-space: nowrap; }
.crumb i { font-style: normal; color: var(--mute); }
.crumb b { color: var(--text); font-weight: 600; }
.clock { color: var(--mute); font-size: 13px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.view { flex: 1; overflow-y: auto; }
.page { max-width: 1480px; margin: 0 auto; padding: 24px 24px 48px; }
.scrim { display: none; }

/* ---------- 通用 ---------- */
.btn {
  height: 36px; padding: 0 14px; border-radius: 9px; display: inline-flex; align-items: center; gap: 6px;
  font-weight: 500; white-space: nowrap; transition: filter .15s, background .15s, box-shadow .15s;
}
.btn .ic { width: 16px; height: 16px; }
.btn-primary {
  color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 4px 12px rgba(59, 108, 246, .28);
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-primary:disabled { opacity: .75; cursor: progress; }
.btn-ghost { background: var(--panel); border: 1px solid var(--line); color: var(--sub); }
.btn-ghost:hover { border-color: #cfd6e6; color: var(--text); }
.btn-light { background: #fff; color: var(--brand); font-weight: 600; box-shadow: 0 6px 18px rgba(20, 32, 90, .18); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.link { color: var(--brand); font-size: 13px; }
.link:hover { text-decoration: underline; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.pill { font-style: normal; font-size: 11.5px; padding: 1px 8px; border-radius: 99px; background: var(--line-2); color: var(--mute); white-space: nowrap; }
.pill.ok { background: #e7f8ef; color: #0e9a59; }
.chip { font-size: 12px; padding: 1px 8px; border-radius: 6px; background: var(--brand-soft); color: var(--brand); }
.mute { color: var(--mute); }
.toast {
  position: fixed; left: 50%; bottom: 36px; transform: translate(-50%, 20px); opacity: 0;
  background: rgba(24, 30, 50, .92); color: #fff; padding: 10px 18px; border-radius: 10px;
  font-size: 13.5px; pointer-events: none; transition: all .2s; z-index: 50;
  width: max-content; max-width: min(560px, calc(100vw - 32px)); line-height: 1.5;   /* 长提示别挤成窄窄一条 */
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.pg-hd { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.pg-hd h1 { margin: 0; font-size: 22px; letter-spacing: .5px; }
.pg-sub { margin: 4px 0 0; color: var(--sub); font-size: 13.5px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pg-act { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.search {
  height: 36px; width: 240px; display: flex; align-items: center; gap: 6px; padding: 0 10px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 9px; color: var(--mute);
}
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.search .ic { width: 16px; height: 16px; }
.search input { border: 0; outline: 0; flex: 1; min-width: 0; font: inherit; color: var(--text); background: none; }

/* ---------- 首页 ---------- */
.hero {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 24px;
  min-height: 210px; padding: 34px 40px; border-radius: 16px; color: #fff;
  background: linear-gradient(120deg, #2f63f0 0%, #4b7bff 45%, #7a63ff 100%);
  box-shadow: 0 10px 30px rgba(59, 108, 246, .25);
}
.hero-txt { position: relative; z-index: 1; max-width: 620px; }
.hero h1 { margin: 0 0 10px; font-size: 26px; letter-spacing: 1px; }
.hero p { margin: 0 0 22px; opacity: .88; font-size: 14.5px; line-height: 1.7; }
.hero-art { position: relative; flex: 1; align-self: stretch; min-width: 200px; }
.orb { position: absolute; border-radius: 50%; background: rgba(255, 255, 255, .14); }
.o1 { width: 220px; height: 220px; right: -40px; top: -90px; }
.o2 { width: 120px; height: 120px; right: 170px; bottom: -60px; background: rgba(255, 255, 255, .1); }
.o3 { width: 60px; height: 60px; right: 60px; bottom: 30px; background: rgba(255, 255, 255, .2); }
.hero-card {
  position: absolute; right: 70px; top: 50%; transform: translateY(-50%) rotate(-4deg);
  display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-radius: 14px; white-space: nowrap;
  background: rgba(255, 255, 255, .95); color: var(--text); box-shadow: 0 12px 30px rgba(20, 30, 90, .25);
}
.hero-card .ic { color: var(--red); width: 22px; height: 22px; }
.hero-card i { font-style: normal; font-size: 12px; color: #fff; background: var(--red); padding: 0 7px; border-radius: 99px; }

.sec-tt { display: flex; align-items: center; gap: 8px; margin: 30px 0 14px; font-size: 16px; }
.sec-tt .ic { color: var(--brand); }
.caps { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.cap {
  display: flex; align-items: flex-start; gap: 12px; padding: 16px; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .15s, box-shadow .15s, transform .15s;
}
.cap:hover { border-color: #c9d5f5; box-shadow: 0 6px 20px rgba(59, 108, 246, .1); transform: translateY(-1px); }
.cap-ic { width: 40px; height: 40px; flex: none; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.cap.dim .cap-ic { background: var(--line-2); color: var(--mute); }
.cap-bd { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cap-bd small { color: var(--mute); font-size: 12.5px; line-height: 1.5; }

/* ---------- 热点榜单 ---------- */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs { display: flex; gap: 4px; padding: 4px; max-width: 100%; overflow-x: auto; scrollbar-width: none; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.tab { flex: none; white-space: nowrap; height: 30px; padding: 0 14px; border-radius: 7px; color: var(--sub); display: flex; align-items: center; gap: 6px; }
.tab i { font-style: normal; font-size: 11.5px; color: var(--mute); }
.tab:hover { color: var(--text); }
.tab.on { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.tab.on i { color: var(--brand); }
.status { color: var(--sub); font-size: 13px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.status .sep { font-style: normal; color: #cfd5e2; }
.status .ic { width: 14px; height: 14px; }
.st-busy { display: inline-flex; align-items: center; gap: 5px; color: var(--brand); }
.st-kw { color: var(--text); }
.st-kw b { color: var(--brand); }
.card[hidden] { display: none; }
.grid.none::before { content: "所有榜单里都没有这个词，换个词试试"; grid-column: 1 / -1; padding: 60px 0; text-align: center; color: var(--mute); }
.c-ok { color: var(--green); }
.c-bad { color: var(--red); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column;
}
.card.planned { background: transparent; border-style: dashed; box-shadow: none; }
.card-hd { display: flex; align-items: center; gap: 10px; padding: 12px 12px 10px 14px; border-bottom: 1px solid var(--line-2); }
.av {
  width: 30px; height: 30px; flex: none; border-radius: 8px; display: grid; place-items: center;
  background: var(--c); color: #fff; font-weight: 700; font-size: 14px;
}
.card.planned .av { opacity: .45; }
.card-tt { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.card-tt b { font-size: 15px; }
.card-tt span { color: var(--mute); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; }
.card-time { color: var(--mute); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.card-note, .card-warn { display: flex; align-items: center; gap: 5px; padding: 6px 14px; font-size: 12px; color: var(--mute); background: #fafbfd; border-bottom: 1px solid var(--line-2); }
.card-note .ic { width: 13px; height: 13px; }
.card-warn { color: #b25e09; background: #fff7ec; }

.rows { list-style: none; margin: 0; padding: 4px 0; max-height: 520px; overflow-y: auto; }
.row {
  display: grid; grid-template-columns: 24px minmax(0, 1fr) auto 26px 26px; align-items: center; gap: 6px;
  height: 36px; padding: 0 8px 0 14px;
}
.row:hover { background: #f7f9fd; }
.rk {
  width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center;
  font-size: 12px; font-weight: 600; color: var(--mute); background: var(--line-2); font-variant-numeric: tabular-nums;
}
.rk.r1 { background: var(--red); color: #fff; }
.rk.r2 { background: var(--orange); color: #fff; }
.rk.r3 { background: var(--amber); color: #fff; }
.tt-wrap { display: flex; align-items: center; gap: 6px; min-width: 0; }
.tt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt:hover { color: var(--brand); }
.tt mark { background: #fff1b8; color: inherit; border-radius: 3px; padding: 0 1px; }
.dot-new { display: inline-block; width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(18, 183, 106, .15); }
.pg-sub .dot-new { margin: 0 2px 0 6px; }
.lab { flex: none; font-style: normal; font-size: 11px; line-height: 16px; padding: 0 4px; border-radius: 4px; background: var(--line-2); color: var(--sub); }
.lab.l-new { background: #e7f8ef; color: #0e9a59; }
.lab.l-hot { background: #fff1e5; color: #e5680a; }
.lab.l-boom { background: #ffe9e7; color: var(--red); }
.lab.l-rec { background: var(--brand-soft); color: var(--brand); }
.heat { color: var(--mute); font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.star { width: 26px; height: 26px; border-radius: 6px; display: grid; place-items: center; color: #c3c9d8; opacity: .35; transition: opacity .1s; }   /* 以前平时完全看不见（0），找不到收选题 / 写稿 */
.star .ic { width: 16px; height: 16px; }
.row:hover .star, .star.on { opacity: 1; }
.star:hover { color: var(--amber); background: #fff8e6; }
.star.wr:hover { color: var(--brand); background: var(--brand-soft); }
.tbl td.r { white-space: nowrap; }
.tbl td.r .icon-btn { display: inline-grid; vertical-align: middle; }
.star.on { color: var(--amber); }
.star.on .ic { fill: var(--amber); }

.rows.sk li { display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 14px; }
.rows.sk span { height: 12px; border-radius: 4px; background: linear-gradient(90deg, #eef1f6 0%, #f7f8fb 50%, #eef1f6 100%); background-size: 200% 100%; animation: sk 1.2s infinite; }
.rows.sk span:first-child { width: 20px; flex: none; }
.rows.sk span:last-child { flex: 1; }
.rows.sk li:nth-child(3n) span:last-child { flex: .7; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: 0 0; } }

.empty { padding: 30px 20px; text-align: center; color: var(--mute); font-size: 13px; }
.empty b { display: block; color: var(--sub); font-size: 14px; margin-bottom: 4px; }
.empty p { margin: 0 0 12px; }
.empty.err b { color: var(--red); }
.empty.big { padding: 60px 20px; }
.empty.big .ic { width: 36px; height: 36px; color: #cdd3e0; margin-bottom: 10px; }
.empty.big .btn .ic { width: 16px; height: 16px; margin-bottom: 0; color: inherit; }   /* 空状态里按钮上的小图标别跟着放大成 36px */
.empty a:not(.btn) { color: var(--brand); }   /* 只管文字链接；按钮（蓝底白字那种）用自己的颜色 */

/* ---------- 选题库 ---------- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-weight: 500; font-size: 12.5px; color: var(--mute); padding: 12px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td a:hover { color: var(--brand); }
.tbl .r { text-align: right; }
.tbl .icon-btn:hover { color: var(--red); background: #ffefed; }

/* ---------- 规划中 ---------- */
.ph { padding: 48px 32px; text-align: center; }
.ph-ic { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 16px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.ph-ic .ic { width: 28px; height: 28px; }
.ph h2 { margin: 0 0 8px; font-size: 18px; }
.ph > p { margin: 0 auto; max-width: 520px; color: var(--sub); }
.reuse { max-width: 520px; margin: 26px auto 0; padding: 16px 18px; text-align: left; background: #fafbfd; border: 1px solid var(--line-2); border-radius: 10px; }
.reuse b { font-size: 13px; color: var(--sub); }
.reuse ul { list-style: none; margin: 8px 0 0; padding: 0; }
.reuse li { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13.5px; }
.reuse .ic { width: 14px; height: 14px; color: var(--brand); }

/* ---------- 通用：表单 / 弹窗 / 状态 ---------- */
.form { display: grid; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 13px; color: var(--sub); }
.field > small { font-size: 12px; color: var(--mute); }
.input, .select, .textarea {
  height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff;
  font: inherit; color: var(--text); outline: 0; min-width: 0; width: 100%;
}
.textarea { height: auto; min-height: 96px; padding: 8px 10px; resize: vertical; line-height: 1.6; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.row-gap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cols-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.panel-bd { padding: 18px; }
.panel-hd { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.panel-hd h3 { margin: 0; font-size: 15px; }
.pill.warn { background: #fff4e5; color: #c26a00; }
.pill.bad { background: #ffecea; color: var(--red); }
.pill.info { background: var(--brand-soft); color: var(--brand); }
.switch { position: relative; width: 38px; height: 22px; flex: none; border-radius: 99px; background: #d5dbe7; transition: background .15s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .15s; }
.switch.on { background: var(--brand); }
.switch.on::after { transform: translateX(16px); }
.modal-mask { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: rgba(15, 20, 35, .55); }
.modal { width: min(920px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: #fff; border-radius: 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.modal-hd { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 10px; padding: 14px 18px; background: #fff; border-bottom: 1px solid var(--line-2); }
.modal-hd h3 { flex: 1; margin: 0; font-size: 15px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-bd { padding: 18px; }
pre.out { margin: 0; padding: 12px 14px; background: #f7f8fb; border: 1px solid var(--line-2); border-radius: 10px; font: 12.5px/1.6 ui-monospace, Menlo, monospace; white-space: pre-wrap; word-break: break-all; max-height: 420px; overflow: auto; }

/* ---------- 手机 / 窄屏 ---------- */
@media (max-width: 860px) {
  .side { position: fixed; z-index: 30; left: 0; top: 0; bottom: 0; width: 240px; transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .side { transform: none; box-shadow: 10px 0 30px rgba(0, 0, 0, .12); }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 20; background: rgba(15, 20, 35, .3); }
  body.folded .side .lbl, body.folded .chev, body.folded .side-ft { display: revert; }
  body.folded .grp.open .grp-bd { display: block; }
  .fold { display: none; }
  .burger { display: grid; }
  .top { padding: 0 16px; }
  .clock { display: none; }
  .page { padding: 16px 16px 40px; }
  .hero { padding: 26px 22px; min-height: 0; }
  .hero-art { display: none; }
  .hero h1 { font-size: 21px; }
  .search { width: 100%; }
  .pg-act { width: 100%; }
  .pg-act .btn { flex: 1; justify-content: center; }
  .grid { grid-template-columns: 1fr; }
  .cols-2 { grid-template-columns: 1fr; }
  .star { opacity: 1; }
  .topics-tbl th:nth-child(4), .topics-tbl td:nth-child(4), .topics-tbl th:nth-child(5), .topics-tbl td:nth-child(5) { display: none; }
}
