/* ==================================================================
   Nebula OJ · 设计系统
   ================================================================== */

:root {
  --accent: #5b5bd6;
  --accent-2: #7c6cf6;
  --accent-3: #46c6f0;
  --accent-soft: #eeeeff;
  --accent-line: #d8d6fb;

  --bg: #f6f7fb;
  --bg-elevated: #ffffff;
  --surface: #ffffff;
  --surface-2: #fafbfe;
  --surface-3: #f1f3f9;
  --border: #e6e8f0;
  --border-strong: #d6d9e6;

  --text: #16182a;
  --text-2: #4a4f63;
  --muted: #838a9e;

  --green: #12a35a;
  --green-soft: #e6f7ee;
  --red: #e5404f;
  --red-soft: #fdecee;
  --amber: #d98300;
  --amber-soft: #fdf3e2;
  --blue: #2f7de1;
  --blue-soft: #eaf2fd;
  --purple: #8b5cf6;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(22, 24, 42, 0.04), 0 1px 3px rgba(22, 24, 42, 0.03);
  --shadow: 0 4px 16px -4px rgba(22, 24, 42, 0.08), 0 2px 6px -2px rgba(22, 24, 42, 0.04);
  --shadow-lg: 0 24px 60px -20px rgba(22, 24, 42, 0.25), 0 8px 24px -12px rgba(22, 24, 42, 0.12);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", "Fira Code", "SF Mono", Consolas, "Liberation Mono",
    Menlo, monospace;

  --header-h: 60px;
  --content-w: 1180px;
}

[data-theme="dark"] {
  --accent: #8b85f8;
  --accent-2: #a394ff;
  --accent-3: #56cdf5;
  --accent-soft: #23224a;
  --accent-line: #3a3870;

  --bg: #0d0f18;
  --bg-elevated: #151824;
  --surface: #151824;
  --surface-2: #1a1e2c;
  --surface-3: #202533;
  --border: #262b3b;
  --border-strong: #333a4e;

  --text: #e8ebf5;
  --text-2: #aeb6ca;
  --muted: #7c8499;

  --green: #3ddc84;
  --green-soft: #12301f;
  --red: #ff6b7a;
  --red-soft: #341a20;
  --amber: #ffb340;
  --amber-soft: #33260f;
  --blue: #63a8ff;
  --blue-soft: #12233a;
  --purple: #b18cff;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 6px 20px -6px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 30px 70px -24px rgba(0, 0, 0, 0.7);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }

::selection { background: color-mix(in srgb, var(--accent) 24%, transparent); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--muted) 35%, transparent);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: content-box;
}
::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--muted) 55%, transparent); background-clip: content-box; }

/* ---------------- 布局 ---------------- */

.app-shell { min-height: 100%; display: flex; flex-direction: column; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--bg-elevated) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  width: 100%;
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; letter-spacing: -0.01em; }
.brand:hover { color: var(--text); }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, var(--accent-2), var(--accent-3));
  display: grid; place-items: center;
  box-shadow: 0 4px 12px -4px color-mix(in srgb, var(--accent) 60%, transparent);
}
.brand-mark svg { width: 18px; height: 18px; }
.brand-text { font-size: 15.5px; }
.brand-text small { display: block; font-size: 10px; font-weight: 500; color: var(--muted); letter-spacing: 0.14em; text-transform: uppercase; line-height: 1; margin-top: 2px; }

.nav { display: flex; gap: 4px; flex: 1; }
.nav a {
  padding: 7px 13px;
  border-radius: 9px;
  color: var(--text-2);
  font-weight: 500;
  font-size: 13.5px;
  transition: background .15s, color .15s;
}
.nav a:hover { background: var(--surface-3); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.header-actions { display: flex; align-items: center; gap: 8px; }

.main {
  flex: 1;
  width: 100%;
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 26px 24px 64px;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 22px 24px 30px;
  color: var(--muted);
  font-size: 12.5px;
}
.footer-inner { max-width: var(--content-w); margin: 0 auto; display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between; }

/* ---------------- 通用元素 ---------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-family: inherit; font-size: 13px; font-weight: 550;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .06s, box-shadow .15s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-3); border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  border-color: transparent; color: #fff;
  box-shadow: 0 4px 14px -6px color-mix(in srgb, var(--accent) 90%, transparent);
}
.btn-primary:hover { filter: brightness(1.06); background: linear-gradient(180deg, var(--accent-2), var(--accent)); border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); border-color: transparent; color: var(--text); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.btn-lg { height: 40px; padding: 0 20px; font-size: 14px; border-radius: 11px; }

.input, .select, .textarea {
  width: 100%;
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit; font-size: 13.5px;
  transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; padding: 9px 11px; line-height: 1.6; resize: vertical; }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23838a9e' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; padding-right: 28px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 20px 22px; }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.section-title { font-size: 15px; font-weight: 680; letter-spacing: -0.01em; display: flex; align-items: center; gap: 8px; }
.section-title .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }

/* ---------------- 徽章 ---------------- */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 8px;
  border-radius: 6px;
  font-size: 11.5px; font-weight: 600; line-height: 1;
  white-space: nowrap;
}
.badge .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-success { background: var(--green-soft); color: var(--green); }
.badge-danger { background: var(--red-soft); color: var(--red); }
.badge-warning { background: var(--amber-soft); color: var(--amber); }
.badge-info { background: var(--blue-soft); color: var(--blue); }
.badge-muted { background: var(--surface-3); color: var(--muted); }
.badge-accent { background: var(--accent-soft); color: var(--accent); }

.diff { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.diff i { width: 8px; height: 8px; border-radius: 2.5px; display: inline-block; }

.tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 5px;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 11.5px;
  margin-right: 4px;
  white-space: nowrap;
}

/* ---------------- 表格 ---------------- */

.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  white-space: nowrap;
}
table.tbl th:first-child { border-top-left-radius: var(--radius); }
table.tbl th:last-child { border-top-right-radius: var(--radius); }
table.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.tbl tbody tr { transition: background .12s; }
table.tbl tbody tr:hover { background: var(--surface-2); }
table.tbl tbody tr:last-child td { border-bottom: none; }
table.tbl td.title-cell { font-weight: 550; }
table.tbl td.title-cell a { color: var(--text); }
table.tbl td.title-cell a:hover { color: var(--accent); }

/* ---------------- 首页 ---------------- */

.hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background:
    radial-gradient(120% 140% at 12% 0%, color-mix(in srgb, var(--accent) 14%, transparent) 0%, transparent 55%),
    radial-gradient(100% 120% at 88% 10%, color-mix(in srgb, var(--accent-3) 16%, transparent) 0%, transparent 52%),
    var(--surface);
  padding: 44px 44px 40px;
  margin-bottom: 26px;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(color-mix(in srgb, var(--accent) 22%, transparent) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: .5;
  mask-image: radial-gradient(70% 70% at 80% 20%, #000 0%, transparent 75%);
  pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
.hero-kicker {
  display: inline-flex; align-items: center; gap: 7px;
  height: 26px; padding: 0 11px;
  border-radius: 99px;
  background: var(--surface);
  border: 1px solid var(--accent-line);
  color: var(--accent);
  font-size: 12px; font-weight: 600;
  margin-bottom: 16px;
}
.hero-kicker .pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 20%, transparent); }
.hero h1 { margin: 0 0 12px; font-size: 34px; line-height: 1.24; letter-spacing: -0.025em; font-weight: 750; }
.hero h1 em { font-style: normal; background: linear-gradient(100deg, var(--accent), var(--accent-3)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { margin: 0; color: var(--text-2); font-size: 14.5px; max-width: 620px; }
.hero-actions { display: flex; gap: 10px; margin-top: 24px; flex-wrap: wrap; }

.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 30px; }
.stat {
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  backdrop-filter: blur(4px);
}
.stat b { display: block; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 11.5px; color: var(--muted); letter-spacing: .04em; }

.grid-2 { display: grid; grid-template-columns: 1.35fr 1fr; gap: 20px; align-items: start; }

.mini-list { display: flex; flex-direction: column; }
.mini-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px dashed var(--border);
  color: var(--text);
}
.mini-item:last-child { border-bottom: none; }
.mini-item:hover { color: var(--accent); }
.mini-item .idx { width: 34px; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.mini-item .name { flex: 1; font-weight: 500; }

/* ---------------- 题库 ---------------- */

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h2 { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: -0.02em; }
.page-head p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

.filter-bar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.filter-bar .input { max-width: 260px; }
.filter-bar .select { width: auto; min-width: 132px; }

.pager { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 20px; }
.pager button {
  min-width: 32px; height: 32px; padding: 0 9px;
  border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2);
  font-family: inherit; font-size: 13px; cursor: pointer;
}
.pager button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.pager button.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.pager button:disabled { opacity: .4; cursor: not-allowed; }

/* ---------------- 题目详情 ---------------- */

.problem-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }

.problem-head { margin-bottom: 18px; }
.problem-head h1 { margin: 0 0 10px; font-size: 24px; font-weight: 720; letter-spacing: -0.02em; line-height: 1.3; }
.problem-meta { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 12.5px; }

