/* ============================================================
   日々マレー語 | Malay Learner
   HarmonyOS 6 风格 - 纯净·轻盈·沉浸
   配色：抹茶绿 + 光感白 + 极黑
   ============================================================ */

/* ===== CSS 变量 ===== */
:root {
  --green: #7ba47b;
  --green-light: #a8c8a8;
  --green-dark: #5a8a5a;
  --green-glow: rgba(123, 164, 123, 0.2);
  --sakura: #fce4ec;
  --bg: #f7f5f2;
  --card: #ffffff;
  --card-border: rgba(0,0,0,0.04);
  --text: #1a1a1a;
  --text-secondary: #8a8a8a;
  --text-tertiary: #b0b0b0;
  --divider: #f0eee8;
  --nav-bg: rgba(255,255,255,0.88);
  --nav-shadow: 0 -2px 20px rgba(0,0,0,0.06);
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --transition: 0.3s cubic-bezier(0.2, 0, 0, 1);
  --spring: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  --sheet-bg: #ffffff;
  --overlay: rgba(0,0,0,0.25);
  --input-bg: #f0eee8;
  --chip-bg: #f0eee8;
  --chip-active: var(--green);
  --chip-active-text: #fff;
  --content-max: 800px;
}

[data-theme="dark"] {
  --bg: #0d0d0d;
  --card: #1a1a1a;
  --card-border: rgba(255,255,255,0.04);
  --text: #e8e8e8;
  --text-secondary: #8a8a8a;
  --text-tertiary: #666;
  --divider: #2a2a2a;
  --nav-bg: rgba(20,20,20,0.92);
  --nav-shadow: 0 -2px 20px rgba(0,0,0,0.3);
  --sheet-bg: #1a1a1a;
  --overlay: rgba(0,0,0,0.5);
  --input-bg: #2a2a2a;
  --chip-bg: #2a2a2a;
}

[data-theme="light"] {
  --bg: #f7f5f2;
  --card: #ffffff;
  --card-border: rgba(0,0,0,0.04);
  --text: #1a1a1a;
  --text-secondary: #8a8a8a;
  --text-tertiary: #b0b0b0;
  --divider: #f0eee8;
  --nav-bg: rgba(255,255,255,0.88);
  --nav-shadow: 0 -2px 20px rgba(0,0,0,0.06);
  --sheet-bg: #ffffff;
  --overlay: rgba(0,0,0,0.25);
  --input-bg: #f0eee8;
  --chip-bg: #f0eee8;
}

/* ===== 基础 ===== */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans JP', 'Noto Sans SC', 'Noto Sans', 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
  overflow-x: hidden;
  transition: background-color 0.6s ease, color 0.6s ease;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--green-glow); }

/* ===== App 容器 - 自适应宽屏 ===== */
#app {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 clamp(12px, 4vw, 32px) 80px;
  position: relative;
  animation: fadeSlideUp 0.6s cubic-bezier(0.2, 0, 0, 1);
}

@keyframes fadeSlideUp {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ===== 顶部状态栏 ===== */
.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: clamp(8px, 2vw, 16px) 0 4px;
  font-size: clamp(0.65rem, 1.5vw, 0.75rem);
  color: var(--text-tertiary);
  letter-spacing: 0.03em;
}

/* ===== 顶栏 ===== */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(4px, 1.5vw, 10px) 0 clamp(12px, 2.5vw, 20px);
  transition: var(--transition);
}

.header.header-compact {
  padding-top: 2px;
  padding-bottom: 6px;
}

.header.header-center {
  justify-content: center;
}

.header.header-center .header-left {
  margin-right: auto;
}

.header-left {
  display: flex;
  align-items: baseline;
  gap: clamp(6px, 1.5vw, 12px);
}

.app-title {
  font-size: clamp(1.1rem, 3vw, 1.6rem);
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
}

.app-sub {
  font-size: clamp(0.65rem, 1.5vw, 0.8rem);
  color: var(--text-secondary);
  font-weight: 400;
}

