/* ============================================
   美术教师工作台 · 样式系统
   移动优先 · 艺术工作室风格
   ============================================ */

:root {
  /* 色彩 */
  --ink: #1C2833;
  --primary: #3D5A80;
  --primary-light: #6B8AAD;
  --primary-dark: #2A4060;
  --accent: #E8743B;
  --accent-light: #F4A582;
  --accent-bg: #FDF0E9;
  --teal: #2A9D8F;
  --gold: #E0A458;
  --green: #5B8C5A;
  --purple: #8B5E83;
  --rust: #C44536;

  --bg: #FAFAF7;
  --surface: #FFFFFF;
  --surface-alt: #F5F5F2;
  --border: #E8E8E4;
  --border-light: #F0F0EC;
  --divider: #EDEDE9;

  --text: #2C3E50;
  --text-mute: #7B8794;
  --text-light: #A0A8B0;
  --text-white: #FFFFFF;

  /* 课型色 */
  --ct-appreciation: #3D5A80;
  --ct-modeling: #E8743B;
  --ct-design: #5B8C5A;
  --ct-comprehensive: #8B5E83;

  /* 尺寸 */
  --topbar-h: 52px;
  --bottomnav-h: 60px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;

  /* 阴影 */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --shadow-fab: 0 4px 12px rgba(232,116,59,0.4);

  /* 动画 */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

#app {
  max-width: 720px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--bg);
}

/* === 顶栏 === */
#topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.topbar-left h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.5px;
}

.icon-btn {
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: var(--text-mute);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}
.icon-btn:active { background: var(--surface-alt); }

