/* ============================================================
 * OI 资料站 · 样式
 * 零外部依赖（不引 CDN、不引字体），首屏体积小，适合小内存服务器。
 * ============================================================ */

/* 颜色 / 圆角 / 阴影 / 字体全部来自 /shared/tokens.css（引入顺序在本文件之前）
 * —— 这里不再自建 :root，避免三套色值各自漂移。 */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  transition: background .22s ease, color .22s ease;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* 避免段落末行只剩一两个字（Chrome 117+ 生效，旧浏览器自动忽略） */
p { text-wrap: pretty; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 22px; }

/* ---------------- 顶栏 ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar-inner { display: flex; align-items: center; gap: 20px; height: 58px; }

.brand { display: flex; align-items: center; gap: 11px; color: inherit; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px; flex: 0 0 34px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: linear-gradient(140deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff; font-weight: 700; font-size: 13px; letter-spacing: .4px;
  font-family: var(--mono);
}
.brand-text { display: flex; align-items: center; min-width: 0; line-height: 1.25; }
.brand-text strong {
  font-size: 15.5px; font-weight: 650; letter-spacing: .2px;
  white-space: nowrap;
}

.nav { display: flex; gap: 4px; margin-left: auto; }
.nav a {
  padding: 7px 13px; border-radius: 8px;
  font-size: 14.5px; color: var(--text-2);
  transition: background .16s ease, color .16s ease;
}
.nav a:hover { background: var(--bg-soft); color: var(--text); text-decoration: none; }
.nav a.active { color: var(--brand); background: var(--brand-soft); font-weight: 560; }

.theme-btn {
  width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--card); color: var(--text-2); cursor: pointer;
  transition: border-color .16s ease, color .16s ease, transform .16s ease;
}
.theme-btn:hover { border-color: var(--brand); color: var(--brand); transform: rotate(-14deg); }

/* ---------------- 首屏 ---------------- */
.hero { padding-top: 46px; padding-bottom: 30px; }
.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(28px, 4.2vw, 40px);
  line-height: 1.28; font-weight: 700; letter-spacing: -.6px;
}
.hero h1 .accent {
  background: linear-gradient(100deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
[data-theme="dark"] .hero h1 .accent {
  background: linear-gradient(100deg, #b3c8ff, #dbe4ff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lead {
  margin: 0; max-width: 730px;
  color: var(--text-2); font-size: 16.5px; line-height: 1.78;
  text-wrap: balance;
}
.hero-meta {
  display: flex; flex-wrap: wrap; gap: 8px 18px;
  margin-top: 22px; font-size: 13.5px; color: var(--text-3);
}
.hero-meta span { display: inline-flex; align-items: center; gap: 7px; }
.hero-meta i {
  width: 5px; height: 5px; border-radius: 50%; background: var(--brand);
  display: inline-block; flex: 0 0 5px;
}

/* 三入口卡片 */
.entries {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
  margin: 30px 0 10px;
}
.entry {
  display: flex; flex-direction: column; padding: 22px 20px 20px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); color: inherit;
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.entry:hover {
  text-decoration: none; border-color: var(--brand);
  transform: translateY(-2px); box-shadow: var(--shadow);
}
.entry-top { display: flex; align-items: center; justify-content: space-between; }
.entry-icon {
  width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand);
}
.entry-count { font-family: var(--mono); font-size: 12.5px; color: var(--text-3); }
.entry h3 { margin: 14px 0 6px; font-size: 16.5px; font-weight: 620; }
.entry p { margin: 0; font-size: 13.5px; color: var(--text-2); line-height: 1.65; text-wrap: balance; }
.entry-more {
  display: inline-block; margin-top: auto; padding-top: 12px;
  font-size: 13px; color: var(--brand); font-weight: 550;
}

/* ---------------- 分区通用 ---------------- */
/* 注意：.section 与 .hero 常和 .wrap 同时出现，这里只能用 padding-block， */
/* 用 padding 简写会把 .wrap 的左右内距清零，导致内容和卡片左右不齐。      */
.section { padding-top: 34px; padding-bottom: 10px; }
.section-head { margin-bottom: 20px; }
.section-head h2 {
  margin: 0 0 6px; font-size: 22px; font-weight: 680; letter-spacing: -.3px;
  display: flex; align-items: center; gap: 10px;
}
.section-head h2::before {
  content: ""; width: 3px; height: 17px; border-radius: 2px;
  background: linear-gradient(var(--brand), var(--brand-2));
}
.section-head p { margin: 0; font-size: 14px; color: var(--text-2); }

/* 工具条：搜索 + 标签 */
.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-bottom: 18px;
}
.search {
  position: relative; flex: 1 1 240px; min-width: 200px;
}
.search input {
  width: 100%; height: 38px; padding: 0 12px 0 36px;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--card); color: var(--text);
  font-size: 14px; font-family: inherit;
  outline: none; transition: border-color .16s ease, box-shadow .16s ease;
}
.search input::placeholder { color: var(--text-3); }
.search input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.search svg {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--text-3); pointer-events: none;
}

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  padding: 5px 11px; border-radius: 20px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card);
  color: var(--text-2); font-size: 12.5px; font-family: inherit;
  transition: all .16s ease; white-space: nowrap;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.on {
  background: var(--p-btn); border-color: var(--p-btn);
  color: #fff; font-weight: 550;
}