.icon-btn {
  width: clamp(36px, 5vw, 44px);
  height: clamp(36px, 5vw, 44px);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.icon-btn:hover {
  background: var(--divider);
  color: var(--text);
}

.icon-btn:active {
  transform: scale(0.92);
}

/* ===== 同步状态 ===== */
.sync-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: clamp(6px, 1.5vw, 10px) clamp(10px, 2vw, 14px);
  background: var(--divider);
  border-radius: var(--radius-sm);
  font-size: clamp(0.7rem, 1.5vw, 0.8rem);
  color: var(--text-secondary);
  margin-bottom: clamp(12px, 2.5vw, 20px);
}

.sync-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
}

.sync-status { flex: 1; }

.sync-btn {
  padding: 4px 14px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--green);
  font-size: clamp(0.7rem, 1.5vw, 0.78rem);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  font-weight: 500;
}

.sync-btn:hover { background: var(--green-glow); }
.sync-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== 搜索栏 ===== */
.search-section {
  margin-bottom: clamp(12px, 2.5vw, 20px);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--input-bg);
  border-radius: var(--radius-lg);
  padding: 4px 4px 4px clamp(12px, 2.5vw, 18px);
  transition: var(--transition);
  border: 1.5px solid transparent;
}

.search-box:focus-within {
  border-color: var(--green-light);
  background: var(--card);
  box-shadow: 0 0 0 4px var(--green-glow);
}

.search-icon { flex-shrink: 0; opacity: 0.4; }

.search-box input {
  flex: 1;
  border: none;
  outline: none;
  font-size: clamp(0.85rem, 2vw, 1rem);
  padding: clamp(10px, 2vw, 14px) 4px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  min-width: 0;
}

.search-box input::placeholder { color: var(--text-tertiary); }

.search-box button {
  padding: clamp(6px, 1.5vw, 10px) clamp(14px, 3vw, 24px);
  border: none;
  border-radius: 50px;
  background: var(--green);
  color: #fff;
  font-size: clamp(0.8rem, 1.8vw, 0.9rem);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.search-box button:hover {
  background: var(--green-dark);
  transform: scale(1.02);
}

.search-box button:active { transform: scale(0.96); }

/* ===== 建议单词网格 - 自适应 ===== */
#suggestions { margin-bottom: 8px; }

.suggest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(120px, 20vw, 180px), 1fr));
  gap: clamp(6px, 1.2vw, 10px);
}

.suggest-chip {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: clamp(10px, 2vw, 16px) clamp(10px, 2vw, 16px);
  cursor: pointer;
  transition: var(--spring);
  text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,0.02);
  position: relative;
  overflow: hidden;
  animation: chipPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.suggest-chip:nth-child(1) { animation-delay: 0.02s; }
.suggest-chip:nth-child(2) { animation-delay: 0.04s; }
.suggest-chip:nth-child(3) { animation-delay: 0.06s; }
.suggest-chip:nth-child(4) { animation-delay: 0.08s; }
.suggest-chip:nth-child(5) { animation-delay: 0.10s; }
.suggest-chip:nth-child(6) { animation-delay: 0.12s; }

@keyframes chipPop {
  0% { opacity: 0; transform: scale(0.85) translateY(8px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.suggest-chip:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.06);
  border-color: var(--green-light);
}

.suggest-chip .sc-word {
  font-size: clamp(0.85rem, 2vw, 1rem);
  font-weight: 500;
  color: var(--text);
}

.suggest-chip .sc-mean {
  font-size: clamp(0.65rem, 1.4vw, 0.75rem);
  color: var(--text-secondary);
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== 单词卡片 ===== */
.word-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: clamp(18px, 3vw, 28px) clamp(16px, 3vw, 24px);
  margin-bottom: 16px;
  border: 1px solid var(--card-border);
  animation: fadeSlideUp 0.4s cubic-bezier(0.2,0,0,1);
}

.wc-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
}

.wc-word {
  font-size: clamp(1.4rem, 4vw, 2.2rem);
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}

