/* ==========================================================================
   仙田信息科技智慧课堂 - 苹果设计语言系统规范 (DESIGN.md 100% 像素级对齐)
   Apple-design-analysis: A photography-first interface framed by SF Pro typography,
   edge-to-edge product tiles, and single Action Blue (#0071e3 / #0066cc).
   ========================================================================== */

:root {
  /* Apple Design Tokens */
  --apple-primary: #0071e3;
  --apple-primary-hover: #0077ed;
  --apple-primary-active: #0066cc;
  --apple-primary-on-dark: #2997ff;
  
  --apple-ink: #1d1d1f;
  --apple-ink-muted-80: #333333;
  --apple-ink-muted-48: #7a7a7a;
  --apple-body-on-dark: #ffffff;
  --apple-body-muted: #cccccc;

  --apple-canvas: #ffffff;
  --apple-canvas-parchment: #f5f5f7;
  --apple-surface-pearl: #fafafc;
  --apple-surface-tile-1: #161617;
  --apple-surface-tile-2: #272729;
  --apple-surface-tile-3: #2a2a2c;
  --apple-surface-black: #000000;
  
  --apple-hairline: #e0e0e0;
  --apple-divider-soft: #f0f0f0;
  --apple-hairline-dark: rgba(255, 255, 255, 0.15);

  /* Typography Stacks */
  --font-display: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", sans-serif;
  --font-text: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", sans-serif;

  /* Elevation */
  --apple-product-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
  --apple-card-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);

  /* Dual Theme Variables */
  --bg-primary: var(--apple-canvas);
  --bg-secondary: var(--apple-canvas-parchment);
  --bg-card: var(--apple-canvas);
  --text-primary: var(--apple-ink);
  --text-secondary: var(--apple-ink-muted-80);
  --text-muted: var(--apple-ink-muted-48);
  --border-color: var(--apple-hairline);
  --positive-color: #34c759; /* Apple System Green */
  --positive-bg: rgba(52, 199, 89, 0.12);
  --negative-color: #ff3b30; /* Apple System Red */
  --negative-bg: rgba(255, 59, 48, 0.12);
}

/* 暗色模式变量 */
html.dark {
  --bg-primary: var(--apple-surface-tile-1);
  --bg-secondary: var(--apple-surface-tile-2);
  --bg-card: var(--apple-surface-tile-2);
  --text-primary: var(--apple-body-on-dark);
  --text-secondary: var(--apple-body-muted);
  --text-muted: #86868b;
  --border-color: var(--apple-hairline-dark);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-text);
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -0.374px;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
}

/* ==========================================================================
   Apple Global Navigation (44px, Ultra-thin, 浅色半透明毛玻璃，完全匹配官网截图)
   ========================================================================== */