/* === 同步状态药丸 === */
.sync-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-alt, #eef1f6);
  border: 1px solid var(--border, #e3e8ef);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 12px;
  color: var(--text-mute, #5b6b82);
  cursor: pointer;
  max-width: 46vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sync-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c2c9d6;
  flex: 0 0 auto;
}
.sync-pill.ok .dot { background: #2fae66; box-shadow: 0 0 0 3px rgba(47,174,102,0.18); }
.sync-pill.warn .dot { background: #e0a800; }
.sync-pill.ok { color: #1f8f54; }
.sync-pill.warn { color: #9a7400; }

/* === 下拉菜单 === */
.dropdown {
  position: fixed;
  top: var(--topbar-h);
  right: 12px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  overflow: hidden;
  min-width: 140px;
}
.dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  border: none;
  background: none;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
}
.dropdown button:active { background: var(--surface-alt); }
.dropdown button + button { border-top: 1px solid var(--border-light); }

/* === 内容区 === */
#content {
  flex: 1;
  padding: 16px;
  padding-bottom: calc(var(--bottomnav-h) + var(--safe-bottom) + 16px);
  overflow-y: auto;
}

/* === 底部导航 === */
#bottomnav {
  height: var(--bottomnav-h);
  padding-bottom: var(--safe-bottom);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 720px;
  z-index: 100;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text-light);
  text-decoration: none;
  font-size: 11px;
  font-weight: 500;
  transition: color 0.2s var(--ease);
  cursor: pointer;
}
.nav-item svg { fill: currentColor; }
.nav-item.active { color: var(--primary); }
.nav-item:active { color: var(--accent); }

/* === 浮动按钮 === */
.fab {
  position: fixed;
  bottom: calc(var(--bottomnav-h) + var(--safe-bottom) + 20px);
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  border: none;
  box-shadow: var(--shadow-fab);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 90;
  transition: transform 0.2s var(--ease);
}
.fab svg { fill: white; }
.fab:active { transform: scale(0.92); }

/* === 手机录入悬浮按钮（电脑端，扫本地服务二维码） === */
.phone-sync-btn {
  position: fixed;
  bottom: calc(var(--bottomnav-h) + var(--safe-bottom) + 20px);
  left: 20px;
  height: 44px;
  padding: 0 16px;
  border-radius: 22px;
  background: var(--primary);
  color: #fff;
  border: none;
  box-shadow: var(--shadow-fab);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  z-index: 90;
  transition: transform 0.2s var(--ease);
}
.phone-sync-btn svg { fill: #fff; }
.phone-sync-btn:active { transform: scale(0.95); }
/* 手机端不需要"扫自己"，隐藏该按钮 */
@media (max-width: 600px) {
  .phone-sync-btn { display: none; }
}


/* === 收集箱标签切换 === */
.inbox-tabs {
  display: flex;
  gap: 6px;
  padding: 12px 12px 4px;
  position: sticky;
  top: var(--topbar-h);
  background: var(--bg);
  z-index: 50;
}
.inbox-tab {
  flex: 0 0 auto;
  border: 1px solid var(--border, #e3e8ef);
  background: var(--surface);
  color: var(--text-mute, #5b6b82);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
}
.inbox-tab.active {
  background: var(--primary, #3d5a80);
  border-color: var(--primary, #3d5a80);
  color: #fff;
}

/* === 通用组件 === */
.section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-mute);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 20px 0 10px;
  padding-left: 4px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease);
}
.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:active { background: var(--primary-dark); }
.btn-accent {
  background: var(--accent);
  color: white;
}
.btn-accent:active { background: #d4632f; }
.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-outline:active { background: var(--surface-alt); }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.6;
}
.tag-appreciation { background: rgba(61,90,128,0.1); color: var(--ct-appreciation); }
.tag-modeling { background: rgba(232,116,59,0.1); color: var(--ct-modeling); }
.tag-design { background: rgba(91,140,90,0.1); color: var(--ct-design); }
.tag-comprehensive { background: rgba(139,94,131,0.1); color: var(--ct-comprehensive); }
.tag-default { background: var(--surface-alt); color: var(--text-mute); }

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-light);
}
.empty-state svg { fill: var(--border); margin-bottom: 12px; }
.empty-state p { font-size: 14px; }

/* === 收集箱 === */
.inbox-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.material-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: transform 0.15s var(--ease);
}
.material-card:active { transform: scale(0.97); }
.material-card .thumb {
  width: 100%;
  aspect-ratio: 1;
  background: var(--surface-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.material-card .thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.material-card .thumb .placeholder {
  color: var(--text-light);
  font-size: 12px;
  text-align: center;
  padding: 8px;
}
.material-card .info {
  padding: 8px 10px;
}
.material-card .info .title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.material-card .info .meta {
  font-size: 11px;
  color: var(--text-light);
  margin-top: 2px;
}

.material-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0,0,0,0.5);
  color: white;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 10px;
}

/* === 素材瀑布流 === */
.masonry {
  columns: 2;
  column-gap: 10px;
}
.masonry .material-card {
  break-inside: avoid;
  margin-bottom: 10px;
}
.masonry .material-card .thumb {
  aspect-ratio: auto;
}
.masonry .material-card .thumb img {
  width: 100%;
  height: auto;
  display: block;
}

/* === 筛选条 === */
.filter-bar {
  position: sticky;
  top: var(--topbar-h);
  background: var(--bg);
  padding: 8px 0;
  z-index: 50;
  margin: -16px -16px 8px;
  padding-left: 16px;
  padding-right: 16px;
  border-bottom: 1px solid var(--border-light);
}
.filter-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.filter-chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0;
  padding: 5px 12px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-mute);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s var(--ease);
}
.chip.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* === 模态框 === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 300;
  opacity: 0;
  transition: opacity 0.25s var(--ease);
}
.modal-overlay:not(.hidden) { opacity: 1; }

.modal {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%) translateY(100%);
  width: 100%;
  max-width: 720px;
  max-height: 85vh;
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  z-index: 301;
  overflow-y: auto;
  transition: transform 0.3s var(--ease);
  padding: 20px 20px calc(20px + var(--safe-bottom));
}
.modal:not(.hidden) {
  transform: translateX(-50%) translateY(0);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.modal-header h2 {
  font-size: 18px;
  font-weight: 700;
}
.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-mute);
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}
.modal-body { margin-bottom: 16px; }
.modal-footer {
  display: flex;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}