.statement { font-size: 14.5px; line-height: 1.85; color: var(--text-2); }
.statement h2 { font-size: 15.5px; font-weight: 680; color: var(--text); margin: 28px 0 10px; display: flex; align-items: center; gap: 8px; }
.statement h2::before { content: ""; width: 3px; height: 14px; border-radius: 2px; background: var(--accent); }
.statement h3 { font-size: 14.5px; font-weight: 650; color: var(--text); margin: 20px 0 8px; }
.statement p { margin: 10px 0; }
.statement ul, .statement ol { margin: 10px 0; padding-left: 22px; }
.statement li { margin: 4px 0; }
.statement code {
  font-family: var(--mono); font-size: 12.8px;
  background: var(--surface-3); padding: 1.5px 5px; border-radius: 5px; color: var(--text);
}
.statement pre {
  background: var(--surface-3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 13px 15px; overflow-x: auto; margin: 12px 0;
}
.statement pre code { background: none; padding: 0; font-size: 12.8px; line-height: 1.7; }
.statement blockquote {
  margin: 12px 0; padding: 8px 14px;
  border-left: 3px solid var(--accent-line);
  background: var(--surface-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-2);
}
.statement table { border-collapse: collapse; margin: 12px 0; font-size: 13px; }
.statement th, .statement td { border: 1px solid var(--border); padding: 6px 12px; }
.statement th { background: var(--surface-2); font-weight: 600; }
.statement .katex { font-size: 1.02em; }
.statement .katex-display { margin: 14px 0; overflow-x: auto; overflow-y: hidden; padding: 2px 0; }

.sample {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 14px 0;
  background: var(--surface-2);
}
.sample-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 12px; font-weight: 600; color: var(--muted);
  background: var(--surface);
}
.sample-body { display: grid; grid-template-columns: 1fr 1fr; }
.sample-col { padding: 10px 14px; }
.sample-col + .sample-col { border-left: 1px solid var(--border); }
.sample-col pre {
  margin: 0; font-family: var(--mono); font-size: 12.5px; line-height: 1.65;
  white-space: pre-wrap; word-break: break-all; color: var(--text);
}
.sample-note { padding: 8px 14px; border-top: 1px dashed var(--border); font-size: 12.5px; color: var(--muted); }

.side-rail { position: sticky; top: calc(var(--header-h) + 18px); display: flex; flex-direction: column; gap: 14px; }
.rail-card { padding: 16px 18px; }
.rail-title { font-size: 12px; font-weight: 650; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 12px; }
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; font-size: 13px; }
.kv span:first-child { color: var(--muted); }
.kv span:last-child { font-weight: 550; font-variant-numeric: tabular-nums; }
.progress { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: 6px; }
.progress i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-3)); }

/* ---------------- 编辑器 ---------------- */