.apple-global-nav {
  height: 44px;
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  position: sticky;
  top: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

html.dark .apple-global-nav {
  background-color: rgba(0, 0, 0, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.apple-global-nav-inner {
  max-width: 1024px;
  width: 100%;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.apple-nav-link {
  font-family: var(--font-text);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: -0.12px;
  color: rgba(29, 29, 31, 0.8);
  text-decoration: none;
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.apple-nav-link:hover {
  color: #000000;
}

html.dark .apple-nav-link {
  color: rgba(255, 255, 255, 0.8);
}

html.dark .apple-nav-link:hover {
  color: #ffffff;
}

.apple-logo-icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
  color: #1d1d1f;
  transition: color 0.2s ease;
}

html.dark .apple-logo-icon {
  color: rgba(255, 255, 255, 0.95);
}

/* ==========================================================================
   Apple Sub-Nav Frosted (52px, Sticky secondary bar)
   ========================================================================== */
.apple-sub-nav {
  height: 52px;
  background-color: rgba(245, 245, 247, 0.8);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 44px;
  z-index: 9990;
  display: flex;
  align-items: center;
  justify-content: center;
}

html.dark .apple-sub-nav {
  background-color: rgba(22, 22, 23, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.apple-sub-nav-inner {
  max-width: 1024px;
  width: 100%;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.apple-sub-nav-title {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.231px;
  color: var(--text-primary);
  text-decoration: none;
}

.apple-sub-nav-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

/* ==========================================================================
   Apple Ribbon Banner (纯白底色，墨黑正文，Action Blue 链接，1:1 匹配官网截图)
   ========================================================================== */
.apple-ribbon {
  background-color: #ffffff;
  color: var(--apple-ink);
  font-size: 14px;
  line-height: 1.43;
  padding: 12px 1rem;
  text-align: center;
  border-bottom: 1px solid var(--apple-hairline);
}
html.dark .apple-ribbon {
  background-color: #161617;
  color: #f5f5f7;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.apple-ribbon a {
  color: var(--apple-primary);
  text-decoration: none;
  font-weight: 400;
}
html.dark .apple-ribbon a {
  color: var(--apple-primary-on-dark);
}
.apple-ribbon a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Apple Buttons (Pill Grammar)
   ========================================================================== */
.apple-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--apple-primary);
  color: #ffffff !important;
  font-family: var(--font-text);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.17;
  padding: 11px 22px;
  border-radius: 9999px; /* rounded.pill */
  border: none;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.2s ease;
  user-select: none;
}

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

.apple-btn-primary:active {
  transform: scale(0.95); /* Apple's system-wide micro-interaction */
  background-color: var(--apple-primary-active);
}

.apple-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  color: var(--apple-primary);
  font-family: var(--font-text);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.17;
  padding: 10px 21px;
  border-radius: 9999px;
  border: 1px solid var(--apple-primary);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.2s ease;
  user-select: none;
}

html.dark .apple-btn-secondary {
  color: var(--apple-primary-on-dark);
  border-color: var(--apple-primary-on-dark);
}

.apple-btn-secondary:hover {
  background-color: rgba(0, 113, 227, 0.08);
}

.apple-btn-secondary:active {
  transform: scale(0.95);
}

/* 小型次级药丸按钮 */
.apple-btn-small {
  font-size: 12px;
  padding: 4px 11px;
  border-radius: 9999px;
}

/* ==========================================================================
   Apple Full-Bleed Product Tiles (交替黑白卡片区块)
   ========================================================================== */
.apple-tile {
  width: 100%;
  padding: 80px 1.5rem; /* {spacing.section} */
  text-align: center;
  position: relative;
  overflow: hidden;
}

.apple-tile-dark {
  background-color: var(--apple-surface-black);
  color: #ffffff;
}

.apple-tile-dark-2 {
  background-color: var(--apple-surface-tile-1);
  color: #ffffff;
}

.apple-tile-light {
  background-color: var(--apple-canvas);
  color: var(--apple-ink);
}

.apple-tile-parchment {
  background-color: var(--apple-canvas-parchment);
  color: var(--apple-ink);
}

/* Typography Inside Tiles */
.apple-headline {
  font-family: var(--font-display);
  font-size: 56px; /* {typography.hero-display} */
  font-weight: 600;
  line-height: 1.07;
  letter-spacing: -0.28px;
  margin-bottom: 8px;
}

.apple-headline-md {
  font-family: var(--font-display);
  font-size: 40px; /* {typography.display-lg} */
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: 0;
  margin-bottom: 8px;
}

.apple-subhead {
  font-family: var(--font-display);
  font-size: 28px; /* {typography.lead} */
  font-weight: 400;
  line-height: 1.14;
  letter-spacing: 0.196px;
  margin-bottom: 17px;
  color: var(--apple-body-muted);
}

.apple-tile-light .apple-subhead {
  color: var(--apple-ink-muted-80);
}

.apple-tagline {
  font-family: var(--font-display);
  font-size: 21px; /* {typography.tagline} */
  font-weight: 600;
  line-height: 1.19;
  letter-spacing: 0.231px;
  margin-bottom: 17px;
}

.apple-cta-group {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 17px;
  margin-top: 17px;
  margin-bottom: 40px;
}

/* ==========================================================================
   Apple Product Image Container & Signature Elevation
   ========================================================================== */
.apple-product-render {
  max-width: 1024px;
  margin: 0 auto;
  position: relative;
  /* Signature Apple drop shadow: only on product images resting on a surface */
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.45));
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.apple-product-render:hover {
  transform: translateY(-4px);
}

/* ==========================================================================
   Apple Store Utility Cards (18px rounded, 1px hairline border)
   ========================================================================== */
.apple-utility-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
  text-align: left;
}

.apple-utility-card {
  background-color: var(--apple-canvas);
  border: 1px solid var(--apple-hairline);
  border-radius: 18px; /* {rounded.lg} */
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-decoration: none;
  color: var(--apple-ink);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

html.dark .apple-utility-card {
  background-color: var(--apple-surface-tile-2);
  border-color: var(--apple-hairline-dark);
  color: var(--apple-body-on-dark);
}

.apple-utility-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

.apple-card-badge {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--apple-ink-muted-48);
  margin-bottom: 8px;
}

.apple-card-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 10px;
}

.apple-card-desc {
  font-size: 15px;
  line-height: 1.5;
  color: var(--apple-ink-muted-80);
  margin-bottom: 24px;
}
html.dark .apple-card-desc {
  color: var(--apple-body-muted);
}

.apple-card-link {
  font-size: 15px;
  color: var(--apple-primary);
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 4px;
}
html.dark .apple-card-link {
  color: var(--apple-primary-on-dark);
}
.apple-card-link:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Apple Footer (64px padding, 2.41 line-height dense links)
   ========================================================================== */
.apple-footer {
  background-color: var(--apple-canvas-parchment);
  color: var(--apple-ink-muted-80);
  font-size: 12px;
  line-height: 1.33;
  padding: 64px 1.5rem 40px;
  border-top: 1px solid var(--apple-hairline);
}
html.dark .apple-footer {
  background-color: #121214;
  color: #86868b;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.apple-footer-inner {
  max-width: 1024px;
  margin: 0 auto;
}

.apple-footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.apple-footer-col h4 {
  font-size: 12px;
  font-weight: 600;
  color: var(--apple-ink);
  margin-bottom: 10px;
}
html.dark .apple-footer-col h4 {
  color: #ffffff;
}

.apple-footer-col ul {
  list-style: none;
}

.apple-footer-col li {
  line-height: 2.41; /* {typography.dense-link} relaxed leading */
}

.apple-footer-col a {
  color: inherit;
  text-decoration: none;
}
.apple-footer-col a:hover {
  color: var(--apple-ink);
  text-decoration: underline;
}
html.dark .apple-footer-col a:hover {
  color: #ffffff;
}

.apple-footer-legal {
  padding-top: 20px;
  border-top: 1px solid var(--apple-hairline);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--apple-ink-muted-48);
}
html.dark .apple-footer-legal {
  border-top-color: rgba(255, 255, 255, 0.08);
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 768px) {
  .apple-headline {
    font-size: 38px;
  }
  .apple-headline-md {
    font-size: 32px;
  }
  .apple-subhead {
    font-size: 21px;
  }
  .apple-tile {
    padding: 56px 1.25rem;
  }
  .apple-global-nav-links {
    display: none;
  }
}

