/* ============================================================
   知识星球 · 样式表
   配色：米色纸张 + 抹茶绿 + 陶土色（延续知识地图的温暖质感）
   ============================================================ */

:root {
  --paper: #f0e8dc;
  --paper-2: #faf6ee;
  --ink: #4a4a4a;
  --ink-2: #5a534a;
  --ink-3: #7d6f5f;
  --ink-4: #9a9084;
  --line: rgba(139, 119, 101, 0.15);
  --line-2: rgba(139, 119, 101, 0.28);
  --green: #7ba890;
  --green-l: #a8c4a0;
  --green-d: #4a5d4a;
  --clay: #c8aa78;
  --purple: #a88cb4;
  --blue: #6a7da0;
  --red: #c25555;
  --shadow-s: 0 2px 12px rgba(139, 119, 101, 0.08);
  --shadow-m: 0 4px 16px rgba(139, 119, 101, 0.12);
  --shadow-l: -8px 0 40px rgba(139, 119, 101, 0.15);
  --radius: 10px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%; height: 100%; overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--paper); color: var(--ink);
  font-size: 14px; -webkit-font-smoothing: antialiased;
}
body {
  background:
    radial-gradient(ellipse at 30% 20%, rgba(216, 197, 168, 0.30) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(186, 172, 149, 0.25) 0%, transparent 50%),
    var(--paper);
}
button { font-family: inherit; }
input, textarea, select { font-family: inherit; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(139, 119, 101, 0.25); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(139, 119, 101, 0.45); }

/* ===================== 顶栏 ===================== */
.header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 300;
  display: flex; align-items: center; gap: 16px;
  padding: 12px 22px;
  background: linear-gradient(180deg, rgba(240, 232, 220, 0.96) 0%, rgba(240, 232, 220, 0.75) 70%, transparent 100%);
  pointer-events: none;
}
.header > * { pointer-events: auto; }

.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--green-l), var(--green));
  display: flex; align-items: center; justify-content: center; font-size: 17px;
  box-shadow: 0 2px 12px rgba(123, 168, 144, 0.35);
}
.logo-text { font-size: 17px; font-weight: 700; color: var(--green-d); line-height: 1.1; }
.logo-sub { font-size: 9.5px; color: var(--ink-4); letter-spacing: 0.14em; text-transform: uppercase; }