.result-hint { font-size: 13px; color: var(--text-3); margin: 0 0 14px; }

/* ---------------- 代码卡片 ---------------- */
.code-list { display: flex; flex-direction: column; gap: 16px; }

.code-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  transition: border-color .18s ease;
}
.code-card:hover { border-color: color-mix(in srgb, var(--brand) 42%, var(--line)); }

.cc-head {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 16px 18px 13px;
}
.cc-title { flex: 1; min-width: 0; }
.cc-title h3 {
  margin: 0 0 5px; font-size: 16px; font-weight: 630;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
}
.pid {
  font-family: var(--mono); font-size: 11.5px; font-weight: 600;
  padding: 2px 7px; border-radius: 5px;
  background: var(--brand-soft); color: var(--brand);
  border: 1px solid color-mix(in srgb, var(--brand) 20%, transparent);
}
.pname { font-size: 13px; color: var(--text-3); font-weight: 400; }
.cc-meta {
  display: flex; flex-wrap: wrap; gap: 6px 14px;
  font-size: 12.5px; color: var(--text-3); font-family: var(--mono);
  margin-top: 3px;
}
.cc-meta b { font-weight: 500; color: var(--text-2); font-family: inherit; }

.btn-copy {
  flex: 0 0 auto; height: 30px; padding: 0 12px;
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); border-radius: 7px;
  background: var(--bg-soft); color: var(--text-2);
  font-size: 12.5px; font-family: inherit; cursor: pointer;
  transition: all .16s ease;
}
.btn-copy:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.btn-copy.done { border-color: #2f8a3e; color: #2f8a3e; background: transparent; }

.cc-idea {
  margin: 0; padding: 0 18px 14px;
  font-size: 14px; color: var(--text-2); line-height: 1.75;
}

.cc-tags { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 18px 14px; }
.tag {
  font-size: 11.5px; padding: 2px 8px; border-radius: 5px;
  background: var(--bg-soft); color: var(--text-2);
  border: 1px solid var(--line-soft);
}

/* 代码块 */
pre.code {
  margin: 0; padding: 16px 18px;
  background: var(--code-bg);
  border-top: 1px solid var(--line-soft);
  overflow-x: auto; overflow-y: auto; max-height: 520px;
  font-family: var(--mono); font-size: 13px; line-height: 1.68;
  color: var(--text); tab-size: 4;
}
pre.code::-webkit-scrollbar { height: 9px; width: 9px; }
pre.code::-webkit-scrollbar-thumb { background: var(--line); border-radius: 5px; }
pre.code::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

.tok-kw { color: var(--kw); font-weight: 560; }
.tok-fn { color: var(--fn); }
.tok-st { color: var(--st); }
.tok-cm { color: var(--cm); font-style: italic; }
.tok-num { color: var(--num); }
.tok-pp { color: var(--pp); }
.tok-ty { color: var(--kw); }

/* ---------------- 讲义 ---------------- */
.note-list { display: flex; flex-direction: column; gap: 14px; }

.note-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  transition: border-color .18s ease;
}
.note-card:hover { border-color: color-mix(in srgb, var(--brand) 38%, var(--line)); }

