/* ============================================
   Apple Design Theme — GllG Chem 教学平台
   ============================================ */

:root {
  /* ---- Apple Color Palette ---- */
  --apple-bg: #f5f5f7;
  --apple-bg-alt: #fafafa;
  --apple-surface: #ffffff;
  --apple-glass: rgba(255, 255, 255, 0.72);
  --apple-glass-strong: rgba(255, 255, 255, 0.88);

  --apple-text: #1d1d1f;
  --apple-text-secondary: #6e6e73;
  --apple-text-tertiary: #86868b;
  --apple-text-placeholder: #aeaeb2;

  --apple-accent: #0071e3;
  --apple-accent-hover: #0077ed;
  --apple-accent-pressed: #006edb;
  --apple-accent-light: rgba(0, 113, 227, 0.08);

  --apple-red: #ff3b30;
  --apple-orange: #ff9500;
  --apple-yellow: #ffcc00;
  --apple-green: #34c759;
  --apple-teal: #5ac8fa;
  --apple-indigo: #5856d6;
  --apple-purple: #af52de;

  --apple-divider: rgba(0, 0, 0, 0.06);
  --apple-border: rgba(0, 0, 0, 0.08);
  --apple-border-focus: rgba(0, 113, 227, 0.4);

  /* ---- Apple Shadows ---- */
  --apple-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04), 0 2px 8px rgba(0, 0, 0, 0.04);
  --apple-shadow-md: 0 2px 4px rgba(0, 0, 0, 0.02), 0 8px 24px rgba(0, 0, 0, 0.06);
  --apple-shadow-lg: 0 4px 8px rgba(0, 0, 0, 0.02), 0 16px 40px rgba(0, 0, 0, 0.08);
  --apple-shadow-xl: 0 8px 16px rgba(0, 0, 0, 0.02), 0 24px 56px rgba(0, 0, 0, 0.1);

  /* ---- Apple Radius ---- */
  --apple-radius-sm: 8px;
  --apple-radius-md: 12px;
  --apple-radius-lg: 16px;
  --apple-radius-xl: 20px;
  --apple-radius-pill: 980px;

  /* ---- Apple Typography ---- */
  --apple-font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "PingFang SC", "Helvetica Neue", sans-serif;
  --apple-font-mono: "SF Mono", "PingFang SC", ui-monospace, monospace;

  /* ---- Apple Transitions ---- */
  --apple-ease: cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* ============================================
   Global Reset
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--apple-font);
  color: var(--apple-text);
  background: var(--apple-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

/* ============================================
   Input Fields — Apple Style
   ============================================ */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="search"],
input[type="tel"],
input[type="url"],
textarea,
select {
  width: 100%;
  padding: 12px 16px;
  font-family: var(--apple-font);
  font-size: 15px;
  color: var(--apple-text);
  background: rgba(0, 0, 0, 0.02);
  border: 0.5px solid var(--apple-border);
  border-radius: var(--apple-radius-md);
  outline: none;
  transition: all 0.2s var(--apple-ease);
  -webkit-appearance: none;
  appearance: none;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--apple-accent);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.14);
  background: var(--apple-surface);
}

input::placeholder,
textarea::placeholder {
  color: var(--apple-text-placeholder);
}

/* ============================================
   Buttons — Apple Style
   ============================================ */

/* Primary Button */
.apple-btn-primary,
button.apple-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px 20px;
  font-family: var(--apple-font);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.2px;
  color: #ffffff;
  background: var(--apple-accent);
  border: none;
  border-radius: var(--apple-radius-md);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s var(--apple-ease);
  user-select: none;
}

.apple-btn-primary:hover {
  background: var(--apple-accent-hover);
  box-shadow: 0 2px 12px rgba(0, 113, 227, 0.24);
}

.apple-btn-primary:active {
  background: var(--apple-accent-pressed);
  box-shadow: none;
  transform: scale(0.98);
}

