/* ==========================================================================
   style.css - 國小特教數學【時間乘除】現代美學與基礎佈局
   採用溫暖柔和的皮克斯/吉卜力護眼配色，結構清晰，層次分明。
   ========================================================================== */

:root {
  --primary: #4f46e5;
  --primary-light: #e0e7ff;
  --primary-dark: #3730a3;
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border-color: #cbd5e1;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.12);
  --font-main: "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", system-ui, sans-serif;
  --font-num: "Nunito", "Quicksand", "Comic Sans MS", "Microsoft JhengHei", sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
}

/* 頂部主導航列 */
.app-header {
  background: linear-gradient(135deg, #4338ca 0%, #6366f1 100%);
  color: #ffffff;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  font-size: 2rem;
  background: rgba(255, 255, 255, 0.2);
  padding: 6px 12px;
  border-radius: var(--radius-md);
}

.brand-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.brand-subtitle {
  font-size: 0.85rem;
  opacity: 0.9;
  font-weight: 400;
}

/* 控制列（白板/模式/語音） */
.header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-ctrl {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  user-select: none;
}

.btn-ctrl:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: translateY(-1px);
}

.btn-ctrl.active {
  background: #fbbf24;
  color: #78350f;
  border-color: #f59e0b;
}

/* 主分頁標籤導航 */
.nav-tabs {
  background: #ffffff;
  border-bottom: 2px solid #e2e8f0;
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 8px 16px;
  overflow-x: auto;
}

.tab-btn {
  background: transparent;
  border: none;
  padding: 12px 24px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--primary);
  background: var(--primary-light);
}

.tab-btn.active {
  color: #ffffff;
  background: var(--primary);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

/* 主內容區塊 */
.main-container {
  max-width: 1300px;
  margin: 24px auto;
  padding: 0 20px;
  min-height: calc(100vh - 180px);
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-content.active {
  display: block;
}

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

/* 通用卡片容器 */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  border: 1.5px solid var(--border-color);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  border-bottom: 2px dashed #f1f5f9;
  padding-bottom: 12px;
}

.card-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #1e1b4b;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 特教按鈕系統 */
.btn-primary {
  background: var(--primary);
  color: #ffffff;
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: #f1f5f9;
  color: #334155;
  border: 1.5px solid #cbd5e1;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: #e2e8f0;
}

.btn-success {
  background: #10b981;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-success:hover {
  background: #059669;
}

/* 頁尾 */
.app-footer {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: 0.95rem;
  border-top: 1.5px solid #e2e8f0;
  background: #ffffff;
  margin-top: 40px;
}
