/* ==========================================================
   成都试题库 · 样式
   色板：宣纸底 + 墨蓝 + 朱砂；标题衬线
   移动端优先，≥820px 切两栏桌面版
   ========================================================== */
:root {
  --paper: #f7f4ee;
  --paper-2: #fffdf8;
  --ink: #1c2b3a;
  --ink-2: #46586c;
  --ink-3: #8494a3;
  --line: #e8e1d3;
  --line-2: #efe9dd;
  --blue: #24476f;
  --blue-2: #35608f;
  --blue-soft: #eaf0f7;
  --red: #c0492f;
  --red-soft: #fbeee9;
  --green: #2f7d5d;
  --green-soft: #e9f3ee;
  --amber: #9a6b1f;
  --amber-soft: #faf1e0;
  --serif: "Noto Serif SC", "Songti SC", STSong, "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  --shadow: 0 1px 2px rgba(28, 43, 58, .05), 0 6px 18px -12px rgba(28, 43, 58, .25);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: #eeeae1;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; text-decoration: none; }

.app {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--paper);
  padding-bottom: 28px;
  box-shadow: 0 0 60px rgba(28, 43, 58, .08);
}

/* ---------------- 头部 ---------------- */
.hd {
  background:
    radial-gradient(120% 80% at 88% -10%, rgba(255, 255, 255, .14), transparent 60%),
    linear-gradient(158deg, #2a4d74 0%, #1f3d5e 55%, #182f4a 100%);
  color: #fff;
  padding: calc(13px + env(safe-area-inset-top)) 16px 14px;
  border-radius: 0 0 20px 20px;
}

.hd-top { display: flex; align-items: center; gap: 8px; }

.brand { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; }
.brand-mark {
  width: 34px; height: 34px; flex: none;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .22));
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-text b {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .08em;
  line-height: 1.15;
  white-space: nowrap;
}
.brand-text i {
  font-style: normal;
  font-size: 8px;
  letter-spacing: .2em;
  color: rgba(255, 255, 255, .48);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 段控：试卷库 / 题库 */
.seg {
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .12);
  flex: none;
}
.seg button {
  height: 26px;
  padding: 0 11px;
  border-radius: 7px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, .72);
  transition: .18s;
  white-space: nowrap;
}
.seg button.on {
  background: #fff;
  color: var(--blue);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
}

.search {
  margin-top: 11px;
  display: flex; align-items: center; gap: 8px;
  height: 40px;
  padding: 0 12px;
  background: rgba(255, 255, 255, .13);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 11px;
  color: rgba(255, 255, 255, .8);
}
.search input {
  flex: 1; min-width: 0;
  border: 0; outline: 0;
  background: transparent;
  color: #fff;
  font-size: 14px;
}
.search input::placeholder { color: rgba(255, 255, 255, .52); }
.search input::-webkit-search-cancel-button { display: none; }
.search-clear {
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(255, 255, 255, .22);
  color: #fff; font-size: 15px; line-height: 1;
  display: grid; place-items: center;
}

/* 快捷筛选：换行铺满，不做横向滚动 */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 6px;
  margin-top: 11px;
}
.chip {
  flex: none;
  height: 27px;
  padding: 0 10px;
  border-radius: 14px;
  font-size: 12px;
  color: rgba(255, 255, 255, .78);
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .12);
  transition: .18s;
  white-space: nowrap;
}
.chip.on {
  background: #fff;
  color: var(--blue);
  border-color: #fff;
  font-weight: 600;
}