.modal-footer .btn { flex: 1; }

/* === 表单 === */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-mute);
  margin-bottom: 6px;
}
.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.2s;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary);
}
.form-textarea { resize: vertical; min-height: 72px; }

.tag-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag-option {
  padding: 5px 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  color: var(--text-mute);
  cursor: pointer;
  transition: all 0.2s;
}
.tag-option.selected {
  background: var(--accent-bg);
  border-color: var(--accent);
  color: var(--accent);
}

/* === 教材浏览 === */
.book-selector {
  position: sticky;
  top: var(--topbar-h);
  z-index: 50;
  margin: -16px -16px 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--border-light);
}
.book-selector-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.book-selector-header:active { background: var(--surface-alt); }
.book-current { font-size: 15px; font-weight: 700; color: var(--ink); }
.book-toggle {
  color: var(--text-mute);
  display: flex;
  align-items: center;
  transition: transform 0.2s ease;
}
.book-selector.collapsed .book-toggle { transform: rotate(-90deg); }
.book-selector-body {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: var(--bg);
  border-bottom: 1px solid var(--border-light);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.1);
  padding: 8px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.book-selector.collapsed .book-selector-body { display: none; }
.book-selector::-webkit-scrollbar { display: none; }
.book-tab {
  flex-shrink: 0;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-mute);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.book-selector-body .book-tab {
  width: 100%;
  text-align: left;
  box-sizing: border-box;
}
.book-tab.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.book-tab.pending {
  opacity: 0.6;
  border-style: dashed;
}
.book-tab .verified-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  margin-left: 4px;
}

.unit-block {
  margin-bottom: 20px;
}
.unit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  padding: 10px 4px 10px 0;
  border-bottom: 1px solid var(--divider);
  margin-bottom: 8px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.unit-header:active { background: var(--surface-alt); }
.unit-name { flex: 1; min-width: 0; }
.unit-toggle {
  color: var(--text-mute);
  display: flex;
  align-items: center;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.unit-block.collapsed .unit-toggle { transform: rotate(-90deg); }
.unit-block.collapsed .unit-body { display: none; }
.unit-block.collapsed .unit-header { border-bottom-color: transparent; margin-bottom: 0; }
.unit-desc {
  font-size: 11px;
  color: var(--text-light);
  margin: -4px 0 8px 0;
  line-height: 1.5;
}
.link-sm {
  font-size: 12px;
  color: var(--primary);
  cursor: pointer;
  user-select: none;
}
.link-sm:active { opacity: 0.6; }
.lesson-row {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s;
}
.lesson-row:active { background: var(--surface-alt); }
.lesson-no {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  margin-right: 12px;
  flex-shrink: 0;
  color: white;
}
.lesson-info { flex: 1; min-width: 0; }
.lesson-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lesson-meta {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 2px;
}
.lesson-arrow {
  color: var(--text-light);
  flex-shrink: 0;
  margin-left: 8px;
}

/* === 教学日历 === */
.calendar-week {
  margin-bottom: 16px;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-light);
}
.calendar-week-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border-light);
}
.calendar-week-header .week-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.calendar-week-header .week-date {
  font-size: 12px;
  color: var(--text-light);
}
.calendar-week-body {
  padding: 8px 14px;
}
.calendar-entry {
  display: flex;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--divider);
}
.calendar-entry:last-child { border-bottom: none; }
.calendar-entry .day {
  width: 32px;
  font-size: 12px;
  color: var(--text-mute);
  flex-shrink: 0;
}
.calendar-entry .entry-content {
  flex: 1;
  min-width: 0;
  margin-left: 8px;
}
.calendar-entry .entry-title {
  font-size: 14px;
  color: var(--text);
}
.calendar-entry .entry-note {
  font-size: 12px;
  color: var(--text-light);
}
.calendar-entry-empty {
  padding: 8px 0;
  color: var(--text-light);
  font-size: 13px;
}
.semester-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.semester-card {
  flex: 1;
  padding: 12px;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}