.wc-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.wc-phonetic {
  font-size: clamp(0.72rem, 1.5vw, 0.85rem);
  color: var(--text-secondary);
  background: var(--divider);
  padding: 2px 10px;
  border-radius: 6px;
}

.wc-pos {
  font-size: clamp(0.65rem, 1.3vw, 0.75rem);
  color: #fff;
  background: var(--green);
  padding: 2px 10px;
  border-radius: 10px;
}

.wc-fav {
  background: none;
  border: none;
  font-size: clamp(1.2rem, 3vw, 1.5rem);
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  transition: var(--transition);
  color: #ccc;
  flex-shrink: 0;
}
.wc-fav.active { color: #ff8a8a; animation: pulse 0.4s ease; }
.wc-fav:hover { background: var(--sakura); }

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

.wc-meaning {
  font-size: clamp(0.9rem, 2vw, 1.05rem);
  color: var(--text);
  padding: clamp(12px, 2.5vw, 16px);
  background: var(--divider);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  line-height: 1.5;
  border-left: 3px solid var(--green-light);
}

.wc-example {
  font-size: clamp(0.82rem, 1.8vw, 0.92rem);
  color: var(--text-secondary);
  padding: clamp(10px, 2vw, 14px) clamp(12px, 2.5vw, 16px);
  background: var(--divider);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  line-height: 1.6;
}

.wc-example .wc-trans {
  display: block;
  color: var(--text-tertiary);
  font-size: clamp(0.72rem, 1.5vw, 0.82rem);
  margin-top: 4px;
}

.wc-online {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--divider);
}

.wc-online-item {
  font-size: clamp(0.78rem, 1.6vw, 0.85rem);
  color: var(--text-secondary);
  margin-bottom: 6px;
  line-height: 1.5;
}

.wc-online-item .olabel {
  color: var(--green);
  font-weight: 500;
}

/* ===== 底部导航 - 自适应 ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  display: flex;
  padding: clamp(4px, 1vw, 8px) clamp(8px, 2vw, 16px) max(14px, env(safe-area-inset-bottom));
  gap: 4px;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--divider);
  z-index: 100;
  box-shadow: var(--nav-shadow);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: clamp(6px, 1.2vw, 10px) 0 4px;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  font-size: clamp(0.55rem, 1.2vw, 0.65rem);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  border-radius: var(--radius-sm);
  position: relative;
}

.nav-item svg {
  width: clamp(20px, 3vw, 26px);
  height: clamp(20px, 3vw, 26px);
  transition: var(--transition);
}

.nav-item span {
  font-size: clamp(0.55rem, 1.2vw, 0.65rem);
  font-weight: 400;
}

.nav-item.active {
  color: var(--green);
}

.nav-item.active svg {
  transform: scale(1.1);
  stroke-width: 2.5;
}

.nav-item:not(.active):active svg {
  transform: scale(0.9);
}

.nav-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 20px;
  height: 3px;
  background: var(--green);
  border-radius: 0 0 3px 3px;
  transition: transform 0.3s cubic-bezier(0.2, 0, 0, 1);
}

.nav-item.active::before {
  transform: translateX(-50%) scaleX(1);
}

/* ===== 设置面板 ===== */
.settings-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  -webkit-tap-highlight-color: transparent;
}

.settings-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.settings-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  transform: translateY(calc(100% + 20px));
  width: 100%;
  max-width: 100%;
  background: var(--sheet-bg);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  z-index: 501;
  padding: 8px 0 max(24px, env(safe-area-inset-bottom));
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: 0 -8px 50px rgba(0,0,0,0.12);
  max-height: 75vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.settings-sheet.open {
  transform: translateY(0);
}

.sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--text-tertiary);
  border-radius: 2px;
  margin: 0 auto 8px;
  opacity: 0.4;
  flex-shrink: 0;
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(16px, 4vw, 24px) 12px;
  border-bottom: 1px solid var(--divider);
  flex-shrink: 0;
}