.editor-wrap {
  position: relative;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.65;
  tab-size: 4;
}
.editor-scroll { position: relative; display: flex; height: 100%; }
.editor-gutter {
  flex: 0 0 auto;
  padding: 14px 10px 14px 14px;
  text-align: right;
  color: var(--muted);
  opacity: .65;
  user-select: none;
  background: var(--surface-2);
  border-right: 1px solid var(--border);
  overflow: hidden;
  font-variant-numeric: tabular-nums;
  white-space: pre;
  line-height: inherit;
  font-size: 12px;
  min-width: 46px;
}
.editor-body { position: relative; flex: 1; min-width: 0; }
.editor-hl {
  position: absolute; inset: 0;
  margin: 0; padding: 14px 16px;
  overflow: hidden;
  white-space: pre;
  pointer-events: none;
  color: var(--text);
  font: inherit;
}
.editor-input {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  margin: 0; padding: 14px 16px;
  border: 0; outline: none; resize: none;
  background: transparent;
  color: transparent;
  caret-color: var(--text);
  font: inherit;
  white-space: pre;
  overflow: auto;
  -webkit-text-fill-color: transparent;
}
.editor-input::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }
.tok-kw { color: #a626a4; font-weight: 550; }
.tok-str { color: #3f8f3f; }
.tok-num { color: #b76b01; }
.tok-com { color: #9aa0b0; font-style: italic; }
.tok-fn { color: #2f6fd0; }
.tok-op { color: #6b7280; }
[data-theme="dark"] .btn-primary {
  background: linear-gradient(180deg, #7b6ef9, #5f52e8);
  color: #fff;
}
[data-theme="dark"] .btn-primary:hover { background: linear-gradient(180deg, #8a7dfa, #6a5cf0); }
[data-theme="dark"] .tok-kw { color: #c678dd; }
[data-theme="dark"] .tok-str { color: #98c379; }
[data-theme="dark"] .tok-num { color: #d19a66; }
[data-theme="dark"] .tok-com { color: #6b7386; }
[data-theme="dark"] .tok-fn { color: #61afef; }
[data-theme="dark"] .tok-op { color: #9aa2b5; }

/* ---------------- 提交面板 ---------------- */

.overlay {
  position: fixed; inset: 0; z-index: 100;
  background: color-mix(in srgb, #0b0d16 55%, transparent);
  backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: fadeIn .16s ease;
}
.overlay-panel {
  width: min(1120px, 100%);
  height: min(86vh, 840px);
  max-height: calc(100vh - 48px);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: popIn .2s cubic-bezier(.2,.9,.3,1.1);
}
.panel-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.panel-title { font-weight: 650; font-size: 14.5px; flex: 1; min-width: 0; }
.panel-title small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }
.panel-body { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr); }
.panel-editor { min-height: 0; display: flex; flex-direction: column; padding: 14px; gap: 10px; border-right: 1px solid var(--border); }
.panel-editor .editor-wrap { flex: 1; min-height: 0; }
.panel-side { min-height: 0; overflow-y: auto; padding: 14px; background: var(--surface-2); }
.panel-foot { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--border); }

.tc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 8px; }
.tc {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 8px;
  background: var(--surface);
  font-size: 11.5px;
  cursor: default;
}
.tc b { display: block; font-size: 11px; font-weight: 600; margin-bottom: 2px; }
.tc span { color: var(--muted); font-variant-numeric: tabular-nums; }
.tc.ac { border-color: color-mix(in srgb, var(--green) 40%, transparent); background: var(--green-soft); }
.tc.ac b { color: var(--green); }
.tc.wa { border-color: color-mix(in srgb, var(--red) 40%, transparent); background: var(--red-soft); }
.tc.wa b { color: var(--red); }
.tc.tle, .tc.mle, .tc.ole { border-color: color-mix(in srgb, var(--amber) 40%, transparent); background: var(--amber-soft); }
.tc.tle b, .tc.mle b, .tc.ole b { color: var(--amber); }
.tc.re { border-color: color-mix(in srgb, var(--red) 30%, transparent); background: var(--red-soft); }
.tc.re b { color: var(--red); }
.tc.sk, .tc.jd, .tc.wt { background: var(--surface-3); }
.tc.sk b, .tc.jd b, .tc.wt b { color: var(--muted); }

.verdict-hero {
  display: flex; align-items: center; gap: 12px;
  padding: 16px; border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 14px;
}
.verdict-hero.ac { background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 30%, transparent); }
.verdict-hero.bad { background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 30%, transparent); }
.verdict-hero.warn { background: var(--amber-soft); border-color: color-mix(in srgb, var(--amber) 30%, transparent); }
.verdict-hero.muted { background: var(--surface-3); }
.verdict-hero .v-label { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.verdict-hero .v-sub { font-size: 12px; color: var(--muted); }
.verdict-icon { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; }
.verdict-hero.ac .verdict-icon { background: var(--green); color: #fff; }
.verdict-hero.bad .verdict-icon { background: var(--red); color: #fff; }
.verdict-hero.warn .verdict-icon { background: var(--amber); color: #fff; }
.verdict-hero.muted .verdict-icon { background: var(--muted); color: #fff; }

.spinner {
  width: 15px; height: 15px;
  border: 2px solid color-mix(in srgb, var(--accent) 25%, transparent);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}

/* ---------------- 代码展示 ---------------- */

.code-view {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-family: var(--mono);
  font-size: 12.8px;
  line-height: 1.7;
  overflow-x: auto;
  white-space: pre;
  color: var(--text);
}
.msg-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--amber);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-family: var(--mono);
  font-size: 12.5px;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-2);
  max-height: 260px;
  overflow: auto;
}

/* ---------------- 用户菜单 / 模态框 ---------------- */

.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 12.5px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--accent-2), var(--accent-3));
  flex: 0 0 auto;
  user-select: none;
}
.avatar-lg { width: 56px; height: 56px; font-size: 20px; border-radius: 16px; }

.user-chip { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border-radius: 99px; border: 1px solid var(--border); background: var(--surface); cursor: pointer; }
.user-chip:hover { border-color: var(--border-strong); }
.user-chip span { font-size: 13px; font-weight: 550; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 176px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  display: none;
  z-index: 80;
}
.dropdown.open .dropdown-menu { display: block; animation: popIn .14s ease; }
.dropdown-menu a, .dropdown-menu button {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 8px 10px;
  border: 0; background: none; border-radius: 7px;
  font-family: inherit; font-size: 13px; color: var(--text-2);
  cursor: pointer; text-align: left;
}
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--surface-3); color: var(--text); }
.dropdown-menu .sep { height: 1px; background: var(--border); margin: 5px 4px; }

.modal {
  width: min(420px, 100%);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 26px 26px 22px;
  animation: popIn .2s cubic-bezier(.2,.9,.3,1.1);
}
.modal h3 { margin: 0 0 4px; font-size: 18px; font-weight: 700; letter-spacing: -0.02em; }
.modal .sub { color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; color: var(--text-2); }
.tabs { display: flex; gap: 4px; background: var(--surface-3); padding: 3px; border-radius: 10px; margin-bottom: 18px; }
.tabs button {
  flex: 1; height: 30px; border: 0; background: none; border-radius: 8px;
  font-family: inherit; font-size: 13px; font-weight: 550; color: var(--text-2); cursor: pointer;
}
.tabs button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ---------------- Toast / 骨架屏 ---------------- */

.toast-host { position: fixed; top: 74px; right: 24px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast {
  display: flex; align-items: center; gap: 9px;
  min-width: 220px; max-width: 380px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  animation: slideIn .22s cubic-bezier(.2,.9,.3,1.1);
}
.toast.ok { border-left: 3px solid var(--green); }
.toast.err { border-left: 3px solid var(--red); }
.toast.info { border-left: 3px solid var(--accent); }

.skeleton {
  background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 37%, var(--surface-3) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
  border-radius: 6px;
}

.empty {
  padding: 54px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
}
.empty svg { opacity: .35; margin-bottom: 10px; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(6px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes slideIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ---------------- 响应式 ---------------- */

@media (max-width: 980px) {
  .problem-layout { grid-template-columns: 1fr; }
  .side-rail { position: static; flex-direction: row; flex-wrap: wrap; }
  .side-rail .rail-card { flex: 1 1 240px; }
  .grid-2 { grid-template-columns: 1fr; }
  .panel-body { grid-template-columns: 1fr; }
  .panel-editor { border-right: 0; border-bottom: 1px solid var(--border); }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .hero { padding: 32px 26px; }
  .hero h1 { font-size: 26px; }
}

@media (max-width: 720px) {
  .main { padding: 18px 14px 48px; }
  .header-inner { padding: 0 14px; gap: 12px; }
  .nav { overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 6px 10px; font-size: 13px; }
  .brand-text { display: none; }
  .sample-body { grid-template-columns: 1fr; }
  .sample-col + .sample-col { border-left: 0; border-top: 1px solid var(--border); }
  .overlay { padding: 0; }
  .overlay-panel { max-height: 100vh; height: 100vh; border-radius: 0; border: 0; }
  .hero { padding: 26px 20px; }
  .stat-row { gap: 10px; }
  table.tbl th:nth-child(5), table.tbl td:nth-child(5) { display: none; }
}

/* ==================================================================
   内容系统：题解 / 专栏 / 评论 / 管理台
   ================================================================== */

/* ---------------- 标签页 ---------------- */

.tabs-line {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs-line::-webkit-scrollbar { display: none; }
.tabs-line a, .tabs-line button {
  position: relative;
  padding: 10px 15px;
  border: 0;
  background: none;
  font-family: inherit;
  font-size: 13.8px;
  font-weight: 550;
  color: var(--text-2);
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .15s, border-color .15s;
}
.tabs-line a:hover, .tabs-line button:hover { color: var(--text); }
.tabs-line a.active, .tabs-line button.active { color: var(--accent); border-bottom-color: var(--accent); }
.tabs-line .count {
  display: inline-block;
  margin-left: 5px;
  padding: 0 6px;
  border-radius: 99px;
  background: var(--surface-3);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  line-height: 17px;
}
.tabs-line .active .count { background: var(--accent-soft); color: var(--accent); }

/* ---------------- 内容列表 ---------------- */

.post-list { display: flex; flex-direction: column; }
.post-item {
  display: block;
  padding: 16px 6px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  transition: background .12s;
}
.post-item:last-child { border-bottom: 0; }
.post-item:hover { background: var(--surface-2); color: var(--text); }
.post-item h3 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.post-item .excerpt {
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.72;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
}
.post-meta .m { display: inline-flex; align-items: center; gap: 4px; }

.post-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.post-card {
  display: flex;
  flex-direction: column;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  transition: border-color .15s, transform .15s, box-shadow .15s;
  min-height: 168px;
}
.post-card:hover {
  border-color: var(--accent-line);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  color: var(--text);
}
.post-card h3 { margin: 0 0 8px; font-size: 15.5px; font-weight: 680; letter-spacing: -0.015em; line-height: 1.45; }
.post-card .excerpt {
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.72;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card .post-meta { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); }

/* ---------------- 角色徽章 ---------------- */

.role-badge {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: 5px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .02em;
  line-height: 1;
}
.role-root { background: linear-gradient(135deg, #ff6b7a, #e5404f); color: #fff; }
.role-admin { background: var(--accent-soft); color: var(--accent); }
.role-moderator { background: var(--blue-soft); color: var(--blue); }
.role-user { display: none; }

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 19px;
  padding: 0 7px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
}
.status-pending { background: var(--amber-soft); color: var(--amber); }
.status-rejected { background: var(--red-soft); color: var(--red); }
.status-draft { background: var(--surface-3); color: var(--muted); }
.status-hidden { background: var(--surface-3); color: var(--muted); }
.status-published { background: var(--green-soft); color: var(--green); }

/* ---------------- 文章详情 ---------------- */

.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 26px; align-items: start; }
.article-head h1 { margin: 0 0 14px; font-size: 27px; font-weight: 750; letter-spacing: -0.025em; line-height: 1.35; }
.article-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.article-body {
  font-size: 15px;
  line-height: 1.95;
  color: var(--text-2);
}
.article-body h2 { font-size: 17px; font-weight: 700; color: var(--text); margin: 34px 0 12px; letter-spacing: -0.01em; }
.article-body h3 { font-size: 15.2px; font-weight: 660; color: var(--text); margin: 24px 0 9px; }
.article-body p { margin: 12px 0; }
.article-body ul, .article-body ol { margin: 12px 0; padding-left: 24px; }
.article-body li { margin: 5px 0; }
.article-body code {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--surface-3);
  padding: 2px 5px;
  border-radius: 5px;
  color: var(--text);
}
.article-body pre {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  overflow-x: auto;
  margin: 16px 0;
  position: relative;
}
.article-body pre code { background: none; padding: 0; font-size: 12.8px; line-height: 1.75; }
.article-body blockquote {
  margin: 16px 0;
  padding: 10px 16px;
  border-left: 3px solid var(--accent-line);
  background: var(--surface-2);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.article-body table { border-collapse: collapse; margin: 16px 0; font-size: 13.5px; width: 100%; }
.article-body th, .article-body td { border: 1px solid var(--border); padding: 7px 12px; }
.article-body th { background: var(--surface-2); font-weight: 650; color: var(--text); }
.article-body hr { border: 0; border-top: 1px solid var(--border); margin: 26px 0; }
.article-body .katex-display { margin: 18px 0; overflow-x: auto; overflow-y: hidden; }

.article-side { position: sticky; top: calc(var(--header-h) + 18px); display: flex; flex-direction: column; gap: 14px; }

/* ---------------- 投票 ---------------- */

.vote-box { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.vote-btn {
  width: 40px; height: 34px;
  display: grid; place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  transition: all .15s;
}
.vote-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.vote-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.vote-btn.down.active { background: var(--red); border-color: var(--red); }
.vote-score { font-size: 16px; font-weight: 750; font-variant-numeric: tabular-nums; color: var(--text); }

/* ---------------- 评论 ---------------- */

.comment-list { display: flex; flex-direction: column; }
.comment {
  display: flex;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px dashed var(--border);
}
.comment:last-child { border-bottom: 0; }
.comment-main { flex: 1; min-width: 0; }
.comment-head { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; flex-wrap: wrap; }
.comment-head b { font-size: 13px; font-weight: 650; color: var(--text); }
.comment-head span { font-size: 11.5px; color: var(--muted); }
.comment-body { font-size: 13.5px; line-height: 1.8; color: var(--text-2); white-space: pre-wrap; word-break: break-word; }
.comment-del { font-size: 11.5px; color: var(--muted); background: none; border: 0; cursor: pointer; padding: 0; }
.comment-del:hover { color: var(--red); }

.comment-form { display: flex; gap: 12px; margin-top: 18px; }
.comment-form .textarea { min-height: 74px; }

/* ---------------- Markdown 编辑器 ---------------- */

.md-editor {
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  display: flex;
  flex-direction: column;
}
.md-toolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 7px 9px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  flex-wrap: wrap;
}
.md-toolbar button {
  min-width: 30px;
  height: 28px;
  padding: 0 7px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--text-2);
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-grid;
  place-items: center;
}
.md-toolbar button:hover { background: var(--surface-3); color: var(--text); }
.md-toolbar .divider { width: 1px; height: 16px; background: var(--border); margin: 0 4px; }
.md-toolbar .spacer { flex: 1; }
.md-toolbar .hint { font-size: 11.5px; color: var(--muted); font-weight: 400; }

.md-body { display: grid; grid-template-columns: 1fr 1fr; min-height: 460px; }
.md-pane { position: relative; min-width: 0; }
.md-pane + .md-pane { border-left: 1px solid var(--border); background: var(--surface-2); }
.md-input {
  width: 100%;
  height: 100%;
  min-height: 460px;
  padding: 16px 18px;
  border: 0;
  outline: none;
  resize: none;
  background: transparent;
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.8;
  tab-size: 2;
}
.md-preview {
  height: 100%;
  min-height: 460px;
  max-height: 70vh;
  overflow-y: auto;
  padding: 16px 20px;
  font-size: 14px;
  line-height: 1.85;
  color: var(--text-2);
}
.md-preview .placeholder { color: var(--muted); font-size: 13px; }
.md-preview h2 { font-size: 16px; font-weight: 700; color: var(--text); margin: 22px 0 10px; }
.md-preview h3 { font-size: 14.5px; font-weight: 650; color: var(--text); margin: 18px 0 8px; }
.md-preview code { font-family: var(--mono); font-size: 12.5px; background: var(--surface-3); padding: 1.5px 5px; border-radius: 4px; }
.md-preview pre { background: var(--surface-3); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; overflow-x: auto; }
.md-preview pre code { background: none; padding: 0; }
.md-preview blockquote { margin: 12px 0; padding: 8px 14px; border-left: 3px solid var(--accent-line); background: var(--surface); border-radius: 0 6px 6px 0; }
.md-preview table { border-collapse: collapse; margin: 12px 0; font-size: 13px; }
.md-preview th, .md-preview td { border: 1px solid var(--border); padding: 5px 10px; }
.md-preview th { background: var(--surface-3); }

/* ---------------- 管理台 ---------------- */

.admin-layout { display: grid; grid-template-columns: 196px minmax(0, 1fr); gap: 22px; align-items: start; }
.admin-nav {
  position: sticky;
  top: calc(var(--header-h) + 18px);
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
}
.admin-nav button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 11px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--text-2);
  font-family: inherit;
  font-size: 13.2px;
  font-weight: 550;
  cursor: pointer;
  text-align: left;
  transition: background .12s, color .12s;
}
.admin-nav button:hover { background: var(--surface-3); color: var(--text); }
.admin-nav button.active { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.admin-nav .badge-count[hidden] { display: none; }
.admin-nav .badge-count {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--red);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 12px; }
.stat-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  background: var(--surface);
}
.stat-card b { display: block; font-size: 22px; font-weight: 720; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-card span { font-size: 11.5px; color: var(--muted); }

.log-row {
  display: grid;
  grid-template-columns: 132px 96px 1fr;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 12.5px;
  align-items: baseline;
}
.log-row:last-child { border-bottom: 0; }
.log-row .t { color: var(--muted); font-variant-numeric: tabular-nums; }
.log-row .a { font-family: var(--mono); font-size: 11.5px; color: var(--accent); }

.review-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.review-card h4 { margin: 0 0 6px; font-size: 14px; font-weight: 650; }
.review-card .excerpt { font-size: 12.8px; color: var(--text-2); line-height: 1.7; }

/* ---------------- 响应式 ---------------- */

@media (max-width: 980px) {
  .article-layout { grid-template-columns: 1fr; }
  .article-side { position: static; flex-direction: row; flex-wrap: wrap; }
  .article-side .card { flex: 1 1 200px; }
  .post-grid { grid-template-columns: 1fr; }
  .md-body { grid-template-columns: 1fr; }
  .md-pane + .md-pane { border-left: 0; border-top: 1px solid var(--border); }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-nav { position: static; flex-direction: row; overflow-x: auto; }
  .admin-nav button { white-space: nowrap; width: auto; }
  .log-row { grid-template-columns: 1fr; gap: 2px; }
}

/* ---------------- 首页信息条 ---------------- */

.notice-bar {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  margin-bottom: 14px;
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-2);
}
.notice-bar > div { flex: 1; min-width: 0; }

.stat-line {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 12.5px;
  color: var(--muted);
  flex-wrap: wrap;
}
.stat-line b { color: var(--text); font-weight: 650; }
.stat-line i { width: 1px; height: 12px; background: var(--border); }

/* ---------------- 名字颜色 / 身份标签 ---------------- */

.uname { font-weight: 650; }
.uname-gray { color: #7d8496; }
.uname-blue { color: #2f7de1; }
.uname-green { color: #12a35a; }
.uname-orange { color: #e8890c; }
.uname-red { color: #e5404f; }
.uname-admin { color: #8b5cf6; }
.uname-cheater { color: #8b5e34; }

/* 传说：首字黑、其余红 */
.uname-legend { color: #e5404f; }
.uname-legend i { font-style: normal; color: #14161f; }

[data-theme="dark"] .uname-gray { color: #9aa2b5; }
[data-theme="dark"] .uname-blue { color: #63a8ff; }
[data-theme="dark"] .uname-green { color: #3ddc84; }
[data-theme="dark"] .uname-orange { color: #ffb340; }
[data-theme="dark"] .uname-red { color: #ff6b7a; }
[data-theme="dark"] .uname-admin { color: #a78bfa; }
[data-theme="dark"] .uname-cheater { color: #c08a5a; }
[data-theme="dark"] .uname-legend { color: #ff6b7a; }
[data-theme="dark"] .uname-legend i {
  color: #000;
  -webkit-text-stroke: 0.6px rgba(255, 255, 255, 0.55);
}

.utag {
  display: inline-flex;
  align-items: center;
  height: 17px;
  padding: 0 6px;
  margin-left: 6px;
  border-radius: 3px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  vertical-align: 1px;
  white-space: nowrap;
}
.utag-purple { background: #8b5cf6; }
.utag-brown { background: #8b5e34; }
.utag-gray { background: #7d8496; }
.utag-blue { background: #2f7de1; }
.utag-green { background: #12a35a; }
.utag-orange { background: #e8890c; }
.utag-red { background: #e5404f; }
.utag-legend { background: #e5404f; }

/* ---------------- 每日打卡 + 运势 ---------------- */

.home-top {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(240px, 1fr);
  gap: 16px;
  margin-bottom: 20px;
  align-items: stretch;
}

.fortune-card {
  --fc-bg: radial-gradient(120% 130% at 15% 0%, #eef0ff 0%, transparent 58%),
    radial-gradient(100% 120% at 90% 10%, #eaf6ff 0%, transparent 55%), var(--surface);
  --fc-border: var(--border);
  --fc-text: var(--text);
  --fc-dim: var(--muted);
  --fc-box-bg: var(--surface-2);
  --fc-box-border: var(--border);
  --fc-good: #cf6a12;
  --fc-bad: var(--text);
  --fc-sub: var(--muted);
  --fc-level: #0f9d58;
  --fc-line: var(--border);
  --fc-dots: rgba(110, 120, 170, 0.1);

  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--fc-border);
  background: var(--fc-bg);
  color: var(--fc-text);
  padding: 16px 18px 14px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
}
.fortune-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(var(--fc-dots) 1px, transparent 1px);
  background-size: 20px 20px;
  mask-image: radial-gradient(65% 60% at 80% 15%, #000 0%, transparent 78%);
  pointer-events: none;
}
.fortune-card > * { position: relative; z-index: 1; }

[data-theme="dark"] .fortune-card {
  --fc-bg: radial-gradient(120% 130% at 15% 0%, #1f2749 0%, transparent 58%),
    radial-gradient(100% 120% at 90% 10%, #1b2a3f 0%, transparent 55%), #11162a;
  --fc-border: #242b4a;
  --fc-text: #e8ebf5;
  --fc-dim: #8792b5;
  --fc-box-bg: rgba(255, 255, 255, 0.025);
  --fc-box-border: #262d4d;
  --fc-good: #ff8a5c;
  --fc-bad: #c9d3ea;
  --fc-sub: #7c87a8;
  --fc-level: #3ddc84;
  --fc-line: #262d4d;
  --fc-dots: rgba(122, 140, 255, 0.16);
  box-shadow: none;
}

.fortune-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  color: var(--fc-dim);
  letter-spacing: 0.04em;
}
.fortune-head b { color: var(--fc-text); font-weight: 600; }

.fortune-level {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 10px 0 14px;
}
.fortune-level i {
  font-style: normal;
  font-size: 26px;
  color: var(--fc-level);
  opacity: 0.75;
  transform: translateY(-3px);
}
.fortune-level b {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--fc-level);
  line-height: 1.1;
}
[data-theme="dark"] .fortune-level b { text-shadow: 0 0 26px rgba(61, 220, 132, 0.35); }
[data-theme="dark"] .fortune-level i { text-shadow: 0 0 26px rgba(61, 220, 132, 0.25); }

/* 末吉：琥珀色，明确不是绿色 */
.fortune-card[data-tone="amber"] { --fc-level: #b87418; }
[data-theme="dark"] .fortune-card[data-tone="amber"] { --fc-level: #ffc857; }
[data-theme="dark"] .fortune-card[data-tone="amber"] .fortune-level b { text-shadow: 0 0 26px rgba(255, 200, 87, 0.28); }

/* 凶：黑色（暗色主题下用浅灰，否则看不见） */
.fortune-card[data-tone="black"] { --fc-level: #14161c; }
[data-theme="dark"] .fortune-card[data-tone="black"] { --fc-level: #d4d8e4; }
[data-theme="dark"] .fortune-card[data-tone="black"] .fortune-level b,
[data-theme="dark"] .fortune-card[data-tone="black"] .fortune-level i { text-shadow: none; }

.fortune-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; flex: 1; }
.fortune-box {
  border: 1px solid var(--fc-box-border);
  border-radius: 10px;
  padding: 9px 12px 10px;
  background: var(--fc-box-bg);
  min-width: 0;
}
.fortune-box h5 {
  margin: 0 0 6px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--fc-dim);
}
.fortune-item { margin-top: 5px; }
.fortune-item b {
  display: block;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.5;
}
.fortune-box.good .fortune-item b { color: var(--fc-good); }
.fortune-box.bad .fortune-item b { color: var(--fc-bad); }
.fortune-item span {
  display: block;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--fc-sub);
  margin-top: 1px;
}

.fortune-foot {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--fc-line);
  font-size: 12.5px;
  color: var(--fc-dim);
  text-align: center;
}
.fortune-foot b { color: var(--fc-level); font-size: 15px; font-weight: 700; padding: 0 2px; }

.fortune-locked {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 26px 10px;
  text-align: center;
  color: var(--fc-dim);
  font-size: 13px;
}
.fortune-mystery {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: var(--fc-level);
  opacity: 0.85;
}

.checkin-card { display: flex; flex-direction: column; }
.checkin-num { display: flex; align-items: baseline; gap: 7px; margin: 2px 0 12px; }
.checkin-num b { font-size: 34px; font-weight: 780; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1; }
.checkin-num span { font-size: 12px; color: var(--muted); }

.checkin-dots { display: flex; gap: 6px; margin-bottom: 12px; }
.checkin-dot {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.checkin-dot i {
  width: 100%;
  height: 26px;
  border-radius: 6px;
  background: var(--surface-3);
  display: grid;
  place-items: center;
  font-size: 10px;
  font-style: normal;
  color: var(--muted);
}
.checkin-dot.checked i { background: var(--green-soft); color: var(--green); font-weight: 700; }
.checkin-dot.today i { box-shadow: inset 0 0 0 1.5px var(--accent-line); }
.checkin-dot span { font-size: 10.5px; color: var(--muted); }

.checkin-meta { font-size: 11.5px; color: var(--muted); margin-bottom: 12px; }
.checkin-card .btn { margin-top: auto; width: 100%; }
.checkin-done {
  margin-top: auto;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid color-mix(in srgb, var(--green) 26%, transparent);
}

@media (max-width: 980px) {
  .home-top { grid-template-columns: 1fr; }
  .fortune-grid { grid-template-columns: 1fr 1fr; }
}

.avatar-img { object-fit: cover; background: var(--surface-3); }

/* ---------------- 私信（聊天） ---------------- */

.chat-shell {
  display: grid;
  grid-template-columns: 296px minmax(0, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  height: min(74vh, 660px);
  min-height: 520px;
}

.chat-side {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: var(--surface-2);
  min-width: 0;
}
.chat-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  font-weight: 650;
}
.chat-search { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.chat-search .input { height: 32px; font-size: 13px; }
.chat-convs { flex: 1; overflow-y: auto; }

.chat-conv {
  display: flex;
  gap: 10px;
  width: 100%;
  padding: 11px 12px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: none;
  text-align: left;
  cursor: pointer;
  align-items: center;
  font-family: inherit;
}
.chat-conv:hover { background: var(--surface-3); }
.chat-conv.active { background: var(--accent-soft); }
.chat-conv-avatar { flex: 0 0 auto; }
.chat-conv-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.chat-conv-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.chat-conv-name { font-size: 13.2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-conv-time { font-size: 11px; color: var(--muted); flex: 0 0 auto; }
.chat-conv-preview {
  font-size: 12.2px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chat-unread {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--red);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--border);
}
.chat-head-peer { display: flex; align-items: center; gap: 10px; color: var(--text); }
.chat-head-name { display: block; font-size: 13.5px; }
.chat-head-sub { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }

.chat-body {
  flex: 1 1 auto;
  min-height: 0;          /* 关键：不加这行，内容一多就会把底部输入框顶出容器 */
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
}
.chat-row { display: flex; align-items: flex-end; gap: 8px; margin-top: 10px; }
.chat-row.grouped { margin-top: 3px; }
.chat-row.me { justify-content: flex-end; }
.chat-avatar { width: 30px; flex: 0 0 30px; }
.chat-bubble {
  max-width: min(68%, 560px);
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--surface-3);
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}
.chat-row.them .chat-bubble { border-bottom-left-radius: 4px; }
.chat-row.me .chat-bubble {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-divider { text-align: center; margin: 14px 0 4px; font-size: 11px; color: var(--muted); }
.chat-divider span { padding: 2px 9px; border-radius: 99px; background: var(--surface-2); }

.chat-composer { flex: 0 0 auto; border-top: 1px solid var(--border); padding: 10px 14px 12px; }
.chat-input {
  width: 100%;
  min-height: 64px;
  max-height: 160px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.7;
  resize: none;
  outline: none;
  background: var(--surface);
  color: var(--text);
}
.chat-input:focus { border-color: var(--accent-line); }
.chat-composer-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.chat-hint { font-size: 11.5px; color: var(--muted); }

.chat-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 100%;
  color: var(--muted);
  font-size: 13px;
}
.chat-empty-icon { font-size: 34px; opacity: 0.45; }
.chat-empty-small { padding: 26px 14px; text-align: center; font-size: 12.5px; color: var(--muted); }
.chat-welcome { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 48px 20px; }
.chat-welcome-name { font-size: 14px; }
.chat-welcome-tip { font-size: 12.5px; color: var(--muted); }

.nc-results { max-height: 240px; overflow-y: auto; margin-bottom: 10px; border: 1px solid var(--border); border-radius: 10px; }
.nc-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}
.nc-item:last-child { border-bottom: 0; }
.nc-item:hover { background: var(--surface-2); }

@media (max-width: 860px) {
  .chat-shell { grid-template-columns: 1fr; height: auto; min-height: 0; }
  .chat-side { max-height: 250px; border-right: 0; border-bottom: 1px solid var(--border); }
  .chat-body { max-height: 340px; }
}

/* ---------------- 帮助站 ---------------- */

.help-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 20px; align-items: start; }
.help-side { position: sticky; top: calc(var(--header-h) + 18px); overflow: hidden; padding: 8px; }
.help-side-head {
  padding: 8px 10px 10px;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .06em;
  color: var(--muted);
  text-transform: uppercase;
}
.help-nav { display: flex; flex-direction: column; gap: 1px; }
.help-nav a {
  padding: 8px 10px;
  border-radius: 7px;
  font-size: 13.2px;
  color: var(--text-2);
}
.help-nav a:hover { background: var(--surface-3); color: var(--text); }
.help-nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.help-head { margin-bottom: 18px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.help-head h1 { margin: 0 0 6px; font-size: 22px; font-weight: 720; letter-spacing: -0.02em; }
.help-head p { margin: 0; color: var(--muted); font-size: 13px; }
.help-foot { margin-top: 26px; padding-top: 16px; border-top: 1px dashed var(--border); }

@media (max-width: 980px) {
  .help-layout { grid-template-columns: 1fr; }
  .help-side { position: static; }
  .help-nav { flex-direction: row; flex-wrap: wrap; }
}

/* KaTeX 加载失败时的降级样式：至少让 TeX 源码可读 */
.math-fallback {
  font-family: var(--mono);
  font-size: 12.5px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
  color: var(--text);
  white-space: pre-wrap;
}
.math-fallback.display {
  display: block;
  padding: 10px 14px;
  margin: 12px 0;
  text-align: center;
  line-height: 1.8;
}

/* ---------------- 帮助中心（分类 + 搜索） ---------------- */

.help-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.help-top h1 { margin: 0 0 4px; font-size: 24px; font-weight: 750; letter-spacing: -0.025em; }
.help-top p { margin: 0; color: var(--muted); font-size: 13px; }

.help-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  background: var(--surface);
  color: var(--muted);
  min-width: 260px;
}
.help-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); }
.help-search input {
  flex: 1;
  border: 0;
  outline: none;
  background: none;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
}

.help-cat {
  padding: 12px 10px 5px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.help-link {
  display: block;
  padding: 7px 10px;
  border-radius: 7px;
  font-size: 13px;
  color: var(--text-2);
}
.help-link:hover { background: var(--surface-3); color: var(--text); }
.help-link.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.help-crumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 14px;
}
.help-crumb a { color: var(--muted); }
.help-crumb a:hover { color: var(--accent); }
.help-crumb .cur { color: var(--text-2); }

.help-section { margin-top: 24px; }
.help-section:first-of-type { margin-top: 8px; }
.help-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.help-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.help-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  transition: border-color .15s, background .15s;
}
.help-card:hover { border-color: var(--accent-line); background: var(--surface-2); }
.help-card b { font-size: 13.5px; font-weight: 650; color: var(--text); }
.help-card span { font-size: 12px; color: var(--muted); line-height: 1.6; }

.help-pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.help-pager-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: 46%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  transition: border-color .15s;
}
.help-pager-item:hover { border-color: var(--accent-line); }
.help-pager-item.right { text-align: right; margin-left: auto; }
.help-pager-item span { font-size: 11.5px; color: var(--muted); }
.help-pager-item b { font-size: 13px; font-weight: 600; color: var(--text); }

@media (max-width: 980px) {
  .help-cards { grid-template-columns: 1fr; }
  .help-search { min-width: 100%; }
}

/* 帮助站：板块 / 文章列表 / 侧栏 */
.help-nav-group { display: flex; flex-direction: column; }
.help-nav-section { font-weight: 600; }
.help-nav-sub { display: flex; flex-direction: column; gap: 1px; margin: 2px 0 6px 10px; border-left: 1px solid var(--border); padding-left: 6px; }
.help-nav-sub a { padding: 6px 8px; font-size: 12.6px; }

.help-crumb { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; display: flex; gap: 6px; align-items: center; }
.help-crumb a { color: var(--muted); }
.help-crumb a:hover { color: var(--accent); }

.help-sections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.help-section-card {
  display: flex; flex-direction: column; gap: 6px;
  padding: 18px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text);
  transition: border-color .15s, transform .15s;
}
.help-section-card:hover { border-color: var(--accent-line); transform: translateY(-2px); color: var(--text); }
.help-section-title { font-size: 15px; font-weight: 680; letter-spacing: -0.01em; }
.help-section-desc { font-size: 12.8px; color: var(--text-2); line-height: 1.7; flex: 1; }
.help-section-count { font-size: 11.5px; color: var(--muted); }

.help-list { display: flex; flex-direction: column; }
.help-item {
  display: flex; flex-direction: column; gap: 4px;
  padding: 13px 4px; border-bottom: 1px solid var(--border);
  color: var(--text);
}
.help-item:last-child { border-bottom: 0; }
.help-item:hover { background: var(--surface-2); color: var(--text); }
.help-item-title { font-size: 14px; font-weight: 620; }
.help-item-desc { font-size: 12.8px; color: var(--muted); }

.help-pager {
  display: flex; justify-content: space-between; gap: 12px;
  margin-top: 26px; padding-top: 16px; border-top: 1px dashed var(--border);
}

/* ---------------- 工单（仿 GitHub Issues） ---------------- */

.issue-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.issue-filters { display: flex; gap: 4px; }
.issue-filters button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: none;
  color: var(--text-2);
  font-family: inherit;
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
}
.issue-filters button:hover { background: var(--surface-3); color: var(--text); }
.issue-filters button.active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); font-weight: 650; }
.issue-filters .cnt {
  min-width: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--surface-3);
  font-size: 11px;
  font-weight: 650;
  line-height: 17px;
  text-align: center;
  color: var(--muted);
}
.issue-filters .active .cnt { background: var(--accent); color: #fff; }

.issue-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.issue-row:last-child { border-bottom: 0; }
.issue-row:hover { background: var(--surface-2); color: var(--text); }
.issue-icon {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  border-radius: 50%;
  position: relative;
}
.issue-icon.open { background: #1a7f37; box-shadow: 0 0 0 3px rgba(26, 127, 55, 0.14); }
.issue-icon.closed { background: #8250df; box-shadow: 0 0 0 3px rgba(130, 80, 223, 0.14); }
.issue-icon::after {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: #fff;
}
.issue-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.issue-row-title { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.issue-row-meta { font-size: 12px; color: var(--muted); }
.issue-row-side { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; font-size: 12px; color: var(--muted); }
.issue-cmt { white-space: nowrap; }

.issue-label {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.issue-detail-head { margin-bottom: 18px; }
.issue-back { font-size: 12.5px; color: var(--muted); }
.issue-back:hover { color: var(--accent); }
.issue-detail-head h1 {
  margin: 10px 0 8px;
  font-size: 24px;
  font-weight: 730;
  letter-spacing: -0.02em;
  line-height: 1.35;
}
.issue-number { color: var(--muted); font-weight: 500; }
.issue-detail-sub { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.issue-state-badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 650;
  color: #fff;
}
.issue-state-badge.open { background: #1a7f37; }
.issue-state-badge.closed { background: #8250df; }

.issue-layout { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 20px; align-items: start; }
.issue-main { min-width: 0; display: flex; flex-direction: column; gap: 14px; }

.issue-comment { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.issue-comment-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 12.5px;
}
.issue-body { padding: 14px 16px; font-size: 14px; }
.issue-body > :first-child { margin-top: 0; }
.issue-body > :last-child { margin-bottom: 0; }

.issue-timeline { position: relative; display: flex; flex-direction: column; gap: 12px; }

.issue-reply { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; background: var(--surface); }
.issue-reply-head { font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.issue-closed-tip {
  padding: 14px 16px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.issue-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: calc(var(--header-h) + 18px); }
.issue-side-block { display: flex; flex-direction: column; gap: 8px; }
.issue-side-title { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; color: var(--muted); text-transform: uppercase; }
.issue-label-list { display: flex; flex-wrap: wrap; gap: 6px; }
.issue-participants { display: flex; gap: 4px; flex-wrap: wrap; }

.issue-label-picker { display: flex; flex-direction: column; gap: 6px; }
.issue-label-opt {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 12.5px;
}
.issue-label-opt:hover { background: var(--surface-2); }
.issue-label-opt input { width: 15px; height: 15px; }

@media (max-width: 980px) {
  .issue-layout { grid-template-columns: 1fr; }
  .issue-side { position: static; }
}

/* 工单：指派相关 */
.issue-assign-line {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.issue-assignee-box { display: flex; align-items: center; gap: 6px; }
.issue-assignee { display: flex; align-items: center; gap: 7px; font-size: 12.8px; }
.issue-hint {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.6;
  padding: 7px 9px;
  border-radius: 7px;
  background: var(--surface-2);
  border: 1px dashed var(--border);
}
.issue-unassigned { color: var(--muted); font-size: 12px; }
.issue-sep { margin: 0 4px; opacity: .5; }
.issue-current {
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 17px;
}

/* 工单：关联题目 */
.issue-problem-chip {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 650;
  font-family: var(--mono);
}
.issue-problem-picked {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
}
.issue-problem-picked button {
  border: 0;
  background: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 13px;
  padding: 0 2px;
  opacity: .7;
}
.issue-problem-picked button:hover { opacity: 1; }
.issue-list-plain { display: flex; flex-direction: column; }
.issue-list-plain .issue-row { border-bottom: 1px solid var(--border); }
.issue-list-plain .issue-row:last-child { border-bottom: 0; }

/* ---------------- 工单：洛谷式布局 ---------------- */

.ticket-layout { display: grid; grid-template-columns: 196px minmax(0, 1fr); gap: 18px; align-items: start; }
.ticket-side { padding: 10px; position: sticky; top: calc(var(--header-h) + 18px); }
.ticket-side-head { font-size: 12px; font-weight: 700; color: var(--muted); padding: 6px 8px 10px; letter-spacing: .04em; }
.ticket-nav { display: flex; flex-direction: column; gap: 1px; }
.ticket-cat {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 7px 10px; border: 0; border-radius: 7px; background: none;
  color: var(--text-2); font-family: inherit; font-size: 13px; text-align: left; cursor: pointer;
}
.ticket-cat:hover { background: var(--surface-3); color: var(--text); }
.ticket-cat.active { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.ticket-cat.special { font-weight: 650; margin-bottom: 6px; }
.ticket-group { margin-top: 8px; }
.ticket-group-name { font-size: 11px; font-weight: 700; color: var(--muted); padding: 4px 10px; letter-spacing: .04em; }

.ticket-toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
.ticket-caption { font-size: 12px; color: var(--muted); margin-bottom: 8px; }

.ticket-row {
  display: flex; gap: 12px; padding: 13px 16px;
  border-bottom: 1px solid var(--border); color: var(--text); align-items: flex-start;
}
.ticket-row:last-child { border-bottom: 0; }
.ticket-row:hover { background: var(--surface-2); color: var(--text); }
.status-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; margin-top: 6px; display: inline-block; }
.ticket-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.ticket-row-title { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.ticket-row-meta { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ticket-cat-tag { padding: 1px 6px; border-radius: 5px; background: var(--surface-3); font-size: 11px; }
.ticket-row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: 0 0 auto; font-size: 11.5px; color: var(--muted); }
.ticket-no { font-family: var(--mono); font-size: 11.5px; color: var(--muted); }
.ticket-time { font-size: 11px; }
.ticket-muted {
  padding: 0 6px; border-radius: 5px; background: var(--red-soft); color: var(--red);
  font-size: 10.5px; font-weight: 700; line-height: 17px;
}

.status-actions { display: flex; flex-direction: column; gap: 5px; }
.status-btn {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 9px; border: 1px solid var(--border); border-radius: 7px;
  background: none; color: var(--text-2); font-family: inherit; font-size: 12.5px;
  text-align: left; cursor: pointer;
}
.status-btn:hover { background: var(--surface-2); }
.status-btn.active { font-weight: 650; background: var(--surface-2); }
.status-btn .status-dot { margin-top: 0; width: 8px; height: 8px; }

@media (max-width: 900px) {
  .ticket-layout { grid-template-columns: 1fr; }
  .ticket-side { position: static; }
  .ticket-nav { flex-direction: row; flex-wrap: wrap; }
  .ticket-group { margin-top: 0; }
}

/* 顶栏图标按钮（私信等） */
.icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  color: var(--text-2);
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn .msg-badge {
  position: absolute;
  top: 2px;
  right: 1px;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border-radius: 99px;
  background: var(--red);
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  line-height: 15px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--surface);
}
.icon-btn .msg-badge[hidden] { display: none; }

/* 工单状态徽章（列表里直接显示状态文字） */
.ticket-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 20px;
  padding: 0 9px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 650;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 32%, transparent);
  white-space: nowrap;
}
.ticket-status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c);
  flex: 0 0 auto;
}

/* 工单类型 chip（跟在状态徽章后面） */
.ticket-cat-chip {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 9px;
  border-radius: 99px;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 550;
  white-space: nowrap;
}

/* 忘记密码 / 重置密码 */
.auth-page { display: flex; justify-content: center; padding: 40px 0 20px; }

/* ---------------- 团队 ---------------- */

.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.team-card {
  display: flex; flex-direction: column; gap: 10px;
  padding: 16px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); color: var(--text);
  transition: border-color .15s, transform .15s;
}
.team-card:hover { border-color: var(--accent-line); transform: translateY(-2px); color: var(--text); }
.team-card-head { display: flex; align-items: center; gap: 10px; }
.team-avatar {
  flex: 0 0 auto;
  width: 38px; height: 38px;
  border-radius: 11px;
  display: grid; place-items: center;
  background: linear-gradient(140deg, var(--accent-2), var(--accent));
  color: #fff; font-size: 17px; font-weight: 700;
}
.team-avatar.lg { width: 52px; height: 52px; border-radius: 14px; font-size: 22px; }
.team-card-name { font-size: 15px; font-weight: 680; letter-spacing: -0.01em; }
.team-card-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.team-card-desc {
  font-size: 12.8px; color: var(--text-2); line-height: 1.7; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.team-card-foot {
  display: flex; justify-content: space-between; gap: 8px;
  font-size: 11.5px; color: var(--muted);
  border-top: 1px dashed var(--border); padding-top: 9px;
}
.team-role {
  flex: 0 0 auto;
  padding: 1px 8px; border-radius: 99px;
  font-size: 11px; font-weight: 700; line-height: 18px;
  background: var(--surface-3); color: var(--muted);
}
.team-role.owner { background: #8b5cf6; color: #fff; }
.team-role.maintainer { background: var(--accent-soft); color: var(--accent); }
.team-role.member { background: var(--surface-3); color: var(--text-2); }

.team-hero {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 20px;
  padding: 22px 24px; margin-bottom: 16px;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 140% at 10% 0%, var(--accent-soft) 0%, transparent 60%),
    var(--surface);
}
.team-hero-title { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.team-hero-title h1 { margin: 0; font-size: 24px; font-weight: 750; letter-spacing: -0.02em; }
.team-hero-main p { margin: 10px 0 0; font-size: 13px; color: var(--text-2); line-height: 1.8; max-width: 640px; }
.team-hero-meta { display: flex; gap: 28px; flex: 0 0 auto; text-align: right; }
.team-hero-meta b { display: block; font-size: 18px; font-weight: 700; }
.team-hero-meta span { font-size: 11.5px; color: var(--muted); }

.team-tabs { display: flex; align-items: center; gap: 4px; margin-bottom: 16px; flex-wrap: wrap; }
.team-tabs-spacer { flex: 1; }

.team-body { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 20px; align-items: start; }
.team-main { min-width: 0; }
.team-side { display: flex; flex-direction: column; gap: 14px; }
.team-side-block {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); padding: 12px 14px;
  display: flex; flex-direction: column; gap: 9px;
}
.team-side-title { font-size: 11.5px; font-weight: 700; color: var(--muted); letter-spacing: .06em; }
.team-side-row { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; }
.team-side-row span { color: var(--muted); }
.team-side-row b { font-weight: 600; }

.member-list { display: flex; flex-direction: column; }
.member-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.member-row:last-child { border-bottom: 0; }
.member-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.member-actions { display: flex; gap: 6px; flex: 0 0 auto; }

@media (max-width: 980px) {
  .team-body { grid-template-columns: 1fr; }
  .team-hero { flex-direction: column; }
  .team-hero-meta { text-align: left; }
}

/* 咕值明细 */
.credit-card { margin-bottom: 18px; }
.credit-rows { display: flex; flex-direction: column; }
.credit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.credit-row:last-child { border-bottom: 0; }
.credit-label { display: flex; align-items: baseline; gap: 8px; color: var(--text-2); }
.credit-desc { font-size: 11.5px; color: var(--muted); }
.credit-value { font-variant-numeric: tabular-nums; font-weight: 650; }
.credit-row.total { border-top: 1px solid var(--border); margin-top: 4px; padding-top: 11px; }
.credit-row.total .credit-label { color: var(--text); font-weight: 650; }
.credit-row.total .credit-value { color: var(--accent); font-size: 15px; }
.credit-row.muted-row .credit-label, .credit-row.muted-row .credit-value { color: var(--muted); font-weight: 500; }

/* 个性签名（点击编辑） */
.bio-edit {
  cursor: text;
  border-bottom: 1px dashed transparent;
  transition: border-color .15s, color .15s;
}
.bio-edit:hover {
  color: var(--text);
  border-bottom-color: var(--muted);
}
.bio-input {
  width: min(420px, 100%);
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--accent-line);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 12.5px;
  outline: none;
}
.bio-tip { margin-left: 8px; font-size: 11.5px; color: var(--muted); }

/* ---------------- 个人主页（仿洛谷） ---------------- */

.profile-cover {
  position: relative;
  /* 统一 5:1 横图比例，窄屏给一个最小高度避免太扁 */
  aspect-ratio: 5 / 1;
  min-height: 148px;
  max-height: 224px;
  height: auto;
  border-radius: var(--radius-lg);
  overflow: visible;
  margin-bottom: 18px;
}
.profile-cover-inner {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(75% 150% at 6% -10%, color-mix(in srgb, var(--accent) 92%, transparent) 0%, transparent 58%),
    radial-gradient(70% 140% at 52% 130%, rgba(236, 72, 153, 0.62) 0%, transparent 60%),
    radial-gradient(65% 130% at 98% -10%, rgba(56, 189, 248, 0.6) 0%, transparent 56%),
    linear-gradient(115deg, #7c6cf5 0%, #a855f7 42%, #e879b9 72%, #f0a1c8 100%);
  border: 1px solid var(--border);
  overflow: hidden;
}
.profile-cover-inner::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, 0.55) 1px, transparent 1px);
  background-size: 20px 20px;
  mask-image: linear-gradient(105deg, #000 0%, transparent 60%);
  opacity: 0.5;
}
/* 用户上传的封面图；没有图的时候退回 .profile-cover-inner 的渐变 */
.profile-cover-img {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* 「更换封面」浮在封面右上角 */
.cover-edit {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 3;
  height: 26px;
  padding: 0 11px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  background: rgba(16, 14, 24, 0.42);
  color: #fff;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background .15s, border-color .15s;
}
.cover-edit:hover { background: rgba(16, 14, 24, 0.62); border-color: rgba(255, 255, 255, 0.7); }
.cover-edit:disabled { opacity: 0.65; cursor: default; }

/* 头像、名字、tag、签名直接压在封面上（底部加一层暗色渐变保证可读） */
.profile-cover-scrim {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  background: linear-gradient(
    to top,
    rgba(10, 8, 16, 0.58) 0%,
    rgba(10, 8, 16, 0.3) 22%,
    rgba(10, 8, 16, 0.08) 40%,
    transparent 55%
  );
  pointer-events: none;
}

.profile-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: flex-end;
  gap: 14px;
  padding: 0 22px 18px;
  z-index: 2;
}

.profile-avatar {
  flex: 0 0 auto;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.92), 0 10px 24px -10px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  line-height: 0;
  cursor: pointer;
  background: var(--surface);
}
.profile-avatar .avatar { border-radius: 50%; }
.profile-ident-text { min-width: 0; flex: 1 1 auto; padding-bottom: 2px; }

/* 封面上的文字一律白色 + 投影，否则浅色封面上看不清 */
.profile-overlay .profile-name h1,
.profile-overlay .profile-name .uname,
.profile-overlay .profile-name .uname i {
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}
.profile-overlay .profile-name .utag { box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); }
.profile-overlay .bio-line,
.profile-overlay .bio-line .bio-edit {
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}
.profile-overlay .bio-edit:hover { border-bottom-color: rgba(255, 255, 255, 0.6); }

/* 右上角按钮组 */
.profile-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  margin-bottom: 2px;
}
.ov-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 30px;
  padding: 0 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 550;
  line-height: 1;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  backdrop-filter: blur(6px);
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.ov-ghost {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.55);
  background: rgba(20, 18, 28, 0.28);
}
.ov-ghost:hover { background: rgba(20, 18, 28, 0.45); border-color: #fff; }
.ov-solid {
  color: #fff;
  background: rgba(18, 16, 26, 0.58);
  border-color: rgba(255, 255, 255, 0.32);
}
.ov-solid:hover { background: rgba(18, 16, 26, 0.74); border-color: rgba(255, 255, 255, 0.5); }
.ov-follow {
  color: #fff;
  background: #2f7de1;
  border-color: #2f7de1;
}
.ov-follow:hover { background: #2b71cc; border-color: #2b71cc; }
.ov-following {
  color: #fff;
  background: rgba(255, 255, 255, 0.24);
  border-color: rgba(255, 255, 255, 0.42);
}
.ov-following:hover { background: rgba(255, 255, 255, 0.34); }
.ov-btn:disabled { opacity: 0.6; cursor: default; }

.ov-dots {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(20, 18, 28, 0.28);
  cursor: pointer;
  backdrop-filter: blur(6px);
}
.ov-dots span {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #fff;
  display: block;
}
.ov-dots:hover { background: rgba(20, 18, 28, 0.45); }

.ov-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 108px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 12px 28px -12px rgba(0, 0, 0, 0.35);
  padding: 5px;
  z-index: 20;
}
.ov-menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 7px 10px;
  border: none;
  background: none;
  border-radius: 6px;
  font-size: 13px;
  color: var(--red);
  cursor: pointer;
  font-family: inherit;
}
.ov-menu button:hover { background: var(--red-soft); }

.profile-name { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.profile-name h1 { margin: 0; font-size: 22px; font-weight: 750; letter-spacing: -0.02em; }
.bio-line { font-size: 12.5px; margin-top: 6px; }

.profile-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  margin-bottom: 18px;
  padding-bottom: 0;
}
.profile-tabs { display: flex; gap: 4px; }
.profile-tabs a {
  padding: 10px 12px;
  font-size: 13.5px;
  color: var(--text-2);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.profile-tabs a:hover { color: var(--text); }
.profile-tabs a.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 650; }

.profile-kpis { display: flex; gap: 18px; padding-bottom: 8px; flex-wrap: wrap; }
.profile-kpis .kpi { font-size: 11.5px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 1px; }
.profile-kpis .kpi b { font-size: 14px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }

.profile-body { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 18px; align-items: start; }
.profile-main { min-width: 0; }
.profile-side { display: flex; flex-direction: column; gap: 16px; }

/* 已通过题目 */
.solved-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.solved-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--text-2);
  background: var(--surface-2);
}
.solved-chip:hover { border-color: var(--accent-line); color: var(--accent); }
.solved-chip .mono { font-size: 11.5px; color: var(--muted); }

@media (max-width: 980px) {
  .profile-body { grid-template-columns: 1fr; }
  .profile-cover { height: 150px; }
}

/* ---------------- 工单详情（仿洛谷） ---------------- */

.tk-head { margin-bottom: 16px; }
.tk-back { font-size: 12.5px; color: var(--muted); }
.tk-back:hover { color: var(--accent); }
.tk-head h1 { margin: 8px 0 0; font-size: 21px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.35; }
.tk-no { color: var(--muted); font-weight: 650; font-variant-numeric: tabular-nums; }

.tk-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.tk-main { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.tk-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 12px; }

.tk-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px 20px; }
.tk-card-title { margin: 0 0 12px; font-size: 14px; font-weight: 700; }
.tk-desc { font-size: 13.5px; }
.tk-sep { height: 1px; background: var(--border); margin: 16px 0; }
.tk-link { color: var(--accent); font-size: 13px; }
.tk-none { color: var(--muted); font-size: 13px; }

.tk-attrs { display: flex; flex-direction: column; gap: 10px; }
.tk-attr { display: flex; gap: 12px; font-size: 13px; align-items: flex-start; }
.tk-attr .k { flex: 0 0 74px; color: var(--muted); }
.tk-attr .v { min-width: 0; display: flex; flex-wrap: wrap; gap: 6px; }

.tk-info { display: flex; flex-direction: column; }
.tk-row { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; padding: 7px 0; }
.tk-row .k { flex: 0 0 68px; color: var(--muted); }
.tk-row .v { min-width: 0; flex: 1 1 auto; text-align: right; word-break: break-word; }
.tk-person { display: inline-flex; align-items: center; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.tk-person > * { white-space: nowrap; }
/* 时间线事件里内嵌的人员名牌：和文字同一条水平线 */
.tk-inline-person {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  vertical-align: middle;
  line-height: 1.3;
}
.tk-inline-person .uname { line-height: inherit; }
.tk-inline-person > * { white-space: nowrap; }

.tk-timeline { display: flex; flex-direction: column; gap: 12px; }
.tk-tl-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 18px; }
.tk-tl-item.is-event { padding: 2px 4px; background: transparent; border: none; border-radius: 0; }
.tk-tl-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.tk-tl-item.is-event .tk-tl-head { color: var(--muted); }
.tk-tl-time { color: var(--muted); font-size: 12px; margin-left: auto; white-space: nowrap; }
.tk-tl-act {
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  vertical-align: middle;
}
.tk-tl-body { margin-top: 10px; font-size: 13.5px; }

.tk-reply { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 18px; }
.tk-reply-head { font-size: 13.5px; font-weight: 650; margin-bottom: 10px; }
.tk-reply-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.tk-closed-tip {
  padding: 14px 18px; background: var(--surface-2); border-radius: var(--radius-lg);
  color: var(--muted); font-size: 13px; text-align: center;
}

.tk-status-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.tk-status-btn {
  display: flex; align-items: center; gap: 6px; padding: 7px 9px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2);
  font-size: 12.5px; color: var(--text-2); cursor: pointer; font-family: inherit;
}
.tk-status-btn:hover { border-color: var(--accent-line); color: var(--text); }
.tk-status-btn.active { font-weight: 650; background: var(--surface); }

.tk-ops { display: flex; flex-direction: column; gap: 8px; }
.tk-hint { font-size: 12.5px; color: var(--muted); line-height: 1.6; }

@media (max-width: 980px) {
  .tk-layout { grid-template-columns: 1fr; }
  .tk-side { position: static; }
}

/* 看起来像链接的按钮（弹窗里的「取消」之类） */
.linklike {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.linklike:hover { color: var(--text); }

/* ---------------- 个人设置 ---------------- */

.settings-layout { display: flex; flex-direction: column; gap: 16px; max-width: 720px; }
.settings-avatar { display: flex; align-items: center; gap: 18px; }
.settings-avatar-preview {
  flex: 0 0 auto;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  overflow: hidden;
  line-height: 0;
  box-shadow: 0 0 0 3px var(--surface-2);
}
.settings-avatar-preview .avatar { border-radius: 50%; }
.settings-hint { font-size: 11.5px; color: var(--muted); margin-top: 6px; }

.settings-cover {
  height: 150px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12.5px;
  overflow: hidden;
}
.settings-cover.is-default {
  background: linear-gradient(115deg, #7c6cf5 0%, #a855f7 42%, #e879b9 72%, #f0a1c8 100%);
  color: rgba(255, 255, 255, 0.9);
  border-color: transparent;
}

/* 个人主页 · 最近活动 */
.activity-list { display: flex; flex-direction: column; }
.activity-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 4px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-2);
}
.activity-item:last-child { border-bottom: none; }
.activity-item:hover { color: var(--text); }
.activity-item .act-text { min-width: 0; flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-item .act-text b { font-weight: 600; color: var(--text); }
.activity-item:hover .act-text b { color: var(--accent); }
.activity-item .act-time { flex: 0 0 auto; font-size: 12px; color: var(--muted); }

/* ---------- 通知中心 ---------- */
.notif-item {
  display: flex;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .15s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--surface-2); }
.notif-item.is-unread { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.notif-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 7px;
  flex: none;
}
.notif-dot[hidden] { display: none; }
.notif-main { flex: 1; min-width: 0; }
.notif-title { font-size: 13.5px; font-weight: 600; color: var(--text); }
.notif-body { font-size: 12.5px; color: var(--text-2); line-height: 1.75; margin-top: 4px; }
.notif-time { font-size: 11.5px; color: var(--muted); margin-top: 6px; }

/* ---------- 点赞按钮（手绘心形） ---------- */
.like-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin: 4px auto 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: transform .18s ease, color .18s ease, background .18s ease;
}
.like-btn svg { transition: transform .18s ease; }
.like-btn:hover { color: #e2557a; background: rgba(226, 85, 122, .08); }
.like-btn:hover svg { transform: scale(1.08) rotate(-4deg); }
.like-btn.is-liked { color: #e2557a; }
.like-btn.is-liked svg { transform: scale(1.02); }
.like-btn:active svg { transform: scale(.92); }
.like-count {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}

/* 题库列表里「已通过」的对勾 */
.ac-check {
  color: var(--green);
  font-weight: 800;
  font-size: 13px;
  margin-right: 1px;
}

/* ---------- 帮助站编辑器 ---------- */
.help-admin-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.help-admin-layout .hp-sec { width: 100%; text-align: left; background: none; border: 0; cursor: pointer; font: inherit; }
.help-admin-layout .hp-art { display: block; }
.help-admin-layout .hp-art.active { color: var(--accent); font-weight: 600; }
.help-admin-layout .hp-new { color: var(--muted); }
@media (max-width: 900px) {
  .help-admin-layout { grid-template-columns: 1fr; }
}

/* 专栏卡片摘要里的 Markdown / LaTeX */
.post-card .excerpt p { margin: 0; }
.post-card .excerpt .katex { font-size: 1em; }
.post-card .excerpt .math-fallback { font-size: .92em; }

/* ---------- 管理团队 ---------- */
.staff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  align-items: start;
}
.staff-col-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.staff-col-head h3 { margin: 0; font-size: 15px; }
.staff-col-desc { font-size: 12px; margin: 6px 0 10px; line-height: 1.6; }
.staff-list { display: flex; flex-direction: column; }
.staff-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 2px;
  border-bottom: 1px dashed var(--border);
  font-size: 13px;
}
.staff-row:last-child { border-bottom: none; }
.staff-id { width: 52px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.staff-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 通过题目统计 ---------- */
.stat-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.chart-svg { width: 100%; overflow: hidden; }
.pie-svg, .hist-svg { width: 100%; height: auto; display: block; }
.pie-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 6px; }
.pie-legend-item { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--text-2); }
.pie-legend-item i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.stats-bottom { display: grid; grid-template-columns: 1.6fr 1fr; gap: 16px; margin-top: 16px; }
.diff-bars { display: flex; flex-direction: column; gap: 8px; }
.diff-bar-row { display: grid; grid-template-columns: 104px 1fr 40px; align-items: center; gap: 10px; }
.diff-bar-track { height: 12px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.diff-bar-track i { display: block; height: 100%; border-radius: 6px; transition: width .3s; }
.diff-tag { display: inline-block; padding: 1px 7px; border-radius: 4px; color: #fff; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.diff-stat-list { display: flex; flex-direction: column; gap: 7px; }
.diff-stat-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.diff-stat-row:last-child { border-bottom: none; }
.chip-problems { display: flex; flex-wrap: wrap; gap: 6px 10px; }
.prob-chip { font-family: var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace); font-size: 12.5px; color: var(--accent); }
.prob-chip:hover { text-decoration: underline; }
.solved-group { padding: 10px 0; border-bottom: 1px dashed var(--border); }
.solved-group:last-child { border-bottom: none; }
.solved-group .diff-tag { margin-bottom: 8px; }
.stats-mini { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stats-mini-item { display: flex; flex-direction: column; gap: 2px; }
.stats-mini-item b { font-size: 18px; }
.stats-mini-item span { font-size: 11.5px; color: var(--muted); }
.intro-body { font-size: 13.5px; line-height: 1.9; color: var(--text-2); white-space: pre-wrap; word-break: break-word; }
@media (max-width: 980px) {
  .stat-charts, .stats-bottom { grid-template-columns: 1fr; }
  .stats-mini { grid-template-columns: repeat(2, 1fr); }
}

/* 管理团队空分类 */
.staff-empty {
  padding: 18px 2px;
  font-size: 12.5px;
  color: var(--muted);
}

/* ---------- 测试点编辑器 ---------- */
.tc-list { display: flex; flex-direction: column; gap: 10px; }
.tc-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--surface-2);
}
.tc-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.tc-no { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.tc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tc-grid label, .tc-meta label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11.5px;
  color: var(--muted);
}
.tc-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 8px;
}
.tc-meta .input { height: 30px; font-size: 12.5px; }
@media (max-width: 720px) {
  .tc-grid, .tc-meta { grid-template-columns: 1fr; }
}

/* ECharts 容器 */
.chart-box { width: 100%; height: 430px; }
.chart-box-sm { height: 190px; }
@media (max-width: 980px) {
  .chart-box { height: 360px; }
}
/* 统计页底部三栏自适应 */
.stats-bottom { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.stats-bottom { align-items: start; }

/* 首页两栏：左侧题目/评测，右侧讨论区/排行 */
.home-cols { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; }
/* 个人主页「通过题目」：左列表 + 右难易度统计 */
.solved-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 16px; align-items: start; }
.solved-main { display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 980px) {
  .home-cols { grid-template-columns: 1fr; }
  .solved-layout { grid-template-columns: 1fr; }
}

/* 首页 · 最新讨论（卡片网格，仿洛谷） */
.forum-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.forum-card {
  display: flex;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
  min-width: 0;
}
.forum-card:hover { border-color: var(--accent-line); box-shadow: 0 4px 14px -8px rgba(0, 0, 0, .25); }
.fc-avatar { flex: 0 0 auto; line-height: 0; border-radius: 50%; }
.fc-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1 1 auto; }
.fc-title {
  font-size: 13.5px;
  font-weight: 550;
  color: var(--accent);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.forum-card:hover .fc-title { text-decoration: underline; }
.fc-meta { display: flex; align-items: center; gap: 6px; font-size: 11.5px; min-width: 0; flex-wrap: wrap; }
.fc-board { color: var(--muted); white-space: nowrap; }
.fc-foot { display: flex; align-items: center; gap: 10px; font-size: 11px; }
.fc-pin {
  margin-left: auto;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 10.5px;
  font-weight: 600;
}
@media (max-width: 900px) {
  .forum-grid { grid-template-columns: 1fr; }
}

/* ---------------- 题解页（仿洛谷） ---------------- */

.sol-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.sol-head-left { display: flex; align-items: baseline; gap: 12px; min-width: 0; flex-wrap: wrap; }
.sol-pid { font-family: var(--mono, monospace); font-size: 13px; color: var(--muted); font-weight: 600; }
.sol-ptitle { font-size: 16px; font-weight: 650; }
.sol-kind { font-size: 13px; color: var(--muted); }
.sol-head-actions { display: flex; gap: 8px; }

.sol-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.sol-main { min-width: 0; }
.sol-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 12px; }

.sol-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  flex-wrap: wrap;
}
.sol-bar-title { font-size: 14px; font-weight: 650; display: flex; align-items: center; gap: 6px; }
.sol-bar-title .count { font-size: 12px; color: var(--muted); font-weight: 500; }
.sol-sort { display: flex; gap: 14px; }
.sol-sort button {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 12.5px;
  color: var(--muted);
  cursor: pointer;
}
.sol-sort button:hover { color: var(--text); }
.sol-sort button.active { color: var(--accent); font-weight: 600; }

.sol-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  overflow: hidden;
}
.sol-item {
  display: block;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  transition: background .12s;
}
.sol-item:last-child { border-bottom: none; }
.sol-item:hover { background: var(--surface-2); }
.sol-item-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.sol-item-time { margin-left: auto; font-size: 11.5px; color: var(--muted); }
.sol-item-body { margin-top: 9px; }
.sol-item-title { font-size: 14px; font-weight: 600; color: var(--text); }
.sol-item:hover .sol-item-title { color: var(--accent); }
.sol-item-excerpt {
  margin-top: 5px;
  font-size: 12.5px;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.6;
}
.sol-item-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 9px;
  font-size: 11.5px;
}
.sol-read { margin-left: auto; color: var(--accent); }
.sol-empty { padding: 44px 20px; text-align: center; color: var(--muted); font-size: 13.5px; }

.sol-note, .sol-warn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--text-2);
}
.sol-note h4, .sol-warn h4 { margin: 0 0 10px; font-size: 14px; font-weight: 700; color: var(--text); }
.sol-note p, .sol-warn p { margin: 0 0 8px; }
.sol-note p:last-child, .sol-warn p:last-child { margin-bottom: 0; }
.sol-warn h4 { color: var(--red); }
.sol-warn b { color: var(--red); }

@media (max-width: 980px) {
  .sol-layout { grid-template-columns: 1fr; }
  .sol-side { position: static; }
}

/* 讨论区 · 置顶按钮（列表行内） */
.forum-pin {
  margin-top: 4px;
  padding: 1px 7px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.forum-pin:hover { color: var(--accent); border-color: var(--accent-line); }
.forum-pin.is-on { color: var(--red); border-color: var(--red-soft); background: var(--red-soft); }
.forum-pin:disabled { opacity: .5; cursor: default; }