.note-head {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 18px 20px; cursor: pointer; user-select: none;
}
.note-head-text { flex: 1; min-width: 0; }
.note-head h3 { margin: 0 0 6px; font-size: 16.5px; font-weight: 630; }
.note-sum { margin: 0; font-size: 13.8px; color: var(--text-2); line-height: 1.7; }
.note-info {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
  margin-top: 9px; font-size: 12px; color: var(--text-3);
}
.note-info .date { font-family: var(--mono); }

.caret {
  flex: 0 0 auto; width: 26px; height: 26px; margin-top: 2px;
  display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 7px;
  color: var(--text-3); transition: transform .22s ease, border-color .16s ease;
}
.note-card.open .caret { transform: rotate(180deg); border-color: var(--brand); color: var(--brand); }

.note-body {
  display: none; padding: 2px 20px 22px;
  border-top: 1px solid var(--line-soft);
  font-size: 15px; color: var(--text); line-height: 1.8;
}
.note-card.open .note-body { display: block; }

.note-body h3 {
  font-size: 15.5px; font-weight: 640; margin: 24px 0 10px;
  padding-left: 10px; border-left: 3px solid var(--brand);
}
.note-body p { margin: 12px 0; }
.note-body ul, .note-body ol { margin: 12px 0; padding-left: 24px; }
.note-body li { margin: 7px 0; }
.note-body code {
  font-family: var(--mono); font-size: 13px;
  background: var(--bg-soft); padding: 1.5px 5px; border-radius: 4px;
  border: 1px solid var(--line-soft); color: var(--text);
}
.note-body b { font-weight: 620; }

pre.code-inline {
  margin: 14px 0; padding: 14px 16px;
  background: var(--code-bg); border: 1px solid var(--line-soft);
  border-radius: 9px; overflow-x: auto;
  font-family: var(--mono); font-size: 12.8px; line-height: 1.65;
  color: var(--text);
}

.tbl {
  width: 100%; border-collapse: collapse; margin: 16px 0;
  font-size: 13.8px;
}
.tbl th, .tbl td {
  padding: 9px 12px; text-align: left;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
.tbl th {
  background: var(--bg-soft); font-weight: 620; font-size: 13px;
  color: var(--text-2); white-space: nowrap;
}
.tbl code { font-size: 12.5px; }
.tbl tr:last-child td { border-bottom: none; }

.warn {
  margin: 16px 0; padding: 12px 15px;
  background: color-mix(in srgb, var(--brand) 6%, transparent);
  border-left: 3px solid var(--brand);
  border-radius: 0 8px 8px 0;
  font-size: 14px; color: var(--text-2);
}

/* ---------------- 视频 ---------------- */
.video-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px;
}
.video-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  transition: border-color .18s ease, transform .18s ease;
}
.video-card:hover { border-color: color-mix(in srgb, var(--brand) 38%, var(--line)); }

.vframe {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  background: var(--bg-soft); overflow: hidden;
}
.vframe iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.vcover {
  position: absolute; inset: 0; cursor: pointer;
  display: grid; place-items: center;
  background:
    radial-gradient(120% 100% at 12% 0%, color-mix(in srgb, var(--brand) 24%, transparent) 0%, transparent 58%),
    linear-gradient(135deg, var(--bg-soft) 0%, color-mix(in srgb, var(--brand) 11%, var(--bg-soft)) 100%);
}
.vcover .play {
  width: 54px; height: 54px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--card); color: var(--brand);
  border: 1px solid var(--line); box-shadow: var(--shadow);
  transition: transform .18s ease;
}
.vcover:hover .play { transform: scale(1.08); }
.vcover .play svg { margin-left: 3px; }

.vcover .pending {
  position: absolute; bottom: 10px; left: 12px;
  font-size: 11.5px; font-family: var(--mono);
  color: var(--text-3); background: var(--card);
  border: 1px solid var(--line); border-radius: 5px;
  padding: 2px 7px;
}
.vcover .topic {
  position: absolute; top: 14px; left: 14px; right: 14px;
  font-size: 13px; font-weight: 600; color: var(--text-2);
  letter-spacing: .2px; opacity: .85;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}

.vbody { padding: 14px 16px 16px; }
.vbody h3 { margin: 0 0 7px; font-size: 15px; font-weight: 620; line-height: 1.5; }
.vbody p { margin: 0 0 10px; font-size: 13.2px; color: var(--text-2); line-height: 1.65; }
.vbody .cc-tags, .vbody .v-tags { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; }