.semester-card.active {
  border-color: var(--primary);
  background: rgba(61,90,128,0.05);
}
.semester-card .sem-title { font-size: 14px; font-weight: 600; }
.semester-card .sem-info { font-size: 12px; color: var(--text-mute); margin-top: 4px; }

/* === 概念网 === */
.concept-domain {
  margin-bottom: 16px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px;
  border-left: 4px solid;
  box-shadow: var(--shadow-sm);
}
.concept-domain h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
}
.concept-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.concept-pill {
  padding: 4px 10px;
  border-radius: 12px;
  background: var(--surface-alt);
  font-size: 13px;
  color: var(--text);
}
.thread-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  border-left: 4px solid;
}
.thread-card h4 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
}
.thread-card .thread-desc {
  font-size: 13px;
  color: var(--text-mute);
  margin-bottom: 8px;
}
.thread-lessons {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.thread-lesson {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--surface-alt);
  color: var(--text-mute);
}

/* === 备课包 === */
.pack-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.pack-lesson-badge {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}
.pack-materials {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.pack-material-thumb {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-alt);
  cursor: pointer;
  position: relative;
}
.pack-material-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pack-material-thumb .remove-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  color: white;
  border: none;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.pack-add-material {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  border: 2px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  cursor: pointer;
  background: var(--surface);
}
.pack-add-material:active { background: var(--surface-alt); }

/* === Toast === */
.toast {
  position: fixed;
  bottom: calc(var(--bottomnav-h) + var(--safe-bottom) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: white;
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 14px;
  z-index: 500;
  opacity: 0;
  transition: all 0.3s var(--ease);
  white-space: nowrap;
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toast:not(.hidden) {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* === 详情页 === */
.detail-back {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  color: var(--primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 12px;
}
.detail-image {
  width: 100%;
  border-radius: var(--radius);
  margin-bottom: 12px;
  background: var(--surface-alt);
}
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.detail-note {
  font-size: 14px;
  color: var(--text);
  line-height: 1.7;
  padding: 12px;
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
}

/* === 工具类 === */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-mute { color: var(--text-mute); }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-8 { gap: 8px; }

/* === 响应式 === */
@media (min-width: 600px) {
  .inbox-grid { grid-template-columns: repeat(3, 1fr); }
  .masonry { columns: 3; }
  .pack-materials { grid-template-columns: repeat(4, 1fr); }
  .add-menu-grid { grid-template-columns: repeat(3, 1fr); }
}

/* === 知识星图 === */
.star-container {
  position: relative;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  background: #0a0e27;
}
.star-canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
}
.star-stats {
  position: absolute;
  top: 10px; left: 12px;
  display: flex;
  gap: 14px;
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  z-index: 2;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
}
.star-controls {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 2;
}
.star-ctrl-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.75);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background 0.2s;
}
.star-ctrl-btn:active { background: rgba(255,255,255,0.2); }
.star-legend {
  position: absolute;
  bottom: 10px; left: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  z-index: 2;
  pointer-events: none;
  max-width: 55%;
}
.star-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: rgba(255,255,255,0.45);
}
.star-legend-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.star-hint {
  position: absolute;
  bottom: 10px; right: 12px;
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  z-index: 2;
  pointer-events: none;
  transition: opacity 0.6s var(--ease);
}
.star-hint.fade-out { opacity: 0; }