/* Secondary Button */
.apple-btn-secondary,
button.apple-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px 20px;
  font-family: var(--apple-font);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.1px;
  color: var(--apple-text);
  background: rgba(0, 0, 0, 0.04);
  border: none;
  border-radius: var(--apple-radius-md);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s var(--apple-ease);
}

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

.apple-btn-secondary:active {
  background: rgba(0, 0, 0, 0.12);
}

/* Ghost Button */
.apple-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  font-family: var(--apple-font);
  font-size: 14px;
  font-weight: 500;
  color: var(--apple-accent);
  background: transparent;
  border: none;
  border-radius: var(--apple-radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s var(--apple-ease);
}

.apple-btn-ghost:hover {
  background: var(--apple-accent-light);
}

/* ============================================
   Cards — Apple Frosted Glass
   ============================================ */

/* Glass Card */
.apple-card {
  background: var(--apple-glass-strong);
  backdrop-filter: blur(32px) saturate(200%);
  -webkit-backdrop-filter: blur(32px) saturate(200%);
  border: 0.5px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--apple-radius-xl);
  box-shadow: var(--apple-shadow-xl);
  padding: 32px;
}

/* Solid Card */
.apple-card-solid {
  background: var(--apple-surface);
  border: 0.5px solid var(--apple-border);
  border-radius: var(--apple-radius-xl);
  box-shadow: var(--apple-shadow-md);
  padding: 24px;
}

/* ============================================
   Links
   ============================================ */
.apple-link {
  color: var(--apple-accent);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s ease;
}

.apple-link:hover {
  color: var(--apple-accent-hover);
  text-decoration: underline;
}

/* ============================================
   Labels
   ============================================ */
.apple-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--apple-text-secondary);
  letter-spacing: -0.08px;
}

/* ============================================
   Checkbox & Toggle
   ============================================ */
input[type="checkbox"] {
  accent-color: var(--apple-accent);
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* ============================================
   Dividers
   ============================================ */
.apple-divider {
  height: 0.5px;
  background: var(--apple-divider);
  border: none;
  margin: 16px 0;
}

/* ============================================
   Badge / Tag
   ============================================ */
.apple-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--apple-accent);
  background: var(--apple-accent-light);
  border-radius: var(--apple-radius-pill);
}

/* ============================================
   Scrollbar
   ============================================ */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.2);
}

/* ============================================
   Animations
   ============================================ */
@keyframes apple-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes apple-scale-in {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.apple-animate-in {
  animation: apple-fade-in 0.4s var(--apple-ease) both;
}

/* ============================================
   Back Navigation Button — Apple Style
   ============================================ */
#back-button a {
  background: var(--apple-glass-strong) !important;
  backdrop-filter: blur(32px) saturate(200%) !important;
  -webkit-backdrop-filter: blur(32px) saturate(200%) !important;
  border: 0.5px solid rgba(255, 255, 255, 0.5) !important;
  box-shadow: var(--apple-shadow-md) !important;
  color: var(--apple-text) !important;
  font-family: var(--apple-font) !important;
  font-weight: 600 !important;
  transition: all 0.2s var(--apple-ease) !important;
  border-radius: var(--apple-radius-pill) !important;
  padding: 8px 16px !important;
}
#back-button a:hover {
  background: var(--apple-surface) !important;
  box-shadow: var(--apple-shadow-lg) !important;
}

#chem-back-to-nav {
  background: var(--apple-glass-strong) !important;
  backdrop-filter: blur(32px) saturate(200%) !important;
  -webkit-backdrop-filter: blur(32px) saturate(200%) !important;
  border: 0.5px solid rgba(255, 255, 255, 0.5) !important;
  box-shadow: var(--apple-shadow-md) !important;
  color: var(--apple-text) !important;
  font-family: var(--apple-font) !important;
  font-weight: 600 !important;
  border-radius: var(--apple-radius-pill) !important;
  padding: 8px 16px !important;
}
#chem-back-to-nav:hover {
  background: var(--apple-surface) !important;
  box-shadow: var(--apple-shadow-lg) !important;
}

/* ============================================
   Utility: chem nav elements (enabled)
   ============================================ */
