/* 记忆表 PC 前台 公共样式(绿色主题, 贴近设计图) */
/* —— 字体: 英文 Noto Sans(可变) / 音标 Charis SIL / 中文 思源黑体(Noto Sans CJK SC) —— */
@font-face { font-family:'Noto Sans'; font-style:normal; font-weight:100 900; font-display:swap; src:url('/assets/fonts/noto-vf-latin.woff2') format('woff2'); unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family:'Noto Sans'; font-style:normal; font-weight:100 900; font-display:swap; src:url('/assets/fonts/noto-vf-latin-ext.woff2') format('woff2'); unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family:'Charis SIL'; font-style:normal; font-weight:400; font-display:swap; src:url('/assets/fonts/charis-400-latin.woff2') format('woff2'); unicode-range:U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family:'Charis SIL'; font-style:normal; font-weight:400; font-display:swap; src:url('/assets/fonts/charis-400-latin-ext.woff2') format('woff2'); unicode-range:U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }

* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --green: #22c55e; --green-d: #16a34a; --green-bg: #f0fdf4; --green-light: #dcfce7;
  --ink: #1f2937; --ink-2: #6b7280; --line: #e5e7eb; --bg: #f6f8f7; --card: #fff;
  --dark: #1e293b; --blue: #3b82f6; --radius: 12px;
}
body { font-family: "Noto Sans", "Noto Sans CJK SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif; background: var(--bg); color: var(--ink); }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* —— 顶栏 —— */
.topbar { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.topbar-in { max-width: 1480px; margin: 0 auto; height: 60px; display: flex; align-items: center; gap: 36px; padding: 0 20px; }
.logo { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 700; color: var(--ink); }
.logo svg { width: 28px; height: 28px; }
.nav { display: flex; gap: 28px; flex: 1; }
.nav a { font-size: 15px; color: var(--ink-2); padding: 18px 2px; border-bottom: 2px solid transparent; }
.nav a.on { color: var(--ink); font-weight: 600; border-bottom-color: var(--green); }
.nav a:hover { color: var(--green-d); }
.btn-ai { background: var(--green); color: #fff; border: none; border-radius: 8px; padding: 9px 22px; font-size: 14px; font-weight: 600; }
.btn-ai:hover { background: var(--green-d); }

/* —— 通用 —— */
.page { max-width: 1480px; margin: 0 auto; padding: 24px 20px 60px; }
.card { background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); }
.btn { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 8px 18px; font-size: 14px; color: var(--ink); }
.btn:hover { border-color: var(--green); color: var(--green-d); }
.btn-p { background: var(--green); border-color: var(--green); color: #fff; font-weight: 600; }
.btn-p:hover { background: var(--green-d); color: #fff; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.empty { text-align: center; color: var(--ink-2); padding: 60px 0; font-size: 14px; }
.toast { position: fixed; left: 50%; top: 72px; transform: translateX(-50%) translateY(-16px); background: rgba(17,24,39,.92); color: #fff; padding: 10px 22px; border-radius: 8px; font-size: 14px; opacity: 0; pointer-events: none; transition: .25s; z-index: 999; max-width: 70%; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* —— 教材库 —— */
.lib { display: flex; gap: 24px; align-items: flex-start; }
.side { width: 150px; flex: none; }
.side h4 { font-size: 14px; color: var(--ink-2); margin-bottom: 12px; font-weight: 600; }
.side .stg { display: block; width: 100%; text-align: center; padding: 11px 0; border: none; background: #f3f4f6; border-radius: 10px; margin-bottom: 10px; font-size: 15px; color: var(--ink); }
.side .stg.on { background: var(--green); color: #fff; font-weight: 600; }
.lib-main { flex: 1; min-width: 0; }
.filters { background: #fff; border-radius: var(--radius); border: 1px solid var(--line); padding: 18px 20px; }
.frow { display: flex; align-items: baseline; gap: 10px; padding: 6px 0; flex-wrap: wrap; }
.frow .flabel { font-size: 14px; font-weight: 600; color: var(--ink); flex: none; margin-right: 6px; }
.pill { border: none; background: var(--green-light); color: var(--green-d); border-radius: 999px; padding: 5px 16px; font-size: 13px; }
.pill.on { background: var(--green); color: #fff; font-weight: 600; }
.pill.ghost { background: #f3f4f6; color: var(--ink-2); }
.pill.ghost.on { background: var(--ink); color: #fff; }
.lib-toolbar { display: flex; align-items: center; justify-content: space-between; margin: 18px 2px 14px; }
.lib-toolbar .count { font-size: 13px; color: var(--ink-2); }
.toolbar-r { display: flex; align-items: center; gap: 12px; }
.search { border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; font-size: 13px; width: 180px; outline: none; background: #fff; }
.search:focus { border-color: var(--green); }
.sel { border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font-size: 13px; background: #fff; color: var(--ink-2); outline: none; }
.view-tg { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.view-tg button { border: none; background: #fff; padding: 7px 10px; color: var(--ink-2); }
.view-tg button.on { background: var(--green-light); color: var(--green-d); }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid.list { grid-template-columns: 1fr; }
.tcard { display: flex; gap: 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; transition: .2s; cursor: pointer; }
.tcard:hover { border-color: var(--green); box-shadow: 0 6px 20px rgba(34,197,94,.10); transform: translateY(-2px); }
.tcard .cov { width: 92px; height: 118px; border-radius: 8px; object-fit: cover; flex: none; background: var(--green-bg); }
.tcard .tt { font-size: 16px; font-weight: 700; margin-bottom: 6px; line-height: 1.35; }
.tcard .meta { font-size: 13px; color: var(--ink-2); margin-bottom: 4px; }
.tcard .desc { font-size: 12px; color: #9ca3af; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tcard .stats { display: flex; gap: 18px; margin-top: 10px; font-size: 12px; color: var(--ink-2); }
.tcard .stats b { font-weight: 600; color: var(--ink); margin-left: 2px; }
.tcard .price { margin-left: auto; align-self: flex-start; font-size: 13px; font-weight: 700; color: #ef4444; }
.tcard .price.free { color: var(--green-d); }
.pager { display: flex; justify-content: center; gap: 8px; margin-top: 26px; }
.pager button { min-width: 34px; height: 34px; border: 1px solid var(--line); background: #fff; border-radius: 8px; font-size: 13px; color: var(--ink-2); }
.pager button.on { background: var(--green); border-color: var(--green); color: #fff; }
.pager button[disabled] { opacity: .4; cursor: default; }

/* —— 详情(记忆表预览) —— */
.dhead { background: var(--dark); color: #fff; }
.dhead-in { max-width: 1480px; margin: 0 auto; padding: 26px 20px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.dhead h1 { font-size: 22px; font-weight: 700; }
.dhead .sub { font-size: 12px; color: #94a3b8; margin-top: 6px; }
.dhead .tagx { background: var(--green); font-size: 12px; border-radius: 6px; padding: 3px 10px; }
.dhead .ops { margin-left: auto; display: flex; gap: 12px; }
.dhead .ops button { display: flex; align-items: center; gap: 6px; border-radius: 8px; padding: 10px 18px; font-size: 14px; border: none; }
.dhead .ops .bp { background: var(--green); color: #fff; font-weight: 600; }
.dhead .ops .bw { background: #fff; color: var(--ink); }
.dhead .ops .bg { background: #475569; color: #e2e8f0; }
.dhead .back { color: #cbd5e1; font-size: 14px; padding: 6px 12px; border: 1px solid #475569; border-radius: 8px; white-space: nowrap; }
.dhead .back:hover { color: #fff; border-color: var(--green); }
.sheet { background: #fff; border-radius: var(--radius); padding: 34px 30px; margin-top: 24px; border: 1px solid var(--line); }
.sheet h2 { text-align: center; font-size: 20px; margin-bottom: 18px; }
.sheet-bar { display: flex; align-items: center; gap: 12px; justify-content: center; margin-bottom: 14px; font-size: 13px; color: var(--ink-2); }
.sheet-bar input { border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px; font-size: 13px; outline: none; }
.sheet-bar .mode-tg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-left: 6px; }
.sheet-bar .mode-tg button { border: none; background: #fff; padding: 6px 12px; font-size: 13px; color: var(--ink-2); }
.sheet-bar .mode-tg button.on { background: var(--green); color: #fff; font-weight: 600; }
.mtable { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.mtable th, .mtable td { border: 1px solid #dbe2ea; padding: 7px 6px; text-align: center; }
.mtable thead th { background: var(--blue); color: #fff; font-weight: 600; }
.mtable thead tr.g2 th { background: #60a5fa; }
.mtable td.w { font-weight: 600; text-align: left; padding-left: 10px; font-family: "Noto Sans", "Noto Sans CJK SC", sans-serif; }
/* 音标优先 Charis SIL, 缺字回退 Noto Sans / 思源黑体 */
.mtable td.ph { font-family: "Charis SIL", "Noto Sans", "Noto Sans CJK SC", sans-serif; font-size: 12px; }
.mtable td.l { text-align: left; }
.mtable tbody td { vertical-align: middle; }
.mtable tbody tr.grp-start td { border-top: 2px solid #93c5fd; }
.mtable td .unit { font-size: 11px; color: var(--ink-2); font-weight: 400; margin-top: 3px; letter-spacing: 0; }
.mtable td.dt { white-space: nowrap; }
.mtable td.nil { color: #cbd5e1; }
.mtable td.ct { text-align: left; padding-left: 14px; line-height: 1.75; }
.mtable td.ct .ti { font-weight: 700; color: var(--ink); margin-bottom: 2px; }
.dfoot { position: sticky; bottom: 16px; margin-top: 24px; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 12px 24px; display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--ink-2); box-shadow: 0 8px 24px rgba(15,23,42,.08); }
.dfoot .ico { width: 26px; height: 26px; border-radius: 6px; background: var(--green-light); color: var(--green-d); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.dfoot .x { margin-left: auto; border: none; background: none; color: var(--ink-2); font-size: 16px; }

/* —— AI 生成 —— */
.aiwrap { display: flex; gap: 24px; align-items: flex-start; }
.ai-left { width: 380px; flex: none; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.ai-left h3 { font-size: 17px; margin-bottom: 18px; }
.drop { border: 2px dashed #a7f3d0; background: var(--green-bg); border-radius: var(--radius); height: 240px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; cursor: pointer; transition: .2s; }
.drop:hover, .drop.over { border-color: var(--green); background: var(--green-light); }
.drop .up { width: 54px; height: 54px; color: var(--green-d); }
.drop .t1 { font-size: 15px; font-weight: 600; }
.drop .t2 { font-size: 12px; color: var(--ink-2); }
.drop .fname { font-size: 13px; color: var(--green-d); font-weight: 600; max-width: 90%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-left .btn-p { width: 120px; margin: 18px auto 0; display: block; padding: 10px 0; border-radius: 8px; border: none; }
.ai-left .demo { margin-top: 18px; font-size: 12px; color: var(--ink-2); }
.ai-left .demo a { color: var(--ink); text-decoration: underline; }
.ai-left .quota { margin-top: 8px; font-size: 12px; color: #9ca3af; }
.ai-right { flex: 1; min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.prog { height: 8px; border-radius: 999px; background: #f3f4f6; overflow: hidden; }
.prog i { display: block; height: 100%; width: 0; background: var(--green); border-radius: 999px; transition: width .4s; }
.ai-rhead { display: flex; align-items: center; margin-top: 12px; font-size: 13px; color: var(--ink-2); }
.ai-rhead .ops { margin-left: auto; display: flex; gap: 16px; }
.ai-rhead .ops a { color: var(--ink-2); cursor: pointer; }
.ai-rhead .ops a:hover { color: var(--green-d); }
.rtable { margin-top: 14px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; max-height: 480px; overflow-y: auto; }
.rtable table { width: 100%; border-collapse: collapse; font-size: 14px; }
.rtable th { background: #f9fafb; text-align: left; padding: 12px 14px; font-size: 13px; color: var(--ink-2); font-weight: 600; border-bottom: 1px solid var(--line); position: sticky; top: 0; }
.rtable td { padding: 11px 14px; border-bottom: 1px solid #f3f4f6; }
.rtable tr:last-child td { border-bottom: none; }
.rtable td .m { color: var(--ink-2); }
.ai-foot { display: flex; gap: 12px; margin-top: 18px; }

/* —— 我的下载(引导页) —— */
.dl { display: flex; gap: 24px; align-items: flex-start; }
.dl-main { flex: 1; min-width: 0; }
.dl-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; }
.dl-card h3 { font-size: 16px; display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.guide { display: flex; gap: 18px; align-items: center; background: var(--green-bg); border: 1px dashed #a7f3d0; border-radius: 10px; padding: 20px; margin-top: 14px; }
.guide .qr { width: 96px; height: 96px; flex: none; border-radius: 10px; background: #fff; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); }
.guide .qr svg { width: 72px; height: 72px; }
.guide h4 { font-size: 15px; margin-bottom: 6px; }
.guide p { font-size: 13px; color: var(--ink-2); line-height: 1.7; }
.vip { margin-top: 16px; background: linear-gradient(90deg, #fef9c3, #fef3c7); border-radius: 10px; padding: 16px 20px; display: flex; align-items: center; }
.vip .t { font-size: 14px; font-weight: 600; color: #854d0e; }
.vip .s { font-size: 12px; color: #a16207; margin-top: 3px; }
.vip button { margin-left: auto; background: var(--green); color: #fff; border: none; border-radius: 8px; padding: 9px 18px; font-size: 13px; font-weight: 600; }
.dl-side { width: 320px; flex: none; display: flex; flex-direction: column; gap: 20px; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.stat-grid .it { background: #f9fafb; border-radius: 10px; padding: 14px; }
.stat-grid .it .l { font-size: 12px; color: var(--ink-2); }
.stat-grid .it .v { font-size: 20px; font-weight: 700; margin-top: 4px; }
.stat-grid .it .v small { font-size: 12px; font-weight: 400; color: var(--ink-2); }

/* —— 弹层 —— */
.mask { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: none; align-items: center; justify-content: center; z-index: 100; }
.mask.show { display: flex; }
.mask .box { background: #fff; border-radius: 14px; padding: 28px; width: 340px; text-align: center; }
.mask .box h3 { font-size: 17px; margin-bottom: 10px; }
.mask .box p { font-size: 13px; color: var(--ink-2); line-height: 1.8; margin-bottom: 16px; }
.mask .box .qr { width: 120px; height: 120px; margin: 0 auto 14px; border: 1px solid var(--line); border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--green-bg); }
.mask .box .qr svg { width: 92px; height: 92px; }

/* —— 打印样式(详情页) —— */
@media print {
  @page { size: A4 landscape; margin: 8mm 8mm 10mm; }
  .topbar, .dhead, .dfoot, .sheet-bar, .toast { display: none !important; }
  body { background: #fff; }
  .page { padding: 0; max-width: none; }
  .sheet { border: none; padding: 0; margin-top: 0; box-shadow: none; }
  .mtable { font-size: 10.5px; }
  .mtable thead th { background: #4b7bec !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .mtable thead tr { page-break-inside: avoid; }
  .mtable tr { page-break-inside: avoid; }
  .mtable td.nil { color: #b6c2d4; }
}