.sheet-header h3 {
  font-size: clamp(0.95rem, 2vw, 1.1rem);
  font-weight: 600;
  color: var(--text);
}

.sheet-header .sheet-close {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--input-bg);
  color: var(--text-secondary);
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  font-family: inherit;
}

.sheet-header .sheet-close:hover {
  background: var(--divider);
  color: var(--text);
}

.sheet-header .sheet-close:active {
  transform: scale(0.88);
}

.sheet-body {
  padding: 0 clamp(16px, 4vw, 24px);
  overflow-y: auto;
}

.sheet-group {
  padding: 16px 0;
  border-bottom: 1px solid var(--divider);
}

.sheet-group:last-child { border-bottom: none; }

.sheet-group-label {
  font-size: clamp(0.7rem, 1.5vw, 0.78rem);
  color: var(--text-tertiary);
  margin-bottom: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sheet-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: clamp(8px, 1.5vw, 12px) clamp(14px, 3vw, 20px);
  border: 1.5px solid var(--divider);
  border-radius: 50px;
  background: transparent;
  color: var(--text-secondary);
  font-size: clamp(0.78rem, 1.6vw, 0.85rem);
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: inherit;
  font-weight: 400;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.chip:hover {
  border-color: var(--green-light);
  color: var(--text);
}

.chip.active {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
  font-weight: 500;
  box-shadow: 0 2px 12px var(--green-glow);
}

.chip:active { transform: scale(0.94); }

.about-info {
  background: var(--input-bg);
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--divider);
}

.about-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: clamp(10px, 2vw, 14px) clamp(12px, 2.5vw, 16px);
  font-size: clamp(0.8rem, 1.6vw, 0.88rem);
  color: var(--text);
  transition: background 0.2s;
}

.about-row + .about-row {
  border-top: 1px solid var(--divider);
}

.about-row .about-label {
  color: var(--text-secondary);
}

.about-row .about-value {
  font-weight: 500;
  text-align: right;
}

.about-brand {
  color: var(--green);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  padding: 2px 6px;
  border-radius: 4px;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

.about-brand:hover {
  background: var(--green-glow);
}

.about-brand:active {
  transform: scale(0.96);
}

.about-brand::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 4px;
  background: var(--green);
  opacity: 0;
  transition: opacity 0.2s;
}

.about-brand:active::after {
  opacity: 0.12;
}

/* ===== 测验 ===== */
.quiz-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 4vw, 32px) clamp(16px, 3vw, 24px);
  border: 1px solid var(--card-border);
}

.quiz-start { text-align: center; padding: clamp(12px, 3vw, 24px) 0; }
.quiz-emoji { font-size: clamp(2.2rem, 5vw, 3rem); margin-bottom: 12px; }
.quiz-start p { color: var(--text-secondary); font-size: clamp(0.8rem, 1.6vw, 0.88rem); margin-bottom: 20px; line-height: 1.5; }