/* ---------------- 工具条 ---------------- */
.toolbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px;
  background: rgba(247, 244, 238, .93);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-2);
}
.tb-count {
  font-size: 12.5px; color: var(--ink-2);
  margin-right: auto;
  display: flex; align-items: center; gap: 6px;
  min-width: 0;
}
.tb-count b { color: var(--ink); font-weight: 600; font-size: 13.5px; }
.tb-count .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-3); display: inline-block; flex: none; }
.tb-count span { white-space: nowrap; }
.tb-btn {
  display: flex; align-items: center; gap: 4px;
  height: 30px; padding: 0 10px;
  border-radius: 8px;
  font-size: 12.5px; color: var(--ink-2);
  border: 1px solid var(--line);
  background: var(--paper-2);
  flex: none;
}
.tb-btn.on { color: var(--blue); border-color: #c3d2e3; background: var(--blue-soft); }
.tb-btn .badge {
  min-width: 15px; height: 15px; padding: 0 4px;
  border-radius: 8px;
  background: var(--red); color: #fff;
  font-size: 10px; line-height: 15px; text-align: center;
}

/* ---------------- 列表 ---------------- */
.list { padding: 12px 16px 24px; display: flex; flex-direction: column; gap: 10px; }

.card {
  position: relative;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 14px;
  box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s;
  cursor: pointer;
}
.card:active { transform: scale(.995); }
.card:hover { box-shadow: 0 2px 4px rgba(28, 43, 58, .06), 0 10px 24px -14px rgba(28, 43, 58, .3); }

.card-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.tag {
  font-size: 10.5px;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 4px;
  letter-spacing: .02em;
  white-space: nowrap;
}
.t-stage { background: var(--blue-soft); color: var(--blue); font-weight: 600; }
.t-type { background: #f2efe7; color: #6b6153; }
.t-green { background: var(--green-soft); color: var(--green); }
.t-amber { background: var(--amber-soft); color: var(--amber); }
.t-red { background: var(--red-soft); color: var(--red); }
.t-gray { background: #f0f0ec; color: var(--ink-3); }
.t-line { border: 1px solid var(--line); color: var(--ink-3); background: transparent; }

.card h3 {
  font-family: var(--serif);
  font-size: 15.5px;
  line-height: 1.5;
  font-weight: 600;
  margin-top: 9px;
  letter-spacing: .01em;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card .meta {
  margin-top: 7px;
  font-size: 12px;
  color: var(--ink-3);
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
}
.card .meta .sep { width: 1px; height: 9px; background: var(--line); }

.card .know { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 9px; }
.card .know span {
  font-size: 11px; color: var(--ink-2);
  background: #f6f3ec;
  border-radius: 5px;
  padding: 3px 6px;
}

.card-foot {
  display: flex; align-items: center; gap: 8px;
  margin-top: 11px; padding-top: 10px;
  border-top: 1px dashed var(--line-2);
  font-size: 11.5px; color: var(--ink-3);
}
.card-foot .grow { margin-left: auto; }

.dl-btn {
  display: inline-flex; align-items: center; gap: 4px;
  height: 27px; padding: 0 11px;
  border-radius: 14px;
  border: 1px solid #e3c8bf;
  background: #fff;
  color: var(--red);
  font-size: 12px; font-weight: 600;
}
.dl-btn.ready { background: var(--red); border-color: var(--red); color: #fff; }
.dl-btn svg { width: 13px; height: 13px; }

.file-dot {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; color: var(--ink-3);
  margin-left: auto;
}
.file-dot::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%;
  background: var(--ink-3); opacity: .5;
}
.file-dot.ok { color: var(--green); }
.file-dot.ok::before { background: var(--green); opacity: 1; }

/* 文件来源徽标：微信群 / 用户上传 / AI 抓取 */
.src {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; line-height: 1;
  padding: 3px 7px; border-radius: 999px;
  white-space: nowrap;
}
.src::before {
  content: "";
  width: 4px; height: 4px; border-radius: 50%;
  background: currentColor; opacity: .7;
}
.src-wechat { background: var(--green-soft); color: var(--green); }
.src-user { background: var(--blue-soft); color: var(--blue); }
.src-ai { background: #f1ede3; color: #8a7757; }

.chip-group { display: none; }

.chip-pick { border-style: dashed; }
.chip-pick.on { border-style: solid; }
.chip-file { margin-left: 2px; }

/* 题目卡 */
.q-stem {
  margin-top: 9px;
  font-size: 14px;
  line-height: 1.62;
  color: var(--ink);
  white-space: pre-wrap;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 分页 / 空态 */
.load-more {
  margin: 6px 0 2px;
  height: 42px;
  border-radius: 12px;
  border: 1px dashed #d8cfbd;
  color: var(--blue);
  font-size: 13px;
  font-weight: 600;
  background: rgba(255, 253, 248, .6);
  display: flex; align-items: center; justify-content: center;
}
.load-more:active { background: var(--blue-soft); }
.list-end {
  padding: 16px 0 4px;
  text-align: center;
  font-size: 11px;
  color: #b6ad9c;
  letter-spacing: .06em;
}

.empty {
  padding: 60px 24px;
  text-align: center;
  color: var(--ink-3);
}
.empty .em-icon {
  width: 56px; height: 56px; margin: 0 auto 14px;
  border-radius: 50%;
  background: #f1ede4;
  display: grid; place-items: center;
  color: #b9b09d;
}
.empty h4 { font-size: 14px; color: var(--ink-2); font-weight: 600; margin-bottom: 6px; }
.empty p { font-size: 12.5px; line-height: 1.7; }
.empty .link { display: inline-block; margin-top: 12px; }

.link { color: var(--blue); font-size: 13px; font-weight: 600; }

/* ---------------- 详情 ---------------- */
.detail {
  position: fixed; inset: 0; z-index: 60;
  background: var(--paper);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(88px + env(safe-area-inset-bottom));
  opacity: 0; transform: translateY(10px);
  transition: opacity .22s ease, transform .22s ease;
}
.detail.show { opacity: 1; transform: none; }

.d-hd {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 10px;
  height: calc(48px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 12px 0;
  background: rgba(247, 244, 238, .94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-2);
}
.d-hd .back { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: var(--ink); }
.d-hd .d-title { font-size: 13px; color: var(--ink-2); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.d-body { padding: 18px 18px 0; max-width: 760px; margin: 0 auto; }

.d-eyebrow { display: flex; gap: 6px; flex-wrap: wrap; }
.d-h1 {
  font-family: var(--serif);
  font-size: 21px; line-height: 1.45; font-weight: 700;
  margin-top: 12px;
  letter-spacing: .01em;
}

.d-facts {
  margin-top: 16px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 13px;
  overflow: hidden;
}
.d-fact {
  display: flex; align-items: baseline; gap: 12px;
  padding: 11px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--line-2);
}
.d-fact:last-child { border-bottom: 0; }
.d-fact dt { color: var(--ink-3); width: 62px; flex: none; font-size: 12.5px; }
.d-fact dd { margin: 0; color: var(--ink); flex: 1; line-height: 1.6; }

/* 详情页附件列表 */
.attach-list { display: flex; flex-direction: column; gap: 7px; }
.attach {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 12px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 12.5px;
  transition: .15s;
}
.attach:hover { border-color: #c9d6e5; background: #fff; }
/* 线上版没有原件：置灰、不可点，避免点了 404 */
.attach-off { background: #f6f2e9; border-style: dashed; color: var(--ink-3); cursor: default; }
.attach-off:hover { border-color: var(--line); background: #f6f2e9; }
.attach-off .aname { color: var(--ink-3); }
.attach-off .asize { color: #b6ad9c; }
.attach .role {
  flex: none;
  font-size: 10px; line-height: 1;
  padding: 4px 6px; border-radius: 4px;
}
.r-ana { background: var(--green-soft); color: var(--green); }
.r-card { background: var(--amber-soft); color: var(--amber); }
.r-tab { background: #f0ece3; color: #8a7757; }
.attach .aname {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink-2);
}
.attach .asize { flex: none; color: var(--ink-3); font-size: 11px; }
.attach .adl { flex: none; color: var(--red); font-weight: 700; }

.sec-title {
  display: flex; align-items: center; gap: 8px;
  margin: 24px 0 12px;
  font-size: 13.5px; font-weight: 600; color: var(--ink);
}
.sec-title::before {
  content: ""; width: 3px; height: 13px; border-radius: 2px;
  background: var(--red);
}
.sec-title .sub { font-weight: 400; color: var(--ink-3); font-size: 12px; margin-left: auto; }

.mini-q {
  display: flex; gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-2);
  cursor: pointer;
}
.mini-q:last-child { border-bottom: 0; }
.mini-q .n {
  width: 22px; height: 22px; flex: none;
  border-radius: 50%;
  background: var(--blue-soft); color: var(--blue);
  font-size: 11px; font-weight: 600;
  display: grid; place-items: center;
  margin-top: 1px;
}
.mini-q p { font-size: 13.5px; line-height: 1.6; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mini-q .m { font-size: 11px; color: var(--ink-3); margin-top: 4px; }

.related { display: flex; flex-direction: column; gap: 8px; }
.related-item {
  display: flex; gap: 10px; align-items: center;
  padding: 11px 12px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
  cursor: pointer;
}
.related-item span:first-child { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.related-item .go { color: var(--ink-3); font-size: 16px; }

.d-note {
  margin: 20px 0 8px;
  font-size: 11.5px; color: var(--ink-3); line-height: 1.75;
  background: #f2eee4;
  border-radius: 10px;
  padding: 12px 14px;
}

.d-actions {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex; gap: 10px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255, 253, 248, .96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  z-index: 70;
}
.d-actions > * { max-width: 728px; }

.btn-primary {
  flex: 1;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(150deg, #2a4f78, #1f3d5e);
  color: #fff;
  font-size: 15px; font-weight: 600;
  letter-spacing: .02em;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  box-shadow: 0 8px 18px -10px rgba(31, 61, 94, .8);
}
.btn-primary:active { filter: brightness(.94); }
.btn-primary[disabled] { opacity: .45; box-shadow: none; }

/* 题目详情 */
.q-block {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
}
.q-block .stem {
  font-size: 15px; line-height: 1.75;
  white-space: pre-wrap;
  color: var(--ink);
}
.q-option {
  display: flex; gap: 8px;
  padding: 9px 11px;
  margin-top: 8px;
  border-radius: 9px;
  background: #f8f5ee;
  font-size: 14px; line-height: 1.6;
  color: var(--ink-2);
}
.q-option.hit { background: var(--green-soft); color: var(--green); font-weight: 600; }

.ans-card {
  margin-top: 14px;
  border: 1px dashed #d9cbb6;
  border-radius: 12px;
  background: #fdf9f0;
  padding: 14px;
}
.ans-card h5 { font-size: 12.5px; color: var(--ink-3); font-weight: 600; letter-spacing: .04em; }
.ans-card .ans { font-size: 15px; font-weight: 700; color: var(--green); margin-top: 8px; white-space: pre-wrap; line-height: 1.7; }
.ans-card .ana { font-size: 13.5px; color: var(--ink-2); line-height: 1.85; margin-top: 12px; white-space: pre-wrap; }
.ans-cover {
  height: 84px;
  display: grid; place-items: center;
  color: var(--ink-3); font-size: 12.5px;
  gap: 4px;
}

/* ---------------- 面板 ---------------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 90; }
.sheet-wrap[hidden] { display: none; }
.sheet-mask {
  position: absolute; inset: 0;
  background: rgba(20, 30, 40, .42);
  animation: fade .2s ease;
}
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-width: 560px; margin: 0 auto;
  max-height: 86vh;
  display: flex; flex-direction: column;
  background: var(--paper);
  border-radius: 18px 18px 0 0;
  animation: slideUp .26s cubic-bezier(.2, .8, .2, 1);
  padding-bottom: env(safe-area-inset-bottom);
}
.sheet-sm { max-height: 70vh; }
.sheet-hd {
  display: flex; align-items: center;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--line-2);
}
.sheet-hd h2 { font-size: 16px; font-weight: 600; flex: 1; font-family: var(--serif); letter-spacing: .04em; }
.sheet-body { overflow-y: auto; padding: 4px 18px 18px; }

.fgroup { padding-top: 16px; }
.fgroup h4 {
  font-size: 12.5px; color: var(--ink-3); font-weight: 600;
  letter-spacing: .04em; margin-bottom: 10px;
  display: flex; align-items: center; gap: 6px;
}
.fgroup h4 .cnt { font-weight: 400; opacity: .7; }
.fopts { display: flex; flex-wrap: wrap; gap: 8px; }
.fopt {
  height: 31px; padding: 0 12px;
  border-radius: 8px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  font-size: 12.5px; color: var(--ink-2);
  display: flex; align-items: center; gap: 5px;
}
.fopt.on { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; }
.fopt .n { font-size: 10.5px; opacity: .55; }
.fopt:disabled { opacity: .35; }

.sheet-ft {
  padding: 10px 18px 14px;
  border-top: 1px solid var(--line-2);
  background: var(--paper);
}

/* 下载面板 */
.dl-body { padding: 22px 20px calc(18px + env(safe-area-inset-bottom)); }
.dl-body .dl-icon {
  width: 46px; height: 46px; border-radius: 12px;
  background: var(--blue-soft); color: var(--blue);
  display: grid; place-items: center;
  margin-bottom: 14px;
}
.dl-body h3 { font-size: 16px; font-weight: 600; font-family: var(--serif); }
.dl-body .dl-title {
  margin-top: 8px; font-size: 13.5px; color: var(--ink-2);
  line-height: 1.65;
  background: #f5f1e8; border-radius: 8px; padding: 10px 12px;
}
.dl-body p.tip { font-size: 12.5px; color: var(--ink-3); line-height: 1.75; margin-top: 12px; }
.dl-actions { display: flex; gap: 10px; margin-top: 18px; }
.dl-actions .btn-primary { height: 42px; font-size: 14px; }
.btn-line {
  flex: 1; height: 42px; border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--paper-2);
  font-size: 14px; color: var(--ink-2);
  display: flex; align-items: center; justify-content: center; gap: 6px;
}

/* ---------------- Toast ---------------- */
.toast {
  position: fixed; left: 50%; bottom: 40px;
  transform: translate(-50%, 10px);
  background: rgba(28, 43, 58, .93);
  color: #fff;
  font-size: 13px;
  padding: 9px 16px;
  border-radius: 20px;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: .22s;
  max-width: 80vw;
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- 动画 ---------------- */
@keyframes fade { from { opacity: 0; } }
@keyframes slideUp { from { transform: translateY(100%); } }
@keyframes cardIn { from { opacity: 0; transform: translateY(6px); } }
.list > * { animation: cardIn .28s ease both; }

/* ==========================================================
   桌面端：≥820px 两栏、更宽的容器
   ========================================================== */
@media (min-width: 820px) {
  .app { max-width: 1080px; box-shadow: none; }

  .hd { border-radius: 0 0 24px 24px; padding: 20px 28px 18px; }
  .hd-top { gap: 18px; }
  .brand { flex: 0 0 auto; gap: 11px; }
  .brand-mark { width: 42px; height: 42px; }
  .brand-text b { font-size: 21px; letter-spacing: .1em; }
  .brand-text i { font-size: 9px; letter-spacing: .26em; margin-top: 4px; }
  .seg { margin-left: auto; }
  .seg button { height: 30px; padding: 0 16px; font-size: 13.5px; }

  .search { max-width: 460px; height: 42px; }
  .chips { gap: 8px; padding-bottom: 2px; align-items: center; }
  .chip { height: 30px; padding: 0 13px; font-size: 12.5px; }
  .chip-group {
    display: inline-flex; align-items: center;
    font-size: 11px; letter-spacing: .12em;
    color: rgba(255, 255, 255, .42);
    margin-left: 10px;
  }
  .chip-group:first-of-type { margin-left: 2px; }

  .toolbar { padding: 12px 28px; }
  .list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: 14px;
    padding: 16px 28px 40px;
  }
  .load-more, .list-end { grid-column: 1 / -1; }
  .card { padding: 15px 16px; }
  .card h3 { font-size: 16px; }

  .detail { padding-bottom: 92px; }
  .d-body { padding: 26px 28px 0; }
  .d-h1 { font-size: 25px; }

  /* 面板改成居中卡片 */
  .sheet {
    top: 50%; bottom: auto;
    transform: translateY(-50%);
    border-radius: 16px;
    max-width: 520px;
    max-height: 80vh;
    animation: popIn .24s cubic-bezier(.2, .8, .2, 1);
    box-shadow: 0 24px 60px -20px rgba(12, 24, 38, .45);
  }
  .sheet-sm { max-width: 460px; }
}

@media (min-width: 1180px) {
  .app { max-width: 1240px; }
  .list { grid-template-columns: 1fr 1fr 1fr; }
}

@keyframes popIn {
  from { opacity: 0; transform: translateY(-50%) scale(.97); }
}

/* 小屏微调 */
@media (max-width: 379px) {
  .brand-text i { display: none; }
  .brand-text b { font-size: 16px; }
  .seg button { padding: 0 9px; font-size: 12px; }
  .chip { height: 26px; padding: 0 8px; font-size: 11.5px; }
  .chips { gap: 6px 5px; }
  .promo-ico { display: none; }
  .promo-text i { display: none; }
  .promo-btn { padding: 0 12px; }
}

/* ==========================================================
   底部：开发方提示 + 邀请入口
   ========================================================== */
.promo {
  position: fixed; left: 0; right: 0; bottom: 0;
  z-index: 45;
  background: rgba(255, 253, 248, .97);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px -18px rgba(28, 43, 58, .45);
  animation: slideUp .3s cubic-bezier(.2, .8, .2, 1);
}
.promo[hidden] { display: none; }
.promo-inner {
  display: flex; align-items: center; gap: 10px;
  max-width: 560px; margin: 0 auto;
  padding: 9px 14px calc(9px + env(safe-area-inset-bottom)) 12px;
}
.promo-ico {
  flex: none; width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: var(--blue-soft); color: var(--blue);
}
.promo-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.promo-text b {
  font-size: 12.5px; font-weight: 600; color: var(--ink);
  letter-spacing: .01em; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.promo-text i {
  font-style: normal; font-size: 11px; color: var(--ink-3);
  line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.promo-btn {
  flex: none; height: 32px; padding: 0 14px;
  border-radius: 16px;
  background: linear-gradient(150deg, #2a4f78, #1f3d5e);
  color: #fff; font-size: 12.5px; font-weight: 600;
  box-shadow: 0 4px 12px -6px rgba(31, 61, 94, .8);
  transition: transform .16s, box-shadow .16s;
}
.promo-btn:active { transform: scale(.96); }
.promo-x {
  flex: none; width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--ink-3); font-size: 16px; line-height: 1;
}
.promo-x:active { background: rgba(28, 43, 58, .06); }

/* 有提示条时给正文让位、把 toast 抬高 */
body.promo-on .app { padding-bottom: 108px; }
body.promo-on .toast { bottom: 108px; }

/* ---------------- 微信内打开：引导去浏览器 ---------------- */
.wx-tip {
  position: fixed; inset: 0; z-index: 150;
  display: flex; flex-direction: column; align-items: center;
  padding: calc(8px + env(safe-area-inset-top)) 20px calc(24px + env(safe-area-inset-bottom));
  background: rgba(12, 22, 34, .8);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  animation: fade .22s ease both;
}
.wx-tip[hidden] { display: none; }
.wx-arrow {
  align-self: flex-end;
  margin: 4px 8px 0 0;
  color: #fff; opacity: .92;
  animation: bob 1.5s ease-in-out infinite;
}
.wx-card {
  width: 100%; max-width: 400px;
  margin: auto 0;
  background: var(--paper-2);
  border-radius: 18px;
  padding: 20px 20px 16px;
  box-shadow: 0 24px 60px -18px rgba(0, 0, 0, .5);
  text-align: left;
}
.wx-card h4 {
  font-family: var(--serif); font-size: 16px; font-weight: 600;
  letter-spacing: .04em; color: var(--ink); margin-bottom: 8px;
}
.wx-card p { font-size: 13px; line-height: 1.85; color: var(--ink-2); }
.wx-card p b { color: var(--blue); font-weight: 700; }
.wx-must {
  margin: 12px 0 4px;
  padding: 12px 14px;
  background: var(--red-soft);
  border: 1px solid #f0d2c8;
  border-radius: 12px;
}
.wx-must-title {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--red);
  margin-bottom: 8px;
}
.wx-must ol { margin: 0; padding-left: 18px; }
.wx-must li {
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink-2);
  margin-bottom: 5px;
}
.wx-must li:last-child { margin-bottom: 0; }
.wx-must li b { color: var(--ink); font-weight: 700; }
.wx-fine {
  margin: 10px 0 0;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--ink-3);
  text-align: center;
}
.wx-actions { display: flex; gap: 10px; margin-top: 16px; }
.wx-actions .btn-line { flex: 1; height: 42px; }
.wx-actions .btn-primary { flex: 1; }

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* ---------------- 展开：WorkBuddy 引导面板 ---------------- */
.promo-panel {
  position: fixed; inset: 0; z-index: 140;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 16px;
  background: rgba(12, 22, 34, .5);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  animation: fade .2s ease both;
}
.promo-panel[hidden] { display: none; }
.pp-card {
  width: 100%; max-width: 460px;
  background: var(--paper-2);
  border-radius: 18px;
  padding: 20px 20px 16px;
  box-shadow: 0 24px 60px -18px rgba(0, 0, 0, .5);
  position: relative;
  animation: slideUp .28s cubic-bezier(.2, .8, .2, 1);
}
.pp-x {
  position: absolute; top: 12px; right: 12px;
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--ink-3); font-size: 18px; line-height: 1;
}
.pp-x:active { background: rgba(28, 43, 58, .06); }
.pp-brand {
  display: flex; align-items: center; gap: 8px;
  color: var(--blue); font-size: 12.5px; font-weight: 600;
  margin-bottom: 12px;
}
.pp-card h4 {
  font-family: var(--serif); font-size: 17px; font-weight: 600;
  letter-spacing: .02em; color: var(--ink); margin-bottom: 6px;
}
.pp-sub { font-size: 13px; line-height: 1.7; color: var(--ink-2); margin-bottom: 16px; }
.pp-steps { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.pp-step { display: flex; align-items: flex-start; gap: 12px; }
.pp-num {
  flex: none; width: 26px; height: 26px;
  display: grid; place-items: center;
  border-radius: 50%; margin-top: 1px;
  background: var(--blue-soft); color: var(--blue);
  font-size: 13px; font-weight: 700;
}
.pp-step b { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.pp-step i { display: block; font-style: normal; font-size: 12px; color: var(--ink-3); margin-top: 2px; line-height: 1.5; }
.pp-step i.pp-wx { color: var(--blue); font-weight: 600; font-size: 13px; }
.pp-actions { display: flex; gap: 10px; }
.pp-actions .btn-primary { flex: 1.2; height: 44px; }
.pp-actions .btn-line { flex: 1; height: 44px; }
.pp-note { font-size: 11.5px; line-height: 1.6; color: var(--ink-3); margin-top: 12px; }

@media (min-width: 820px) {
  .promo-inner { max-width: 1080px; padding-left: 28px; padding-right: 28px; }
  body.promo-on .app { padding-bottom: 104px; }
  .promo-panel { align-items: center; }
}
@media (min-width: 1180px) {
  .promo-inner { max-width: 1240px; }
}

/* ==========================================================
   AI 自建 / WorkBuddy 教程页
   ========================================================== */
.about { max-width: 760px; margin: 0 auto; padding: 8px 16px 40px; }
.about[hidden] { display: none; }

/* 教程页切换时，隐藏列表/工具栏/筛选/搜索（需覆盖它们自身的 display） */
#list[hidden], #toolbar[hidden], #chips[hidden], .search[hidden] { display: none !important; }

.about-hero {
  position: relative;
  border-radius: 20px;
  padding: 28px 22px 26px;
  margin-bottom: 20px;
  background: linear-gradient(150deg, #1f3d5e, #2a4f78 60%, #35618f);
  color: #fff;
  overflow: hidden;
}
.about-hero::after {
  content: ''; position: absolute; right: -40px; top: -40px;
  width: 160px; height: 160px; border-radius: 50%;
  background: rgba(255, 255, 255, .08);
}
.about-badge {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  font-size: 12px; font-weight: 600; letter-spacing: .02em;
  margin-bottom: 16px;
}
.about-hero h1 {
  font-family: var(--serif); font-size: 22px; line-height: 1.4;
  font-weight: 700; letter-spacing: .02em; margin-bottom: 10px;
  position: relative; z-index: 1;
}
.about-sub { font-size: 13.5px; line-height: 1.8; color: rgba(255, 255, 255, .86); margin-bottom: 18px; position: relative; z-index: 1; }
.about-cta {
  width: 100%; height: 46px; font-size: 15px;
  background: #fff; color: #1f3d5e; box-shadow: 0 6px 18px -6px rgba(0, 0, 0, .4);
  position: relative; z-index: 1;
}
.about-cta:active { background: #f2f5f9; }
.about-cta-note { text-align: center; font-size: 11.5px; color: rgba(255, 255, 255, .7); margin-top: 10px; }

.about-body { display: flex; flex-direction: column; gap: 16px; }
.ab-sec {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 18px 20px;
}
.ab-sec h2 {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--serif); font-size: 16.5px; font-weight: 700;
  color: var(--ink); margin-bottom: 12px; letter-spacing: .02em;
}
.ab-num {
  flex: none; font-family: var(--mono, monospace);
  font-size: 12px; font-weight: 700; color: var(--blue);
  background: var(--blue-soft); padding: 3px 7px; border-radius: 6px;
  letter-spacing: .02em;
}
.ab-sec p { font-size: 13.5px; line-height: 1.85; color: var(--ink-2); }
.ab-sec p + p { margin-top: 8px; }
.ab-sec p b { color: var(--ink); font-weight: 600; }

.ab-alert {
  background: var(--warm-soft, #fdf3e7);
  border: 1px solid #f3d8b0;
  border-radius: 12px;
  padding: 12px 14px; margin-bottom: 14px;
}
.ab-alert b { display: block; font-size: 13.5px; color: #8a5a12; margin-bottom: 4px; }
.ab-alert p { font-size: 12.5px; line-height: 1.7; color: #8a6a3a; }

.ab-link-box { margin-bottom: 16px; }
.ab-link {
  font-family: var(--mono, monospace);
  font-size: 12px; line-height: 1.6;
  color: var(--blue); word-break: break-all;
  background: var(--blue-soft);
  border-radius: 10px; padding: 10px 12px; margin-bottom: 10px;
}
.ab-link-actions { display: flex; gap: 10px; }
.ab-link-actions .btn-primary { flex: 1.2; height: 44px; }
.ab-link-actions .btn-line { flex: 1; height: 44px; }

.ab-flow { list-style: none; counter-reset: f; display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.ab-flow li {
  position: relative; padding-left: 30px;
  font-size: 13px; line-height: 1.7; color: var(--ink-2);
}
.ab-flow li::before {
  content: counter(f); counter-increment: f;
  position: absolute; left: 0; top: 2px;
  width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--blue-soft); color: var(--blue);
  font-size: 12px; font-weight: 700;
}
.ab-flow li b { color: var(--ink); font-weight: 600; }

.ab-wx-tip {
  display: flex; align-items: flex-start; gap: 10px;
  background: #eef6ee; border: 1px solid #cfe6cf;
  border-radius: 12px; padding: 12px 14px; margin-top: 10px;
}
.ab-wx-tip div { font-size: 13px; line-height: 1.7; color: #3c6b3c; }
.ab-wx-tip b { font-weight: 700; }
.ab-wx-arrow {
  flex: none; font-size: 20px; line-height: 1; color: #3c6b3c;
  animation: bob 1.5s ease-in-out infinite;
}

.ab-steps { display: flex; flex-direction: column; gap: 14px; margin-top: 6px; }
.ab-step { display: flex; align-items: flex-start; gap: 12px; }
.ab-step-num {
  flex: none; width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 50%; margin-top: 2px;
  background: var(--blue-soft); color: var(--blue);
  font-size: 14px; font-weight: 700;
}
.ab-step b { display: block; font-size: 14px; font-weight: 600; color: var(--ink); }
.ab-step i { display: block; font-style: normal; font-size: 12.5px; line-height: 1.7; color: var(--ink-3); margin-top: 3px; }

.ab-examples { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ab-ex {
  background: var(--bg, #faf8f3);
  border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 13px;
}
.ab-ex b { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.ab-ex i { font-style: normal; font-size: 12px; line-height: 1.6; color: var(--ink-3); }

.ab-sec-cta { text-align: center; padding-bottom: 22px; }
.ab-sec-cta h2 { justify-content: center; }
.ab-sec-cta .btn-primary { width: 100%; height: 46px; font-size: 15px; margin-top: 6px; }
.ab-wx-line { font-size: 12.5px; color: var(--ink-3); margin-top: 12px; }
.ab-wx-line b { color: var(--blue); font-weight: 700; }

/* 激活3天 / 加微信拿代码 */
.ab-tip-note {
  margin-top: 12px; font-size: 12px; line-height: 1.7;
  color: var(--ink-3); background: var(--bg, #faf8f3);
  border-radius: 10px; padding: 10px 12px;
}
.ab-wx-card {
  border: 1px dashed var(--blue); border-radius: 14px;
  padding: 14px 16px 16px;
  background: linear-gradient(180deg, rgba(42, 79, 120, .04), transparent);
}
.ab-wx-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
}
.ab-wx-label {
  flex: none; font-size: 11px; color: var(--ink-3);
  background: var(--blue-soft); color: var(--blue);
  padding: 3px 9px; border-radius: 999px; font-weight: 600;
}
.ab-wx-head b {
  font-size: 17px; font-weight: 700; color: var(--ink);
  letter-spacing: .02em; font-family: var(--mono, monospace);
}
.ab-wx-card p { font-size: 13px; line-height: 1.7; color: var(--ink-2); margin-bottom: 8px; }
.ab-wx-list { list-style: none; display: flex; flex-direction: column; gap: 7px; margin: 0 0 14px; }
.ab-wx-list li {
  position: relative; padding-left: 18px;
  font-size: 13px; line-height: 1.65; color: var(--ink-2);
}
.ab-wx-list li::before {
  content: '✓'; position: absolute; left: 0; top: 1px;
  color: var(--blue); font-weight: 700;
}
.ab-wx-list b { color: var(--ink); font-weight: 600; }
.ab-wx-card .btn-line { width: 100%; height: 44px; }

@media (min-width: 820px) {
  .about { padding-top: 16px; }
  .about-hero { padding: 40px 36px 34px; }
  .about-hero h1 { font-size: 26px; }
  .about-cta, .ab-sec-cta .btn-primary { width: auto; min-width: 260px; padding-left: 28px; padding-right: 28px; }
}