/* 即时嵌入面板 */
.embed-panel {
  margin-bottom: 22px; padding: 18px 20px;
  background: var(--card); border: 1px dashed color-mix(in srgb, var(--brand) 40%, var(--line));
  border-radius: var(--radius);
}
.embed-panel h3 {
  margin: 0 0 4px; font-size: 15px; font-weight: 630;
  display: flex; align-items: center; gap: 8px;
}
.embed-panel h3 .badge {
  font-size: 11px; font-weight: 500; font-family: var(--mono);
  padding: 1.5px 7px; border-radius: 5px;
  background: var(--brand-soft); color: var(--brand);
}
.embed-panel > p { margin: 0 0 13px; font-size: 13px; color: var(--text-2); }
.embed-row { display: flex; gap: 9px; flex-wrap: wrap; }
.embed-row input {
  flex: 1 1 300px; height: 38px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--bg); color: var(--text);
  font-size: 14px; font-family: var(--mono); outline: none;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.embed-row input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.embed-row button {
  height: 38px; padding: 0 18px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--p-btn); background: var(--p-btn); color: #fff;
  font-size: 14px; font-family: inherit; font-weight: 550;
  transition: filter .16s ease;
}
.embed-row button:hover { filter: brightness(1.07); }
.embed-out { margin-top: 14px; }
.embed-out .vframe { border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.embed-msg { margin-top: 10px; font-size: 13px; color: var(--text-2); }
.embed-msg code {
  font-family: var(--mono); font-size: 12.5px;
  background: var(--bg-soft); padding: 2px 6px; border-radius: 4px;
  border: 1px solid var(--line-soft); color: var(--text);
}

/* ---------------- 空状态 / 页脚 ---------------- */
.empty {
  padding: 44px 20px; text-align: center;
  color: var(--text-3); font-size: 14px;
  background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius);
}

.footer {
  margin-top: 56px; padding: 26px 0 34px;
  border-top: 1px solid var(--line-soft);
  font-size: 13px; color: var(--text-3);
}
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.footer-dot { opacity: .5; }

/* ============================================================
 * 信息架构组件：比赛 → 主题 → 知识点 → 资源
 * ============================================================ */