.search-box {
  display: flex; align-items: center; gap: 8px; margin-left: 14px;
  background: rgba(255, 253, 248, 0.9); border: 1px solid var(--line);
  border-radius: 20px; padding: 6px 14px; width: 300px;
}
.search-box input { flex: 1; background: transparent; border: none; outline: none; color: var(--ink); font-size: 13px; }
.search-box input::placeholder { color: #b0a69a; }
.search-icon { color: var(--ink-4); font-size: 13px; }

.search-results {
  position: absolute; top: 52px; left: 0; width: 100%;
  background: rgba(255, 253, 248, 0.98); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: var(--shadow-m); overflow: hidden; display: none;
  max-height: 60vh; overflow-y: auto;
}
.search-results.show { display: block; }
.search-result-item { padding: 9px 14px; cursor: pointer; border-bottom: 1px solid rgba(139, 119, 101, 0.07); }
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: rgba(123, 168, 144, 0.10); }
.sr-title { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.sr-path { font-size: 11px; color: var(--ink-4); margin-top: 2px; }

.header-spacer { flex: 1; }

.view-toggle {
  display: flex; background: rgba(255, 253, 248, 0.92);
  border: 1px solid var(--line-2); border-radius: 20px; padding: 3px; box-shadow: var(--shadow-s);
}
.view-toggle button {
  padding: 6px 15px; border: none; background: transparent; color: #8a7a6a;
  font-size: 13px; cursor: pointer; border-radius: 16px; transition: all 0.2s ease;
}
.view-toggle button:hover { color: #5a5048; }
.view-toggle button.active {
  background: linear-gradient(135deg, #8ab8a8, #6a9888); color: #fff;
  box-shadow: 0 2px 8px rgba(106, 152, 136, 0.3);
}

/* ===================== 星球 / 地图视图 ===================== */
#map-view { position: fixed; inset: 0; z-index: 10; opacity: 0; pointer-events: none; transition: opacity 0.35s ease; }
#map-view.active { opacity: 1; pointer-events: auto; }
#map-svg { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
#map-svg.dragging { cursor: grabbing; }

.map-nav {
  position: fixed; top: 66px; left: 50%; transform: translateX(-50%); z-index: 120;
  display: flex; align-items: center; gap: 4px;
  background: rgba(255, 253, 248, 0.92); border: 1px solid var(--line);
  border-radius: 20px; padding: 5px 12px; font-size: 12.5px; box-shadow: var(--shadow-s);
}
.nav-crumb { padding: 5px 12px; border-radius: 14px; cursor: pointer; color: #8b7765; transition: all 0.2s; }
.nav-crumb:hover { color: var(--green-d); background: rgba(123, 168, 144, 0.1); }
.nav-crumb.active { color: var(--green-d); background: rgba(123, 168, 144, 0.16); font-weight: 500; }
.nav-sep { color: #c8bfb3; font-size: 11px; }

.zoom-controls {
  position: fixed; bottom: 22px; right: 22px; z-index: 120;
  display: flex; flex-direction: column; gap: 2px;
  background: rgba(255, 253, 248, 0.92); border: 1px solid var(--line-2);
  border-radius: 10px; overflow: hidden; box-shadow: var(--shadow-m);
}
.zoom-btn {
  width: 36px; height: 34px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 15px; color: var(--ink-3); background: transparent; border: none;
  transition: all 0.2s;
}
.zoom-btn:hover { background: rgba(123, 168, 144, 0.16); color: var(--green-d); }
.zoom-level {
  padding: 3px 0; text-align: center; font-size: 10px; color: var(--ink-4);
  border-top: 1px solid rgba(139, 119, 101, 0.08); border-bottom: 1px solid rgba(139, 119, 101, 0.08);
}

.legend {
  position: fixed; bottom: 22px; left: 22px; z-index: 120;
  background: rgba(255, 253, 248, 0.93); border: 1px solid var(--line-2);
  border-radius: var(--radius); padding: 12px 15px; font-size: 11.5px; box-shadow: var(--shadow-m);
  max-width: 240px;
}
.legend-title { font-weight: 600; margin-bottom: 9px; color: var(--ink-2); font-size: 12px; }
.legend-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 5px 10px; }
.legend-item { display: flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: 11px; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.legend-hint { margin-top: 9px; padding-top: 8px; border-top: 1px solid rgba(139, 119, 101, 0.1); color: var(--ink-4); font-size: 10.5px; line-height: 1.6; }

.map-hint {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 110;
  background: rgba(255, 253, 248, 0.92); border: 1px solid var(--line);
  border-radius: 20px; padding: 7px 18px; font-size: 12px; color: #8b7765; box-shadow: var(--shadow-s);
  animation: float 3s ease-in-out infinite;
}
@keyframes float { 0%,100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-3px); } }

.map-tooltip {
  position: fixed; z-index: 150; background: rgba(255, 253, 248, 0.97);
  border: 1px solid var(--line-2); border-radius: 8px; padding: 9px 13px;
  font-size: 12.5px; pointer-events: none; opacity: 0; transition: opacity 0.15s;
  min-width: 150px; max-width: 260px; box-shadow: var(--shadow-m);
}
.map-tooltip.show { opacity: 1; }
.tooltip-title { font-weight: 600; color: var(--ink); margin-bottom: 3px; }
.tooltip-desc { font-size: 11.5px; color: var(--ink-3); line-height: 1.5; }
.tooltip-count { font-size: 11px; color: var(--green-d); margin-top: 4px; font-weight: 500; }

/* SVG 元素样式 */
.continent { cursor: pointer; }
.continent-land { stroke: rgba(90, 75, 60, 0.35); stroke-width: 1.4; stroke-linejoin: round; transition: filter 0.25s, stroke-width 0.25s; }
.continent:hover .continent-land { filter: brightness(1.06); stroke-width: 2.2; }
/* 地图上的文字统一加浅色描边，压在色块上也能看清 */
.continent-label, .continent-sub, .country-label, .country-sub, .kp-name, .kp-num {
  paint-order: stroke fill;
  stroke: rgba(255, 253, 248, 0.92);
  stroke-width: 2.6px;
  stroke-linejoin: round;
}
.continent-label { font-size: 22px; font-weight: 600; fill: #3d3530; text-anchor: middle; pointer-events: none; }
.continent-icon { font-size: 34px; text-anchor: middle; pointer-events: none; }
.continent-sub { font-size: 15px; fill: #7d6f5f; text-anchor: middle; pointer-events: none; }
.country { cursor: pointer; }
.country-land { stroke: rgba(90, 75, 60, 0.4); stroke-width: 1; stroke-linejoin: round; transition: filter 0.2s; }
.country:hover .country-land { filter: brightness(1.06); stroke-width: 1.6; }
.country-label { font-size: 20px; font-weight: 600; fill: #3d3530; text-anchor: middle; pointer-events: none; }
.country-sub { font-size: 14px; fill: #8b7765; text-anchor: middle; pointer-events: none; }
.kp-block { cursor: pointer; }
.kp-badge { fill: rgba(122, 138, 154, 0.55); stroke: rgba(122, 138, 154, 0.7); stroke-width: 1; rx: 3; transition: all 0.2s; }
.kp-block:hover .kp-badge { fill: rgba(123, 168, 144, 0.75); stroke: #5a8a70; }
.kp-num { font-size: 13px; font-weight: 700; fill: #5a6a7a; text-anchor: middle; pointer-events: none; }
.kp-name { font-size: 15px; font-weight: 600; fill: #4a443c; pointer-events: none; }
.kp-block:hover .kp-name { fill: #3d4d3d; font-weight: 600; }
.kp-block.has-content .kp-badge { fill: rgba(123, 168, 144, 0.7); stroke: #6a9888; }
.kp-block.empty .kp-badge { fill: rgba(200, 195, 185, 0.35); stroke: rgba(139, 119, 101, 0.45); stroke-dasharray: 2 2; }
.road { stroke: rgba(139, 119, 101, 0.22); stroke-width: 1; stroke-dasharray: 4 3; fill: none; pointer-events: none; }
.grid-line { stroke: rgba(139, 119, 101, 0.06); stroke-width: 1; fill: none; pointer-events: none; }
.globe-hint { font-size: 12px; fill: #8b7765; text-anchor: middle; }

/* ===================== 侧边详情面板 ===================== */
.side-panel {
  position: fixed; top: 0; right: -580px; width: 560px; height: 100vh;
  background: rgba(255, 253, 248, 0.985); backdrop-filter: blur(20px);
  border-left: 1px solid var(--line); z-index: 400;
  transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1); overflow-y: auto; box-shadow: var(--shadow-l);
}
.side-panel.open { right: 0; }
.panel-header {
  position: sticky; top: 0; background: rgba(255, 253, 248, 0.98); backdrop-filter: blur(20px);
  padding: 20px 26px 16px; border-bottom: 1px solid rgba(139, 119, 101, 0.1); z-index: 10;
}
.panel-close {
  position: absolute; top: 14px; right: 16px; width: 28px; height: 28px; border-radius: 50%;
  background: rgba(139, 119, 101, 0.08); border: 1px solid rgba(139, 119, 101, 0.12);
  color: var(--ink-3); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 13px;
}
.panel-close:hover { background: rgba(200, 90, 90, 0.12); border-color: rgba(200, 90, 90, 0.2); color: var(--red); }
.panel-type-badge { display: inline-block; padding: 3px 10px; border-radius: 10px; font-size: 10.5px; font-weight: 600; margin-bottom: 7px; letter-spacing: 0.05em; }
.panel-title { font-size: 21px; font-weight: 700; color: #3d3530; line-height: 1.3; margin-bottom: 8px; padding-right: 30px; }
.panel-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.meta-chip {
  padding: 3px 10px; border-radius: 10px; font-size: 11.5px;
  background: rgba(123, 168, 144, 0.12); color: #5a7d68; border: 1px solid rgba(123, 168, 144, 0.2);
}
.meta-chip.gray { background: rgba(139, 119, 101, 0.1); color: var(--ink-3); border-color: rgba(139, 119, 101, 0.18); }
.panel-body { padding: 20px 26px 60px; }
.panel-section { margin-bottom: 22px; }
.panel-section-title {
  font-size: 13.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}
.panel-section-title::before { content: ''; width: 3px; height: 14px; background: linear-gradient(180deg, var(--green), var(--green-l)); border-radius: 2px; }
.plain-text { font-size: 14px; line-height: 1.85; color: var(--ink-2); white-space: pre-wrap; word-break: break-word; }
.plain-text p { margin-bottom: 8px; }
.plain-text ul { padding-left: 20px; }
.plain-text li { margin-bottom: 6px; }
.quote-box {
  background: rgba(250, 246, 238, 0.75); border-left: 3px solid rgba(139, 119, 101, 0.3);
  border-radius: 8px; padding: 12px 15px; font-size: 13.5px; line-height: 1.8; color: var(--ink-2); white-space: pre-wrap;
}
.visual-box {
  background: rgba(123, 168, 144, 0.06); border: 1px solid rgba(123, 168, 144, 0.16);
  border-radius: 12px; padding: 14px; overflow-x: auto;
}
.visual-box svg { display: block; margin: 0 auto; max-width: 100%; height: auto; }
.metaphor-box {
  background: rgba(200, 170, 120, 0.1); border: 1px solid rgba(200, 170, 120, 0.26);
  border-radius: 10px; padding: 13px 16px;
}
.metaphor-label { font-size: 11px; font-weight: 600; color: #b8956a; margin-bottom: 6px; }
.metaphor-text { font-size: 13.5px; color: #8b7355; line-height: 1.7; }
.goal-box {
  background: rgba(123, 168, 144, 0.09); border: 1px solid rgba(123, 168, 144, 0.2);
  border-radius: 10px; padding: 13px 16px; font-size: 13.5px; line-height: 1.75; color: #4a6a58;
}
.warn-box {
  background: rgba(200, 130, 120, 0.08); border: 1px solid rgba(200, 130, 120, 0.22);
  border-radius: 10px; padding: 13px 16px;
}
.warn-box li { font-size: 13.3px; line-height: 1.75; color: #9a5a52; margin-bottom: 6px; }
.warn-box ul { padding-left: 18px; }
.keypoint-list { display: flex; flex-direction: column; gap: 7px; }
.keypoint-item {
  display: flex; gap: 9px; font-size: 13.5px; line-height: 1.7; color: var(--ink-2);
  background: rgba(250, 246, 238, 0.7); border-radius: 8px; padding: 9px 13px;
}
.keypoint-idx {
  flex-shrink: 0; width: 18px; height: 18px; border-radius: 50%; background: rgba(123, 168, 144, 0.22);
  color: #4a7a62; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; margin-top: 2px;
}
.backlinks { display: flex; flex-wrap: wrap; gap: 8px; }
.backlink-tag {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 12px;
  background: rgba(100, 160, 140, 0.1); border: 1px solid rgba(100, 160, 140, 0.22);
  border-radius: 14px; font-size: 12px; color: #5a8a78; cursor: pointer; transition: all 0.2s;
}
.backlink-tag:hover { background: rgba(100, 160, 140, 0.2); transform: translateY(-1px); }
.backlink-tag.paper { background: rgba(168, 140, 180, 0.1); border-color: rgba(168, 140, 180, 0.22); color: #7a5e8a; }

/* 习题卡 */
.exercise-card {
  background: rgba(250, 246, 238, 0.65); border: 1px solid rgba(139, 119, 101, 0.12);
  border-radius: 12px; padding: 16px 18px; margin-bottom: 13px; transition: border-color 0.2s;
}
.exercise-card:hover { border-color: rgba(123, 168, 144, 0.28); }
.exercise-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; gap: 10px; }
.exercise-num { font-weight: 600; font-size: 13px; color: #5a7d68; }
.exercise-tags { display: flex; gap: 6px; }
.exercise-type { font-size: 11px; padding: 2px 8px; border-radius: 4px; background: rgba(123, 168, 144, 0.13); color: #5a7d68; font-weight: 500; }
.exercise-diff { font-size: 11px; padding: 2px 8px; border-radius: 4px; background: rgba(200, 170, 120, 0.14); color: #a88860; }
.exercise-question { font-size: 13.8px; line-height: 1.8; color: #44403c; margin-bottom: 10px; white-space: pre-wrap; }
.options { margin: 8px 0 10px; display: flex; flex-direction: column; gap: 5px; }
.option-item { font-size: 13.3px; color: #57534e; padding: 4px 10px; background: rgba(255,255,255,0.6); border-radius: 6px; }
.show-answer-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px;
  background: rgba(123, 168, 144, 0.12); border: 1px solid rgba(123, 168, 144, 0.22);
  border-radius: 6px; color: #5a7d68; font-size: 12.5px; cursor: pointer; font-weight: 500; transition: all 0.2s;
}
.show-answer-btn:hover { background: rgba(123, 168, 144, 0.24); }
.answer-section { display: none; margin-top: 12px; padding-top: 12px; border-top: 1px dashed rgba(123, 168, 144, 0.25); }
.answer-section.show { display: block; animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.answer-label { font-size: 10.5px; font-weight: 600; color: #5a8a5a; margin-bottom: 7px; letter-spacing: 0.08em; }
.answer-content {
  font-size: 13.5px; color: #3f6a4a; line-height: 1.75; margin-bottom: 12px;
  padding: 10px 14px; background: rgba(123, 168, 123, 0.08); border-radius: 8px; border-left: 3px solid #7ba87b; white-space: pre-wrap;
}
.steps-label { font-size: 10.5px; font-weight: 600; color: #8a7d5a; margin-bottom: 7px; letter-spacing: 0.08em; }
.steps-list { counter-reset: step; margin-bottom: 12px; }
.step-item {
  position: relative; padding-left: 26px; margin-bottom: 7px; font-size: 13.2px;
  line-height: 1.75; color: #6b6255;
}
.step-item::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 2px; width: 17px; height: 17px; border-radius: 50%;
  background: rgba(200, 170, 120, 0.28); color: #8a6d3b; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.analysis-label { font-size: 10.5px; font-weight: 600; color: var(--blue); margin-bottom: 7px; letter-spacing: 0.08em; }
.analysis-content { font-size: 13.2px; color: #5a6a8a; line-height: 1.8; white-space: pre-wrap; }
.anim-box { margin: 10px 0 12px; padding: 10px; background: rgba(200, 170, 120, 0.06); border-radius: 8px; border-left: 3px solid rgba(200, 170, 120, 0.35); overflow-x: auto; }
.anim-box svg { display: block; margin: 0 auto; max-width: 100%; }
.anim-note { font-size: 10px; color: #b8a898; text-align: right; margin-top: 4px; }
.used-kps { margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(106, 125, 160, 0.1); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.used-kps-label { font-size: 11px; color: var(--ink-4); }
.kp-tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 8px;
  font-size: 11px; background: rgba(168, 140, 180, 0.12); color: #7a5e8a; border: 1px solid rgba(168, 140, 180, 0.2);
  cursor: pointer;
}
.kp-tag::before { content: '#'; opacity: 0.5; }
.kp-tag:hover { background: rgba(168, 140, 180, 0.22); }

/* 教材来源 */
.textbook-card {
  background: rgba(250, 246, 238, 0.65); border: 1px solid rgba(139, 119, 101, 0.12);
  border-left: 3px solid rgba(123, 168, 144, 0.4); border-radius: 10px; padding: 12px 15px; margin-bottom: 8px;
}
.textbook-std { font-size: 13px; font-weight: 600; color: #4a5a4a; margin-bottom: 3px; }
.textbook-year { font-size: 11.5px; color: #5a7d68; margin-bottom: 5px; }
.textbook-versions { font-size: 11.5px; color: var(--ink-3); line-height: 1.7; }
.textbook-src { font-size: 11.5px; color: var(--ink-3); line-height: 1.7; }
.textbook-src + .textbook-src { margin-top: 4px; }
.src-badge { display: inline-block; padding: 1px 7px; border-radius: 6px; background: rgba(123,168,144,0.14); color: #5a7d68; font-size: 10.5px; margin-right: 6px; }

/* ===================== 列表视图 ===================== */
.view-panel { position: fixed; inset: 0; z-index: 20; display: none; flex-direction: column; overflow: hidden; }
.view-panel.active { display: flex; }
#list-view { background: linear-gradient(180deg, #f7f2e8 0%, var(--paper) 100%); padding-top: 62px; }
.list-header { padding: 16px 30px 12px; border-bottom: 1px solid var(--line); background: rgba(255, 253, 248, 0.85); }
.list-title { font-size: 21px; font-weight: 600; color: #5a5048; margin-bottom: 5px; }
.list-subtitle { font-size: 12.5px; color: var(--ink-4); }
.list-tabs { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; align-items: center; }
.list-tab {
  padding: 6px 16px; border-radius: 16px; border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.6); color: #7a7068; font-size: 13px; cursor: pointer; transition: all 0.2s;
}
.list-tab:hover { border-color: rgba(138, 184, 168, 0.55); color: #5a7d68; }
.list-tab.active { background: linear-gradient(135deg, #8ab8a8, #6a9888); color: #fff; border-color: transparent; box-shadow: 0 2px 8px rgba(106, 152, 136, 0.25); }
.list-content { flex: 1; overflow-y: auto; padding: 18px 30px 50px; }
.tree-stage { margin-bottom: 22px; }
.tree-stage-title {
  font-size: 17px; font-weight: 600; color: #5a5048; margin-bottom: 12px;
  padding-left: 9px; border-left: 4px solid #8ab8a8; line-height: 1.2;
}
.tree-subject { margin-bottom: 10px; background: rgba(255, 255, 255, 0.62); border-radius: 10px; border: 1px solid rgba(139, 119, 101, 0.08); overflow: hidden; }
.tree-subject:hover { box-shadow: var(--shadow-s); }
.tree-subject-header { display: flex; align-items: center; padding: 11px 16px; cursor: pointer; user-select: none; }
.tree-subject-icon { font-size: 19px; margin-right: 10px; }
.tree-subject-name { font-size: 15px; font-weight: 600; color: #5a5048; flex: 1; }
.tree-subject-count { font-size: 12px; color: var(--ink-4); margin-right: 8px; }
.tree-subject-arrow { font-size: 11px; color: #b0a89c; transition: transform 0.25s; }
.tree-subject.open .tree-subject-arrow { transform: rotate(90deg); }
.tree-subject-body { display: none; padding: 0 14px 12px; }
.tree-subject.open .tree-subject-body { display: block; }
.tree-module { margin-bottom: 8px; border-radius: 8px; background: rgba(250, 246, 238, 0.6); }
.tree-module-header { display: flex; align-items: center; padding: 9px 13px; cursor: pointer; user-select: none; }
.tree-module-name { font-size: 13.8px; font-weight: 500; color: #6a6258; flex: 1; }
.tree-module-count { font-size: 11.5px; color: var(--ink-4); margin-right: 8px; }
.tree-module-arrow { font-size: 10px; color: #b0a89c; transition: transform 0.25s; }
.tree-module.open .tree-module-arrow { transform: rotate(90deg); }
.tree-module-body { display: none; padding: 0 12px 10px; }
.tree-module.open .tree-module-body { display: block; }
.tree-kp {
  display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 7px;
  font-size: 13.2px; color: var(--ink-2); cursor: pointer; transition: background 0.15s;
}
.tree-kp:hover { background: rgba(123, 168, 144, 0.12); }
.kp-dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(123, 168, 144, 0.6); flex-shrink: 0; }
.kp-dot.empty { background: rgba(180, 170, 155, 0.5); }
.tree-kp-grade { margin-left: auto; font-size: 11px; color: var(--ink-4); flex-shrink: 0; }
.tree-kp mark { background: linear-gradient(180deg, transparent 55%, rgba(232, 200, 120, 0.5) 55%); color: inherit; }
.list-empty { text-align: center; padding: 60px 20px; color: #b0a89c; }
.list-empty .ico { font-size: 38px; opacity: 0.5; margin-bottom: 10px; }

/* ===================== 管理视图 ===================== */
#admin-view { background: linear-gradient(180deg, #f7f2e8 0%, var(--paper) 100%); padding-top: 62px; }
.admin-wrap { flex: 1; overflow-y: auto; padding: 20px 30px 60px; }
.admin-card {
  background: rgba(255, 253, 248, 0.85); border: 1px solid var(--line);
  border-radius: 12px; padding: 18px 22px; margin-bottom: 16px;
}
.admin-card h3 { font-size: 15px; color: #5a5048; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.admin-card .desc { font-size: 12.5px; color: var(--ink-4); line-height: 1.7; margin-bottom: 12px; }
.admin-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 11.5px; color: var(--ink-3); }
.field input, .field select, .field textarea {
  padding: 7px 10px; border: 1px solid var(--line-2); border-radius: 7px; font-size: 13px;
  background: rgba(255, 255, 255, 0.75); color: var(--ink-2); outline: none; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: rgba(138, 184, 168, 0.7); box-shadow: 0 0 0 3px rgba(138, 184, 168, 0.1); }
.field textarea { min-height: 90px; resize: vertical; line-height: 1.6; }
.btn {
  padding: 7px 16px; border-radius: 7px; border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.8); color: var(--ink-2); font-size: 13px; cursor: pointer; transition: all 0.2s;
}
.btn:hover { border-color: rgba(138, 184, 168, 0.6); color: #5a7d68; }
.btn.primary { background: linear-gradient(135deg, #8ab8a8, #6a9888); color: #fff; border-color: transparent; }
.btn.primary:hover { filter: brightness(1.06); color: #fff; }
.btn.danger { color: var(--red); border-color: rgba(200, 90, 90, 0.3); }
.btn.danger:hover { background: rgba(200, 90, 90, 0.1); }
.result-box {
  margin-top: 12px; padding: 12px 14px; border-radius: 8px; font-size: 12.5px; line-height: 1.75;
  background: rgba(139, 119, 101, 0.06); white-space: pre-wrap; display: none; max-height: 320px; overflow: auto;
}
.result-box.show { display: block; }
.result-box.ok { background: rgba(123, 168, 144, 0.1); color: #4a6a58; }
.result-box.err { background: rgba(200, 90, 90, 0.08); color: #9a4a4a; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.stat-item { background: rgba(250, 246, 238, 0.8); border-radius: 10px; padding: 12px 14px; text-align: center; }
.stat-num { font-size: 22px; font-weight: 700; color: #5a7d68; }
.stat-label { font-size: 11.5px; color: var(--ink-4); margin-top: 2px; }
.paper-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px;
  background: rgba(250, 246, 238, 0.7); margin-bottom: 8px; font-size: 13px; cursor: pointer;
}
.paper-item:hover { background: rgba(123, 168, 144, 0.1); }
.paper-title { flex: 1; color: var(--ink-2); }
.paper-meta { font-size: 11.5px; color: var(--ink-4); }

/* ===================== 提示条 ===================== */
.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: rgba(61, 53, 48, 0.92); color: #faf6ee; padding: 10px 22px; border-radius: 20px;
  font-size: 13px; z-index: 900; opacity: 0; transition: all 0.3s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.loading-mask {
  position: fixed; inset: 0; z-index: 800; background: rgba(240, 232, 220, 0.7);
  display: flex; align-items: center; justify-content: center; font-size: 14px; color: var(--ink-3);
}
.loading-mask.hide { display: none; }

/* ===================== 客户端身份 chip ===================== */
.client-chip {
  display: flex; align-items: center; gap: 7px; max-width: 190px;
  background: rgba(255, 253, 248, 0.9); border: 1px solid var(--line);
  border-radius: 18px; padding: 4px 12px 4px 5px; box-shadow: var(--shadow-s);
  cursor: default; user-select: none;
}
.cc-avatar {
  width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #cfe0d4, #a8c4a0); font-size: 14px; flex-shrink: 0;
}
.cc-text { display: flex; flex-direction: column; line-height: 1.15; overflow: hidden; }
.cc-text b { font-size: 11.5px; color: var(--ink-2); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-text i { font-size: 9.5px; color: var(--ink-4); font-style: normal; letter-spacing: 0.04em; }

/* ===================== 后台顶栏 / 页签 ===================== */
#admin-view { background: linear-gradient(180deg, #f7f2e8 0%, var(--paper) 100%); padding-top: 0; }
.admin-topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 68px 30px 8px; flex-wrap: wrap;
}
.admin-brand { font-size: 17px; font-weight: 600; color: #5a5048; }
.admin-topbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.admin-user { font-size: 12px; color: var(--ink-3); background: rgba(123,168,144,0.12); padding: 4px 10px; border-radius: 12px; }
.admin-user.ok { color: #4a7a62; background: rgba(123,168,144,0.18); }

.admin-tabs {
  display: flex; gap: 6px; padding: 6px 30px 0; flex-wrap: wrap;
  border-bottom: 1px solid var(--line); overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.admin-tab {
  padding: 8px 16px; border: 1px solid transparent; border-bottom: none;
  background: transparent; color: #7a7068; font-size: 13.5px; cursor: pointer;
  border-radius: 10px 10px 0 0; white-space: nowrap; transition: all 0.2s;
}
.admin-tab:hover { color: #5a7d68; background: rgba(123,168,144,0.08); }
.admin-tab.active {
  background: rgba(255, 253, 248, 0.95); color: #4a7a62; font-weight: 600;
  border-color: var(--line); box-shadow: 0 -2px 8px rgba(139,119,101,0.05);
}
.admin-pane { display: none; }
.admin-pane.active { display: block; animation: fadeIn 0.25s ease; }

.admin-subtabs { display: flex; gap: 6px; margin: 4px 0 14px; flex-wrap: wrap; }
.admin-subtab {
  padding: 5px 14px; border-radius: 14px; border: 1px solid var(--line-2);
  background: rgba(255,255,255,0.6); color: #7a7068; font-size: 12.5px; cursor: pointer;
}
.admin-subtab.active { background: linear-gradient(135deg, #8ab8a8, #6a9888); color: #fff; border-color: transparent; }

.admin-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.btn-sm { padding: 5px 11px; font-size: 12px; }
.hint-text { font-size: 11.5px; color: var(--ink-4); }
.form-control { padding: 7px 10px; border: 1px solid var(--line-2); border-radius: 7px; background: rgba(255,255,255,0.75); color: var(--ink-2); font-size: 13px; }

/* ===================== 图表 ===================== */
.chart-box { width: 100%; overflow-x: auto; }
.bar-chart { display: flex; align-items: flex-end; gap: 4px; height: 130px; padding: 6px 2px 0; min-width: 320px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 16px; }
.bar-col .bar {
  width: 100%; max-width: 26px; background: linear-gradient(180deg, #8ab8a8, #6a9888);
  border-radius: 3px 3px 0 0; min-height: 2px; transition: height 0.4s ease;
}
.bar-col .bar.zero { background: rgba(139,119,101,0.18); }
.bar-col .bar-val { font-size: 9.5px; color: var(--ink-4); }
.bar-col .bar-lab { font-size: 9.5px; color: var(--ink-4); white-space: nowrap; }
.hbar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.hbar-label { width: 62px; font-size: 12.5px; color: var(--ink-3); flex-shrink: 0; }
.hbar-track { flex: 1; height: 18px; background: rgba(139,119,101,0.08); border-radius: 9px; overflow: hidden; }
.hbar-fill { height: 100%; background: linear-gradient(90deg, #a8c4a0, #6a9888); border-radius: 9px; transition: width 0.5s ease; }
.hbar-val { width: 46px; text-align: right; font-size: 12px; color: var(--ink-2); flex-shrink: 0; }
.device-icon { margin-right: 4px; }
.path-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px dashed rgba(139,119,101,0.12); }
.path-row:last-child { border-bottom: none; }
.path-name { flex: 1; font-size: 12.5px; color: var(--ink-2); word-break: break-all; font-family: ui-monospace, Consolas, monospace; }
.path-count { font-size: 12px; color: #5a7d68; font-weight: 600; }

/* ===================== 数据列表（客户端 / 访问记录） ===================== */
.data-list { display: flex; flex-direction: column; gap: 8px; }
.data-card {
  background: rgba(250, 246, 238, 0.72); border: 1px solid rgba(139,119,101,0.1);
  border-radius: 10px; padding: 11px 14px;
}
.data-card:hover { border-color: rgba(123,168,144,0.3); }
.dc-main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.dc-id {
  font-family: ui-monospace, Consolas, monospace; font-size: 12px; font-weight: 700;
  background: rgba(123,168,144,0.16); color: #4a7a62; padding: 2px 8px; border-radius: 6px;
}
.dc-name { font-size: 13.5px; font-weight: 600; color: var(--ink-2); }
.dc-badge { font-size: 10.5px; padding: 2px 8px; border-radius: 8px; background: rgba(139,119,101,0.1); color: var(--ink-3); }
.dc-badge.mobile { background: rgba(200,170,120,0.18); color: #8a6d3b; }
.dc-badge.tablet { background: rgba(168,140,180,0.18); color: #7a5e8a; }
.dc-badge.desktop { background: rgba(106,125,160,0.16); color: #4a5a7a; }
.dc-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.dc-item { font-size: 11.8px; color: var(--ink-3); }
.dc-item i { font-style: normal; color: var(--ink-4); margin-right: 4px; }
.dc-item.mono { font-family: ui-monospace, Consolas, monospace; }
.dc-actions { margin-left: auto; display: flex; gap: 6px; }
.link-btn { background: none; border: none; color: #5a8a78; font-size: 11.8px; cursor: pointer; padding: 2px 4px; }
.link-btn:hover { text-decoration: underline; }

/* ===================== 登录门禁 ===================== */
.admin-gate {
  position: absolute; inset: 0; z-index: 60;
  display: flex; align-items: flex-start; justify-content: center; padding: 20px;
  background: rgba(240, 232, 220, 0.92); backdrop-filter: blur(6px);
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.admin-gate.hide { display: none; }
.login-card {
  margin: auto;
  width: 340px; max-width: 100%; background: rgba(255, 253, 248, 0.98);
  border: 1px solid var(--line); border-radius: 16px; padding: 28px 26px 22px;
  box-shadow: 0 12px 40px rgba(139,119,101,0.18); text-align: center;
}
.login-logo { font-size: 40px; margin-bottom: 6px; }
.login-card h2 { font-size: 18px; color: #4a4038; margin-bottom: 4px; }
.login-sub { font-size: 12.5px; color: var(--ink-4); margin-bottom: 16px; }
.login-card form { display: flex; flex-direction: column; gap: 10px; }
.login-card input {
  padding: 10px 14px; border: 1px solid var(--line-2); border-radius: 9px;
  font-size: 14px; text-align: center; letter-spacing: 0.1em; outline: none; background: #fff;
}
.login-card input:focus { border-color: #8ab8a8; box-shadow: 0 0 0 3px rgba(138,184,168,0.12); }
.login-card .btn { padding: 10px; font-size: 14px; }
.login-tip { margin-top: 12px; font-size: 12.5px; min-height: 18px; color: var(--red); }
.login-tip.ok { color: #4a7a62; }
.login-hint { margin-top: 10px; font-size: 11.5px; color: var(--ink-4); line-height: 1.7; }
.login-hint code { background: rgba(139,119,101,0.1); padding: 1px 6px; border-radius: 4px; }
.lock-countdown { font-size: 13px; color: #9a5a52; font-weight: 600; }

/* ===================== 页脚（备案信息） ===================== */
.site-footer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 260;
  height: 28px; display: flex; align-items: center; justify-content: center;
  gap: 6px; padding: 0 14px;
  font-size: 11.5px; color: #9a9084; letter-spacing: 0.02em;
  background: linear-gradient(0deg, rgba(240, 232, 220, 0.96) 30%, rgba(240, 232, 220, 0));
  pointer-events: none;
}
.site-footer a { pointer-events: auto; color: #8a8074; text-decoration: none; border-bottom: 1px dotted rgba(154,144,132,0.5); }
.site-footer a:hover { color: #5a7d68; border-bottom-color: rgba(90,125,104,0.6); }
.sf-notice { opacity: 0.85; }
.sf-sep { opacity: 0.5; }

/* 页脚出现后，地图上的浮动控件整体上移 */
.map-hint { bottom: 46px; }
.zoom-controls { bottom: 44px; }
.legend { bottom: 44px; }

/* ===================== 响应式：平板 ===================== */
@media (max-width: 1080px) {
  .admin-two-col { grid-template-columns: 1fr; }
  .client-chip { max-width: 150px; }
}

@media (max-width: 900px) {
  .side-panel { width: 100%; right: -100%; }
  .search-box { width: 170px; }
  .legend { display: none; }
  .admin-topbar { padding-left: 18px; padding-right: 18px; }
  .admin-tabs { padding-left: 18px; padding-right: 18px; }
  .admin-wrap { padding-left: 18px; padding-right: 18px; }
  .list-header, .list-content { padding-left: 18px; padding-right: 18px; }
}

/* ===================== 响应式：手机 ===================== */
@media (max-width: 680px) {
  .header { flex-wrap: wrap; padding: 8px 12px; gap: 8px; align-items: center; }
  .logo { order: 1; }
  .logo-icon { width: 30px; height: 30px; font-size: 15px; }
  .logo-text { font-size: 15px; }
  .logo-sub { display: none; }
  .header-spacer { order: 2; flex: 1; }
  .client-chip { order: 3; max-width: 132px; padding: 3px 9px 3px 4px; }
  .cc-text b { font-size: 11px; }
  .cc-text i { display: none; }
  .search-box { order: 4; flex: 1 1 55%; width: auto; margin-left: 0; }
  .view-toggle { order: 5; }
  .view-toggle button { padding: 5px 11px; font-size: 12px; }

  .map-nav { top: 92px; font-size: 12px; padding: 4px 8px; max-width: 92vw; overflow-x: auto; }
  .nav-crumb { padding: 4px 8px; }
  .map-hint { bottom: 108px; font-size: 11px; padding: 5px 12px; max-width: 90vw; text-align: center; }
  .zoom-controls { bottom: 38px; right: 12px; }
  .zoom-btn { width: 32px; height: 30px; }
  .site-footer {
    height: auto; min-height: 26px; flex-wrap: wrap; justify-content: center;
    padding: 3px 10px; font-size: 10.5px; line-height: 1.5; text-align: center;
    background: rgba(240, 232, 220, 0.96);
  }
  .sf-notice { display: none; }

  .side-panel { width: 100%; right: -100%; top: 0; }
  .panel-header { padding: 16px 16px 12px; }
  .panel-body { padding: 14px 16px 40px; }
  .panel-title { font-size: 18px; }

  .list-title { font-size: 18px; }
  .tree-stage-title { font-size: 15.5px; }
  .tree-subject-header { padding: 10px 12px; }
  .tree-kp { font-size: 13px; padding: 8px 10px; }

  .admin-topbar { padding-top: 92px; padding-bottom: 6px; }
  .admin-brand { font-size: 15.5px; }
  .admin-topbar-right { width: 100%; justify-content: flex-end; }
  .admin-tabs { padding-top: 4px; gap: 4px; flex-wrap: nowrap; }
  .admin-tab { padding: 7px 12px; font-size: 12.5px; }
  .admin-card { padding: 14px 14px; }
  .admin-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
  .stat-num { font-size: 18px; }
  .login-card { padding: 22px 18px 18px; }

  .data-card { padding: 10px 12px; }
  .dc-meta { gap: 3px 12px; }
  .dc-actions { margin-left: 0; width: 100%; }

  /* 图解 / 动画：窄屏不再无限缩小导致看不清，改为可横向滑动 */
  .visual-box svg, .anim-box svg { min-width: 320px; }
  .anim-box { overflow-x: auto; }
  .plain-text { font-size: 14.5px; line-height: 1.9; }
  .exercise-question { font-size: 14.5px; line-height: 1.85; }

  .admin-row input[type="text"], .admin-row select, .admin-row input[type="file"] { width: 100%; }
  .bar-chart { height: 110px; min-width: 280px; }
}

/* 横屏手机 */
@media (max-height: 480px) and (orientation: landscape) {
  .map-nav { top: 60px; }
  .admin-topbar { padding-top: 58px; }
  .legend { display: none; }
}

/* 触屏设备：禁用文字选中，手势更顺滑 */
@media (hover: none) and (pointer: coarse) {
  #map-svg { touch-action: none; }
  .continent-land, .country-land, .kp-badge { transition: none; }
  .map-hint::after { content: '（双指缩放）'; }
}

/* 减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ===================== 后台独立页面 ===================== */
.admin-page { background: #f0e8dc; height: 100vh; height: 100dvh; overflow: hidden; }
.admin-page-wrap { position: relative; height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }

/* 后台顶栏里的返回链接 */
.admin-back { text-decoration: none; margin-left: 10px; font-size: 12px; color: #7a7068; }
.admin-back:hover { color: #5a7d68; }

/* 等宽字体 */
.mono { font-family: ui-monospace, Consolas, "SF Mono", monospace; }

/* ===================== 安全防护页 ===================== */
.sec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.sec-cell {
  background: rgba(250, 246, 238, 0.8); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 3px;
}
.sec-cell i { font-style: normal; font-size: 11.5px; color: var(--ink-4); }
.sec-cell b { font-size: 15px; color: #4a4038; font-weight: 600; word-break: break-all; }
.sec-sub { font-size: 11.5px; color: var(--ink-4); line-height: 1.6; }

.sec-list { display: flex; flex-direction: column; gap: 6px; }
.sec-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: rgba(250, 246, 238, 0.7); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 12px; font-size: 12.5px;
}
.sec-ip { flex: 0 0 auto; color: #4a4038; font-size: 12.5px; }
.sec-geo { flex: 1; min-width: 120px; color: var(--ink-3); font-size: 12px; line-height: 1.5; }
.sec-count { color: #5a7d68; font-weight: 600; font-size: 12.5px; white-space: nowrap; }
.sec-reason {
  flex: 1; min-width: 100px; color: var(--ink-3); font-size: 12px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px;
}
.geo-xy { color: #b0a294; font-size: 11px; }

.sec-events { display: flex; flex-direction: column; gap: 5px; max-height: 420px; overflow-y: auto; }
.sec-event {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: rgba(250, 246, 238, 0.7); border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 12px; font-size: 12.5px;
}
.ev-time { color: var(--ink-4); font-size: 11.5px; white-space: nowrap; }
.ev-kind {
  padding: 2px 9px; border-radius: 10px; font-size: 11px; white-space: nowrap;
  background: rgba(139, 119, 101, 0.12); color: #7a7068;
}
.ev-kind.login_fail, .ev-kind.login_lock { background: rgba(200, 120, 60, 0.14); color: #a06020; }
.ev-kind.rate_limit, .ev-kind.blocked { background: rgba(200, 90, 90, 0.13); color: #9a4a4a; }
.ev-kind.ban { background: rgba(200, 90, 90, 0.2); color: #8f3f3f; font-weight: 600; }
.ev-kind.unban { background: rgba(123, 168, 144, 0.16); color: #4a7a62; }
.ev-detail { flex: 1; min-width: 120px; color: var(--ink-2); }
.ev-ip { color: var(--ink-3); font-size: 12px; white-space: nowrap; }

@media (max-width: 680px) {
  .sec-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .sec-reason { max-width: 100%; white-space: normal; }
}

/* ===================== 薄弱知识点 ===================== */
/* 顶栏入口 */
.mark-entry {
  display: flex; align-items: center; gap: 5px;
  padding: 7px 14px; border: 1px solid var(--line-2);
  background: rgba(255, 253, 248, 0.92); color: #8a7a6a;
  font-size: 13px; border-radius: 18px; cursor: pointer;
  box-shadow: var(--shadow-s); transition: all 0.2s ease; position: relative;
}
.mark-entry:hover { color: #c25555; border-color: rgba(194, 85, 85, 0.4); }
.mark-entry-ico { font-size: 13px; }
.mark-entry-count {
  min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: #d9544f; color: #fff; font-size: 10.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}

/* 薄弱面板 */
.weak-group { margin-bottom: 18px; }
.weak-group-title {
  display: flex; align-items: center; gap: 7px;
  font-size: 14px; font-weight: 700; color: var(--green-d);
  padding-bottom: 7px; margin-bottom: 8px; border-bottom: 1px solid var(--line);
}
.weak-group-count {
  font-size: 11px; color: var(--ink-4); font-weight: 500;
  background: rgba(139, 119, 101, 0.1); border-radius: 9px; padding: 1px 8px;
}
.weak-item {
  background: rgba(255, 253, 248, 0.9); border: 1px solid var(--line);
  border-radius: 10px; padding: 11px 14px; margin-bottom: 8px;
  transition: box-shadow 0.15s;
}
.weak-item:hover { box-shadow: var(--shadow-s); }
.weak-main {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; cursor: pointer;
}
.weak-type {
  font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 10px; white-space: nowrap;
}
.weak-name { font-size: 13.5px; font-weight: 600; color: var(--ink-2); flex: 1; min-width: 120px; }
.weak-grade { font-size: 11px; color: var(--ink-4); background: rgba(139,119,101,0.1); padding: 1px 7px; border-radius: 8px; }
.weak-sub {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: 5px; font-size: 11.5px; color: var(--ink-4); flex-wrap: wrap;
}
.weak-path { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
.weak-review { color: #5a7d68; }
.weak-review.due { color: #d9544f; font-weight: 600; }
.weak-note {
  margin-top: 6px; font-size: 12px; color: var(--ink-3);
  background: rgba(139, 119, 101, 0.07); border-radius: 7px; padding: 5px 9px;
}
.weak-ops {
  display: flex; align-items: center; gap: 6px; margin-top: 8px; flex-wrap: wrap;
}
.weak-days-label { font-size: 11.5px; color: var(--ink-4); }
.weak-days {
  font-size: 12px; padding: 3px 6px; border: 1px solid var(--line-2);
  border-radius: 7px; background: #fffdf8; color: var(--ink-2);
}
.weak-del { color: #a06060 !important; border-color: rgba(194, 85, 85, 0.3) !important; }

/* 详情面板标记条 */
.panel-mark-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: rgba(179, 147, 47, 0.09); border: 1px solid rgba(179, 147, 47, 0.2);
  border-radius: 10px; padding: 8px 12px; margin-bottom: 16px;
}
.pm-status { font-size: 12px; color: var(--ink-4); flex: 1; }
.pm-chip { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 10px; background: rgba(179,147,47,0.13); }
.pm-info { font-size: 11.5px; color: var(--ink-3); flex: 1; min-width: 120px; }
.pm-ops { display: flex; gap: 6px; }
.pm-del { color: #a06060 !important; border-color: rgba(194, 85, 85, 0.3) !important; }

/* 列表知识点行徽章 */
.tree-kp-mark {
  font-size: 10.5px; font-weight: 600; padding: 1px 7px; border-radius: 9px;
  white-space: nowrap; flex: 0 0 auto;
}

/* 标记弹窗 */
.mark-modal {
  position: fixed; inset: 0; z-index: 600;
  display: flex; align-items: center; justify-content: center; padding: 18px;
  background: rgba(74, 60, 48, 0.42); backdrop-filter: blur(4px);
}
.mark-dialog {
  width: 380px; max-width: 100%; background: #fdfaf4;
  border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow-l); padding: 22px 24px;
  animation: fadeIn 0.2s ease;
}
.mark-dialog h3 { font-size: 16px; color: var(--ink-2); margin-bottom: 6px; }
.mark-desc { font-size: 12px; color: var(--ink-4); line-height: 1.6; margin-bottom: 14px; }
.mark-types { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 14px; }
.mark-type {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 8px; border: 1.5px solid var(--line-2); border-radius: 10px;
  background: #fffdf8; color: var(--ink-3); font-size: 13px; cursor: pointer; transition: all 0.15s;
}
.mark-type:hover { border-color: var(--green); color: var(--green-d); }
.mt-emoji { font-size: 15px; }
.mark-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.mark-row label { font-size: 12.5px; color: var(--ink-3); flex: 0 0 58px; }
.mark-row select, .mark-row input {
  flex: 1; font-size: 12.5px; padding: 7px 9px; border: 1px solid var(--line-2);
  border-radius: 8px; background: #fff; color: var(--ink-2);
}
.mark-next-hint { font-size: 11px; color: var(--ink-4); white-space: nowrap; }
.mark-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }

/* 到期提醒横幅 */
.review-banner {
  position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 350;
  display: flex; align-items: center; gap: 14px; max-width: 640px; width: calc(100% - 40px);
  background: rgba(255, 250, 240, 0.98); border: 1px solid rgba(217, 84, 79, 0.35);
  border-radius: 12px; box-shadow: var(--shadow-m);
  padding: 10px 14px; font-size: 12.5px; color: var(--ink-2);
  animation: fadeIn 0.3s ease;
}
.rb-text { flex: 1; line-height: 1.6; min-width: 0; }
.rb-name {
  display: inline-block; margin: 0 2px; padding: 1px 7px; border-radius: 8px;
  background: rgba(217, 84, 79, 0.1); color: #b04843; font-size: 11.5px;
}
.rb-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.rb-btn { border-color: rgba(194, 85, 85, 0.3); color: #b04843; }
.rb-close { border-color: transparent; background: transparent; color: var(--ink-4); }

@media (max-width: 680px) {
  .mark-entry { padding: 6px 10px; font-size: 12px; }
  .review-banner { top: 56px; flex-direction: column; align-items: flex-start; gap: 6px; }
  /* 时钟浮层：手机端进一步缩小，保证完整显示 */
  .clock-dialog { padding: 26px 16px 20px; width: min(360px, 94vw); }
  .clock-time { font-size: clamp(40px, 13vw, 60px); letter-spacing: 2px; }
  .clock-date { font-size: clamp(18px, 5.5vw, 24px); }
  .clock-week { font-size: clamp(14px, 4.5vw, 17px); margin: 6px 0 14px; }
  .clock-close { margin-top: 18px; }
}

/* ===================== 按学科复习 ===================== */
.weak-review-subject {
  margin-left: auto; color: var(--green-d) !important;
  border-color: rgba(90, 125, 104, 0.35) !important;
}
.weak-rev-one { color: var(--green-d) !important; border-color: rgba(90, 125, 104, 0.35) !important; }

.review-dialog { width: 430px; }
.review-progress { font-size: 12px; color: var(--ink-4); margin-bottom: 10px; }
.review-card {
  display: flex; flex-direction: column; gap: 8px;
  background: #fffdf8; border: 1px solid var(--line);
  border-radius: 12px; padding: 18px 16px; min-height: 110px;
}
.review-type { align-self: flex-start; font-size: 11.5px; font-weight: 700; padding: 2px 10px; border-radius: 10px; }
.review-name { font-size: 17px; font-weight: 700; color: var(--ink-2); line-height: 1.5; }
.review-grade { font-size: 12px; color: var(--ink-4); }
.review-date { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.review-date.due { color: #d9544f; font-weight: 600; }
.review-ops { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.review-grow { flex: 1; min-width: 160px; }
.review-finished { text-align: center; padding: 18px 6px 6px; }
.rf-ico { font-size: 40px; margin-bottom: 8px; }
.rf-text { font-size: 14.5px; font-weight: 700; color: var(--ink-2); line-height: 1.6; }
.rf-hint { font-size: 12px; color: var(--ink-4); margin: 8px 0 16px; line-height: 1.6; }

/* ===================== 后台：薄弱点 ===================== */
.mark-stat-grid { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; }
.mark-stat {
  font-size: 12px; color: var(--ink-3); padding: 5px 12px;
  border: 1px solid var(--line-2); border-radius: 14px; background: rgba(255,253,248,0.85);
}
.mark-stat b { font-size: 14px; margin: 0 2px; }
.mark-stat.big b { font-size: 17px; }
.mark-stat.due { color: #c25555; border-color: rgba(194,85,85,0.35); background: rgba(217,84,79,0.06); }
.mark-row-card {
  background: rgba(255, 253, 248, 0.92); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 14px; margin-bottom: 8px;
}
.markc-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.markc-name { font-size: 14px; font-weight: 700; color: var(--ink-2); flex: 1; min-width: 140px; }
.markc-meta { font-size: 11.5px; color: var(--ink-4); }
.markc-sub {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-top: 7px; font-size: 12px; color: var(--ink-3);
}
.markc-due { color: #d9544f; font-weight: 700; }
.markc-note {
  margin-top: 7px; font-size: 12px; color: var(--ink-3);
  background: rgba(139, 119, 101, 0.07); border-radius: 7px; padding: 5px 9px;
}
.markc-ops { margin-top: 8px; display: flex; justify-content: flex-end; }
.markc-del { color: #a06060 !important; border-color: rgba(194, 85, 85, 0.3) !important; }
.due-check { display: flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }

/* ===================== 薄弱面板 Tabs ===================== */
.weak-tabs { display: flex; gap: 6px; padding: 8px 16px 0; border-bottom: 1px solid var(--line); }
.weak-tab {
  padding: 6px 14px; font-size: 12.5px; border-radius: 12px 12px 0 0;
  border: 1px solid transparent; border-bottom: none;
  background: transparent; color: var(--ink-4); cursor: pointer;
}
.weak-tab.active {
  background: #fffdf8; color: var(--ink-2); font-weight: 700;
  border-color: var(--line); margin-bottom: -1px;
  box-shadow: 0 -2px 6px rgba(60, 45, 30, 0.05);
}

/* ===================== 习题答题区 ===================== */
.exercise-do {
  margin: 10px 0 6px; padding: 10px 12px;
  border: 1px dashed var(--line-2); border-radius: 10px; background: rgba(255, 253, 248, 0.7);
}
.do-tip { font-size: 11.5px; color: var(--ink-4); margin-bottom: 8px; }
.do-options { display: flex; flex-direction: column; gap: 6px; }
.do-opt {
  display: flex; align-items: flex-start; gap: 8px; text-align: left;
  font-size: 12.5px; color: var(--ink-3); padding: 6px 10px;
  border: 1px solid var(--line-2); border-radius: 8px; background: #fff; cursor: pointer;
}
.do-opt:hover { border-color: var(--green-d); color: var(--ink-2); }
.do-opt-letter { font-weight: 700; color: var(--green-d); flex-shrink: 0; }
.do-btns { display: flex; gap: 8px; }
.do-btn {
  flex: 1; padding: 7px 10px; font-size: 12.5px; border-radius: 8px;
  border: 1px solid var(--line-2); background: #fff; color: var(--ink-3); cursor: pointer;
}
.do-btn.wrong { color: #a06060; }
.do-btn:hover { border-color: var(--green-d); }
.do-btn.wrong:hover { border-color: #c25555; }
.do-result { margin-top: 8px; font-size: 12.5px; font-weight: 700; }
.do-ok { color: var(--green-d); }
.do-bad { color: #c25555; }
.exercise-do.answered-ok { border-color: rgba(90, 125, 104, 0.5); background: rgba(90, 125, 104, 0.05); }
.exercise-do.answered-bad { border-color: rgba(217, 84, 79, 0.45); background: rgba(217, 84, 79, 0.05); }

/* ===================== 错题本 ===================== */
.wrong-item .weak-main { cursor: pointer; }
.wrong-question {
  margin-top: 6px; font-size: 12.5px; color: var(--ink-3); line-height: 1.6;
  padding: 6px 9px; background: rgba(217, 84, 79, 0.05);
  border-left: 3px solid rgba(217, 84, 79, 0.35); border-radius: 0 6px 6px 0;
}
.weak-marked-chip { font-size: 12px; color: #5a7d68; font-weight: 600; padding: 4px 10px; }
.weak-confirm { color: var(--green-d) !important; border-color: rgba(90, 125, 104, 0.35) !important; }
.weak-ignore { color: var(--ink-4); }

/* ===================== 顶栏时钟 / 闹钟按钮 ===================== */
.clock-btn {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line-2); background: rgba(255, 253, 248, 0.9);
  font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.15s; flex-shrink: 0;
}
.clock-btn:hover { border-color: var(--green-d); transform: scale(1.06); }

/* ===================== 放大时钟浮层 ===================== */
.clock-overlay {
  position: fixed; inset: 0; z-index: 900;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(60, 46, 36, 0.6); backdrop-filter: blur(4px);
}
.clock-dialog {
  width: min(400px, 92vw);
  background: #fdfaf4; border: 1px solid var(--line); border-radius: 20px;
  box-shadow: var(--shadow-l);
  text-align: center; color: var(--ink-2); user-select: none;
  padding: 34px 24px 26px;
  animation: fadeIn 0.25s ease;
}
.clock-date { font-size: clamp(22px, 7vw, 32px); font-weight: 700; letter-spacing: 2px; }
.clock-week { font-size: clamp(15px, 5vw, 21px); margin: 8px 0 20px; color: var(--ink-3); }
.clock-time {
  font-size: clamp(46px, 15vw, 84px); font-weight: 800; line-height: 1.1;
  font-variant-numeric: tabular-nums; letter-spacing: 3px;
  color: var(--ink-1);
}
.clock-close {
  margin-top: 26px; display: inline-block;
  font-size: 13px; color: var(--ink-4); cursor: pointer; letter-spacing: 1px;
  border: 1px solid var(--line-2); border-radius: 8px;
  padding: 7px 20px; background: #fff; transition: all 0.15s;
}
.clock-close:hover { color: var(--green-d); border-color: var(--green-d); }

/* ===================== 闹钟面板 ===================== */
.alarm-overlay {
  position: fixed; inset: 0; z-index: 900;
  display: flex; align-items: center; justify-content: center; padding: 18px;
  background: rgba(60, 46, 36, 0.5); backdrop-filter: blur(4px);
}
.alarm-dialog {
  width: 340px; max-width: 100%; background: #fdfaf4;
  border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-l);
  padding: 20px 22px; animation: fadeIn 0.2s ease;
}
.alarm-dialog h3 { font-size: 16px; color: var(--ink-2); margin-bottom: 14px; }
.alarm-add { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; }
.alarm-add select {
  padding: 7px 6px; border: 1px solid var(--line-2); border-radius: 8px;
  background: #fff; color: var(--ink-2); font-size: 13px;
}
.al-colon { font-size: 16px; font-weight: 700; color: var(--ink-3); }
.al-rep-check {
  display: flex; align-items: center; gap: 3px; margin-left: 6px;
  font-size: 12px; color: var(--ink-3); white-space: nowrap; cursor: pointer;
}
.alarm-add .btn { margin-left: auto; }
.alarm-list { max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.alarm-empty { font-size: 12.5px; color: var(--ink-4); text-align: center; padding: 16px 0; }
.alarm-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fff;
}
.al-time { font-size: 16px; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.al-rep { font-size: 11.5px; color: var(--ink-4); }
.al-del {
  margin-left: auto; border: 1px solid var(--line-2); border-radius: 7px;
  background: #fff; color: #a06060; font-size: 12px; padding: 4px 9px; cursor: pointer;
}
.al-del:hover { border-color: #c25555; }
.alarm-foot { display: flex; justify-content: flex-end; margin-top: 14px; }

/* ===================== 闹钟响铃 ===================== */
.alarm-ring {
  position: fixed; inset: 0; z-index: 950;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(60, 46, 36, 0.6); backdrop-filter: blur(6px);
}
.alarm-ring-dialog {
  width: 320px; max-width: 100%; text-align: center; background: #fdfaf4;
  border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-l);
  padding: 30px 24px; animation: fadeIn 0.2s ease;
}
.ar-ico { font-size: 56px; animation: ringWiggle 0.6s infinite alternate; }
.ar-title { font-size: 20px; font-weight: 700; color: var(--ink-2); margin: 14px 0 6px; }
.ar-now { font-size: 12.5px; color: var(--ink-4); margin-bottom: 20px; }
.ar-btn { width: 100%; }
@keyframes ringWiggle {
  from { transform: rotate(-10deg) scale(1); }
  to { transform: rotate(10deg) scale(1.08); }
}

/* ===================== 详情页掌握度条 ===================== */
.panel-prof {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0 18px 10px; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: 10px;
}
.pp-label { font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.pp-bar {
  flex: 1; min-width: 90px; height: 7px; border-radius: 4px;
  background: rgba(139, 119, 101, 0.14); overflow: hidden;
}
.pp-fill { display: block; height: 100%; border-radius: 4px; transition: width 0.4s ease; }
.pp-meta { font-size: 11.5px; color: var(--ink-4); white-space: nowrap; }

/* ===================== 掌握度列表 ===================== */
.prof-bar {
  margin-top: 8px; height: 6px; border-radius: 3px;
  background: rgba(139, 119, 101, 0.14); overflow: hidden;
}
.prof-bar-fill { display: block; height: 100%; border-radius: 3px; }