.btn-primary {
  padding: clamp(10px, 2vw, 14px) clamp(30px, 6vw, 48px);
  border: none;
  border-radius: 50px;
  background: var(--green);
  color: #fff;
  font-size: clamp(0.85rem, 1.8vw, 0.95rem);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.btn-primary:hover {
  background: var(--green-dark);
  transform: scale(1.02);
}

.btn-primary:active { transform: scale(0.96); }

.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.quiz-header h3 { font-size: clamp(0.9rem, 2vw, 1.05rem); font-weight: 500; }

.quiz-progress {
  font-size: clamp(0.7rem, 1.5vw, 0.78rem);
  color: var(--text-secondary);
  background: var(--divider);
  padding: 4px 12px;
  border-radius: 10px;
}

.quiz-question {
  text-align: center;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 600;
  color: var(--text);
  padding: 20px 0 4px;
}

.quiz-hint {
  text-align: center;
  font-size: clamp(0.75rem, 1.5vw, 0.85rem);
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.quiz-options {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  grid-template-columns: 1fr;
}

.quiz-opt {
  padding: clamp(12px, 2.5vw, 16px) clamp(14px, 3vw, 20px);
  border: 1.5px solid var(--divider);
  border-radius: var(--radius-sm);
  background: var(--card);
  font-size: clamp(0.88rem, 1.8vw, 1rem);
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  font-family: inherit;
  color: var(--text);
}

.quiz-opt:hover:not(:disabled) {
  border-color: var(--green-light);
  background: var(--green-glow);
}

.quiz-opt.correct {
  border-color: var(--green);
  background: var(--green-glow);
  color: var(--green-dark);
}

.quiz-opt.wrong {
  border-color: #ff8a8a;
  background: rgba(255, 138, 138, 0.08);
  color: #d33;
}

.quiz-opt:disabled { cursor: default; opacity: 0.6; }

.quiz-feedback {
  text-align: center;
  padding: 12px;
  border-radius: var(--radius-sm);
  margin-top: 12px;
  font-size: clamp(0.85rem, 1.8vw, 0.95rem);
  animation: fadeSlideUp 0.3s ease;
}

.quiz-feedback.ok {
  background: var(--green-glow);
  color: var(--green-dark);
}

.quiz-feedback.fail {
  background: rgba(255,138,138,0.08);
  color: #d33;
}

.quiz-score { text-align: center; padding: 16px 0; }
.score-num { font-size: clamp(2.2rem, 5vw, 3.2rem); font-weight: 700; color: var(--green); }
.score-label { font-size: clamp(0.8rem, 1.6vw, 0.88rem); color: var(--text-secondary); margin-top: 4px; }
.score-detail { margin: 14px 0; font-size: clamp(0.78rem, 1.5vw, 0.85rem); color: var(--text-secondary); }

/* ===== 收藏 ===== */
.fav-list {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: clamp(16px, 3vw, 24px);
  border: 1px solid var(--card-border);
}

.fav-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: clamp(10px, 2vw, 16px) clamp(8px, 1.5vw, 14px);
  cursor: pointer;
  transition: var(--transition);
  gap: 12px;
  border-bottom: 1px solid var(--divider);
}

.fav-item:last-child { border-bottom: none; }
.fav-item:hover { background: var(--divider); border-radius: var(--radius-sm); }

.fav-word { font-weight: 500; color: var(--text); font-size: clamp(0.88rem, 1.8vw, 0.95rem); }
.fav-mean { font-size: clamp(0.72rem, 1.4vw, 0.8rem); color: var(--text-secondary); margin-top: 2px; }

.fav-remove {
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: var(--transition);
  font-size: clamp(0.9rem, 1.8vw, 1.1rem);
  flex-shrink: 0;
}

.fav-remove:hover { color: #ff8a8a; background: rgba(255,138,138,0.08); }

.fav-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
  font-size: clamp(0.82rem, 1.6vw, 0.9rem);
}

/* ===== 知识 ===== */
.knowledge-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: clamp(18px, 3vw, 28px) clamp(16px, 3vw, 24px);
  border: 1px solid var(--card-border);
}

.section-title {
  font-size: clamp(0.88rem, 2vw, 1rem);
  font-weight: 600;
  color: var(--text);
  margin-bottom: 16px;
}

.knowledge-grid {
  display: grid;
  gap: clamp(8px, 1.5vw, 12px);
}

.k-item {
  padding: clamp(12px, 2vw, 16px) clamp(14px, 2.5vw, 18px);
  background: var(--divider);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--green-light);
  transition: var(--spring);
  cursor: pointer;
}

.k-item:hover {
  background: var(--green-glow);
  transform: translateX(6px);
}

.k-item .kt {
  font-weight: 500;
  font-size: clamp(0.8rem, 1.8vw, 0.9rem);
  color: var(--text);
  margin-bottom: 4px;
}