/* ---------------- 通用小件 ---------------- */
.bd {
  display: inline-flex; align-items: center;
  font-size: 11.5px; line-height: 1.55; font-weight: 550;
  padding: 1.5px 7px; border-radius: 5px;
  border: 1px solid transparent; white-space: nowrap;
}
.bd-contest { background: var(--brand-soft); color: var(--brand); }
.bd-lv {
  background: var(--bg-soft); color: var(--text-2);
  border-color: var(--line); font-family: var(--mono);
  font-size: 11px; letter-spacing: .2px;
}
.bd-topic { background: transparent; color: var(--text-3); border-color: var(--line); }
.bd-type.t-code { background: var(--brand-soft); color: var(--brand); }
.bd-type.t-note { background: color-mix(in srgb, #2f8a3e 15%, transparent); color: #2f8a3e; }
.bd-type.t-video { background: color-mix(in srgb, #b07412 17%, transparent); color: #a3611b; }
[data-theme="dark"] .bd-type.t-note { color: #98c379; }
[data-theme="dark"] .bd-type.t-video { color: #d19a66; }

.res-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.code-card > .res-meta { padding: 0 18px 12px; }
.note-head-text > .res-meta { margin-top: 9px; }
.vbody > .res-meta { margin-top: 10px; }

.pid-plain {
  background: var(--bg-soft); color: var(--text-3);
  border-color: var(--line); font-weight: 500;
}

/* ---------------- 按钮 ---------------- */
.btn-primary, .btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 18px; border-radius: 9px;
  font-size: 14px; font-weight: 550; letter-spacing: .2px;
  border: 1px solid var(--p-btn); background: var(--p-btn); color: #fff;
  transition: filter .16s ease, background .16s ease;
}
.btn-primary:hover { filter: brightness(1.08); text-decoration: none; }
.btn-ghost {
  background: transparent; color: var(--brand);
  border-color: color-mix(in srgb, var(--brand) 34%, var(--line));
}
.btn-ghost:hover { background: var(--brand-soft); text-decoration: none; }
.btn-primary.sm { height: 32px; padding: 0 14px; font-size: 13px; border-radius: 8px; }
.btn-link { font-size: 13.5px; color: var(--brand); }

/* ---------------- 首页 · GESP 主推 ---------------- */
.gesp-hero {
  position: relative; overflow: hidden;
  margin-top: 6px; padding: 30px 30px 26px;
  background:
    radial-gradient(120% 130% at 100% 0%, var(--brand-soft) 0%, transparent 55%),
    var(--card);
  border: 1px solid color-mix(in srgb, var(--brand) 24%, var(--line));
  border-radius: 16px;
  box-shadow: var(--shadow);
}
.gh-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.gh-badge {
  font-size: 11.5px; font-weight: 650; letter-spacing: .6px;
  padding: 2px 9px; border-radius: 999px;
  background: var(--p-btn); color: #fff;
}
.gh-kicker {
  font-size: 12px; color: var(--text-3);
  font-family: var(--mono); letter-spacing: .3px;
}
.gh-title { margin: 0 0 10px; font-size: 30px; font-weight: 680; letter-spacing: -.6px; }
.gh-title em {
  font-style: normal; font-size: 15px; font-weight: 500;
  color: var(--text-3); margin-left: 8px;
}
.gh-desc {
  margin: 0 0 18px; max-width: 880px;
  font-size: 14.8px; line-height: 1.78; color: var(--text-2);
  text-wrap: balance;
}
.gh-meta {
  display: flex; flex-wrap: wrap; gap: 10px 30px;
  margin-bottom: 20px; font-size: 13.5px; color: var(--text);
}
.gh-meta span { display: flex; flex-direction: column; gap: 2px; }
.gh-meta i {
  font-style: normal; font-size: 11px; letter-spacing: .5px;
  color: var(--text-3); text-transform: uppercase;
}
.gh-levels {
  display: grid; grid-template-columns: repeat(8, 1fr); gap: 8px;
  margin-bottom: 20px;
}
.gh-lv {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 10px 4px 9px; border-radius: 10px;
  background: var(--bg); border: 1px solid var(--line);
  color: var(--text); transition: all .16s ease;
}
.gh-lv:hover {
  border-color: var(--brand); background: var(--brand-soft);
  transform: translateY(-2px); text-decoration: none;
}
.gh-lv b { font-size: 17px; font-weight: 680; font-family: var(--mono); line-height: 1.2; }
.gh-lv span { font-size: 11.5px; color: var(--text-2); }
.gh-lv i { font-style: normal; font-size: 10.5px; color: var(--text-3); }
.gh-act { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

/* ---------------- 首页 · 资源速览 / 主题云 ---------------- */
.quick-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}
.quick {
  display: block; padding: 16px 18px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); color: var(--text);
  transition: border-color .16s ease, transform .16s ease;
}
.quick:hover {
  border-color: color-mix(in srgb, var(--brand) 40%, var(--line));
  transform: translateY(-2px); text-decoration: none;
}
.q-head { display: flex; align-items: baseline; gap: 6px; margin-bottom: 9px; }
.q-head span { flex: 1; font-size: 14px; font-weight: 620; }
.q-head b { font-size: 19px; font-weight: 680; font-family: var(--mono); color: var(--brand); line-height: 1; }
.q-head i { font-style: normal; font-size: 11.5px; color: var(--text-3); }
.quick ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 5px; }
.quick li {
  font-size: 12.8px; color: var(--text-2); line-height: 1.55;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  padding-left: 11px; position: relative;
}
.quick li::before {
  content: ''; position: absolute; left: 0; top: .62em;
  width: 4px; height: 4px; border-radius: 50%; background: var(--line);
}
.quick li.q-none { color: var(--text-3); padding-left: 0; }
.quick li.q-none::before { display: none; }

.topic-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tc-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line);
  color: var(--text); font-size: 13.5px;
  transition: all .16s ease;
}
.tc-pill:hover {
  border-color: var(--brand); background: var(--brand-soft);
  color: var(--brand); text-decoration: none;
}
.tc-pill i {
  font-style: normal; font-size: 11px; font-family: var(--mono);
  color: var(--text-3); background: var(--bg-soft);
  border-radius: 4px; padding: 0 5px; line-height: 1.6;
}

/* ---------------- 页面头 ---------------- */
.page-head { margin-bottom: 22px; }
.pg-kicker {
  display: inline-block; margin-bottom: 8px;
  font-size: 11.5px; font-weight: 600; letter-spacing: 1.1px;
  text-transform: uppercase; color: var(--brand);
}
.page-head h1 {
  margin: 0 0 9px; font-size: 28px; font-weight: 680; letter-spacing: -.5px;
}
.page-head p {
  margin: 0; max-width: 780px;
  font-size: 14.8px; line-height: 1.78; color: var(--text-2);
}

/* ---------------- GESP 信息框 ---------------- */
.info-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px; margin-bottom: 16px;
}
.info-box {
  padding: 14px 16px; border-radius: 11px;
  background: var(--card); border: 1px solid var(--line);
}
.ib-k {
  margin-bottom: 5px; font-size: 11px; letter-spacing: .8px;
  text-transform: uppercase; color: var(--text-3); font-weight: 600;
}
.ib-v { font-size: 13.8px; line-height: 1.72; color: var(--text); }