/* ==========================================================================
   全站顶栏角色切换徽章 (教师端 / 学生端)
   ========================================================================== */
.apple-nav-role-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 9999px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.apple-nav-role-badge.teacher {
  background: rgba(0, 113, 227, 0.1);
  color: var(--apple-primary);
  border: 1px solid rgba(0, 113, 227, 0.25);
}
.apple-nav-role-badge.teacher:hover {
  background: var(--apple-primary);
  color: #ffffff;
  transform: scale(0.98);
}
.apple-nav-role-badge.student {
  background: rgba(0, 0, 0, 0.05);
  color: var(--apple-ink);
  border: 1px solid var(--apple-hairline);
}
.apple-nav-role-badge.student:hover {
  background: rgba(0, 0, 0, 0.09);
  color: var(--apple-primary);
  transform: scale(0.98);
}
html.dark .apple-nav-role-badge.student {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.18);
}
html.dark .apple-nav-role-badge.student:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #38bdf8;
}

/* 评价看板系统一致配色（无绿色，纯正 Apple 蓝/黑/灰/白） */
.eval-apple-theme {
  background: var(--apple-bg);
  color: var(--apple-ink);
}
.eval-apple-control-bar {
  background: #ffffff;
  border: 1px solid var(--apple-hairline);
  border-radius: 18px;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--apple-card-shadow);
}
html.dark .eval-apple-control-bar {
  background: #1c1c1e;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.4);
}