.k-item .kd {
  font-size: clamp(0.72rem, 1.5vw, 0.82rem);
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(60px);
  background: var(--text);
  color: var(--bg);
  padding: 10px 24px;
  border-radius: 50px;
  font-size: clamp(0.78rem, 1.5vw, 0.85rem);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 999;
  pointer-events: none;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== 管理员面板 ===== */
.admin-panel {
  position: fixed;
  top: 0;
  right: -400px;
  width: 380px;
  max-width: 90vw;
  height: 100vh;
  background: var(--card);
  box-shadow: -8px 0 40px rgba(0,0,0,0.15);
  z-index: 2000;
  transition: right 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-panel.open { right: 0; }

/* ============================================================
   管理员后台面板（HarmonyOS 风格）
   ============================================================ */

.admin-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: clamp(14px, 2vw, 20px) clamp(16px, 3vw, 24px);
  border-bottom: 1px solid var(--divider);
  background: var(--card);
  flex-shrink: 0;
}

.admin-panel-header span {
  font-weight: 600;
  font-size: clamp(0.9rem, 2vw, 1rem);
  color: var(--text);
}

.admin-close {
  width: 32px;
  height: 32px;
  border: none;
  background: var(--input-bg);
  color: var(--text-secondary);
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-family: inherit;
}

.admin-close:hover {
  background: var(--divider);
  color: var(--text);
}

.admin-close:active {
  transform: scale(0.88);
}

.admin-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: clamp(12px, 2vw, 20px) clamp(16px, 3vw, 24px);
  background: var(--bg);
}

/* Tab 导航 */
.admin-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  background: var(--divider);
  border-radius: var(--radius-sm);
  padding: 3px;
}

.admin-tab {
  flex: 1;
  padding: 8px 6px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  font-size: clamp(0.72rem, 1.5vw, 0.82rem);
  cursor: pointer;
  transition: all 0.25s ease;
  font-family: inherit;
  font-weight: 500;
  white-space: nowrap;
}

.admin-tab.active {
  background: var(--card);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.admin-tab:not(.active):hover {
  color: var(--text);
}

/* Tab 内容 */
.admin-tab-content {
  display: none;
  animation: fadeSlideUp 0.3s ease;
}

.admin-tab-content.active {
  display: block;
}

.admin-tab-content label {
  display: block;
  font-size: clamp(0.72rem, 1.5vw, 0.8rem);
  color: var(--text-secondary);
  margin-bottom: 4px;
  margin-top: 10px;
}

.admin-tab-content label:first-child {
  margin-top: 0;
}

/* 输入框/文本域/下拉框 */
.admin-tab-content input[type="text"],
.admin-tab-content input[type="url"],
.admin-tab-content textarea,
.admin-tab-content select {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--divider);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  font-size: clamp(0.8rem, 1.5vw, 0.88rem);
  font-family: inherit;
  transition: var(--transition);
  outline: none;
  box-sizing: border-box;
}

.admin-tab-content input[type="text"]:focus,
.admin-tab-content textarea:focus,
.admin-tab-content select:focus {
  border-color: var(--green-light);
  box-shadow: 0 0 0 3px var(--green-glow);
}

.admin-tab-content textarea {
  resize: vertical;
  min-height: 60px;
}

.admin-tab-content select {
  cursor: pointer;
  appearance: auto;
}

/* Checkbox 优化 */
.admin-tab-content input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--green);
  margin-right: 6px;
  vertical-align: middle;
  cursor: pointer;
}

.admin-tab-content input[type="checkbox"] + label {
  display: inline !important;
  margin-top: 0 !important;
  cursor: pointer;
}

/* 颜色选择器 */
.admin-tab-content input[type="color"] {
  width: 100%;
  height: 44px;
  padding: 3px !important;
  border: 1.5px solid var(--divider);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: var(--card);
}

/* 范围滑块 */
.admin-tab-content input[type="range"] {
  width: 100%;
  height: 6px;
  appearance: none;
  -webkit-appearance: none;
  background: var(--divider);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.admin-tab-content input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid var(--card);
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
  cursor: pointer;
}