.callout {
  padding: 15px 18px; border-radius: 11px;
  background: var(--brand-soft);
  border: 1px solid color-mix(in srgb, var(--brand) 24%, transparent);
  border-left: 3px solid var(--brand);
}
.callout b { display: block; margin-bottom: 4px; font-size: 13.5px; font-weight: 640; }
.callout p { margin: 0; font-size: 13.8px; line-height: 1.75; color: var(--text-2); }
.pg-link { margin: 14px 0 0; font-size: 13.2px; color: var(--text-3); }

/* ---------------- GESP 级别手风琴 ---------------- */
.level-list { display: flex; flex-direction: column; gap: 11px; }
.level-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  transition: border-color .18s ease;
}
.level-card:hover { border-color: color-mix(in srgb, var(--brand) 38%, var(--line)); }
.level-card.open { border-color: color-mix(in srgb, var(--brand) 46%, var(--line)); }

.lc-head {
  display: flex; align-items: flex-start; gap: 15px;
  padding: 17px 20px; cursor: pointer; user-select: none;
}
.lc-num {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 11px;
  display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand);
  font-family: var(--mono); font-size: 18px; font-weight: 700;
}
.lc-main { flex: 1; min-width: 0; }
.lc-name {
  display: flex; flex-wrap: wrap; align-items: center; gap: 9px;
  font-size: 16.5px; font-weight: 640;
}
.lc-hours, .lc-count {
  font-size: 11.5px; font-weight: 500; color: var(--text-3);
  border: 1px solid var(--line); border-radius: 5px;
  padding: 1px 7px; background: var(--bg-soft);
}
.lc-hours { font-family: var(--mono); }
.lc-count { border-color: transparent; background: transparent; padding: 0; }
.lc-goal {
  margin: 6px 0 0; font-size: 13.6px; line-height: 1.72; color: var(--text-2);
}
.level-card.open .caret { transform: rotate(180deg); border-color: var(--brand); color: var(--brand); }

.lc-body {
  display: none; padding: 4px 20px 20px;
  border-top: 1px solid var(--line-soft);
}
.level-card.open .lc-body { display: block; }

.kp-title {
  margin: 16px 0 8px; padding-left: 9px;
  border-left: 3px solid var(--brand);
  font-size: 12.5px; font-weight: 640; letter-spacing: .4px;
  color: var(--text-2);
}
.kp-list {
  list-style: none; margin: 0; padding: 0;
  counter-reset: kp; display: grid; gap: 0;
}
.kp-item {
  counter-increment: kp;
  display: flex; align-items: baseline; gap: 10px;
  padding: 6px 0; font-size: 13.8px; line-height: 1.7;
  border-bottom: 1px dashed var(--line-soft);
}
.kp-item:last-child { border-bottom: 0; }
.kp-item::before {
  content: counter(kp, decimal-leading-zero);
  flex: 0 0 auto; font-family: var(--mono);
  font-size: 11px; color: var(--text-3);
}
.kp-text { flex: 1; min-width: 0; }
.kp-topic {
  flex: 0 0 auto; font-size: 11px; padding: 1px 7px;
  border-radius: 5px; color: var(--brand);
  border: 1px solid color-mix(in srgb, var(--brand) 26%, transparent);
  background: var(--brand-soft);
}
.kp-topic:hover { text-decoration: none; filter: brightness(.97); }