/* Star detail bottom sheet */
.star-detail {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: rgba(12, 16, 38, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px));
  z-index: 3;
  transform: translateY(0);
  transition: transform 0.35s var(--ease);
  max-height: 55%;
  overflow-y: auto;
}
.star-detail.collapsed {
  transform: translateY(100%);
  pointer-events: none;
}
.star-detail-stripe {
  height: 3px;
  border-radius: 2px;
  margin-bottom: 10px;
}
.star-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 4px;
}
.star-detail-domain {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.star-detail-name {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  margin-top: 2px;
}
.star-detail-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  font-size: 24px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  flex-shrink: 0;
}
.star-detail-count {
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  margin-bottom: 10px;
  line-height: 1.6;
}
.star-detail-materials {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  margin-bottom: 8px;
  padding-bottom: 2px;
}
.star-detail-materials::-webkit-scrollbar { display: none; }
.star-detail-thumb {
  flex-shrink: 0;
  width: 54px; height: 54px;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255,255,255,0.06);
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.1);
}
.star-detail-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.star-detail-thumb-icon {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

/* === 收集添加菜单 === */
.add-menu-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.add-menu-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.15s var(--ease);
}
.add-menu-item:active {
  transform: scale(0.96);
  background: var(--surface-alt);
}
.add-menu-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.add-menu-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

/* === 微信图片弹窗 === */
.wechat-tip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #D5F0E0;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 600;
  color: #2F855A;
}
.wechat-tip svg { fill: currentColor; flex-shrink: 0; }

.paste-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px 16px;
  text-align: center;
  cursor: text;
  transition: border-color 0.2s, background 0.2s;
  outline: none;
  -webkit-user-select: text;
  user-select: text;
}
.paste-zone:focus,
.paste-zone:active {
  border-color: var(--green);
  background: rgba(47,133,90,0.03);
}
.paste-zone-icon {
  color: var(--text-light);
  margin-bottom: 8px;
}
.paste-zone-icon svg { fill: currentColor; }

.paste-preview-item {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: 4px;
}
.paste-preview-item img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 2px solid var(--green);
}
.paste-preview-check {
  font-size: 11px;
  color: var(--green);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 2px;
}
.paste-preview-check svg { fill: currentColor; }

.wechat-guide {
  margin-top: 16px;
  padding: 12px 14px;
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-mute);
  line-height: 1.8;
}
.wechat-guide p { margin: 0; }
.wechat-guide strong { color: var(--text); }

/* === 收集预览弹窗 === */
.collect-preview-grid {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.collect-preview-grid::-webkit-scrollbar { display: none; }
.collect-preview-thumb {
  flex-shrink: 0;
  width: 100px;
  height: 100px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-alt);
  border: 1px solid var(--border-light);
}
.collect-preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.collect-preview-thumb .doc-thumb {
  width: 100%;
  height: 100%;
}

/* === 收集箱卡片：备注预览 + 知识节点提示 === */
.card-note-preview {
  font-size: 11px;
  color: var(--text-mute);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 3px;
}
.card-note-preview svg { fill: currentColor; flex-shrink: 0; }
.card-node-hint {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 500;
}

