/* ============================================================
   Aixyun Learning OS — 统一绿色视觉体系
   ============================================================ */
:root {
  --accent: #1a9e54;
  --accent-strong: #157a41;
  --accent-soft: rgba(26, 158, 84, 0.14);
  --dock-size: 56px;
  --radius: 10px;
  --radius-lg: 14px;
  --font: -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}

body[data-theme="light"] {
  --text: #14261b;
  --text-2: #4d5f54;
  --panel: rgba(255, 255, 255, 0.82);
  --panel-solid: #ffffff;
  --panel-border: rgba(20, 60, 35, 0.12);
  --bar: rgba(250, 252, 250, 0.72);
  --input-bg: rgba(255, 255, 255, 0.9);
  --hover: rgba(26, 158, 84, 0.08);
  --shadow: 0 8px 30px rgba(15, 45, 28, 0.18);
}
body[data-theme="dark"] {
  --text: #e8f2ec;
  --text-2: #9db3a6;
  --panel: rgba(22, 32, 26, 0.86);
  --panel-solid: #1a2620;
  --panel-border: rgba(255, 255, 255, 0.1);
  --bar: rgba(16, 24, 19, 0.72);
  --input-bg: rgba(10, 16, 12, 0.6);
  --hover: rgba(255, 255, 255, 0.07);
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: var(--font);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
button, input, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
.hidden { display: none !important; }

/* 键盘焦点 */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ============================================================
   桌面与壁纸
   ============================================================ */
#desktop {
  position: fixed;
  inset: 0;
  background-color: #274b33;
  background-size: cover;
  background-position: center;
  transition: background-image 0.4s ease;
}
#desktop.wall-campus { background-image: url("清华大学图片.jpg"); }
#desktop.wall-green  { background-image: linear-gradient(160deg, #1d5c38 0%, #123a24 60%, #0c291a 100%); }
#desktop.wall-night  { background-image: linear-gradient(170deg, #101c26 0%, #0a1218 55%, #060b0f 100%); }

/* ============================================================
   顶部状态栏
   ============================================================ */
#statusbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: var(--bar);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  font-size: 13px;
  color: var(--text);
  z-index: 40;
  user-select: none;
}
.sb-left, .sb-right { display: flex; align-items: center; gap: 12px; }
.sb-logo { color: var(--accent); font-size: 14px; }
.sb-os { font-weight: 600; }
.sb-divider { width: 1px; height: 14px; background: var(--panel-border); }
.sb-item { display: inline-flex; align-items: center; gap: 5px; color: var(--text-2); }
.sb-clock { color: var(--text); font-variant-numeric: tabular-nums; }
#sbNet.offline { color: #c0392b; }

/* ============================================================
   学习驾驶舱
   ============================================================ */
#cockpit {
  position: absolute;
  top: 34px; left: 0; right: 0; bottom: 0;
  padding: 28px clamp(20px, 5vw, 72px) 110px;
  overflow-y: auto;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
#cockpit.collapsed {
  opacity: 0;
  transform: scale(0.985);
  pointer-events: none;
}
.cockpit-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 20px;
  color: #fff;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.45);
}
#greeting { font-size: clamp(24px, 3.4vw, 36px); font-weight: 700; }
.greet-date { font-size: 14px; opacity: 0.92; margin-top: 4px; }
.cockpit-goal { font-size: 13px; opacity: 0.92; }

.cockpit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  max-width: 1180px;
}
.widget {
  background: var(--panel);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  min-height: 150px;
  display: flex;
  flex-direction: column;
}
.widget-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 12px;
  letter-spacing: 0.02em;
}
.cockpit-hint {
  margin-top: 18px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5);
}

/* 学科进度 */
.subjects { display: flex; flex-direction: column; gap: 10px; }
.subject-row { display: grid; grid-template-columns: 44px 1fr 40px; align-items: center; gap: 10px; font-size: 13px; }
.subject-row button { all: unset; cursor: pointer; display: contents; }
.subject-name { font-weight: 500; }
.subject-bar { height: 6px; border-radius: 3px; background: var(--accent-soft); overflow: hidden; }
.subject-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.4s ease; }
.subject-pct { text-align: right; color: var(--text-2); font-variant-numeric: tabular-nums; }