.lc-res { display: flex; flex-direction: column; gap: 6px; }
.lc-res-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 11px; border-radius: 8px;
  border: 1px solid var(--line-soft); background: var(--bg);
  color: var(--text); font-size: 13.2px;
  transition: all .16s ease;
}
.lc-res-item:hover {
  border-color: color-mix(in srgb, var(--brand) 34%, var(--line));
  background: var(--brand-soft); text-decoration: none;
}
.kp-none { margin: 0; font-size: 13px; color: var(--text-3); }

/* ---------------- 比赛卡片 ---------------- */
.contest-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 15px;
}
.contest-card {
  display: flex; flex-direction: column;
  padding: 22px 22px 18px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius);
}
.contest-card.primary {
  border-color: color-mix(in srgb, var(--brand) 40%, var(--line));
  box-shadow: var(--shadow);
}
.ct-head { display: flex; align-items: center; gap: 9px; }
.ct-head h3 { margin: 0; font-size: 21px; font-weight: 680; letter-spacing: -.3px; }
.ct-badge {
  font-size: 11px; font-weight: 650; letter-spacing: .5px;
  padding: 1.5px 8px; border-radius: 999px;
  background: var(--p-btn); color: #fff;
}
.ct-full { margin: 5px 0 12px; font-size: 13px; color: var(--text-3); }
.ct-intro {
  margin: 0 0 16px; font-size: 14px; line-height: 1.78; color: var(--text-2);
}
.ct-meta { display: grid; gap: 7px; margin-bottom: 14px; }
.ct-row { display: flex; gap: 10px; font-size: 13.2px; line-height: 1.65; }
.ct-row i {
  flex: 0 0 34px; font-style: normal; font-size: 12px;
  color: var(--text-3); padding-top: 1px;
}
.ct-row span { flex: 1; min-width: 0; color: var(--text); }
.ct-bonus {
  margin-bottom: 14px; padding: 10px 12px; border-radius: 8px;
  background: var(--brand-soft); color: var(--text-2);
  font-size: 12.8px; line-height: 1.7;
  border-left: 2px solid color-mix(in srgb, var(--brand) 50%, transparent);
}
.ct-foot {
  margin-top: auto; padding-top: 14px;
  border-top: 1px solid var(--line-soft);
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
}
.ct-count { font-size: 12.5px; color: var(--text-3); }
.ct-link { margin-left: auto; font-size: 12.5px; }

/* ---------------- 主题卡片 ---------------- */
.topic-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 13px;
}
.topic-card {
  display: flex; flex-direction: column;
  padding: 18px 19px 15px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .16s ease;
}
.topic-card:hover { border-color: color-mix(in srgb, var(--brand) 36%, var(--line)); }
.tc-head { display: flex; align-items: flex-start; gap: 10px; }
.tc-head h3 { flex: 1; margin: 0; font-size: 16.5px; font-weight: 650; }
.tc-desc {
  margin: 7px 0 0; font-size: 13px; line-height: 1.7; color: var(--text-2);
}
.tc-points {
  list-style: none; margin: 13px 0 0; padding: 0;
  display: grid; gap: 5px;
}
.tc-points li {
  display: flex; gap: 8px; align-items: baseline;
  font-size: 12.8px; line-height: 1.6; color: var(--text-2);
}
.tc-points li b {
  flex: 0 0 26px; font-family: var(--mono);
  font-size: 10.5px; font-weight: 600; color: var(--text-3);
}
.tc-more { color: var(--text-3); font-size: 12px; padding-left: 34px; }
.tc-foot {
  margin-top: auto; padding-top: 13px;
  border-top: 1px solid var(--line-soft);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12.5px;
}
.tc-foot span { color: var(--text-3); font-size: 12px; }

/* ---------------- 资源库 · 多维筛选 ---------------- */
.filters {
  padding: 4px 16px 10px; margin-bottom: 16px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius);
}
.filter-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 9px 0; border-bottom: 1px dashed var(--line-soft);
}
.filter-row:last-child { border-bottom: 0; }
.fl-label {
  flex: 0 0 30px; padding-top: 5px;
  font-size: 12.5px; color: var(--text-3); font-weight: 550;
}
.filter-row .chips { margin: 0; }