/* === 作品类型色标 === */
.card-artwork-type {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* === 美术语言小标签 === */
.card-art-lang {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 10px;
  background: var(--surface-alt);
  color: var(--text-mute);
}

/* === 快速标签行 === */
.quick-tag-row {
  margin-bottom: 10px;
}
.quick-tag-row .quick-tag-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.quick-tag-row .quick-tag-hint {
  font-size: 11px;
  color: var(--text-light);
  margin-left: 4px;
  font-weight: normal;
}

/* === 文档卡片缩略图 === */
.doc-thumb {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.doc-thumb .doc-icon svg { fill: currentColor; }
.doc-thumb .doc-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* === 自定义标签内联输入 === */
.tag-inline-input {
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
}
.tag-inline-input::placeholder {
  font-size: 12px;
}

/* === 知识网：添加节点按钮 === */
.concept-add {
  cursor: pointer;
  transition: all 0.15s var(--ease);
}
.concept-add:active {
  transform: scale(0.95);
  opacity: 0.7;
}

/* === 标签选择器：+ 新建按钮 === */
.tag-add-new {
  cursor: pointer;
  transition: all 0.15s var(--ease);
}
.tag-add-new:active {
  transform: scale(0.95);
  opacity: 0.7;
}

/* === 待办清单 === */

/* 四象限矩阵概览 */
.todo-matrix {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.todo-quadrant-card {
  padding: 14px 12px;
  border-radius: var(--radius);
  border: 1px solid;
  cursor: pointer;
  text-align: center;
  transition: transform 0.15s var(--ease);
}
.todo-quadrant-card:active { transform: scale(0.97); }
.tq-label {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
}
.tq-count {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
}
.tq-desc {
  font-size: 11px;
  color: var(--text-mute);
  margin-top: 2px;
}

/* 象限分区 */
.todo-section {
  margin-bottom: 14px;
}
.todo-section-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-left: 3px solid;
  margin-bottom: 6px;
}
.todo-section-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.todo-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}
.todo-section-count {
  font-size: 12px;
  color: var(--text-mute);
  background: var(--surface-alt);
  padding: 1px 8px;
  border-radius: 10px;
}
.todo-empty {
  padding: 10px 12px;
  color: var(--text-light);
  font-size: 13px;
}

/* 待办卡片 */
.todo-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  margin-bottom: 6px;
  transition: all 0.15s var(--ease);
}
.todo-card:active { background: var(--surface-alt); }
.todo-card-overdue {
  border-color: rgba(196,69,54,0.3);
  background: rgba(196,69,54,0.03);
}
.todo-card-done {
  opacity: 0.55;
}

/* 完成勾选圆圈 */
.todo-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 1px;
  transition: all 0.2s var(--ease);
  padding: 0;
}
.todo-check:active { transform: scale(0.85); }
.todo-check.checked {
  background: var(--green);
  border-color: var(--green);
  color: white;
}
.todo-check.checked svg { fill: white; }

/* 待办内容 */
.todo-content {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}
.todo-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.5;
  word-break: break-word;
}
.todo-title-done {
  text-decoration: line-through;
  color: var(--text-mute);
}
.todo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-top: 4px;
  align-items: center;
}
.todo-date {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: var(--text-mute);
  background: var(--surface-alt);
  padding: 1px 6px;
  border-radius: 4px;
}
.todo-date svg { fill: currentColor; }
.todo-date-overdue {
  color: var(--rust) !important;
  background: rgba(196,69,54,0.08);
  font-weight: 600;
}
.todo-lesson {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 500;
}
.todo-note-preview {
  font-size: 11px;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}
.todo-completed-date {
  font-size: 11px;
  color: var(--green);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.todo-completed-date svg { fill: currentColor; }
.todo-edit-btn {
  opacity: 0;
  transition: opacity 0.2s;
  flex-shrink: 0;
  margin-top: 1px;
}
.todo-card:active .todo-edit-btn,
.todo-card:hover .todo-edit-btn {
  opacity: 1;
}

/* 已完成区域 */
.todo-completed-section {
  margin-top: 20px;
}
.todo-completed-header {
  cursor: pointer;
  border-left-color: var(--green) !important;
}
.todo-chevron {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-light);
}
#completed-list {
  transition: all 0.2s var(--ease);
}

/* 象限选择器（表单内） */
.quadrant-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.quadrant-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s var(--ease);
  background: var(--surface);
}
.quadrant-option:active { transform: scale(0.97); }
.quadrant-option.selected {
  border-width: 2px;
  padding: 9px 11px;
}
.qo-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.qo-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.qo-label {
  font-size: 13px;
  font-weight: 600;
}
.qo-desc {
  font-size: 11px;
  color: var(--text-mute);
}

