/* ============ 设计变量 ============ */
:root {
  --bg: #f4f5f9;
  --panel: #ffffff;
  --ink: #0f172a;
  --ink-2: #344054;
  --muted: #7b879d;
  --line: #e6e8f0;
  --line-soft: #eef0f6;
  --brand: #4f46e5;
  --brand-2: #6366f1;
  --brand-ink: #4338ca;
  --brand-soft: #eef2ff;
  --ok: #0f9f6e;
  --warn: #d97706;
  --danger: #e11d48;
  --radius: 16px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow: 0 1px 3px rgba(16, 24, 40, .05), 0 16px 40px -20px rgba(16, 24, 40, .25);
  --mono: "JetBrains Mono", "Cascadia Code", Consolas, "SFMono-Regular", Menlo, monospace;
  --sans: "Inter", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 520px at 8% -12%, #e6e9ff 0%, transparent 62%),
    radial-gradient(900px 480px at 102% -4%, #e2f6ff 0%, transparent 58%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.6;
}

h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
a { color: var(--brand-ink); text-decoration: none; }
svg { display: block; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
::selection { background: #c7d2fe; color: #1e1b4b; }
:focus-visible { outline: 2px solid #818cf8; outline-offset: 2px; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: none; }

/* ============ 顶栏 ============ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 22px;
  height: 72px;
  padding: 0 28px;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid rgba(230, 232, 240, .9);
}

.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); flex: none; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 13px; font-weight: 700; color: #fff; letter-spacing: -.5px;
  background: linear-gradient(140deg, #6366f1, #4338ca 60%, #312e81);
  box-shadow: 0 6px 16px -6px rgba(79, 70, 229, .7), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 16px; letter-spacing: .2px; }
.brand-text small { font-size: 11px; color: var(--muted); letter-spacing: .6px; }

.searchbox {
  display: flex; align-items: center; gap: 9px;
  flex: 1; max-width: 460px; height: 40px; padding: 0 12px;
  background: #f5f6fa; border: 1px solid transparent; border-radius: 12px;
  transition: background .18s, border-color .18s, box-shadow .18s;
}
.searchbox .icon { color: #98a2b3; }
.searchbox:focus-within { background: #fff; border-color: #c7d2fe; box-shadow: 0 0 0 4px rgba(99, 102, 241, .12); }
.searchbox input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 14px; color: var(--ink);
}
.searchbox input::placeholder { color: #98a2b3; }
.searchbox kbd {
  font-family: var(--mono); font-size: 11px; color: #98a2b3;
  border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 1px 6px;
}

.top-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid transparent;
  font-size: 13.5px; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: transform .15s, background .18s, border-color .18s, box-shadow .18s, color .18s;
}
.btn:active { transform: translateY(1px); }
.btn .icon { width: 16px; height: 16px; }
.btn.primary {
  color: #fff;
  background: linear-gradient(135deg, #4f46e5, #6366f1);
  box-shadow: 0 8px 18px -10px rgba(79, 70, 229, .9), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.btn.primary:hover { background: linear-gradient(135deg, #4338ca, #5856eb); }
.btn.primary:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; transform: none; }
.btn.ghost { background: #fff; border-color: var(--line); color: var(--ink-2); box-shadow: var(--shadow-sm); }
.btn.ghost:hover { border-color: #c7d2fe; color: var(--brand-ink); background: #fbfbff; }
.btn.danger { background: #fff; border-color: #fecdd3; color: var(--danger); }
.btn.danger:hover { background: #fff1f2; }
.btn.small { height: 32px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }

.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center;
  border-radius: 10px; border: 1px solid transparent; background: transparent;
  color: #667085; cursor: pointer; transition: background .16s, color .16s;
}
.icon-btn:hover { background: #f2f3f9; color: var(--ink); }
.icon-btn.danger:hover { background: #fff1f2; color: var(--danger); }
.icon-btn.active { background: #fffbeb; color: #b45309; }
.icon-btn.active:hover { background: #fef3c7; color: #92400e; }
.menu-btn { display: none; }

.fav-mark { color: #f59e0b; font-size: 12px; line-height: 1; flex: none; }

/* ============ 布局 ============ */
.layout {
  display: grid;
  grid-template-columns: 274px minmax(0, 1fr);
  gap: 28px;
  max-width: 1360px;
  margin: 0 auto;
  padding: 28px 28px 72px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: #d7dbe7 transparent;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: #d7dbe7; border-radius: 99px; }

.side-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.overview {
  background:
    radial-gradient(220px 120px at 100% 0%, #e0e7ff 0%, transparent 70%),
    linear-gradient(160deg, #fbfbff, #f6f7ff);
  border-color: #e3e6f7;
}
.ov-label { font-size: 12px; color: var(--muted); letter-spacing: .4px; }
.ov-num { display: flex; align-items: baseline; gap: 6px; margin-top: 2px; }
.ov-num span { font-size: 34px; font-weight: 700; letter-spacing: -1px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.ov-num small { font-size: 13px; color: var(--muted); }
.ov-sub { font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.ov-bars { display: grid; gap: 7px; }
.ov-bar { display: grid; grid-template-columns: 58px 1fr 26px; align-items: center; gap: 8px; font-size: 11.5px; color: var(--ink-2); }
.ov-bar .track { height: 5px; border-radius: 99px; background: #eceefa; overflow: hidden; }
.ov-bar .fill { height: 100%; border-radius: 99px; }
.ov-bar .count { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

.side-title {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; font-weight: 600; letter-spacing: .8px; color: #667085;
  margin-bottom: 10px;
}
.side-hint { font-weight: 400; letter-spacing: 0; color: #a3abbb; font-size: 11px; }

.filter-list { display: grid; gap: 2px; }
.filter-item {
  display: flex; align-items: center; gap: 9px;
  width: 100%; padding: 7px 9px; border: 0; border-radius: 9px;
  background: transparent; cursor: pointer; font-size: 13.5px; color: var(--ink-2);
  transition: background .15s, color .15s;
}
.filter-item:hover { background: #f5f6fb; }
.filter-item.active { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.filter-item .dot { width: 8px; height: 8px; border-radius: 3px; flex: none; }
.filter-item .count {
  margin-left: auto; font-size: 11.5px; color: #98a2b3;
  background: #f2f3f8; border-radius: 99px; padding: 0 7px; min-width: 24px; text-align: center;
  font-variant-numeric: tabular-nums;
}
.filter-item.active .count { background: #e0e7ff; color: var(--brand-ink); }
.filter-item .star { width: 14px; height: 14px; color: #f59e0b; fill: #f59e0b; stroke: #f59e0b; }

.chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.chip-btn {
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  border-radius: 8px; padding: 6px 0; font-size: 12px; cursor: pointer; transition: all .15s;
}
.chip-btn:hover { border-color: #c7d2fe; color: var(--brand-ink); }
.chip-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 4px 10px -6px rgba(79, 70, 229, .9); }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-btn {
  border: 0; background: #f4f5fa; color: #5b6478; border-radius: 7px;
  padding: 3px 9px; font-size: 12px; cursor: pointer; transition: all .15s;
}
.tag-btn:hover { background: #e9ebf5; color: var(--ink); }
.tag-btn.active { background: var(--brand); color: #fff; }
.muted-note { font-size: 12px; color: #a3abbb; }

.side-foot { padding: 4px 6px 0; display: grid; gap: 6px; font-size: 11px; color: #a3abbb; }
.side-foot code { font-family: var(--mono); font-size: 10.5px; background: #eceef6; padding: 1px 4px; border-radius: 4px; color: #667085; }
.link-btn { border: 0; background: none; padding: 0; color: var(--brand-ink); font-size: 12px; cursor: pointer; width: fit-content; }
.link-btn:hover { text-decoration: underline; }

/* ============ 首页 ============ */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  padding: 30px 32px;
  color: #fff;
  background:
    radial-gradient(520px 220px at 88% -30%, rgba(129, 140, 248, .85), transparent 70%),
    radial-gradient(400px 200px at 100% 120%, rgba(14, 165, 233, .5), transparent 70%),
    linear-gradient(125deg, #1e1b4b, #312e81 55%, #1e3a8a);
  box-shadow: 0 26px 50px -28px rgba(49, 46, 129, .8);
  margin-bottom: 24px;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .16) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(100deg, transparent 30%, #000 100%);
  pointer-events: none;
}
.hero h1 { font-size: 25px; letter-spacing: -.4px; line-height: 1.4; position: relative; }
.hero p { margin-top: 8px; font-size: 13.5px; color: #c7d2fe; max-width: 620px; position: relative; }
.hero-actions { display: flex; gap: 10px; margin-top: 18px; position: relative; flex-wrap: wrap; }
.hero .btn.primary { background: #fff; color: #312e81; box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .6); }
.hero .btn.primary:hover { background: #eef2ff; }
.hero .btn.ghost { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .28); color: #e0e7ff; box-shadow: none; }
.hero .btn.ghost:hover { background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .45); }
.hero-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; position: relative; }
.hero-tags span {
  font-size: 11.5px; padding: 3px 9px; border-radius: 99px;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16); color: #dbeafe;
}

.list-head { display: flex; align-items: center; gap: 12px; margin: 2px 2px 14px; flex-wrap: wrap; }
.list-head h2 { font-size: 17px; letter-spacing: -.2px; display: flex; align-items: center; gap: 8px; }
.count-pill {
  font-size: 11.5px; font-weight: 500; color: #667085; background: #eceef6;
  border-radius: 99px; padding: 1px 8px; font-variant-numeric: tabular-nums;
}
.list-head .sub { font-size: 12.5px; color: var(--muted); }
.list-head .spacer { flex: 1; }
.sortbox { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.sortbox select {
  height: 32px; border-radius: 8px; border: 1px solid var(--line); background: #fff;
  font: inherit; font-size: 12.5px; color: var(--ink-2); padding: 0 8px; outline: none; cursor: pointer;
}

.problem-list { display: grid; gap: 10px; min-width: 0; }
.problem-card {
  position: relative;
  display: flex; align-items: center; gap: 18px;
  min-width: 0;
  padding: 15px 18px 15px 22px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  cursor: pointer; box-shadow: var(--shadow-sm);
  transition: transform .16s, box-shadow .18s, border-color .18s;
}
.problem-card::before {
  content: ""; position: absolute; left: 0; top: 16px; bottom: 16px; width: 3px;
  border-radius: 0 4px 4px 0; background: var(--src, #94a3b8); opacity: .85;
}
.problem-card:hover { transform: translateY(-2px); border-color: #cfd5f5; box-shadow: var(--shadow); }
.pc-main { min-width: 0; flex: 1; }
.pc-title-row { display: flex; align-items: center; gap: 8px; }
.pc-title { font-size: 15.5px; font-weight: 600; letter-spacing: -.1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pc-excerpt { font-size: 12.5px; color: var(--muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.chip {
  font-size: 11px; line-height: 1.7; padding: 1px 8px; border-radius: 99px;
  background: #f3f5fa; color: #5b6478; white-space: nowrap;
}
.chip.src { color: var(--src-ink, #475467); background: var(--src-bg, #f3f5fa); font-weight: 500; }
.chip.year { background: #fff7ed; color: #b45309; }
.chip.level { background: #f0fdf4; color: #15803d; }
.chip.tag { background: #f8fafc; border: 1px solid #eef1f7; color: #667085; }
.pc-side { display: flex; align-items: center; gap: 14px; flex: none; }
.difficulty { display: grid; gap: 4px; justify-items: end; }
.difficulty small { font-size: 10.5px; color: #a3abbb; }
.dots { display: flex; gap: 3px; }
.dots i { width: 7px; height: 7px; border-radius: 99px; background: #e4e7ef; }
.dots i.on { background: var(--dot, #6366f1); }
.pc-arrow { color: #c3c9d8; transition: color .15s, transform .15s; }
.problem-card:hover .pc-arrow { color: var(--brand); transform: translateX(2px); }
.demo-badge {
  font-size: 10px; color: #b45309; background: #fffbeb; border: 1px solid #fde68a;
  border-radius: 5px; padding: 0 5px; line-height: 1.7; flex: none;
}

.empty {
  text-align: center; padding: 72px 24px; background: #fff;
  border: 1px dashed #d8dceb; border-radius: 18px;
}
.empty-icon {
  width: 62px; height: 62px; margin: 0 auto 14px; border-radius: 18px;
  display: grid; place-items: center; color: #6366f1;
  background: linear-gradient(150deg, #eef2ff, #e0f2fe);
}
.empty-icon .icon { width: 28px; height: 28px; }
.empty h3 { font-size: 16px; }
.empty p { color: var(--muted); font-size: 13px; margin: 6px 0 18px; }
.empty .btn { margin: 0 4px; }

.more-note { text-align: center; font-size: 12px; color: var(--muted); padding: 14px 0 0; }

/* ============ 详情 ============ */
.back-link {
  display: inline-flex; align-items: center; gap: 6px; border: 0; background: none;
  color: var(--muted); font-size: 13px; cursor: pointer; padding: 4px 2px; margin-bottom: 12px;
}
.back-link:hover { color: var(--brand-ink); }
.back-link .icon { width: 15px; height: 15px; }

.detail-head {
  background: #fff; border: 1px solid var(--line); border-radius: 18px;
  padding: 24px 26px; box-shadow: var(--shadow-sm);
}
.detail-top { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.detail-title { font-size: 25px; letter-spacing: -.5px; line-height: 1.35; flex: 1; min-width: 240px; }
.detail-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; align-items: center; }
.detail-meta .chip { font-size: 11.5px; padding: 2px 9px; }
.limits { display: flex; gap: 14px; margin-top: 12px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.limits span { display: inline-flex; align-items: center; gap: 5px; }
.limits .icon { width: 14px; height: 14px; }

.panel {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 24px; margin-top: 14px; box-shadow: var(--shadow-sm);
}
.panel-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; letter-spacing: .6px; color: #475467;
  margin-bottom: 12px;
}
.panel-title::before {
  content: ""; width: 3px; height: 14px; border-radius: 2px;
  background: linear-gradient(180deg, #6366f1, #a5b4fc);
}

.prose { font-size: 14.5px; line-height: 1.9; color: var(--ink-2); overflow-wrap: anywhere; }
.prose > * + * { margin-top: 10px; }
.prose h2, .prose h3, .prose h4, .prose h5, .prose h6 { color: var(--ink); line-height: 1.5; margin-top: 20px; letter-spacing: -.1px; }
.prose h2 { font-size: 18px; }
.prose h3 { font-size: 16px; }
.prose h4 { font-size: 14.5px; }
.prose strong { color: var(--ink); font-weight: 600; }
.prose em { font-style: italic; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin: 3px 0; }
.prose li::marker { color: #a5b4fc; }
.prose blockquote {
  border-left: 3px solid #c7d2fe; background: #f8f9ff; color: #475467;
  padding: 8px 14px; border-radius: 0 8px 8px 0;
}
.prose hr { border: 0; border-top: 1px dashed var(--line); margin: 18px 0; }
.prose code {
  font-family: var(--mono); font-size: 12.5px; background: #f1f3f9; color: #be185d;
  padding: 1.5px 6px; border-radius: 5px; border: 1px solid #e8ebf3;
}
.prose pre, .code-block {
  position: relative;
  background: #0f172a; color: #e2e8f0; border-radius: 12px;
  padding: 14px 16px; overflow-x: auto; font-family: var(--mono); font-size: 12.5px;
  line-height: 1.7; border: 1px solid #1e293b;
}
.prose pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
.prose pre::after { content: attr(data-lang); position: absolute; top: 6px; right: 12px; font-size: 10px; color: #64748b; letter-spacing: .5px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 8px 0; }
.prose th, .prose td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; }
.prose th { background: #f8f9fc; font-weight: 600; color: var(--ink); }
.prose a { border-bottom: 1px solid #c7d2fe; }
.prose .math { font-family: "Cambria Math", "Times New Roman", serif; font-style: italic; color: #1f2937; padding: 0 1px; }
.prose .math sup, .prose .math sub { font-style: normal; font-size: 10px; }

.sample-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sample {
  position: relative; background: #fbfcfe; border: 1px solid var(--line);
  border-radius: 12px; overflow: hidden;
}
.sample-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 12px; font-size: 11.5px; color: var(--muted);
  background: #f5f7fb; border-bottom: 1px solid var(--line);
  letter-spacing: .4px;
}
.sample pre {
  margin: 0; padding: 12px; font-family: var(--mono); font-size: 12.5px; line-height: 1.75;
  color: #1f2937; white-space: pre-wrap; overflow-wrap: anywhere; min-height: 46px;
  max-height: 300px; overflow: auto;
}
.copy-btn {
  border: 0; background: transparent; color: #98a2b3; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px; font-size: 11px; padding: 2px 4px; border-radius: 5px;
}
.copy-btn:hover { color: var(--brand-ink); background: #eef2ff; }
.copy-btn .icon { width: 13px; height: 13px; }
.copy-btn.done { color: var(--ok); }

.note-panel textarea {
  width: 100%; min-height: 130px; resize: vertical; border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 14px; font-family: var(--mono); font-size: 12.5px;
  line-height: 1.7; color: var(--ink-2); outline: none; background: #fcfcff;
}
.note-panel textarea:focus { border-color: #c7d2fe; box-shadow: 0 0 0 4px rgba(99, 102, 241, .1); }
.note-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; font-size: 11.5px; color: #a3abbb; }

.detail-empty { text-align: center; padding: 80px 20px; }

/* ============ 弹窗 ============ */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 22px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .45); backdrop-filter: blur(5px); animation: fade .18s ease; }
.modal-card {
  position: relative; width: min(560px, 100%); max-height: 92vh;
  display: flex; flex-direction: column;
  background: #fff; border-radius: 20px; box-shadow: 0 40px 90px -30px rgba(15, 23, 42, .55);
  animation: pop .2s cubic-bezier(.2, .9, .3, 1.2);
}
.modal-card.wide { width: min(900px, 100%); }
.modal-card:focus { outline: none; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.985); } }
@keyframes fade { from { opacity: 0; } }

.modal-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 20px 24px 16px; border-bottom: 1px solid var(--line-soft);
}
.modal-head h2 { font-size: 18px; letter-spacing: -.2px; }
.modal-head p { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.modal-body { padding: 18px 24px; overflow-y: auto; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 14px 24px; border-top: 1px solid var(--line-soft); background: #fcfcfe;
  border-radius: 0 0 20px 20px;
}

.dropzone {
  display: grid; justify-items: center; gap: 6px; text-align: center;
  padding: 30px 20px; border: 2px dashed #d6dbeb; border-radius: 14px;
  background: #fbfcff; cursor: pointer; transition: border-color .18s, background .18s;
}
.dropzone:hover, .dropzone:focus-visible, .dropzone.drag { border-color: var(--brand-2); background: #f5f6ff; outline: none; }
.dz-icon {
  width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center;
  color: var(--brand); background: linear-gradient(150deg, #eef2ff, #e0f2fe); margin-bottom: 4px;
}
.dropzone strong { font-size: 14px; font-weight: 600; }
.dropzone .link { color: var(--brand-ink); text-decoration: underline; text-underline-offset: 3px; }
.dz-hint { font-size: 12px; color: var(--muted); }

.file-list { display: grid; gap: 6px; margin-top: 12px; }
.file-list:empty { display: none; }
.file-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  background: #f8f9fc; border: 1px solid var(--line-soft); border-radius: 10px; font-size: 12.5px;
}
.file-row .icon { color: #7c8aa5; width: 15px; height: 15px; }
.file-row .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.file-row .size { color: #a3abbb; font-size: 11px; font-family: var(--mono); }
.file-row .icon-btn { width: 24px; height: 24px; }

.check { display: flex; align-items: flex-start; gap: 8px; margin-top: 14px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--brand); }

.import-result { margin-top: 14px; border-radius: 12px; padding: 12px 14px; font-size: 12.5px; line-height: 1.8; }
.import-result.ok { background: #f0fdf7; border: 1px solid #bbf7d0; color: #166534; }
.import-result.warn { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.import-result.error { background: #fff1f2; border: 1px solid #fecdd3; color: #9f1239; }
.import-result ul { margin-top: 4px; }
.import-result li { list-style: disc; margin-left: 18px; padding-left: 2px; }

.hint-box { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 12px; }
.hint-box summary { font-size: 12.5px; color: var(--brand-ink); cursor: pointer; }
.hint-body { font-size: 12.5px; color: var(--ink-2); margin-top: 8px; }
.hint-body p { margin: 6px 0; }
.hint-body pre {
  background: #0f172a; color: #e2e8f0; border-radius: 10px; padding: 12px 14px;
  overflow-x: auto; font-family: var(--mono); font-size: 11.5px; line-height: 1.65;
}
.hint-body pre code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
.hint-body code { font-family: var(--mono); font-size: 11.5px; background: #f1f3f9; padding: 1px 5px; border-radius: 4px; color: #be185d; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: grid; gap: 5px; font-size: 12.5px; color: #475467; }
.field > span { font-weight: 500; }
.field > span b { color: var(--danger); font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 9px;
  background: #fff; padding: 8px 11px; font: inherit; font-size: 13px; color: var(--ink);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.field input, .field select { height: 38px; }
.field textarea { resize: vertical; line-height: 1.65; font-family: var(--mono); font-size: 12.5px; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: #a5b4fc; box-shadow: 0 0 0 4px rgba(99, 102, 241, .1); }
.field input::placeholder, .field textarea::placeholder { color: #b6bdcc; }
.span-2 { grid-column: span 2; }

.samples { display: grid; gap: 8px; margin-bottom: 8px; }
.sample-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: stretch; }
.sample-row textarea {
  border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; font-family: var(--mono);
  font-size: 12px; line-height: 1.6; resize: vertical; min-height: 70px; outline: none;
}
.sample-row textarea:focus { border-color: #a5b4fc; box-shadow: 0 0 0 3px rgba(99, 102, 241, .1); }
.sample-row .icon-btn { align-self: start; }

.help-body section + section { margin-top: 20px; padding-top: 18px; border-top: 1px dashed var(--line); }
.help-body h3 { font-size: 14.5px; margin-bottom: 6px; }
.help-body p { font-size: 13px; color: var(--ink-2); line-height: 1.8; }
.help-body code { font-family: var(--mono); font-size: 11.5px; background: #f1f3f9; padding: 1px 5px; border-radius: 4px; color: #be185d; }
.help-body pre {
  background: #0f172a; color: #e2e8f0; border-radius: 10px; padding: 12px 14px;
  overflow-x: auto; font-family: var(--mono); font-size: 11.5px; line-height: 1.7; margin: 8px 0;
}
.help-body pre code { background: none; padding: 0; color: inherit; }
.help-body .btn { margin-top: 8px; }

/* ============ Toast ============ */
.toasts { position: fixed; right: 22px; bottom: 22px; z-index: 200; display: grid; gap: 8px; justify-items: end; }
.toast {
  display: flex; align-items: flex-start; gap: 9px; max-width: 380px;
  padding: 11px 15px; background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--brand);
  border-radius: 11px; box-shadow: 0 18px 40px -18px rgba(15, 23, 42, .4);
  font-size: 13px; color: var(--ink-2); animation: slide .22s ease;
}
.toast.success { border-left-color: var(--ok); }
.toast.error { border-left-color: var(--danger); }
.toast .icon { width: 16px; height: 16px; margin-top: 2px; }
.toast.success .icon { color: var(--ok); }
.toast.error .icon { color: var(--danger); }
@keyframes slide { from { opacity: 0; transform: translateY(8px); } }

/* ============ 账号 / 评测 ============ */
.user-menu { position: relative; }
.user-chip {
  display: flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 10px 0 5px; border-radius: 99px;
  border: 1px solid var(--line); background: #fff; cursor: pointer;
  box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s;
}
.user-chip:hover { border-color: #c7d2fe; box-shadow: 0 6px 16px -12px rgba(79, 70, 229, .8); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: none;
  display: grid; place-items: center; color: #fff; font-size: 12.5px; font-weight: 700;
  background: linear-gradient(140deg, #6366f1, #0ea5e9);
}
.user-meta { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.user-meta b { font-size: 12.5px; font-weight: 600; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta small { font-size: 10px; color: var(--muted); }
.user-chip > .icon { width: 14px; height: 14px; color: #98a2b3; }
.user-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 152px; z-index: 60;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); padding: 6px; display: grid; gap: 2px;
}
.user-dropdown button {
  border: 0; background: none; text-align: left; padding: 8px 10px;
  border-radius: 8px; font-size: 13px; color: var(--ink-2); cursor: pointer;
}
.user-dropdown button:hover { background: #f5f6fb; }
.user-dropdown button.danger { color: var(--danger); }

.auth-card { width: min(420px, 100%); }
.auth-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 3px;
  background: #f2f4fa; border-radius: 10px; margin-bottom: 16px;
}
.auth-tab {
  height: 34px; border: 0; border-radius: 8px; background: none;
  font-size: 13px; color: #667085; cursor: pointer;
}
.auth-tab.active { background: #fff; color: var(--ink); font-weight: 600; box-shadow: var(--shadow-sm); }
.auth-form { display: grid; gap: 12px; }
.auth-submit { width: 100%; height: 40px; margin-top: 2px; }
.auth-error {
  background: #fff1f2; border: 1px solid #fecdd3; color: #9f1239;
  border-radius: 9px; padding: 8px 11px; font-size: 12.5px; line-height: 1.6;
}
.auth-note { margin-top: 14px; font-size: 11.5px; color: var(--muted); line-height: 1.7; text-align: center; }

.field-hint { font-size: 11.5px; color: var(--muted); line-height: 1.6; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.judge-lock { text-align: center; padding: 10px 0 6px; }
.judge-lock-icon {
  width: 48px; height: 48px; margin: 0 auto 10px; border-radius: 14px;
  display: grid; place-items: center; color: var(--brand);
  background: linear-gradient(150deg, #eef2ff, #e0f2fe);
}
.judge-lock b { font-size: 14.5px; }
.judge-lock p { color: var(--muted); font-size: 12.5px; margin: 5px 0 14px; }

.judge-offline {
  display: flex; align-items: flex-start; gap: 10px;
  background: #fffbeb; border: 1px solid #fde68a; color: #92400e;
  border-radius: 10px; padding: 11px 13px; font-size: 12.5px; line-height: 1.7;
}
.judge-offline .icon { margin-top: 2px; color: #d97706; }

.judge-meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--muted); margin-bottom: 9px; }
.judge-meta span { display: inline-flex; align-items: center; gap: 5px; }
.judge-meta .icon { width: 14px; height: 14px; }

.code-area {
  width: 100%; min-height: 230px; resize: vertical;
  background: #0f172a; color: #e2e8f0; border: 1px solid #1e293b; border-radius: 12px;
  padding: 14px 16px; font-family: var(--mono); font-size: 12.5px; line-height: 1.75;
  outline: none; tab-size: 4;
}
.code-area:focus { border-color: #6366f1; box-shadow: 0 0 0 4px rgba(99, 102, 241, .18); }
.code-area::placeholder { color: #64748b; }

.submit-bar { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.submit-bar .spacer { flex: 1; }
.judge-hint { font-size: 11.5px; color: #a3abbb; }

.judge-result { margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: #fbfcff; }
.judge-loading { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--ink-2); padding: 6px 0; }
.spinner {
  width: 14px; height: 14px; border-radius: 50%; flex: none;
  border: 2px solid #c7d2fe; border-top-color: #4f46e5;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.judge-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.judge-score { display: inline-flex; align-items: baseline; gap: 2px; color: var(--ink); }
.judge-score b { font-size: 26px; line-height: 1; font-variant-numeric: tabular-nums; }
.judge-score small { font-size: 12px; color: var(--muted); }
.judge-stat { font-size: 12px; color: var(--muted); }
.judge-note { font-size: 12px; color: var(--warn); margin-top: 8px; }
.judge-links { margin-top: 10px; font-size: 12.5px; }
.judge-links a { border-bottom: 1px solid #c7d2fe; }

.verdict {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 8px; font-size: 12px; font-weight: 700;
  border: 1px solid transparent; white-space: nowrap;
}
.verdict.AC { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.verdict.WA { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.verdict.TLE { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.verdict.RE { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.verdict.CE, .verdict.SE { background: #f8fafc; color: #475467; border-color: #e2e8f0; }
.verdict.OLE { background: #faf5ff; color: #7e22ce; border-color: #e9d5ff; }
.verdict.PD, .verdict.JD { background: #eef2ff; color: #4338ca; border-color: #c7d2fe; }

.test-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.test-dot {
  font-family: var(--mono); font-size: 11px; padding: 2px 8px;
  border-radius: 6px; border: 1px solid transparent; white-space: nowrap;
}
.test-dot.AC { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.test-dot.WA { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.test-dot.TLE { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.test-dot.RE { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.test-dot.OLE { background: #faf5ff; color: #7e22ce; border-color: #e9d5ff; }
.test-dot.CE, .test-dot.SE { background: #f8fafc; color: #475467; border-color: #e2e8f0; }

.compile-error {
  margin-top: 11px; max-height: 260px; overflow: auto;
  background: #1e1e2e; color: #fecdd3; border-radius: 9px;
  padding: 11px 13px; font-family: var(--mono); font-size: 11.5px; line-height: 1.65;
  white-space: pre-wrap; overflow-wrap: anywhere;
}

.page-head { margin: 2px 2px 16px; }
.page-head h1 { font-size: 23px; letter-spacing: -.4px; }
.page-head p { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

.sub-list { display: grid; gap: 8px; }
.sub-item {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 16px; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; cursor: pointer; box-shadow: var(--shadow-sm);
  transition: transform .15s, box-shadow .18s, border-color .18s;
}
.sub-item:hover { transform: translateY(-1px); border-color: #cfd5f5; box-shadow: var(--shadow); }
.sub-score {
  flex: none; width: 62px; text-align: center; font-size: 19px; font-weight: 700;
  font-variant-numeric: tabular-nums; color: var(--ink);
}
.sub-score small { font-size: 10px; font-weight: 500; color: var(--muted); margin-left: 1px; }
.sub-title { flex: 1; min-width: 0; }
.sub-title b { display: block; font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub-title small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.code-view {
  background: #0f172a; color: #e2e8f0; border-radius: 12px;
  padding: 14px 16px; margin: 0; overflow: auto; max-height: 560px;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.75;
  white-space: pre; tab-size: 4;
}

/* ============ CSP-J/S 真题索引 ============ */
.csp-entry {
  display: block; text-decoration: none;
  background: radial-gradient(220px 120px at 100% 0%, rgba(99, 102, 241, .55), transparent 70%),
    linear-gradient(150deg, #1e1b4b, #312e81 70%);
  border-color: #312e81; color: #e0e7ff;
}
.csp-entry:hover { transform: translateY(-1px); box-shadow: 0 16px 30px -20px rgba(49, 46, 129, .9); }
.csp-entry-top { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.csp-entry-badge {
  font-family: var(--mono); font-size: 10px; letter-spacing: .5px;
  padding: 1px 6px; border-radius: 5px; color: #fff;
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .2);
}
.csp-entry-kicker { font-size: 11px; letter-spacing: 1.2px; color: #a5b4fc; }
.csp-entry b { display: block; font-size: 14px; color: #fff; }
.csp-entry p { font-size: 11.5px; color: #c7d2fe; margin: 3px 0 9px; }
.csp-entry-go { font-size: 11.5px; color: #fff; }

.game-top-btn { border-color: #fde68a; color: #92400e; background: linear-gradient(135deg, #fffbeb, #fef3c7); }
.game-top-btn:hover { border-color: #f59e0b; color: #78350f; background: linear-gradient(135deg, #fef3c7, #fde68a); }

.game-entry {
  background: radial-gradient(220px 120px at 100% 0%, rgba(251, 191, 36, .42), transparent 70%),
    linear-gradient(150deg, #3b1d0b, #7c2d12 70%);
  border-color: #7c2d12;
}
.game-entry .csp-entry-kicker { color: #fed7aa; }
.game-entry p { color: #fed7aa; }
.game-entry:hover { box-shadow: 0 16px 30px -20px rgba(124, 45, 18, .9); }

.contest-top-btn { border-color: #fcd34d; color: #92400e; background: linear-gradient(135deg, #fffbeb, #fef3c7); }
.contest-top-btn:hover { border-color: #f59e0b; color: #78350f; background: linear-gradient(135deg, #fef3c7, #fde68a); }
.contest-entry {
  background: radial-gradient(220px 120px at 100% 0%, rgba(251, 191, 36, .45), transparent 70%),
    linear-gradient(150deg, #451a03, #92400e 70%);
  border-color: #92400e;
}
.contest-entry .csp-entry-kicker, .contest-entry p { color: #fde68a; }
.contest-entry:hover { box-shadow: 0 16px 30px -20px rgba(146, 64, 14, .9); }

.blog-top-btn { border-color: #c7d2fe; color: #3730a3; background: linear-gradient(135deg, #eef2ff, #e0e7ff); }
.blog-top-btn:hover { border-color: #818cf8; color: #312e81; background: linear-gradient(135deg, #e0e7ff, #c7d2fe); }

.blog-banner {
  display: flex; align-items: center; gap: 14px; margin: 14px 0 18px;
  padding: 14px 18px; border-radius: 16px; text-decoration: none; color: #eef2ff;
  background: radial-gradient(420px 160px at 95% -30%, rgba(129, 140, 248, .45), transparent 70%),
    linear-gradient(120deg, #1e1b4b, #312e81 60%, #4338ca);
  border: 1px solid #4338ca;
  box-shadow: 0 18px 36px -26px rgba(49, 46, 129, .9);
}
.blog-banner:hover { transform: translateY(-1px); box-shadow: 0 22px 40px -24px rgba(49, 46, 129, .95); }
.blog-badge {
  flex: none; font-family: var(--mono); font-size: 10px; letter-spacing: .8px;
  padding: 4px 8px; border-radius: 6px; color: #1e1b4b; background: #c7d2fe; font-weight: 700;
}
.blog-banner-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.blog-banner-text b { font-size: 14px; color: #fff; }
.blog-banner-text small { font-size: 11.5px; color: #c7d2fe; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.blog-banner-go { margin-left: auto; flex: none; font-size: 12px; color: #e0e7ff; }

.blog-hero {
  padding: 30px 32px; border-radius: 20px; color: #fff; margin-bottom: 16px;
  background: radial-gradient(480px 220px at 92% -20%, rgba(129, 140, 248, .55), transparent 70%),
    linear-gradient(125deg, #1e1b4b, #312e81 58%, #4338ca);
  box-shadow: 0 26px 50px -30px rgba(49, 46, 129, .9);
}
.blog-hero .blog-badge { display: inline-block; margin-bottom: 10px; }
.blog-hero h1 { font-size: 27px; letter-spacing: -.5px; }
.blog-hero p { font-size: 13px; color: #e0e7ff; line-height: 1.8; margin-top: 8px; max-width: 760px; }
.blog-meta { margin-top: 13px; font-size: 11.5px; color: #a5b4fc; }

.blog-article {
  max-width: 900px; margin: 0 auto; background: #fff; border: 1px solid var(--line);
  border-radius: 18px; padding: 28px 34px; box-shadow: var(--shadow-sm);
  font-size: 14px; line-height: 1.95; color: #344054;
}
.blog-article h2 { font-size: 19px; color: #1e1b4b; margin: 26px 0 9px; letter-spacing: -.2px; }
.blog-article h2:first-child { margin-top: 0; }
.blog-article p { margin: 8px 0; }
.blog-article ul, .blog-article ol { margin: 8px 0 8px 22px; }
.blog-article li { margin: 3px 0; }
.blog-article a { color: #4338ca; text-decoration: underline; text-underline-offset: 2px; }
.blog-article code { font-family: var(--mono); font-size: 12px; background: #eef2ff; padding: 1px 5px; border-radius: 4px; color: #3730a3; }
.blog-article blockquote { border-left: 3px solid #c7d2fe; margin: 10px 0; padding: 4px 14px; color: #667085; background: #f8faff; }
.blog-actions { display: flex; flex-wrap: wrap; gap: 8px; max-width: 900px; margin: 16px auto 0; }

@media (max-width: 720px) {
  .blog-banner { align-items: flex-start; flex-wrap: wrap; }
  .blog-banner-go { margin-left: 0; }
  .blog-banner-text small { white-space: normal; }
  .blog-hero { padding: 22px 20px; }
  .blog-hero h1 { font-size: 22px; }
  .blog-article { padding: 20px 18px; font-size: 13.5px; }
}

.quick-nav {
  display: flex; gap: 6px; align-items: center;
  padding: 8px max(18px, calc((100vw - 1380px) / 2));
  background: #fff; border-bottom: 1px solid var(--line);
  overflow-x: auto; scrollbar-width: none;
}
.quick-nav::-webkit-scrollbar { display: none; }
.quick-nav a {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  padding: 6px 10px; border-radius: 8px; text-decoration: none;
  color: #475467; font-size: 12px; background: #f8fafc; border: 1px solid #eef0f4;
}
.quick-nav a:hover { color: #1d4ed8; background: #eff6ff; border-color: #bfdbfe; }
.quick-nav .icon { width: 14px; height: 14px; }

.community-hero {
  padding: 28px 30px; border-radius: 20px; color: #fff; margin-bottom: 16px;
  background: radial-gradient(420px 220px at 95% -10%, rgba(45, 212, 191, .4), transparent 70%),
    linear-gradient(125deg, #042f2e, #115e59 65%, #0f766e);
  box-shadow: 0 24px 46px -28px rgba(6, 78, 59, .85);
}
.community-hero h1 { font-size: 26px; margin-top: 6px; letter-spacing: -.4px; }
.community-hero p { font-size: 13px; line-height: 1.85; color: #ccfbf1; margin-top: 8px; max-width: 760px; }

.community-layout { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 16px; align-items: start; }
.community-form { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px; box-shadow: var(--shadow-sm); }
.community-form h2 { font-size: 16px; margin-bottom: 4px; }
.community-form .muted-note { margin-bottom: 12px; }
.community-form .field { margin-bottom: 10px; }
.community-form textarea { min-height: 140px; resize: vertical; }
.community-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.community-form .form-foot { display: flex; align-items: center; gap: 8px; justify-content: space-between; margin-top: 12px; }
.community-form .form-foot span { font-size: 11px; color: var(--muted); }

.community-list { display: grid; gap: 10px; }
.community-post { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 15px 17px; box-shadow: var(--shadow-sm); }
.community-post-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.community-post-head b { font-size: 13px; }
.community-type { font-size: 10.5px; padding: 2px 7px; border-radius: 99px; background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.community-type.submit { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.community-type.tutor { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.community-time { margin-left: auto; font-size: 11px; color: var(--muted); }
.community-post h3 { font-size: 14px; margin-top: 9px; }
.community-post .body { font-size: 13px; line-height: 1.85; color: #344054; margin-top: 7px; white-space: pre-wrap; overflow-wrap: anywhere; }
.community-post .contact { font-size: 11px; color: var(--muted); margin-top: 8px; }
.community-empty { background: #fff; border: 1px dashed var(--line); border-radius: 14px; padding: 28px; text-align: center; color: var(--muted); }

.class-hero {
  padding: 28px 30px; border-radius: 20px; color: #fff; margin-bottom: 16px;
  background: radial-gradient(420px 220px at 95% -10%, rgba(96, 165, 250, .42), transparent 70%),
    linear-gradient(125deg, #172554, #1e40af 65%, #2563eb);
  box-shadow: 0 24px 46px -28px rgba(30, 64, 175, .85);
}
.class-hero h1 { font-size: 26px; margin-top: 6px; letter-spacing: -.4px; }
.class-hero p { font-size: 13px; line-height: 1.8; color: #dbeafe; margin-top: 8px; max-width: 760px; }
.class-hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; font-size: 12px; color: #eff6ff; }
.class-hero-meta > span { padding: 4px 9px; border-radius: 99px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2); }
.class-role { display: inline-block; font-size: 10.5px; padding: 2px 8px; border-radius: 99px; color: #dbeafe; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2); }
.class-role.owner { color: #1e3a8a; background: #dbeafe; }
.class-code { font-family: var(--mono); letter-spacing: 1px; color: #fff; }
.class-hero .link-btn { color: #dbeafe; text-decoration: underline; }

.class-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.class-form { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px; box-shadow: var(--shadow-sm); }
.class-form h2 { font-size: 16px; margin-bottom: 4px; }
.class-form .muted-note { margin-bottom: 12px; }
.class-form .field { margin-bottom: 10px; }
.class-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.class-join-row { display: flex; gap: 8px; }
.class-join-row input { flex: 1; text-transform: uppercase; letter-spacing: 2px; font-family: var(--mono); }

.class-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.class-card { display: flex; flex-direction: column; gap: 7px; padding: 18px; border-radius: 16px; border: 1px solid var(--line); background: #fff; text-decoration: none; color: inherit; box-shadow: var(--shadow-sm); }
.class-card:hover { border-color: #93c5fd; background: #f8fbff; }
.class-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.class-card-top .class-role { color: #1d4ed8; background: #eff6ff; border-color: #bfdbfe; }
.class-card-top .class-role.owner { color: #047857; background: #ecfdf5; border-color: #a7f3d0; }
.class-meta { font-size: 11px; color: var(--muted); }
.class-card h2 { font-size: 18px; }
.class-card p { font-size: 12.5px; color: var(--muted); line-height: 1.7; flex: 1; }
.class-card-foot { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; color: #1d4ed8; margin-top: 6px; }
.class-card-foot .class-code { color: #1d4ed8; }

.class-main { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: start; }
.assignment-form { margin-bottom: 14px; }
.assignment-list { display: grid; gap: 10px; }
.assignment-card { display: flex; align-items: center; gap: 16px; padding: 16px 18px; background: #fff; border: 1px solid var(--line); border-radius: 14px; text-decoration: none; color: inherit; box-shadow: var(--shadow-sm); }
.assignment-card:hover { border-color: #93c5fd; background: #f8fbff; }
.assignment-main { flex: 1; min-width: 0; }
.assignment-main h3 { font-size: 15px; }
.assignment-main p { font-size: 12px; color: var(--muted); margin-top: 4px; }
.assignment-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 7px; font-size: 11px; color: var(--muted); }
.assignment-progress { flex: none; text-align: center; min-width: 60px; }
.assignment-progress b { display: block; font: 700 18px var(--mono); color: #1d4ed8; }
.assignment-progress small { font-size: 10.5px; color: var(--muted); }

.class-members { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 4px 16px 16px; box-shadow: var(--shadow-sm); }
.member-list { display: flex; flex-wrap: wrap; gap: 6px; }
.member-chip { font-size: 11.5px; padding: 4px 8px; border-radius: 99px; background: #f8fafc; border: 1px solid #e2e8f0; color: #475467; }

.assignment-problem-list { display: grid; gap: 9px; }
.assignment-problem { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: inherit; }
.assignment-problem:hover { border-color: #93c5fd; background: #f8fbff; }
.assignment-problem .idx { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: #eff6ff; color: #1d4ed8; font: 700 12px var(--mono); }
.assignment-problem b { display: block; font-size: 13px; }
.assignment-problem small { font-size: 11px; color: var(--muted); }
.assignment-problem .status { margin-left: auto; font-size: 11px; color: var(--muted); }
.assignment-problem .status.done { color: #047857; font-weight: 700; }
.assignment-problem .status.attempted { color: #b45309; }

@media (max-width: 920px) {
  .class-actions, .class-grid, .class-main { grid-template-columns: 1fr; }
  .class-hero { padding: 22px 20px; }
  .class-hero h1 { font-size: 22px; }
}

.launcher-hero {
  padding: 28px 30px; border-radius: 20px; color: #fff; margin-bottom: 16px;
  background: radial-gradient(420px 220px at 95% -10%, rgba(74, 222, 128, .38), transparent 70%),
    linear-gradient(125deg, #052e16, #166534 65%, #15803d);
  box-shadow: 0 24px 46px -28px rgba(22, 101, 52, .85);
}
.launcher-hero h1 { font-size: 26px; margin-top: 6px; letter-spacing: -.4px; }
.launcher-hero p { font-size: 13px; line-height: 1.85; color: #dcfce7; margin-top: 8px; max-width: 760px; }

.launcher-feature {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  background: #fff; border: 1px solid #bbf7d0; border-left: 5px solid #16a34a;
  border-radius: 18px; padding: 22px 24px; box-shadow: var(--shadow-sm); margin-bottom: 14px;
}
.launcher-feature .launcher-icon {
  width: 62px; height: 62px; border-radius: 16px; display: grid; place-items: center;
  font: 800 22px var(--mono); color: #fff; background: linear-gradient(135deg, #16a34a, #065f46);
}
.launcher-feature .launcher-main { flex: 1; min-width: 220px; }
.launcher-feature h2 { font-size: 20px; }
.launcher-feature p { font-size: 12.5px; color: var(--muted); margin-top: 5px; line-height: 1.7; }
.launcher-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.launcher-tags span { font-size: 10.5px; padding: 2px 7px; border-radius: 99px; background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.launcher-feature .launcher-actions { display: flex; flex-direction: column; gap: 6px; min-width: 170px; }
.launcher-feature .hash { font-family: var(--mono); font-size: 9px; color: #98a2b3; word-break: break-all; max-width: 420px; }

.launcher-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.launcher-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 7px; }
.launcher-card h3 { font-size: 15px; }
.launcher-card p { font-size: 12px; line-height: 1.65; color: var(--muted); flex: 1; }
.launcher-card .tag { align-self: flex-start; font-size: 10px; padding: 2px 7px; border-radius: 99px; background: #f1f5f9; color: #475467; }
.launcher-card a { color: #15803d; font-size: 12px; font-weight: 600; }

@media (max-width: 920px) {
  .community-layout, .launcher-grid { grid-template-columns: 1fr; }
  .community-hero, .launcher-hero { padding: 22px 20px; }
  .community-hero h1, .launcher-hero h1 { font-size: 22px; }
}

.contest-hero {
  padding: 28px 30px; border-radius: 20px; color: #fff; margin-bottom: 16px;
  background: radial-gradient(420px 220px at 95% -10%, rgba(251, 191, 36, .42), transparent 70%),
    linear-gradient(125deg, #451a03, #92400e 65%, #b45309);
  box-shadow: 0 24px 46px -28px rgba(120, 53, 15, .85);
}
.contest-kicker { font-size: 11px; letter-spacing: 1.8px; color: #fde68a; }
.contest-hero h1 { font-size: 26px; margin-top: 6px; letter-spacing: -.4px; }
.contest-hero p { font-size: 13px; line-height: 1.8; color: #fef3c7; margin-top: 8px; max-width: 820px; }
.contest-hero-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; font-size: 12px; color: #fffbeb; }
.contest-hero-meta span { padding: 4px 9px; border-radius: 99px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2); }

.contest-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 14px 0 24px; }
.contest-card { display: flex; flex-direction: column; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px; box-shadow: var(--shadow-sm); }
.contest-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.contest-card h2 { font-size: 17px; letter-spacing: -.2px; }
.contest-card p { font-size: 12px; line-height: 1.7; color: var(--muted); }
.contest-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 6px; }
.contest-time { font-size: 11.5px; color: var(--muted); }
.contest-status { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.contest-status.running { color: #047857; background: #ecfdf5; border: 1px solid #a7f3d0; }
.contest-status.upcoming { color: #b45309; background: #fffbeb; border: 1px solid #fde68a; }
.contest-status.ended { color: #64748b; background: #f1f5f9; border: 1px solid #e2e8f0; }
.contest-countdown { font-family: var(--mono); font-size: 12px; color: #b45309; }

.standings { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.standings th { text-align: left; font-size: 11px; color: var(--muted); font-weight: 600; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.standings td { padding: 9px 10px; border-bottom: 1px solid #f0f1f5; }
.standings tr:last-child td { border-bottom: 0; }
.standings .rank { font-family: var(--mono); color: var(--muted); width: 48px; }
.standings .score { font-weight: 700; color: #92400e; }
.standings .me { background: #fffbeb; }
.standings-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: #fff; }

.contest-problem-list { display: grid; gap: 10px; }
.contest-problem { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: inherit; }
.contest-problem:hover { border-color: #f59e0b; background: #fffbeb; }
.contest-problem .idx { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: #fef3c7; color: #92400e; font: 700 13px var(--mono); }
.contest-problem b { display: block; font-size: 13.5px; }
.contest-problem small { color: var(--muted); font-size: 11.5px; }
.contest-problem .go { margin-left: auto; color: #b45309; font-size: 12px; }

.contest-strip {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 10px 14px; margin-bottom: 12px; border-radius: 12px;
  background: #fffbeb; border: 1px solid #fde68a; color: #92400e; font-size: 12.5px;
}
.contest-strip svg { width: 16px; height: 16px; }
.contest-strip a { margin-left: auto; color: #b45309; font-weight: 600; }

.calendar-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.calendar-item { background: #fff; border: 1px solid var(--line); border-left: 4px solid #f59e0b; border-radius: 12px; padding: 14px 16px; }
.calendar-item h3 { font-size: 14px; }
.calendar-item p { font-size: 12px; color: var(--muted); line-height: 1.7; margin-top: 4px; }
.calendar-item .cal-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; font-size: 11px; color: #92400e; }
.calendar-item a { color: #b45309; font-weight: 600; }

@media (max-width: 920px) {
  .contest-grid, .calendar-grid { grid-template-columns: 1fr; }
  .contest-hero { padding: 22px 20px; }
  .contest-hero h1 { font-size: 22px; }
}

.csp-hero {
  position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 28px 30px; border-radius: 20px; color: #fff;
  background:
    radial-gradient(480px 220px at 90% -30%, rgba(129, 140, 248, .8), transparent 70%),
    linear-gradient(125deg, #1e1b4b, #312e81 55%, #1e3a8a);
  box-shadow: 0 26px 50px -28px rgba(49, 46, 129, .8);
}
.csp-kicker { font-size: 11px; letter-spacing: 1.4px; color: #a5b4fc; }
.csp-hero h1 { font-size: 26px; letter-spacing: -.5px; margin-top: 6px; line-height: 1.35; }
.csp-hero p { font-size: 13px; color: #c7d2fe; margin-top: 9px; max-width: 700px; line-height: 1.85; }
.csp-hero .btn.primary { flex: none; background: #fff; color: #312e81; box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .6); }
.csp-hero .btn.primary:hover { background: #eef2ff; }

.csp-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 16px 2px; }
.csp-seg { display: inline-flex; gap: 2px; padding: 3px; background: #eceef6; border-radius: 10px; }
.csp-seg button {
  border: 0; background: none; border-radius: 8px; padding: 6px 12px;
  font-size: 12.5px; color: #667085; cursor: pointer; white-space: nowrap;
}
.csp-seg button:hover { color: var(--ink); }
.csp-seg button.active { background: #fff; color: var(--ink); font-weight: 600; box-shadow: var(--shadow-sm); }
.csp-count { margin-left: auto; font-size: 12px; color: var(--muted); }

.csp-years { display: grid; gap: 16px; }
.csp-year-head { display: flex; align-items: baseline; gap: 8px; margin: 0 2px 8px; }
.csp-year-head h2 { font-size: 18px; letter-spacing: -.2px; }
.csp-year-head span { font-size: 11.5px; color: var(--muted); }
.csp-year-head i { flex: 1; height: 1px; background: var(--line); }
.csp-rounds { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.csp-round { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-sm); }
.csp-round-head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; background: #fbfcff; border-bottom: 1px solid var(--line-soft);
}
.csp-badge { font-size: 10.5px; font-weight: 700; letter-spacing: .4px; border-radius: 6px; padding: 2px 7px; flex: none; }
.csp-badge.j { background: #e0f2fe; color: #0369a1; }
.csp-badge.s { background: #fef3c7; color: #b45309; }
.csp-round-meta { font-size: 11.5px; color: var(--muted); }
.csp-round-link { margin-left: auto; font-size: 11.5px; color: var(--brand-ink); white-space: nowrap; }
.csp-round-link:hover { text-decoration: underline; }
.csp-problems { display: grid; }
.csp-problem {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-top: 1px solid #f2f4f9; font-size: 12.5px;
  transition: background .15s;
}
.csp-problem:first-child { border-top: 0; }
.csp-problem:hover { background: #fafbff; }
.csp-slot { flex: none; width: 22px; font-family: var(--mono); font-size: 10.5px; color: #98a2b3; }
.csp-name { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 6px; color: var(--ink); }
.csp-name b { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.csp-name:hover b { color: var(--brand-ink); }
.csp-pid { flex: none; font-family: var(--mono); font-size: 10px; color: #b6bdcc; }
.csp-tags { display: flex; gap: 4px; flex: none; }
.csp-tags span { font-size: 10px; color: #667085; background: #f4f5fa; border-radius: 5px; padding: 1px 5px; }
.csp-diff { flex: none; width: 88px; text-align: right; font-size: 10.5px; color: var(--muted); }
.csp-open { flex: none; width: 14px; height: 14px; color: #c3c9d8; }
.csp-problem:hover .csp-open { color: var(--brand); }

.csp-first-note { font-size: 13px; color: var(--muted); line-height: 1.8; margin: 2px 2px 12px; }
.csp-first-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.csp-first-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: 12px;
  color: var(--ink); box-shadow: var(--shadow-sm); transition: transform .15s, border-color .15s, box-shadow .15s;
}
.csp-first-card:hover { transform: translateY(-1px); border-color: #cfd5f5; box-shadow: var(--shadow); }
.csp-first-card b { font-size: 13.5px; }
.csp-first-card small { font-size: 11.5px; color: var(--brand-ink); }
.csp-first-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.csp-footnote { margin-top: 18px; font-size: 11.5px; color: #a3abbb; line-height: 1.8; }
.csp-footnote code { font-family: var(--mono); font-size: 10.5px; background: #eceef6; padding: 1px 4px; border-radius: 4px; color: #667085; }

/* ============ 原创题单 ============ */
.plist-entry {
  background: radial-gradient(220px 120px at 100% 0%, rgba(20, 184, 166, .5), transparent 70%),
    linear-gradient(150deg, #042f2e, #115e59 70%);
  border-color: #115e59;
}.plist-hero {
  padding: 30px 32px; border-radius: 20px; color: #fff; margin-bottom: 18px;
  background:
    radial-gradient(480px 220px at 92% -20%, rgba(45, 212, 191, .55), transparent 70%),
    linear-gradient(125deg, #042f2e, #115e59 58%, #0f766e);
  box-shadow: 0 26px 50px -28px rgba(6, 78, 59, .85);
}
.plist-kicker { font-size: 11px; letter-spacing: 1.6px; color: #99f6e4; }
.plist-hero h1 { font-size: 26px; letter-spacing: -.5px; margin-top: 6px; }
.plist-hero p { font-size: 13px; color: #ccfbf1; margin-top: 9px; max-width: 760px; line-height: 1.85; }
.plist-hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.plist-hero-tags span {
  font-size: 11.5px; padding: 3px 9px; border-radius: 99px;
  color: #ccfbf1; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18);
}

.plist-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.plist-section + .plist-section { margin-top: 24px; }
.plist-section-head { display: flex; align-items: baseline; gap: 8px; margin: 18px 2px 10px; }
.plist-section-head h2 { font-size: 16px; letter-spacing: -.2px; }
.plist-section-head span { font-size: 11.5px; color: var(--muted); }
.plist-section-head i { flex: 1; height: 1px; background: var(--line); }
.plist-card {
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--pl, #0ea5e9);
  border-radius: 16px; padding: 18px 18px 16px; box-shadow: var(--shadow-sm);
}
.plist-card.green { --pl: #10b981; --pl-soft: #ecfdf5; --pl-ink: #047857; }
.plist-card.blue { --pl: #0ea5e9; --pl-soft: #f0f9ff; --pl-ink: #0369a1; }
.plist-card.purple { --pl: #8b5cf6; --pl-soft: #f5f3ff; --pl-ink: #6d28d9; }
.plist-card.amber { --pl: #f59e0b; --pl-soft: #fffbeb; --pl-ink: #b45309; }
.plist-card.orange { --pl: #f97316; --pl-soft: #fff7ed; --pl-ink: #c2410c; }
.plist-card.cyan { --pl: #06b6d4; --pl-soft: #ecfeff; --pl-ink: #0e7490; }
.plist-card.rose { --pl: #f43f5e; --pl-soft: #fff1f2; --pl-ink: #be123c; }
.plist-top { display: flex; align-items: center; justify-content: space-between; }
.plist-stage {
  font-size: 11px; font-weight: 600; color: var(--pl-ink, #0369a1);
  background: var(--pl-soft, #f0f9ff); border-radius: 6px; padding: 2px 8px;
}
.plist-count { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.plist-card h2 { font-size: 18px; letter-spacing: -.3px; margin-top: 10px; }
.plist-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.plist-topics { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.plist-topics span { font-size: 10.5px; color: #667085; background: #f4f5fa; border-radius: 5px; padding: 1px 6px; }
.plist-preview { margin: 13px 0 14px; display: grid; gap: 6px; }
.plist-preview li { display: flex; align-items: center; gap: 8px; font-size: 12.5px; min-width: 0; }
.plist-preview li > span {
  width: 18px; height: 18px; flex: none; border-radius: 5px;
  display: grid; place-items: center; font-size: 10px; color: var(--pl-ink, #0369a1);
  background: var(--pl-soft, #f0f9ff); font-family: var(--mono);
}
.plist-preview a { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plist-preview a:hover { color: var(--brand-ink); }
.plist-go { margin-top: auto; width: 100%; }
.plist-go .icon { width: 14px; height: 14px; }
.plist-actions { margin-top: auto; display: flex; gap: 8px; align-items: center; }
.plist-actions .plist-go { margin-top: 0; flex: 1; width: auto; }
.plist-actions .btn { white-space: nowrap; }
.plist-detail-side .btn { margin-top: 10px; white-space: nowrap; }

.plist-detail-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 24px 28px; border-radius: 18px; margin-bottom: 16px;
  background: linear-gradient(135deg, var(--pl-soft, #f0f9ff), #fff 70%);
  border: 1px solid var(--line); border-left: 5px solid var(--pl, #0ea5e9);
}
.plist-detail-hero.green { --pl: #10b981; --pl-soft: #ecfdf5; --pl-ink: #047857; }
.plist-detail-hero.blue { --pl: #0ea5e9; --pl-soft: #f0f9ff; --pl-ink: #0369a1; }
.plist-detail-hero.purple { --pl: #8b5cf6; --pl-soft: #f5f3ff; --pl-ink: #6d28d9; }
.plist-detail-hero.amber { --pl: #f59e0b; --pl-soft: #fffbeb; --pl-ink: #b45309; }
.plist-detail-hero.orange { --pl: #f97316; --pl-soft: #fff7ed; --pl-ink: #c2410c; }
.plist-detail-hero.cyan { --pl: #06b6d4; --pl-soft: #ecfeff; --pl-ink: #0e7490; }
.plist-detail-hero.rose { --pl: #f43f5e; --pl-soft: #fff1f2; --pl-ink: #be123c; }
.plist-detail-hero h1 { font-size: 25px; letter-spacing: -.5px; margin-top: 8px; }
.plist-detail-hero p { font-size: 13px; color: var(--ink-2); margin-top: 5px; }
.plist-goal { color: var(--muted) !important; line-height: 1.8; }
.plist-detail-side { flex: none; text-align: center; color: var(--pl-ink, #0369a1); }
.plist-detail-side b { display: block; font-size: 38px; line-height: 1; font-variant-numeric: tabular-nums; }
.plist-detail-side small { font-size: 12px; color: var(--muted); }

/* ============ AI 学习助手 ============ */
.ai-top-btn { border-color: #ddd6fe; color: #5b21b6; background: linear-gradient(135deg, #f5f3ff, #eef2ff); }
.ai-top-btn:hover { border-color: #a78bfa; color: #4c1d95; background: linear-gradient(135deg, #ede9fe, #e0e7ff); }
.ai-card { width: min(840px, 100%); }
.ai-tabs { display: flex; gap: 4px; padding: 10px 24px 0; border-bottom: 1px solid var(--line-soft); }
.ai-tabs button {
  border: 0; background: none; padding: 9px 14px 10px; cursor: pointer;
  font-size: 13px; color: #667085; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.ai-tabs button:hover { color: var(--ink); }
.ai-tabs button.active { color: var(--brand-ink); font-weight: 600; border-bottom-color: var(--brand); }
.ai-body { min-height: 360px; max-height: 68vh; }

.ai-loading { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 13px; padding: 18px 4px; }
.ai-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.ai-stat {
  background: linear-gradient(160deg, #f8f9ff, #fff); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px;
}
.ai-stat span { font-size: 11.5px; color: var(--muted); }
.ai-stat b { display: block; font-size: 24px; line-height: 1.3; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.ai-stat small { font-size: 10.5px; color: #a3abbb; }
.ai-current {
  margin-top: 12px; font-size: 12.5px; color: var(--ink-2);
  background: #f0fdfa; border: 1px solid #ccfbf1; border-radius: 10px; padding: 9px 12px;
}
.ai-current b { color: #0f766e; }

.ai-section { margin-top: 18px; }
.ai-section-title {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 9px;
}
.ai-section-title span { font-size: 10.5px; font-weight: 400; color: #a3abbb; }
.ai-lists { display: grid; gap: 9px; }
.ai-list-row { display: grid; gap: 5px; }
.ai-list-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-2); }
.ai-list-label small { color: var(--muted); font-variant-numeric: tabular-nums; }
.ai-bar { height: 6px; border-radius: 99px; background: #eef0f8; overflow: hidden; }
.ai-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #6366f1, #0ea5e9); }

.ai-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-tag {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: #fff; border-radius: 8px;
  padding: 4px 9px; font-size: 12px; color: var(--ink-2); cursor: pointer;
}
.ai-tag span { font-size: 10px; color: var(--muted); }
.ai-tag:hover { border-color: #c7d2fe; }
.ai-tag.mastered { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }
.ai-tag.learning { background: #fffbeb; border-color: #fde68a; color: #b45309; }
.ai-tag.weak { background: #fff1f2; border-color: #fecdd3; color: #be123c; }

.ai-recs { display: grid; gap: 6px; }
.ai-rec {
  display: flex; align-items: center; gap: 8px; padding: 8px 11px;
  background: #fff; border: 1px solid var(--line); border-radius: 9px; color: var(--ink-2);
  font-size: 12.5px;
}
.ai-rec:hover { border-color: #c7d2fe; background: #fbfbff; }
.ai-rec-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-rec-diff { font-size: 10.5px; color: var(--muted); }
.ai-rec-go { font-size: 11.5px; color: var(--brand-ink); }

.ai-advice-panel { margin-top: 18px; border-top: 1px dashed var(--line); padding-top: 14px; }
.ai-advice-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.ai-advice-head .panel-title { margin: 0; }
.ai-advice {
  font-size: 13px; line-height: 1.85; color: var(--ink-2);
  background: #fbfbff; border: 1px solid #eef0f8; border-radius: 10px; padding: 12px 14px;
}
.ai-advice p { margin: 0 0 8px; }
.ai-advice p:last-child { margin-bottom: 0; }
.ai-advice-badge {
  display: inline-block; font-size: 10.5px; border-radius: 5px; padding: 1px 7px; margin-bottom: 8px;
}
.ai-advice-badge.ai { background: #eef2ff; color: #4338ca; }
.ai-advice-badge.local { background: #f4f5fa; color: #667085; }
.ai-warning { font-size: 11.5px; color: #b45309; background: #fffbeb; border: 1px solid #fde68a; border-radius: 7px; padding: 6px 9px; margin-top: 8px; }

.ai-gen-form { display: grid; grid-template-columns: 1fr 150px auto; gap: 10px; align-items: end; }
.ai-gen-form .btn { height: 38px; }
.ai-generated { margin-top: 14px; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; background: #fff; }
.ai-gen-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ai-gen-head h3 { font-size: 18px; letter-spacing: -.3px; }
.ai-gen-badge { font-size: 10px; font-weight: 700; border-radius: 5px; padding: 2px 7px; }
.ai-gen-badge.ai { background: #eef2ff; color: #4338ca; }
.ai-gen-badge.local { background: #f4f5fa; color: #667085; }
.ai-gen-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin-top: 6px; font-size: 11.5px; color: var(--muted); }
.ai-gen-prose { margin-top: 12px; max-height: 240px; overflow: auto; }
.ai-gen-io { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; font-size: 12.5px; color: var(--ink-2); }
.ai-gen-io > div { background: #fbfcff; border: 1px solid var(--line-soft); border-radius: 9px; padding: 9px 11px; }
.ai-gen-io > div > span { display: block; font-size: 10.5px; color: var(--muted); margin-bottom: 4px; }
.ai-gen-io p { margin: 0; }
.ai-gen-sample { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.ai-gen-sample > span { grid-column: span 2; font-size: 10.5px; color: var(--muted); }
.ai-gen-sample pre {
  margin: 0; background: #f8fafc; border: 1px solid var(--line-soft); border-radius: 8px;
  padding: 8px 10px; font-family: var(--mono); font-size: 11.5px; white-space: pre-wrap;
}
.ai-gen-actions { display: flex; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

.ai-settings { display: grid; gap: 12px; max-width: 520px; }
.ai-settings .row-actions { margin-top: 2px; }
.ai-foot-status { font-size: 11.5px; }
.ai-status.on { color: #047857; }
.ai-status.off { color: var(--muted); }

/* ============ 响应式 ============ */
.scrim { display: none; }

@media (max-width: 1080px) {
  .layout { grid-template-columns: 244px minmax(0, 1fr); gap: 20px; padding: 22px 20px 60px; }
  .searchbox { max-width: 360px; }
}

@media (max-width: 920px) {
  .layout { grid-template-columns: minmax(0, 1fr); padding: 18px 16px 60px; }
  .menu-btn { display: grid; }
  .sidebar {
    position: fixed; z-index: 80; top: 0; left: 0; bottom: 0; width: 286px;
    max-height: none; background: #fff; padding: 16px; transform: translateX(-104%);
    transition: transform .25s cubic-bezier(.3, .8, .3, 1); box-shadow: 0 0 60px rgba(15, 23, 42, .2);
  }
  .sidebar.open { transform: none; }
  .scrim.show { display: block; position: fixed; inset: 0; z-index: 70; background: rgba(15, 23, 42, .35); backdrop-filter: blur(2px); }
  .top-actions .btn.ghost:not(#btnLogin) span { display: none; }
  .top-actions .btn.ghost:not(#btnLogin) { width: 38px; padding: 0; }
  .detail-title { font-size: 22px; }
  .csp-rounds { grid-template-columns: 1fr; }
  .csp-hero { flex-direction: column; align-items: flex-start; }
  .csp-diff { display: none; }
  .plist-grid { grid-template-columns: 1fr 1fr; }
  .plist-detail-hero { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; height: auto; padding: 10px 16px; gap: 10px; }
  .brand-mark { width: 36px; height: 36px; border-radius: 10px; font-size: 12px; }
  .brand-text strong { font-size: 15px; }
  .brand-text small { display: none; }
  .searchbox { order: 3; flex-basis: 100%; max-width: none; height: 38px; }
  .top-actions { gap: 4px; }
  .top-actions .btn.ghost:not(#btnLogin) { display: none; }
  #btnLogin { height: 34px; padding: 0 10px; font-size: 12px; }
  .top-actions .btn.primary { width: 38px; padding: 0; }
  .top-actions .btn.primary span { display: none; }
  .user-meta { display: none; }
  .user-chip { height: 36px; padding: 0 8px 0 4px; }
  .user-chip > .icon { display: none; }
  .avatar { width: 26px; height: 26px; font-size: 11px; }
  .page-head h1 { font-size: 20px; }
  .sub-item { gap: 10px; padding: 10px 12px; }
  .sub-score { width: 46px; font-size: 16px; }
  .code-view { font-size: 11.5px; }
  .judge-head { gap: 10px; }
  .judge-score b { font-size: 22px; }
  .hero { padding: 22px 20px; border-radius: 16px; }
  .csp-hero { padding: 20px; border-radius: 16px; }
  .csp-hero h1 { font-size: 21px; }
  .csp-hero p { font-size: 12px; }
  .csp-tags { display: none; }
  .csp-count { width: 100%; margin-left: 0; }
  .csp-seg button { padding: 6px 9px; }
  .plist-grid { grid-template-columns: 1fr; }
  .plist-hero { padding: 20px; border-radius: 16px; }
  .plist-hero h1 { font-size: 21px; }
  .ai-stats { grid-template-columns: 1fr 1fr; }
  .ai-gen-form { grid-template-columns: 1fr; }
  .ai-gen-io, .ai-gen-sample { grid-template-columns: 1fr; }
  .ai-gen-sample > span { grid-column: span 1; }
  .ai-tabs { padding: 8px 16px 0; }
  .ai-body { max-height: 74vh; }
  .hero h1 { font-size: 20px; }
  .problem-card { padding: 14px 14px 14px 18px; }
  .pc-side .difficulty { display: none; }
  .sample-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .modal { padding: 12px; }
  .modal-card { max-height: 94vh; }
  .modal-body { padding: 16px; }
  .modal-head, .modal-foot { padding: 14px 16px; }
  .sample-row { grid-template-columns: 1fr 1fr; }
  .sample-row .icon-btn { grid-column: span 2; justify-self: end; height: 26px; }
  .detail-head { padding: 18px; }
  .panel { padding: 16px 18px; }
  .toasts { left: 14px; right: 14px; justify-items: stretch; }
  .toast { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* 博客广场 */
.blog-square-hero {
  padding: 28px 30px; border-radius: 20px; color: #fff; margin-bottom: 16px;
  background: radial-gradient(440px 240px at 92% -10%, rgba(251, 191, 36, .35), transparent 70%),
    linear-gradient(125deg, #3b0764, #6d28d9 62%, #8b5cf6);
  box-shadow: 0 24px 46px -28px rgba(109, 40, 217, .8);
}
.blog-kicker { font: 700 10px/1 var(--mono); letter-spacing: 2px; color: #fde68a; }
.blog-square-hero h1 { font-size: 28px; margin-top: 6px; letter-spacing: -.4px; }
.blog-square-hero p { font-size: 13px; line-height: 1.8; color: #ede9fe; margin-top: 8px; max-width: 760px; }
.blog-hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; font-size: 12px; }
.blog-hero-meta span { padding: 4px 9px; border-radius: 99px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2); }

.blog-form { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px; box-shadow: var(--shadow-sm); }
.blog-form-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.blog-form-head h2 { font-size: 17px; }
.blog-form .field { margin-bottom: 10px; }
.blog-form textarea { min-height: 150px; }
.blog-form-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.blog-list { display: grid; gap: 12px; }
.blog-card { display: block; padding: 18px 20px; background: #fff; border: 1px solid var(--line); border-radius: 16px; text-decoration: none; color: inherit; box-shadow: var(--shadow-sm); }
.blog-card:hover { border-color: #c4b5fd; background: #fbfaff; }
.blog-card-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: 11px; color: var(--muted); }
.blog-card h2 { font-size: 19px; margin-top: 7px; letter-spacing: -.2px; }
.blog-card p { font-size: 13px; line-height: 1.75; color: var(--muted); margin-top: 5px; }
.blog-card-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; font-size: 11px; color: #7c3aed; }
.blog-card-foot > span:last-child { margin-left: auto; }
.blog-tag, .post-tags .tag, .blog-card-foot .tag {
  display: inline-block; padding: 2px 7px; border-radius: 99px; background: #f5f3ff; border: 1px solid #ddd6fe; color: #6d28d9; font-size: 10.5px;
}
.post { max-width: 920px; margin: 0 auto; }
.post-hero { padding: 28px 30px 22px; border-radius: 20px 20px 0 0; background: #fff; border: 1px solid var(--line); border-bottom: 0; }
.post-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 11.5px; color: var(--muted); }
.post-hero h1 { font-size: 30px; line-height: 1.3; margin-top: 8px; letter-spacing: -.6px; }
.post-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.post-hero .link-btn { margin-top: 12px; }
.post-body { padding: 24px 30px; background: #fff; border: 1px solid var(--line); border-top: 1px solid #f1f5f9; }
.comments { margin-top: 16px; padding: 20px 24px; background: #fff; border: 1px solid var(--line); border-radius: 16px; }
.comments h2 { font-size: 17px; margin-bottom: 12px; }
.comments h2 span { color: var(--muted); font-size: 12px; font-weight: 400; }
.comment-list { display: grid; gap: 12px; }
.comment { padding: 12px 14px; border-radius: 12px; background: #f8fafc; border: 1px solid #eef2f7; }
.comment-meta { display: flex; gap: 10px; font-size: 11px; color: var(--muted); }
.comment-meta b { color: #334155; }
.comment p { margin-top: 6px; font-size: 13px; line-height: 1.75; color: #475467; }
.comment-form { display: grid; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); }
.comment-form input, .comment-form textarea { width: 100%; }
.comment-form textarea { min-height: 70px; }
.comment-form .btn { justify-self: start; }

@media (max-width: 700px) {
  .blog-square-hero, .post-hero, .post-body, .comments { padding: 18px; }
  .blog-square-hero h1, .post-hero h1 { font-size: 23px; }
  .blog-form-head { display: block; }
  .blog-form-head .muted-note { display: block; margin-top: 4px; }
}

/* AI 付费墙 */
.ai-paywall { text-align: center; padding: 26px 18px 18px; max-width: 520px; margin: 0 auto; }
.ai-lock-icon { width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; margin: 0 auto 12px; color: #6d28d9; background: #f5f3ff; border: 1px solid #ddd6fe; }
.ai-lock-icon .icon { width: 26px; height: 26px; }
.ai-pay-kicker { font: 700 10px/1 var(--mono); letter-spacing: 2px; color: #8b5cf6; }
.ai-paywall h3 { font-size: 22px; margin-top: 7px; }
.ai-paywall > p { font-size: 13px; line-height: 1.8; color: var(--muted); margin-top: 8px; }
.ai-price { display: flex; align-items: baseline; justify-content: center; gap: 4px; margin: 16px 0 4px; color: #6d28d9; }
.ai-price b { font: 700 34px/1 var(--mono); }
.ai-price span { font-size: 13px; color: var(--muted); }
.ai-pay-contact { font-size: 12px !important; color: #475467 !important; background: #f8fafc; border: 1px dashed var(--line); border-radius: 10px; padding: 8px 10px; }
.ai-redeem { display: flex; gap: 8px; margin-top: 14px; }
.ai-redeem input { flex: 1; text-transform: uppercase; letter-spacing: 1px; font-family: var(--mono); }
@media (max-width: 540px) {
  .ai-redeem { flex-direction: column; }
  .ai-redeem .btn { width: 100%; }
}

/* AI 会员中心 */
.member-hero {
  padding: 26px 30px; border-radius: 20px; color: #fff; margin-bottom: 16px;
  background: radial-gradient(420px 220px at 92% -10%, rgba(251, 191, 36, .35), transparent 70%),
    linear-gradient(125deg, #2e1065, #6d28d9 68%, #a855f7);
  box-shadow: 0 24px 46px -28px rgba(109, 40, 217, .8);
}
.member-kicker { font: 700 10px/1 var(--mono); letter-spacing: 2px; color: #fde68a; }
.member-hero h1 { font-size: 27px; margin-top: 6px; }
.member-hero > p { font-size: 13px; line-height: 1.8; color: #ede9fe; margin-top: 7px; max-width: 760px; }
.member-status-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; padding: 9px 12px; border-radius: 10px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); font-size: 12px; }
.member-status-bar.active { background: rgba(16,185,129,.22); border-color: rgba(167,243,208,.45); }
.member-status-bar b { font-size: 12px; color: #d1fae5; }

.member-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, .8fr); gap: 14px; align-items: start; }
.member-panel { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px; box-shadow: var(--shadow-sm); }
.member-panel h2 { font-size: 17px; margin-bottom: 12px; }
.member-plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 13px; }
.member-plan { position: relative; display: block; cursor: pointer; }
.member-plan input { position: absolute; opacity: 0; pointer-events: none; }
.member-plan-body { display: flex; flex-direction: column; gap: 3px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcff; min-height: 88px; }
.member-plan input:checked + .member-plan-body { border-color: #8b5cf6; background: #f5f3ff; box-shadow: 0 0 0 2px #ede9fe; }
.member-plan-body b { font-size: 14px; }
.member-plan-body span { font-size: 11px; color: var(--muted); }
.member-plan-body strong { font: 700 18px var(--mono); color: #6d28d9; margin-top: 3px; }
.member-plan-body em { font-style: normal; font-size: 10px; color: #047857; background: #ecfdf5; border-radius: 99px; padding: 1px 6px; align-self: flex-start; }
.member-code-row { display: flex; gap: 8px; }
.member-code-row input { flex: 1; text-transform: uppercase; letter-spacing: 1px; font-family: var(--mono); }
.member-orders { margin-top: 14px; }
.member-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.member-section-head h2 { margin-bottom: 12px; }
.member-order { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-top: 10px; }
.member-order-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.member-status { font-size: 10.5px; padding: 2px 7px; border-radius: 99px; background: #f1f5f9; color: #475467; }
.member-status.paid { background: #ecfdf5; color: #047857; }
.member-status.pending { background: #fffbeb; color: #b45309; }
.member-status.cancelled { background: #f8fafc; color: #94a3b8; }
.member-order-main { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; margin-top: 7px; font-size: 12px; color: var(--muted); }
.member-order-main b { color: var(--ink); font-size: 14px; }
.member-order .muted-note { margin-top: 5px; }
.member-qr { display: block; width: 150px; height: 150px; object-fit: contain; margin: 10px 0; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.member-order-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.member-order-actions .muted-note { margin-right: auto; }

@media (max-width: 820px) {
  .member-layout { grid-template-columns: 1fr; }
  .member-plans { grid-template-columns: 1fr; }
  .member-hero { padding: 20px; }
  .member-hero h1 { font-size: 23px; }
}