.res-group { margin-bottom: 28px; }
.rg-head {
  display: flex; align-items: center; gap: 7px;
  margin-bottom: 11px; padding-left: 9px;
  border-left: 3px solid var(--brand);
  font-size: 14px; font-weight: 640;
}
.rg-head i {
  font-style: normal; font-size: 11.5px; font-family: var(--mono);
  color: var(--text-3); background: var(--bg-soft);
  border-radius: 4px; padding: 0 6px; line-height: 1.7;
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 860px) {
  .entries { grid-template-columns: 1fr; gap: 11px; }
  .video-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 36px; padding-bottom: 22px; }
}

@media (max-width: 620px) {
  .wrap { padding: 0 16px; }
  .topbar-inner { height: 56px; gap: 10px; }
  .nav { gap: 0; }
  .nav a { padding: 6px 9px; font-size: 13.5px; }
  .brand-mark { width: 30px; height: 30px; flex-basis: 30px; font-size: 12px; }
  .brand-text strong { font-size: 14.5px; }
  .hero h1 { font-size: 25px; }
  .hero p.lead { font-size: 15px; }
  pre.code { font-size: 12px; padding: 13px 14px; }
  .cc-head { padding: 14px 14px 11px; flex-wrap: wrap; }
  .btn-copy { order: 3; }
  .note-head { padding: 15px 16px; }
  .note-body { padding: 2px 16px 18px; font-size: 14.5px; }
  .tbl { font-size: 12.8px; }
  .tbl th, .tbl td { padding: 7px 8px; }
  .section-head h2 { font-size: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ---------------- 响应式 · 新组件 ---------------- */
@media (max-width: 860px) {
  .gh-levels { grid-template-columns: repeat(4, 1fr); }
  .quick-grid { grid-template-columns: 1fr; }
  .contest-grid { grid-template-columns: 1fr; }
  .topic-grid { grid-template-columns: 1fr; }
  .gesp-hero { padding: 24px 20px 22px; }
  .gh-title { font-size: 25px; }
  .page-head h1 { font-size: 24px; }
}

@media (max-width: 620px) {
  .gh-levels { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .gh-lv { padding: 8px 2px 7px; }
  .gh-lv b { font-size: 15px; }
  .gh-lv span { font-size: 10.5px; }
  .gh-meta { gap: 8px 18px; font-size: 12.8px; }
  .gh-act .btn-primary, .gh-act .btn-ghost { flex: 1 1 auto; }
  .info-grid { grid-template-columns: 1fr; }
  .filters { padding: 2px 12px 8px; }
  .filter-row { flex-direction: column; gap: 3px; }
  .fl-label { flex: none; padding-top: 0; }
  .lc-head { padding: 14px 15px; gap: 11px; }
  .lc-body { padding: 2px 15px 16px; }
  .lc-num { width: 34px; height: 34px; font-size: 16px; border-radius: 9px; }
  .lc-name { font-size: 15.5px; }
  .kp-item { font-size: 13px; gap: 8px; }
  .kp-topic { display: none; }
  .ct-foot .ct-link { margin-left: 0; }
}

@media (max-width: 480px) {
  /* 顶栏改两行：品牌独占首行（不再折行），导航整行铺开（5 项全部可见） */
  .topbar-inner {
    flex-wrap: wrap; height: auto;
    padding-top: 9px; padding-bottom: 7px; row-gap: 2px;
  }
  .brand { flex: 1 1 auto; min-width: 0; }
  .nav {
    order: 3; flex: 0 0 100%;
    margin: 0; gap: 0; justify-content: space-between;
    overflow-x: auto; scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 6px 4px; font-size: 13px; white-space: nowrap; }

  .gesp-hero { padding: 18px 15px 16px; }
  .gh-title { font-size: 22px; margin-bottom: 6px; }
  .gh-title em { display: block; margin: 4px 0 0; font-size: 13.5px; }
  .gh-desc { margin-bottom: 14px; font-size: 14px; line-height: 1.68; text-wrap: pretty; }
  .gh-meta {
    flex-direction: column; gap: 7px; margin-bottom: 16px;
  }
  .gh-meta span { flex-direction: row; align-items: baseline; gap: 8px; }
  .gh-levels { margin-bottom: 16px; }
}