/* 日历中的待办提醒 */
.cal-todo-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--divider);
  cursor: pointer;
  transition: background 0.15s;
}
.cal-todo-item:last-child { border-bottom: none; }
.cal-todo-item:active { background: var(--surface-alt); }
.cal-todo-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cal-todo-title {
  flex: 1;
  font-size: 13px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-todo-date {
  font-size: 11px;
  color: var(--text-mute);
  flex-shrink: 0;
}
.cal-todo-overdue .cal-todo-title {
  color: var(--rust);
}

/* === 5项底部导航适配 === */
.nav-item span {
  font-size: 10px;
}
@media (min-width: 600px) {
  .nav-item span { font-size: 11px; }
}

/* === 更新提示横幅 === */
.update-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  background: linear-gradient(135deg, #2D9B5B, #5B8C5A);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  animation: slideDown 0.3s ease;
  position: relative;
  z-index: 50;
}
.update-banner:active {
  opacity: 0.85;
}
@keyframes slideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* === 课时备课全页 === */
.lp-page { padding: 4px 0 32px; }
.lp-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 4px;
  margin-bottom: 4px;
  cursor: pointer;
}
.lp-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
}
.lp-title { font-size: 18px; font-weight: 700; color: var(--ink); line-height: 1.3; }
.lp-sub { font-size: 12px; color: var(--text-mute); margin-top: 3px; }
.lp-threads { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }

.lp-section {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 16px;
  margin-bottom: 14px;
}
.lp-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}
.lp-section-no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  flex-shrink: 0;
}
.lp-section-desc {
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.6;
  margin-bottom: 12px;
}

.lp-design-card { margin-bottom: 12px; }
.lp-design-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.lp-design-label span { color: var(--text-light); font-weight: 400; font-size: 12px; }
.lp-design-area {
  width: 100%;
  min-height: 76px;
  border: 1px solid var(--divider);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.6;
  background: var(--surface-alt);
  color: var(--text);
  resize: vertical;
  box-sizing: border-box;
  font-family: inherit;
}
.lp-design-area:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
}