/* 后台按钮 */
.admin-btn {
  display: inline-block;
  padding: 9px 20px;
  border: 1.5px solid var(--divider);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--text);
  font-size: clamp(0.78rem, 1.5vw, 0.85rem);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  font-weight: 500;
  margin-top: 10px;
  margin-right: 6px;
}

.admin-btn:hover {
  border-color: var(--green-light);
  color: var(--green);
}

.admin-btn:active {
  transform: scale(0.96);
}

.admin-btn-primary {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

.admin-btn-primary:hover {
  background: var(--green-dark);
  border-color: var(--green-dark);
  color: #fff;
}

.admin-actions {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--divider);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Tab 内容间距 */
.tab-panel {
  animation: fadeSlideUp 0.35s cubic-bezier(0.2, 0, 0, 1);
}

/* ===== 加载 ===== */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
}

.spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 2.5px solid var(--divider);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-bottom: 10px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 大屏幕增强（>1024px） ===== */
@media (min-width: 1024px) {
  #app {
    --content-max: 960px;
    padding: 0 40px 80px;
  }
  .suggest-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .quiz-options {
    grid-template-columns: 1fr 1fr;
  }
}

/* ===== 平板（768-1023px） ===== */
@media (min-width: 768px) and (max-width: 1023px) {
  #app {
    --content-max: 720px;
  }
  .suggest-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ===== 小手机（<480px） ===== */
@media (max-width: 479px) {
  .suggest-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .chip {
    padding: 8px 14px;
    font-size: 0.78rem;
  }
}

/* ===== 暗黑模式滚动条 ===== */
[data-theme="dark"] ::-webkit-scrollbar-track { background: #1a1a1a; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #333; }

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--divider); border-radius: 2px; }

/* ============================================================
   公告横幅（最顶部固定，先看再关，完美排版）
   ============================================================ */
.announcement-banner {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 2vw, 14px);
  background: linear-gradient(135deg, #7ba47b 0%, #6b9a6b 50%, #5a8a5a 100%);
  color: #fff;
  font-size: clamp(0.82rem, 1.8vw, 0.92rem);
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
  line-height: 1.5;
  opacity: 1;
  padding: clamp(12px, 2vw, 18px) clamp(16px, 3vw, 24px);
  max-height: 200px;
  overflow: hidden;
  transition: max-height 0.5s cubic-bezier(0.2, 0, 0, 1),
              padding 0.5s cubic-bezier(0.2, 0, 0, 1),
              opacity 0.3s ease,
              box-shadow 0.4s ease;
  margin: 0;
}

.announcement-banner.hidden {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  pointer-events: none;
  box-shadow: none;
}

.ann-icon {
  flex-shrink: 0;
  font-size: 1.1em;
  animation: annPulse 2s ease-in-out infinite;
}

@keyframes annPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.ann-text {
  flex: 1;
  text-align: center;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.ann-close {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border: none;
  background: rgba(255,255,255,0.2);
  color: #fff;
  border-radius: 50%;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-family: inherit;
}

.ann-close:hover {
  background: rgba(255,255,255,0.35);
  transform: scale(1.1);
}

.ann-close:active {
  transform: scale(0.9);
}


/* 管理员后台 - 本地图片上传区域 */
.admin-upload-area {
  margin: 8px 0;
  padding: 16px;
  border: 2px dashed var(--divider);
  border-radius: var(--radius-sm);
  text-align: center;
  transition: all 0.25s ease;
  cursor: pointer;
}

.admin-upload-area:hover {
  border-color: var(--green-light);
  background: var(--green-glow);
}

.admin-upload-area input[type="file"] {
  display: none;
}

.admin-upload-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 0.82rem;
  cursor: pointer;
}

.admin-upload-label .upload-icon {
  font-size: 1.6rem;
}

.admin-upload-preview {
  max-width: 100%;
  max-height: 120px;
  border-radius: 8px;
  margin-top: 8px;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* ===== 暗黑模式公告 ===== */
[data-theme="dark"] .announcement-banner {
  background: linear-gradient(135deg, #4a7a4a 0%, #3a6a3a 50%, #2d5a2d 100%);
}
