﻿:root {
  --bg: #f3f6fb;
  --card: #ffffff;
  --line: #d8e0ea;
  --text: #1c2432;
  --brand: #0f766e;
  --brand-dark: #115e59;
  --accent: #f59e0b;
  --panel-tint: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(247,250,255,0.98));
  --shadow-soft: 0 12px 36px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--text);
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(14, 165, 233, 0.12), transparent 26%),
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.12), transparent 24%),
    linear-gradient(145deg, #eef6ff 0%, var(--bg) 40%, #f8fbff 100%);
}

.page { width: min(1200px, 96vw); margin: 24px auto; padding-bottom: 30px; }
.page-title {
  position: relative;
  padding: 18px 20px 16px;
  border: 1px solid rgba(191, 219, 254, 0.9);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255,255,255,0.94), rgba(239,246,255,0.94));
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  margin-bottom: 14px;
}
.page-title::after {
  content: "";
  position: absolute;
  right: -32px;
  top: -36px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245,158,11,0.18), rgba(245,158,11,0));
  pointer-events: none;
}
.page-title h1 {
  margin: 0;
  font-size: clamp(28px, 3.4vw, 40px);
  line-height: 1.08;
}
.page-title h1::before {
  content: none;
}
.page-title p { margin: 8px 0 16px; color: #4a5568; font-size: 15px; }
.lang-switch {
  position: absolute;
  top: 16px;
  right: 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.lang-switch label { font-size: 13px; color: #4a5568; }
.lang-switch select { width: 130px; }

.practice-tools {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 10px;
}

.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.tab {
  position: relative;
  border: 1px solid #c7d2df;
  background: linear-gradient(180deg, #fefefe, #eef4fb);
  color: #314158;
  border-radius: 12px;
  height: 40px;
  padding: 0 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease, background 140ms ease;
}
.tab:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(148, 163, 184, 0.18);
  border-color: #93c5fd;
}
.tab.is-active {
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  color: #fff;
  border-color: #2563eb;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.24);
}
.tab[data-main-tab],
.tab[data-tab] {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.tab[data-main-tab]::before,
.tab[data-tab]::before {
  font-size: 15px;
  line-height: 1;
}
.tab[data-main-tab="practice"]::before { content: "🖨️"; }
.tab[data-main-tab="family"]::before { content: "🏠"; }
.tab[data-main-tab="study"]::before { content: "🎯"; }
.tab[data-tab="math"]::before { content: "🧮"; }
.tab[data-tab="math2"]::before { content: "📐"; }
.tab[data-tab="hanzi"]::before { content: "✍️"; }
.tab[data-tab="eng-spell"]::before { content: "🔤"; }
.tab[data-tab="eng-cloze"]::before { content: "📝"; }
.tab[data-tab="cn-match"]::before { content: "🔗"; }
.tab[data-tab="py-write"]::before { content: "🈶"; }
.tab[data-tab="idiom"]::before { content: "📚"; }
.tab[data-tab="science"]::before { content: "🔬"; }
.tab[data-tab="logic"]::before { content: "🧠"; }
.tab[data-tab="sudoku"]::before { content: "🔢"; }
.tab[data-tab="work-search"]::before { content: "🔎"; }
.tab[data-tab="times"]::before { content: "✖️"; }
.tab[data-tab="oral"]::before { content: "⚡"; }
.tab[data-tab="family-games"]::before { content: "🏠"; }
.tab[data-tab="study-games"]::before { content: "🎯"; }

.category { display: none; }
.category.is-active { display: block; }
.hub { display: none; }
.hub.is-active { display: block; }

body.a4-preview {
  background: #e9edf4;
}

body.a4-preview .category.is-active:not([data-tab="family-games"]):not([data-tab="study-games"]) .worksheet {
  display: none;
}

body.a4-preview .a4-preview-pages {
  display: grid;
  gap: 14px;
}

body.a4-preview .a4-page {
  width: 210mm;
  height: 297mm;
  margin: 0 auto 14px;
  padding: 10mm;
  background: #fff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18);
  border: 1px solid #d3dbe8;
  border-radius: 2px;
  overflow: hidden;
}

body.a4-preview .a4-page-inner {
  height: 100%;
  overflow: hidden;
}

body.a4-preview .a4-page .answer-key {
  display: block;
  break-before: page;
  page-break-before: always;
}

body.a4-preview .sheet-header {
  display: block;
}

.panel {
  background: var(--panel-tint);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  box-shadow: var(--shadow-soft);
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #0ea5e9, #2563eb, #f59e0b);
}

.group-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 19px;
  font-weight: 800;
  margin: 6px 0 14px;
}

.group-title::before {
  content: "◆";
  color: var(--accent);
  font-size: 14px;
}

.grid { display: grid; gap: 10px; margin-bottom: 12px; }
.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
textarea, input, select, button { border-radius: 12px; border: 1px solid #c6d2e1; padding: 0 10px; font-size: 14px; }
textarea { min-height: 88px; resize: vertical; padding: 10px; }
input, select, button { height: 40px; }

input, select, textarea {
  background: rgba(255,255,255,0.92);
  box-shadow: inset 0 1px 2px rgba(148, 163, 184, 0.08);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.14);
}

button {
  border: none;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), #0f766e);
  font-weight: 800;
  letter-spacing: 0.01em;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.22);
  transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease;
}
button:hover {
  background: linear-gradient(135deg, var(--brand-dark), #134e4a);
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(15, 118, 110, 0.26);
}
button.ghost {
  background: linear-gradient(180deg, #ffffff, #edf3fb);
  color: #22314a;
  border: 1px solid #d4deea;
  box-shadow: 0 8px 18px rgba(148, 163, 184, 0.12);
}

.inline-check { flex-direction: row; align-items: center; gap: 8px; font-weight: 600; }
.inline-check input { width: 18px; height: 18px; }

.chip-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.chip { flex-direction: row; align-items: center; gap: 8px; border: 1px solid #c8d3e0; border-radius: 999px; padding: 8px 12px; background: linear-gradient(180deg, #ffffff, #f5f9ff); font-weight: 700; }
.chip input { width: 16px; height: 16px; }
.actions-row { align-items: end; }

.sheet-header { display: none; border-bottom: 1px solid #d1dae6; padding-bottom: 10px; margin-bottom: 12px; }
.header-line { display: flex; justify-content: space-between; gap: 12px; font-size: 16px; margin-bottom: 8px; }
.stars { letter-spacing: 4px; color: #64748b; }

.question-list, .exercise-list { margin: 0; padding-left: 34px; display: grid; gap: 10px 22px; }
.question-list.cols-1 { grid-template-columns: 1fr; }
.question-list.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.question-list.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.question-list.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.exercise-list { grid-template-columns: 1fr; }
.exercise-list.multi-col { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.question-list li, .exercise-list li { font-size: 20px; line-height: 1.6; padding-left: 8px; }
.question-list li::marker, .exercise-list li::marker { font-weight: 700; }
.math2-list li { line-height: 1.45; }
.math2-q { font-size: 20px; }
.column-blank {
  width: 180px;
  min-height: 192px;
  margin-top: 6px;
  border: 1px dashed #b8c4d6;
  border-radius: 8px;
  padding: 4px 8px;
  display: grid;
  grid-template-rows: repeat(8, 1fr);
  gap: 0;
}

.column-blank-row {
  border-bottom: 1px solid #d8e2ef;
}

.column-blank-row:last-child {
  border-bottom: none;
}

.answer-key { margin-top: 16px; border-top: 1px dashed #d1dae6; padding-top: 10px; color: #334155; font-size: 13px; }
.answer-key h3 { margin: 0 0 8px; font-size: 14px; }
.answer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px 10px; }

.match-board { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 20px; }
.match-col { border: 1px solid #d7e1ee; border-radius: 10px; padding: 12px; }
.match-col h4 { margin: 0 0 8px; font-size: 15px; }
.match-col ol { margin: 0; padding-left: 20px; display: grid; gap: 8px; }

.logic-custom-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: flex-start;
}

#logicCustomStatus {
  margin: 4px 0 0;
  font-size: 13px;
  color: #475569;
  min-height: 20px;
  font-weight: 600;
}

#spellBankStatus,
#clozeBankStatus,
#matchBankStatus,
#pyBankStatus,
#idiomBankStatus,
#scienceBankStatus,
#wsBankStatus {
  margin: 4px 0 0;
  font-size: 13px;
  color: #475569;
  min-height: 20px;
  font-weight: 600;
}

.sudoku-board {
  display: inline-grid;
  gap: 0;
  border: 2px solid #334155;
  margin-top: 6px;
}

.sudoku-list {
  display: grid;
  grid-template-columns: repeat(var(--sudoku-cols, 2), max-content);
  gap: 14px 18px;
  align-items: start;
  justify-content: start;
}

.sudoku-item {
  display: inline-block;
}

.sudoku-item-title {
  font-size: 13px;
  color: #475569;
  margin-bottom: 4px;
}

.sudoku-cell {
  width: var(--sudoku-cell, 36px);
  height: var(--sudoku-cell, 36px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(var(--sudoku-cell, 36px) * 0.5);
  border: 1px solid #94a3b8;
  font-weight: 700;
}

.sudoku-cell.given { color: #0f172a; }
.sudoku-cell.blank { color: transparent; }

.ws-grid {
  display: inline-grid;
  gap: 0;
  border: 2px solid #334155;
  margin-top: 6px;
}

.ws-cell {
  width: 30px;
  height: 30px;
  border: 1px solid #c2ccda;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
}

.ws-words {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 6px 10px;
  font-size: 14px;
  color: #334155;
}

.family-games-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}

.family-game-page {
  display: none;
}

.family-game-page.is-active {
  display: block;
}

.family-game-section {
  display: grid;
  gap: 12px;
  max-width: 980px;
  margin: 0 auto;
}

.mini-title {
  margin: 0 0 8px;
  font-size: 18px;
}

.mini-status {
  margin: 0 0 10px;
  min-height: 20px;
  font-size: 13px;
  color: #475569;
  font-weight: 600;
}

.memory-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 98px));
  gap: 12px;
  justify-content: center;
}

.memory-meta {
  min-height: 20px;
  font-size: 13px;
  color: #475569;
  font-weight: 600;
}

.memory-card {
  width: 98px;
  min-height: 98px;
  padding: 0;
  border-radius: 14px;
  border: 1px solid #c9d5e4;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  user-select: none;
  font-weight: 700;
  perspective: 800px;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.memory-card:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.14);
}

.memory-card-inner {
  position: relative;
  width: 100%;
  min-height: 98px;
  border-radius: 14px;
  transform-style: preserve-3d;
  transition: transform 220ms ease;
}

.memory-card.revealed .memory-card-inner,
.memory-card.matched .memory-card-inner {
  transform: rotateY(180deg);
}

.memory-card-face {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
  padding: 10px 8px;
}

.memory-card-back {
  background: linear-gradient(145deg, #eff6ff, #dbeafe);
  color: #0f172a;
}

.memory-card-front {
  background: #ffffff;
  color: #0f172a;
  transform: rotateY(180deg);
}

.memory-card-icon {
  font-size: 26px;
  line-height: 1;
}

.memory-card-zh {
  font-size: 18px;
  line-height: 1.15;
  color: #0f172a;
}

.memory-card-en {
  font-size: 13px;
  line-height: 1.1;
  color: #475569;
}

.memory-card.just-flipped {
  animation: memory-flip 180ms ease-out;
}

.memory-card.matched {
  border-color: #22c55e;
}

@keyframes memory-flip {
  0% { transform: scale(0.98); }
  100% { transform: scale(1); }
}

.gomoku-board {
  display: grid;
  grid-template-columns: repeat(15, 34px);
  grid-template-rows: repeat(15, 34px);
  gap: 0;
  background: #e7c58b;
  padding: 10px;
  width: max-content;
  border-radius: 12px;
  border: 1px solid #c9a56b;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.35);
  margin: 0 auto;
}

.gomoku-cell {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(51, 65, 85, 0.35);
  position: relative;
  cursor: pointer;
}

.gomoku-stone {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
}

.gomoku-stone.black {
  background: #111827;
}

.gomoku-stone.white {
  background: #f8fafc;
  border: 1px solid #94a3b8;
}

.ttt-board {
  display: grid;
  grid-template-columns: repeat(3, 78px);
  gap: 8px;
  width: max-content;
  margin: 0 auto;
}

.ttt-cell {
  width: 78px;
  height: 78px;
  border: 2px solid #94a3b8;
  border-radius: 12px;
  background: #fff;
  font-size: 38px;
  font-weight: 800;
  cursor: pointer;
  color: #1e3a8a;
}

.connect4-board {
  display: grid;
  grid-template-columns: repeat(7, 54px);
  gap: 8px;
  width: max-content;
  margin: 0 auto;
  padding: 12px;
  border-radius: 18px;
  background: linear-gradient(180deg, #2563eb, #1d4ed8);
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.24);
}

.connect4-cell {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.24);
  background: rgba(255,255,255,0.9);
  cursor: pointer;
  position: relative;
}

.connect4-disc {
  position: absolute;
  inset: 6px;
  border-radius: 50%;
}

.connect4-disc.red {
  background: radial-gradient(circle at 30% 30%, #fca5a5, #dc2626 62%);
}

.connect4-disc.yellow {
  background: radial-gradient(circle at 30% 30%, #fde68a, #f59e0b 62%);
}

.leaderboard {
  margin-top: 12px;
  padding: 10px;
  border: 1px solid #d9e2ee;
  border-radius: 10px;
  background: #f8fafc;
  width: min(260px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.leaderboard-title {
  margin: 0 0 8px;
  font-size: 14px;
}

.leaderboard-list {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: #334155;
}

.game-end-action {
  min-height: 42px;
}

.game-end-action button {
  margin-top: 8px;
}

.confetti-layer {
  position: relative;
  height: 0;
  pointer-events: none;
}

.confetti-piece {
  position: absolute;
  top: 0;
  width: 10px;
  height: 18px;
  border-radius: 3px;
  opacity: 0;
  animation: confetti-fall 1200ms ease-out forwards;
}

@keyframes confetti-fall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(140px) rotate(540deg); opacity: 0; }
}

.study-groups {
  display: grid;
  gap: 14px;
}

.study-group {
  border: 1px solid #d7e1ee;
  border-radius: 12px;
  padding: 12px;
  background: #f8fbff;
}

.study-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.study-card {
  min-height: 42px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid #c8d4e3;
  background: linear-gradient(180deg, #ffffff, #f4f8ff);
  color: #1f2937;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.study-card::before {
  font-size: 15px;
  line-height: 1;
}

.study-card.is-active {
  background: linear-gradient(135deg, #0f766e, #0ea5e9);
  color: #fff;
  border-color: #0f766e;
}

.study-card[data-study-game="mental-quest"]::before { content: "🏁"; }
.study-card[data-study-game="monster-quiz"]::before { content: "👾"; }
.study-card[data-study-game="number-link"]::before { content: "🔢"; }
.study-card[data-study-game="times-memory"]::before { content: "🃏"; }
.study-card[data-study-game="countdown-calc"]::before { content: "⏱️"; }
.study-card[data-study-game="hanzi-match"]::before { content: "汉"; }
.study-card[data-study-game="idiom-puzzle"]::before { content: "📚"; }
.study-card[data-study-game="pinyin-hanzi"]::before { content: "🈶"; }
.study-card[data-study-game="word-order"]::before { content: "🔤"; }
.study-card[data-study-game="picture-word"]::before { content: "🖼️"; }
.study-card[data-study-game="word-flip"]::before { content: "🗂️"; }
.study-card[data-study-game="audio-word"]::before { content: "🔊"; }
.study-card[data-study-game="spelling-challenge"]::before { content: "✏️"; }
.study-card[data-study-game="letter-drag"]::before { content: "🧲"; }
.study-card[data-family-game="memory"]::before { content: "🧠"; }
.study-card[data-family-game="gomoku"]::before { content: "⚫"; }
.study-card[data-family-game="ttt"]::before { content: "❌"; }
.study-card[data-family-game="connect4"]::before { content: "🟡"; }

.study-playground {
  min-height: 260px;
  max-width: 980px;
  margin: 0 auto;
}

.study-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.study-game-content {
  border: 1px dashed #d6deea;
  border-radius: 12px;
  padding: 14px;
  background: #fcfdff;
  min-height: 160px;
}

.study-options {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.study-option {
  text-align: left;
}

.study-answer-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
  flex-wrap: wrap;
}

.study-answer-row input {
  width: 220px;
}

.study-grid {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.study-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  min-height: 40px;
  padding: 6px 10px;
  border: 1px solid #c8d4e3;
  border-radius: 10px;
  background: #fff;
  font-weight: 700;
  cursor: pointer;
}

.hanzi-sheet { display: grid; grid-template-columns: repeat(var(--hanzi-cols, 10), minmax(0, 1fr)); gap: 6px; }
.cn-cell { position: relative; aspect-ratio: 1 / 1; border: 1px solid var(--grid-color, #94a3b8); overflow: hidden; --py-zone: 34%; --cn-zone: calc(100% - var(--py-zone)); }
.cn-cell-grid { position: absolute; left: 0; right: 0; bottom: 0; height: var(--cn-zone); border-top: 1px solid var(--grid-color, #94a3b8); background: linear-gradient(var(--grid-color, #94a3b8), var(--grid-color, #94a3b8)) center / 1px 100% no-repeat, linear-gradient(var(--grid-color, #94a3b8), var(--grid-color, #94a3b8)) center / 100% 1px no-repeat; }
.cn-cell.mi::before, .cn-cell.mi::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: var(--cn-zone); pointer-events: none; }
.cn-cell.mi::before { background: linear-gradient(45deg, transparent 49.4%, var(--grid-color, #94a3b8) 49.7%, var(--grid-color, #94a3b8) 50.3%, transparent 50.6%); }
.cn-cell.mi::after { background: linear-gradient(-45deg, transparent 49.4%, var(--grid-color, #94a3b8) 49.7%, var(--grid-color, #94a3b8) 50.3%, transparent 50.6%); }

.cn-pinyin { position: absolute; top: 0; left: 0; right: 0; height: var(--py-zone); font-size: 13px; color: #334155; }
.cn-pinyin::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(var(--grid-color, #94a3b8), var(--grid-color, #94a3b8)) top / 100% 1px no-repeat, linear-gradient(var(--grid-color, #94a3b8), var(--grid-color, #94a3b8)) 0 33.33% / 100% 1px no-repeat, linear-gradient(var(--grid-color, #94a3b8), var(--grid-color, #94a3b8)) 0 66.66% / 100% 1px no-repeat, linear-gradient(var(--grid-color, #94a3b8), var(--grid-color, #94a3b8)) bottom / 100% 1px no-repeat; }
.cn-pinyin span { position: absolute; left: 50%; top: 33.33%; transform: translate(-50%, -28%); z-index: 1; line-height: 1; white-space: nowrap; }
.hanzi-large .cn-pinyin { font-size: 14px; }
.cn-pinyin.hidden { color: transparent; }
.cn-pinyin.hidden span { visibility: hidden; }

.cn-char { position: absolute; left: 0; right: 0; bottom: 0; height: var(--cn-zone); display: flex; align-items: center; justify-content: center; font-size: 38px; line-height: 1; color: #ef4444; }
.hanzi-large .cn-char { font-size: 46px; }
.cn-char.gray { color: #94a3b8; }
.cn-char.red { color: #ef4444; }
.cn-char.blank { color: transparent; }

@media (max-width: 980px) {
  .cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .question-list.cols-3, .question-list.cols-4, .exercise-list.multi-col { grid-template-columns: 1fr; }
  .match-board { grid-template-columns: 1fr; }
  .family-games-grid { grid-template-columns: 1fr; }
  .memory-board { grid-template-columns: repeat(4, minmax(0, 86px)); }
  .memory-card, .memory-card-inner { width: 86px; min-height: 86px; }
  .lang-switch { position: static; margin-top: 12px; }
}

@media (max-width: 560px) {
  .cols-4, .cols-2 { grid-template-columns: 1fr; }
  .question-list, .exercise-list { grid-template-columns: 1fr !important; }
  .memory-board { grid-template-columns: repeat(2, minmax(0, 96px)); }
  .gomoku-board { transform: scale(0.82); transform-origin: top center; }
}

@media print {
  @page { size: A4; margin: 10mm; }
  body { background: #fff; margin: 0; }
  .page { width: 100%; margin: 0; padding: 0; }
  .no-print { display: none !important; }
  .panel { border: none; box-shadow: none; padding: 0; }
  .category:not(.is-active) { display: none !important; }
  .sheet-header { display: block; }
  .question-list li, .exercise-list li { font-size: 18px; }
  body:not(.print-with-answers) .answer-key { display: none; }
  .answer-key {
    break-before: page;
    page-break-before: always;
  }
  .sudoku-list {
    grid-template-columns: repeat(2, max-content);
    justify-content: space-between;
  }
  .sudoku-board {
    --sudoku-cell: 27px;
  }
}

#blankHub {
  display: none;
}

#blankHub.is-active {
  display: block;
}

.blank-sheet-block {
  min-height: 240px;
}

.blank-lines-sheet {
  display: grid;
  grid-template-rows: repeat(var(--blank-line-count, 18), minmax(0, 1fr));
  gap: 0;
  padding-top: 8px;
}

.blank-line-row {
  height: auto;
  min-height: 0;
  border-bottom: 2px solid #94a3b8;
}

.blank-line-row.english-four-line {
  position: relative;
  height: auto;
  border-bottom: none;
  background:
    linear-gradient(to bottom,
      #94a3b8 0 1px,
      transparent 1px 24%,
      #cbd5e1 24% calc(24% + 1px),
      transparent calc(24% + 1px) 52%,
      #cbd5e1 52% calc(52% + 1px),
      transparent calc(52% + 1px) 82%,
      #94a3b8 82% calc(82% + 2px),
      transparent calc(82% + 2px) 100%);
}

.blank-pinyin-sheet {
  display: grid;
  grid-template-columns: repeat(var(--blank-pinyin-cols, 8), minmax(0, 1fr));
  gap: 10px;
}

.blank-pinyin-cell {
  display: grid;
  grid-template-rows: 36px 64px;
  gap: 4px;
}

.blank-pinyin-quad {
  position: relative;
  border-left: 1px solid #cbd5e1;
  border-right: 1px solid #cbd5e1;
  background-image: linear-gradient(to bottom, #94a3b8 0, #94a3b8 1px, transparent 1px, transparent calc(33.33% - 1px), #94a3b8 calc(33.33% - 1px), #94a3b8 33.33%, transparent 33.33%, transparent calc(66.66% - 1px), #94a3b8 calc(66.66% - 1px), #94a3b8 66.66%, transparent 66.66%, transparent calc(100% - 1px), #94a3b8 calc(100% - 1px), #94a3b8 100%);
}

.blank-hanzi-box {
  position: relative;
  border: 1px solid #94a3b8;
  background:
    linear-gradient(to right, transparent calc(50% - 0.5px), #cbd5e1 calc(50% - 0.5px), #cbd5e1 calc(50% + 0.5px), transparent calc(50% + 0.5px)),
    linear-gradient(to bottom, transparent calc(50% - 0.5px), #cbd5e1 calc(50% - 0.5px), #cbd5e1 calc(50% + 0.5px), transparent calc(50% + 0.5px));
}

.blank-pinyin-cell.is-mi .blank-hanzi-box::before,
.blank-pinyin-cell.is-mi .blank-hanzi-box::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.blank-pinyin-cell.is-mi .blank-hanzi-box::before {
  background-image: linear-gradient(45deg, transparent calc(50% - 0.5px), #cbd5e1 calc(50% - 0.5px), #cbd5e1 calc(50% + 0.5px), transparent calc(50% + 0.5px));
}

.blank-pinyin-cell.is-mi .blank-hanzi-box::after {
  background-image: linear-gradient(-45deg, transparent calc(50% - 0.5px), #cbd5e1 calc(50% - 0.5px), #cbd5e1 calc(50% + 0.5px), transparent calc(50% + 0.5px));
}

.blank-grid-sheet {
  display: grid;
  grid-template-columns: repeat(var(--blank-grid-cols, 16), minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid #94a3b8;
  border-left: 1px solid #94a3b8;
}

.blank-grid-cell {
  aspect-ratio: 1 / 1;
  border-right: 1px solid #94a3b8;
  border-bottom: 1px solid #94a3b8;
}

.blank-grid-cell.is-title {
  background: #f8fafc;
}

.blank-grid-cell.is-indent {
  background:
    linear-gradient(135deg, transparent 0 48%, #dbe4ef 48% 52%, transparent 52% 100%);
}

.blank-grid-sheet.is-large .blank-grid-cell {
  min-height: 34px;
}

@media print {
  #blankHub .controls {
    display: none !important;
  }
}

.site-footer {
  margin-top: 28px;
  padding: 18px 20px 24px;
  border-top: 1px solid #d9e3ef;
}

.tool-directory {
  margin-top: 28px;
  padding: 20px 22px;
}

.tool-directory-head p {
  margin: 8px 0 0;
  color: #475569;
  line-height: 1.6;
}

.tool-directory-copy {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.tool-directory-copy p {
  margin: 0;
  color: #334155;
  line-height: 1.7;
}

.tool-directory-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.tool-directory-col h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.tool-directory-links {
  display: grid;
  gap: 10px;
}

.tool-directory-links a {
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #dbe4ef;
  background: #f8fbff;
  color: #0f172a;
  font-weight: 700;
  text-decoration: none;
}

.tool-directory-links a:hover {
  border-color: #93c5fd;
  background: #eef6ff;
}

.footer-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.footer-link {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #0f172a;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
}

.footer-link.is-active {
  border-color: #0f766e;
  background: linear-gradient(135deg, #0f766e, #14b8a6);
  color: #fff;
}

.info-panel {
  padding: 18px 20px;
}

.info-body {
  color: #334155;
  line-height: 1.7;
}

.info-body p {
  margin: 0 0 10px;
}

.hero-copy {
  margin-top: 10px;
  max-width: 760px;
  color: #dbeafe;
}

.hero-copy p {
  margin: 0 0 6px;
  line-height: 1.6;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 4px;
}

.site-logo {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.14), rgba(37, 99, 235, 0.12));
  border: 1px solid rgba(191, 219, 254, 0.9);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: 0 0 auto;
}

.site-logo img {
  width: 44px;
  height: 44px;
  display: block;
}

@media (max-width: 560px) {
  .tool-directory-grid {
    grid-template-columns: 1fr;
  }

  .footer-links {
    flex-direction: column;
  }

  .footer-link {
    width: 100%;
    text-align: left;
  }
}








/* ===== 2026 优化增强 ===== */

/* 平滑滚动 */
html { scroll-behavior: smooth; }

/* 加载动画 */
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
@keyframes shimmer { 0% { background-position: -1000px 0; } 100% { background-position: 1000px 0; } }

.page { animation: fadeIn 0.4s ease-out; }

/* 改进按钮交互 */
.tab, button, .btn {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.tab:active, button:active, .btn:active {
  transform: scale(0.96);
}

/* 卡片悬浮效果增强 */
.card, .panel {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover, .panel:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 48px rgba(14, 165, 233, 0.15);
}

/* 移动端优化 */
@media (max-width: 768px) {
  .page { width: 95vw; margin: 12px auto; padding-bottom: 20px; }
  .page-title { padding: 14px 16px; border-radius: 16px; }
  .page-title h1 { font-size: 22px; }
  .tabs { gap: 6px; }
  .tab { height: 36px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
  .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
}

/* 打印优化 */
@media print {
  .no-print { display: none !important; }
  .page { width: 100%; margin: 0; padding: 0; }
  .page-title { border: none; box-shadow: none; padding: 10px 0; }
  body { background: white; }
}

/* 辅助功能 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 焦点样式 - 键盘导航 */
.tab:focus, button:focus, input:focus, select:focus {
  outline: 3px solid #0ea5e9;
  outline-offset: 2px;
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f172a;
    --card: #1e293b;
    --line: #334155;
    --text: #e2e8f0;
  }
  body {
    background: linear-gradient(145deg, #0f172a 0%, #1e293b 40%, #0f172a 100%);
  }
}

/* 加载骨架屏 */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 1000px 100%;
  animation: shimmer 2s infinite;
  border-radius: 4px;
}

/* 工具提示 */
.tooltip {
  position: relative;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  background: #1e293b;
  color: white;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 1000;
}

.tooltip:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

/* 成功/错误动画 */
@keyframes successPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

.success-anim { animation: successPulse 0.4s ease; }
.error-anim { animation: shake 0.4s ease; }

/* 浮动操作按钮 */
.fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  color: white;
  border: none;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  z-index: 1000;
  transition: transform 0.2s, box-shadow 0.2s;
}

.fab:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.4);
}

/* 进度条 */
.progress-bar {
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #0ea5e9, #2563eb);
  transition: width 0.3s ease;
  border-radius: 3px;
}
/* ===== Agent Harbor 界面美化升级 ===== */
:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --secondary: #ec4899;
  --accent: #f59e0b;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg-gradient-start: #f8fafc;
  --bg-gradient-mid: #e0e7ff;
  --bg-gradient-end: #fae8ff;
  --card-bg: rgba(255, 255, 255, 0.95);
  --card-border: rgba(99, 102, 241, 0.2);
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

body {
  background: 
    radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 10%, rgba(236, 72, 153, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 50% 80%, rgba(16, 185, 129, 0.06) 0%, transparent 40%),
    linear-gradient(135deg, #f8fafc 0%, #e0e7ff 50%, #fae8ff 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

.page {
  width: min(1280px, 95vw);
  margin: 32px auto;
  padding-bottom: 40px;
  animation: pageFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes pageFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-title {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(249, 250, 255, 0.96));
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 24px;
  padding: 28px 32px;
  box-shadow: 0 20px 25px rgba(0, 0, 0, 0.1), 0 0 40px rgba(99, 102, 241, 0.1);
  position: relative;
  overflow: hidden;
  margin-bottom: 24px;
}

.page-title::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, #6366f1, #ec4899, #f59e0b);
}

.page-title h1 {
  background: linear-gradient(135deg, #6366f1, #ec4899);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.page-title p {
  color: #64748b;
  font-size: 16px;
  line-height: 1.6;
}

.tabs {
  gap: 10px;
  margin-bottom: 20px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 16px;
  backdrop-filter: blur(10px);
}

.tab {
  border: 2px solid transparent;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  color: #64748b;
  border-radius: 12px;
  height: 44px;
  padding: 0 18px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
}

.tab:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
  border-color: #818cf8;
  color: #6366f1;
}

.tab.is-active {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #ffffff;
  border-color: #6366f1;
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1), 0 0 20px rgba(99, 102, 241, 0.3);
  transform: translateY(-2px);
}

.tab[data-tab]::before,
.tab[data-main-tab]::before {
  font-size: 16px;
  margin-right: 6px;
}

.panel {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.panel:hover {
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
  border-color: #818cf8;
}

.panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #6366f1, #ec4899, #f59e0b);
}

.group-title {
  font-size: 20px;
  font-weight: 700;
  margin: 8px 0 18px;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 12px;
}

.group-title::before {
  content: '';
  width: 4px;
  height: 24px;
  background: linear-gradient(180deg, #6366f1, #ec4899);
  border-radius: 2px;
}

input[type=number],
input[type=text],
select,
textarea {
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 14px;
  transition: all 0.2s ease;
  background: #ffffff;
  color: #1e293b;
}

input[type=number]:focus,
input[type=text]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
  transform: translateY(-1px);
}

input[type=number]:hover,
input[type=text]:hover,
select:hover,
textarea:hover {
  border-color: #818cf8;
}

button,
.btn {
  border: none;
  border-radius: 12px;
  padding: 10px 20px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

button.primary,
.btn-primary {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #ffffff;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07), 0 4px 12px rgba(99, 102, 241, 0.3);
}

button.primary:hover,
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1), 0 8px 20px rgba(99, 102, 241, 0.4);
}

button:active {
  transform: scale(0.98);
}

.grid {
  gap: 16px;
}

input[type=checkbox] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: #6366f1;
}

.fab {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #ec4899);
  color: #ffffff;
  border: none;
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1), 0 8px 24px rgba(99, 102, 241, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  z-index: 1000;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fab:hover {
  transform: scale(1.15) translateY(-4px);
  box-shadow: 0 20px 25px rgba(0, 0, 0, 0.1), 0 12px 32px rgba(99, 102, 241, 0.5);
}

.fab:active {
  transform: scale(1.05);
}

@media (max-width: 768px) {
  .page {
    width: 95vw;
    margin: 16px auto;
    padding-bottom: 24px;
  }
  .page-title {
    padding: 20px 24px;
    border-radius: 16px;
  }
  .page-title h1 {
    font-size: 24px;
  }
  .tabs {
    gap: 6px;
    padding: 6px;
  }
  .tab {
    height: 40px;
    padding: 0 14px;
    font-size: 13px;
    border-radius: 12px;
  }
  .panel {
    padding: 18px;
    border-radius: 12px;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-gradient-start: #0f172a;
    --bg-gradient-mid: #1e293b;
    --bg-gradient-end: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.95);
    --card-border: rgba(99, 102, 241, 0.3);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
  }
  body {
    background: 
      radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
      radial-gradient(circle at 90% 10%, rgba(236, 72, 153, 0.12) 0%, transparent 40%),
      linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  }
  .tab {
    background: linear-gradient(180deg, #1e293b, #0f172a);
    color: #94a3b8;
  }
  .tab.is-active {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
  }
}

@media print {
  .no-print, .tabs, .lang-switch, .fab, button {
    display: none !important;
  }
  body { background: white; }
  .panel { box-shadow: none; border: 1px solid #e2e8f0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

.tab:focus, button:focus, input:focus, select:focus, .fab:focus {
  outline: 3px solid #6366f1;
  outline-offset: 2px;
}

.question-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96));
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 16px;
  padding: 20px;
  margin: 16px 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.question-card:hover {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
  transform: translateY(-2px);
  border-color: #818cf8;
}

hr {
  border: none;
  height: 2px;
  background: linear-gradient(90deg, transparent, #818cf8, transparent);
  margin: 24px 0;
}
/* Logo 样式增强 */
.site-logo {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, #6366f1, #ec4899);
  border: 2px solid rgba(255,255,255,0.3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(99,102,241,0.3);
  transition: all 0.3s ease;
  margin-right: 12px;
}
.site-logo:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(99,102,241,0.4);
}
.site-logo img {
  width: 40px;
  height: 40px;
  display: block;
}
.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

/* ===== 移动端优化 ===== */
@media (max-width: 768px) {
  button, .tab, .btn, input, select { min-height: 44px; min-width: 44px; }
  .a4-preview-check, .a4-preview-pages { display: none !important; }
  .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; flex-wrap: nowrap; }
  .tab { flex: 0 0 auto; margin-right: 8px; }
  input[type=number], input[type=text], select { font-size: 16px; width: 100%; }
  .grid.cols-4, .grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
  .fab { width: 50px; height: 50px; }
  .ah-fab-container { bottom: 16px; right: 16px; }
  .page-title h1 { font-size: 20px; }
  .lang-switch { position: static; margin-top: 12px; justify-content: center; }
}
@media (max-width: 480px) {
  .grid.cols-4, .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
  .tab { font-size: 12px; padding: 0 10px; }
}
@supports (padding: max(0px)) {
  body { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
  .ah-fab-container { right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); }
}
.mobile-share-btn { display: none; position: fixed; top: 80px; right: 16px; z-index: 999; width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, #6366f1, #ec4899); color: white; border: none; box-shadow: 0 4px 12px rgba(0,0,0,0.2); font-size: 20px; cursor: pointer; }
@media (max-width: 768px) { .mobile-share-btn { display: flex; align-items: center; justify-content: center; } }
.mobile-tip { display: none; background: linear-gradient(135deg, #6366f1, #ec4899); color: white; padding: 12px 16px; margin: 12px; border-radius: 12px; font-size: 14px; text-align: center; box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
@media (max-width: 768px) { .mobile-tip { display: block; } }
.mobile-tip .close { float: right; cursor: pointer; font-size: 18px; margin-left: 8px; }

/* 修复底部链接样式 */
.footer-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.footer-link {
  color: #64748b;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.2s ease;
  background: none;
  border: none;
  font-size: 14px;
  cursor: pointer;
}

.footer-link:hover {
  color: #6366f1;
  background: rgba(99, 102, 241, 0.1);
  text-decoration: none;
}

/* 隐藏旧的信息面板（改用独立页面） */
.info-panel, .mini-title, .info-body {
  display: none;
}

/* 移动端底部链接 */
@media (max-width: 768px) {
  .footer-links {
    gap: 8px;
  }
  .footer-link {
    font-size: 13px;
    padding: 6px 10px;
  }
}

/* 强制显示底部链接 */
.site-footer {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.footer-links {
  display: flex !important;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin: 20px 0 16px;
  visibility: visible !important;
}

.footer-link {
  display: inline-block !important;
  visibility: visible !important;
  color: #64748b;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.2s ease;
  font-size: 14px;
  font-weight: 500;
}

.footer-link:hover {
  color: #6366f1;
  background: rgba(99, 102, 241, 0.1);
  text-decoration: none;
}

/* 确保 info-panel 隐藏但不影响 footer */
.info-panel {
  display: none !important;
}