.lp-ppt-list { margin-top: 12px; }
.lp-ppt-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
.lp-ppt-icon { color: #DD6B20; flex-shrink: 0; }
.lp-ppt-name { flex: 1; min-width: 0; font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp-ppt-size { font-size: 11px; color: var(--text-light); flex-shrink: 0; }
.lp-ppt-dl, .lp-ppt-del {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: var(--surface);
  color: var(--text-mute);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.lp-ppt-dl { color: var(--primary); }
.lp-ppt-del { color: #E53E3E; }

.lp-mat-count {
  margin-left: auto;
  background: var(--surface-alt);
  color: var(--text-mute);
  font-size: 12px;
  padding: 2px 9px;
  border-radius: 10px;
}
.lp-empty {
  font-size: 13px;
  color: var(--text-light);
  padding: 10px 12px;
  background: var(--surface-alt);
  border-radius: var(--radius-sm);
  line-height: 1.6;
}
.lp-mat-card .remove-btn {
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: none;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* === 我的数据 / 修改历史 === */
.dv-summary {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.dv-stat {
  flex: 1;
  background: var(--surface-alt);
  border-radius: 10px;
  padding: 10px 4px;
  text-align: center;
}
.dv-stat-num { font-size: 20px; font-weight: 700; color: var(--ink); }
.dv-stat-label { font-size: 11px; color: var(--text-mute); margin-top: 2px; }
.dv-cap { font-size: 12px; color: var(--text-mute); margin-bottom: 12px; }
.dv-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin: 14px 0 8px;
  padding-left: 8px;
  border-left: 3px solid var(--primary);
}
.dv-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.dv-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
  cursor: pointer;
}
.dv-thumb img { width: 100%; height: 100%; object-fit: cover; }
.dv-thumb-ic {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-mute);
  background: var(--surface);
}
.dv-thumb-more {
  aspect-ratio: 1/1;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px; background: var(--surface-alt);
  font-size: 13px; color: var(--text-mute); font-weight: 600;
}
.dv-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 8px;
  border-radius: 8px;
  cursor: pointer;
  border-bottom: 1px solid var(--divider);
}
.dv-row:active { background: var(--surface-alt); }
.dv-row-title { font-size: 14px; color: var(--ink); font-weight: 500; }
.dv-row-sub { font-size: 11px; color: var(--text-mute); margin-top: 2px; }
.dv-empty { font-size: 13px; color: var(--text-light); padding: 14px 4px; text-align: center; }
.dv-actions { display: flex; gap: 10px; margin-top: 16px; }
.dv-actions .btn { flex: 1; }
.dv-tip {
  font-size: 11px;
  color: var(--gold);
  background: rgba(224,164,88,0.1);
  border-radius: 8px;
  padding: 8px 10px;
  margin-top: 12px;
  line-height: 1.5;
}
.hist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 8px;
  border-bottom: 1px solid var(--divider);
}
.hist-info { flex: 1; min-width: 0; }
.hist-label { font-size: 13px; color: var(--ink); display: flex; align-items: center; gap: 6px; }
.hist-time { font-size: 11px; color: var(--text-mute); margin-top: 3px; }
.hist-op {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
  flex-shrink: 0;
}
.hist-op.op-add { background: rgba(91,140,90,0.15); color: var(--green); }
.hist-op.op-upd { background: rgba(61,90,128,0.12); color: var(--primary); }
.hist-op.op-del { background: rgba(229,62,62,0.12); color: #E53E3E; }

/* ============================================================
   桌面端适配（宽屏 ≥ 900px）：左侧固定侧边栏 + 宽内容 + 多列网格
   ============================================================ */
@media (min-width: 900px) {
  /* 应用容器铺满，不再限宽 720 */
  #app {
    max-width: none;
    margin: 0;
  }

  /* 顶栏让出左侧栏宽度，并加高更大气 */
  #topbar {
    height: 60px;
    padding-left: 236px;
  }
  #update-banner {
    padding-left: 236px;
  }

  /* 底部导航 → 左侧固定侧边栏 */
  #bottomnav {
    left: 0;
    top: 0;
    bottom: 0;
    width: 220px;
    max-width: none;
    transform: none;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    border-top: none;
    border-right: 1px solid var(--border);
    padding: 76px 12px 16px;
    gap: 6px;
    z-index: 110;
  }
  .nav-item {
    flex: none;
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 14px;
  }
  .nav-item svg { width: 22px; height: 22px; }
  .nav-item span { font-size: 13px; }
  .nav-item.active { background: rgba(61,90,128,0.08); color: var(--primary); }

  /* 内容区让出侧边栏，并在剩余空间内居中、加宽 */
  #content {
    padding: 28px 36px 48px 252px;
    max-width: 1440px;
    margin: 0 auto;
  }

  /* 各类网格多列展示，利用宽屏空间 */
  .inbox-grid { grid-template-columns: repeat(5, 1fr); gap: 14px; }
  .masonry { columns: 5; column-gap: 14px; }
  .masonry .material-card { margin-bottom: 14px; }
  .pack-materials { grid-template-columns: repeat(6, 1fr); }
  .dv-grid { grid-template-columns: repeat(8, 1fr); }
  .add-menu-grid { grid-template-columns: repeat(6, 1fr); }

  /* 顶栏标题在桌面更克制 */
  .topbar-left h1 { font-size: 20px; }

  /* 模态框在桌面端改为居中对话框（而非底部抽屉） */
  .modal {
    left: 50%;
    top: 50%;
    bottom: auto;
    transform: translate(-50%, -50%) scale(0.98);
    max-width: 760px;
    max-height: 86vh;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    padding: 24px 26px;
    transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
  }
  .modal:not(.hidden) {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }

  /* FAB 与「手机录入」按钮重新定位，避开左侧栏 */
  .fab {
    bottom: 28px;
    right: 28px;
  }
  .phone-sync-btn {
    bottom: auto;
    top: 70px;
    left: 252px;
  }

  /* 教材选择器 / 筛选条在宽屏撑满内容区 */
  .book-selector { margin: -28px -36px 16px; }
  .filter-bar { margin: -28px -36px 12px; }
}