/* 任务列表（驾驶舱 & 自习共用） */
.task-list { list-style: none; flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; min-height: 40px; }
.task-list li {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px;
  padding: 6px 8px;
  border-radius: 8px;
  transition: background 0.15s ease;
}
.task-list li:hover { background: var(--hover); }
.task-list li.done .task-text { text-decoration: line-through; opacity: 0.55; }
.task-check {
  width: 17px; height: 17px; flex: none;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 11px; line-height: 1;
  transition: background 0.15s ease;
}
li.done .task-check { background: var(--accent); }
.task-text { flex: 1; word-break: break-all; }
.task-del { opacity: 0; color: var(--text-2); font-size: 14px; padding: 0 4px; border-radius: 4px; }
.task-list li:hover .task-del, .task-list li:focus-within .task-del { opacity: 0.9; }
.task-del:hover { color: #c0392b; }
.task-empty { color: var(--text-2); font-size: 12.5px; padding: 4px 2px; }
.task-list.dark li:hover { background: rgba(255, 255, 255, 0.08); }
.task-list.dark .task-check { border-color: #7fd6a4; }
.task-list.dark li.done .task-check { background: #2ea566; }

.task-add { display: flex; gap: 8px; margin-top: 10px; }
.task-add input {
  flex: 1; min-width: 0;
  padding: 7px 10px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: var(--input-bg);
}
.focus-panel .task-add input { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.18); color: #eef6f0; }
.focus-panel .task-add input::placeholder { color: rgba(255,255,255,0.45); }

/* 继续学习 / 今日专注 */
.continue-subject { font-size: 20px; font-weight: 700; }
.continue-topic { font-size: 13px; color: var(--text-2); margin: 4px 0 14px; flex: 1; }
.focus-time { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.goal-bar { height: 6px; border-radius: 3px; background: var(--accent-soft); overflow: hidden; margin: 10px 0 6px; }
.goal-bar-fill { height: 100%; width: 0; background: var(--accent); border-radius: 3px; transition: width 0.4s ease; }
.goal-text { font-size: 12px; color: var(--text-2); flex: 1; }
.widget .btn { align-self: flex-start; }

/* ============================================================
   按钮
   ============================================================ */
.btn {
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 13px;
  border: 1px solid var(--panel-border);
  background: var(--panel-solid);
  transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}
.btn:hover { background: var(--hover); box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--accent-strong); }
.btn-danger { color: #c0392b; border-color: rgba(192, 57, 43, 0.4); }
.btn-danger:hover { background: rgba(192, 57, 43, 0.1); }
.btn-ghost-light { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.22); color: #f2f8f4; }
.btn-ghost-light:hover { background: rgba(255, 255, 255, 0.22); }
.btn-lg { padding: 10px 30px; font-size: 15px; }

/* ============================================================
   程序坞
   ============================================================ */
#dock {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bar);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--panel-border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  z-index: 40;
}
.dock-items { display: flex; align-items: flex-end; gap: 8px; }
.dock-sep { width: 1px; align-self: stretch; margin: 4px 2px; background: var(--panel-border); }
.dock-icon {
  position: relative;
  width: var(--dock-size);
  height: var(--dock-size);
  border-radius: 22%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 3px 10px rgba(10, 30, 18, 0.25);
}
.dock-icon:hover { transform: translateY(-7px) scale(1.1); }
.dock-icon.running::after {
  content: "";
  position: absolute;
  bottom: -6px; left: 50%;
  transform: translateX(-50%);
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--accent);
}
#dockLaunchpad { background: linear-gradient(150deg, #2f9e63, #157a41); }
#dock.drop-hint { outline: 2px dashed var(--accent); outline-offset: 4px; }

/* ============================================================
   Launchpad 应用中心
   ============================================================ */
.overlay { position: fixed; inset: 0; z-index: 100; }
#launchpad {
  background: rgba(12, 24, 16, 0.55);
  backdrop-filter: blur(28px) saturate(1.2);
  -webkit-backdrop-filter: blur(28px) saturate(1.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 40px 30px;
  animation: fadeIn 0.18s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.lp-search {
  display: flex; align-items: center; gap: 8px;
  width: min(320px, 80vw);
  padding: 8px 14px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  margin-bottom: 40px;
}
.lp-search input { flex: 1; background: none; border: none; outline: none; color: #fff; font-size: 14px; }
.lp-search input::placeholder { color: rgba(255, 255, 255, 0.6); }
.lp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 28px 20px;
  width: min(760px, 92vw);
}
.lp-app {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: #fff;
  border-radius: 12px;
  padding: 8px 4px;
  transition: background 0.15s ease, transform 0.15s ease;
  cursor: pointer;
}
.lp-app:hover { background: rgba(255, 255, 255, 0.12); }
.lp-app:active { transform: scale(0.94); }
.lp-app[draggable="true"] { cursor: grab; }
.lp-icon {
  width: 64px; height: 64px;
  border-radius: 22%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}
.lp-name { font-size: 13px; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5); }
.lp-soon {
  font-size: 10px;
  padding: 1px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.9);
}
.lp-app.coming .lp-icon { filter: grayscale(0.55) opacity(0.8); }
.lp-empty { grid-column: 1 / -1; text-align: center; color: rgba(255,255,255,0.75); font-size: 14px; }
.lp-hint { margin-top: auto; padding-top: 24px; font-size: 12px; color: rgba(255, 255, 255, 0.65); }

/* ============================================================
   窗口（系统偏好设置）
   ============================================================ */
.window {
  position: fixed;
  top: 90px; left: 50%;
  transform: translateX(-50%);
  width: min(860px, 94vw);
  height: min(600px, calc(100vh - 150px));
  background: var(--panel-solid);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
  z-index: 90;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.window.maximized {
  top: 40px; left: 8px; right: 8px;
  width: auto;
  height: calc(100vh - 48px);
  transform: none;
  border-radius: var(--radius);
}
.win-titlebar {
  height: 40px; flex: none;
  display: flex; align-items: center;
  padding: 0 12px;
  background: var(--bar);
  border-bottom: 1px solid var(--panel-border);
  user-select: none;
  cursor: grab;
}
.win-title { flex: 1; text-align: center; font-size: 13px; font-weight: 600; color: var(--text-2); margin-right: 52px; }
.traffic { display: flex; gap: 8px; }
.tl { width: 12px; height: 12px; border-radius: 50%; transition: filter 0.15s ease; }
.tl:hover { filter: brightness(0.85); }
.tl-close { background: #ff5f57; }
.tl-min { background: #febc2e; }
.tl-max { background: #28c840; }

.win-body { flex: 1; display: flex; min-height: 0; }
.settings-nav {
  width: 168px; flex: none;
  padding: 12px 8px;
  border-right: 1px solid var(--panel-border);
  background: var(--bar);
  display: flex; flex-direction: column; gap: 2px;
  overflow-y: auto;
}
.sn-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  text-align: left;
  color: var(--text);
  transition: background 0.15s ease;
}
.sn-item:hover { background: var(--hover); }
.sn-item.active { background: var(--accent); color: #fff; }
.sn-ico { width: 20px; text-align: center; }
.settings-content { flex: 1; overflow-y: auto; padding: 22px 26px; }
.s-section h3 { font-size: 17px; margin-bottom: 18px; }
.save-hint { margin-top: 16px; font-size: 12px; color: var(--text-2); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.form-grid label, .pwd-row label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 13px; color: var(--text-2);
}
input[type="text"], input[type="password"], input[type="number"], select {
  padding: 8px 10px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: var(--input-bg);
  color: var(--text);
  font-size: 13px;
}
input[type="text"]:focus, input[type="password"]:focus, input[type="number"]:focus, select:focus {
  border-color: var(--accent); outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.switch-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--panel-border);
  font-size: 13.5px;
  cursor: pointer;
}
.switch-row input[role="switch"], .switch-row input[type="checkbox"] {
  appearance: none;
  width: 40px; height: 24px;
  border-radius: 12px;
  background: rgba(120, 130, 124, 0.4);
  position: relative;
  transition: background 0.2s ease;
  cursor: pointer;
  flex: none;
}
.switch-row input::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}
.switch-row input:checked { background: var(--accent); }
.switch-row input:checked::after { transform: translateX(16px); }

.teacher-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.teacher-card {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px;
  border: 1.5px solid var(--panel-border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.teacher-card:hover { background: var(--hover); }
.teacher-card input { position: absolute; opacity: 0; pointer-events: none; }
.teacher-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.teacher-card:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.tc-name { font-weight: 600; font-size: 14px; }
.tc-desc { font-size: 12px; color: var(--text-2); }

.info-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--panel-border);
  font-size: 13.5px;
}
.info-row span:last-child { color: var(--text-2); }
.pwd-row { display: flex; gap: 10px; align-items: flex-end; margin: 14px 0 6px; }
.pwd-row label { flex: 1; }
.pwd-msg { font-size: 12px; color: var(--accent); min-height: 18px; margin-bottom: 6px; }
.btn-row { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }

.ap-block { margin-bottom: 20px; }
.ap-label { font-size: 13px; color: var(--text-2); margin-bottom: 8px; }
.seg { display: inline-flex; border: 1px solid var(--panel-border); border-radius: 9px; overflow: hidden; }
.seg-item { padding: 7px 20px; font-size: 13px; transition: background 0.15s ease; }
.seg-item:hover { background: var(--hover); }
.seg-item.active { background: var(--accent); color: #fff; }
.swatches { display: flex; gap: 12px; }
.swatch {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--sw);
  border: 2px solid transparent;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.swatch:hover { transform: scale(1.12); }
.swatch.active { border-color: var(--text); box-shadow: 0 0 0 3px var(--accent-soft); }
.wall-choices { display: flex; gap: 10px; }
.wall-chip {
  padding: 8px 18px;
  border: 1.5px solid var(--panel-border);
  border-radius: 9px;
  font-size: 13px;
  transition: all 0.15s ease;
}
.wall-chip:hover { background: var(--hover); }
.wall-chip.active { border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
input[type="range"] { width: min(320px, 100%); accent-color: var(--accent); }

/* ============================================================
   沉浸式自习
   ============================================================ */
#focus { display: flex; flex-direction: column; color: #eef6f0; }
.focus-bg {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(5, 14, 9, 0.82), rgba(5, 14, 9, 0.88)),
    url("清华大学图片.jpg");
  background-size: cover;
  background-position: center;
  filter: saturate(0.7);
}
#focus.wall-green .focus-bg { background-image: linear-gradient(160deg, #10361f, #081f12); filter: none; }
#focus.wall-night .focus-bg { background-image: linear-gradient(170deg, #0e1822, #050a0e); filter: none; }

.focus-top {
  position: relative;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px;
}
.focus-tip {
  font-size: 13.5px;
  color: rgba(210, 235, 220, 0.85);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 7px 16px;
}
.focus-main {
  position: relative;
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 18px;
  padding: 6px 22px 22px;
  min-height: 0;
}
.focus-left {
  display: flex; flex-direction: column; gap: 16px;
  overflow-y: auto;
  min-height: 0;
  padding-right: 4px;
}
.timer-box {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 22px 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
}
.timer-presets { display: flex; gap: 8px; }
.tp-item {
  padding: 5px 14px;
  border-radius: 16px;
  font-size: 13px;
  color: rgba(230, 245, 236, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.18);
  transition: all 0.15s ease;
}
.tp-item:hover { background: rgba(255, 255, 255, 0.12); }
.tp-item.active { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.timer-display {
  font-size: clamp(56px, 9vw, 84px);
  font-weight: 200;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.03em;
  line-height: 1.1;
}
.timer-display.running { color: #8be0ae; }
.timer-controls { display: flex; gap: 12px; align-items: center; }

.focus-panel {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
}
.fp-title { font-size: 13px; font-weight: 600; color: rgba(210, 235, 220, 0.75); margin-bottom: 10px; }
.fp-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.fp-row .fp-title { margin-bottom: 0; }
.fp-row select { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.18); color: #eef6f0; }
.fp-row select option { color: #14261b; }
.stats-row { display: flex; gap: 10px; }
.stat { flex: 1; text-align: center; padding: 8px 4px; background: rgba(255,255,255,0.05); border-radius: 10px; }
.stat-num { display: block; font-size: 17px; font-weight: 700; color: #9fe5bb; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 11.5px; color: rgba(210, 235, 220, 0.6); }

/* AI 面板 */
.ai-panel {
  display: flex; flex-direction: column;
  background: rgba(14, 24, 18, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  min-height: 0;
  overflow: hidden;
}
.ai-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.ai-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent);
  color: #fff; font-weight: 700; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}
.ai-name { font-size: 14px; font-weight: 600; }
.ai-persona { font-size: 11.5px; color: rgba(210, 235, 220, 0.6); }
.ai-messages {
  flex: 1; overflow-y: auto;
  padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.ai-msg {
  max-width: 92%;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.ai-msg.user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.ai-msg.bot { align-self: flex-start; background: rgba(255, 255, 255, 0.1); border-bottom-left-radius: 4px; }
.ai-msg img { max-width: 100%; border-radius: 8px; margin-top: 6px; display: block; }
.ai-quick { display: flex; gap: 6px; padding: 0 14px 10px; flex-wrap: wrap; }
.chip {
  font-size: 12px;
  padding: 5px 11px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(235, 248, 240, 0.9);
  transition: background 0.15s ease;
}
.chip:hover { background: rgba(255, 255, 255, 0.14); }
.ai-input-row { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.ai-input-row input {
  flex: 1; min-width: 0;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #eef6f0;
  font-size: 13px;
}
.ai-input-row input::placeholder { color: rgba(255, 255, 255, 0.4); }

/* ============================================================
   弹窗 / Toast / 工具提示
   ============================================================ */
.modal {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(8, 16, 11, 0.5);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.15s ease;
}
.modal-card {
  width: min(420px, 90vw);
  background: var(--panel-solid);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 14px;
}
.modal-card h3 { font-size: 16px; }
.report-body { font-size: 13.5px; line-height: 1.9; color: var(--text-2); }
.report-body strong { color: var(--text); }

.toast {
  position: fixed;
  left: 50%; bottom: 92px;
  transform: translateX(-50%);
  z-index: 300;
  background: rgba(16, 28, 20, 0.92);
  color: #eafff2;
  font-size: 13px;
  padding: 10px 20px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
  animation: toastIn 0.2s ease;
  max-width: 80vw;
  text-align: center;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

.tooltip {
  position: fixed;
  z-index: 400;
  background: rgba(16, 28, 20, 0.95);
  color: #eafff2;
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 7px;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.3);
}

/* ============================================================
   平板 / 小屏适配
   ============================================================ */
@media (max-width: 1024px) {
  .focus-main { grid-template-columns: 1fr 300px; }
  .settings-nav { width: 56px; padding: 12px 6px; }
  .sn-item { justify-content: center; font-size: 0; gap: 0; padding: 10px; }
  .sn-ico { font-size: 16px; width: auto; }
}
@media (max-width: 860px) {
  .focus-main { grid-template-columns: 1fr; overflow-y: auto; }
  .focus-left { overflow: visible; }
  .ai-panel { min-height: 420px; }
  .cockpit-grid { grid-template-columns: 1fr 1fr; }
  .form-grid, .teacher-options { grid-template-columns: 1fr; }
  #statusbar { font-size: 12px; }
  .sb-os { display: none; }
  .window { top: 44px; height: calc(100vh - 96px); }
}
@media (max-width: 560px) {
  .cockpit-grid { grid-template-columns: 1fr; }
  .cockpit-head { flex-direction: column; align-items: flex-start; gap: 6px; }
}

/* 滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(120, 140, 128, 0.35); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(120, 140, 128, 0.6); }
::-webkit-scrollbar-track { background: transparent; }
