/* ============================================================
   Apple & GitHub Primer Inspired Design System (苹果与GitHub极简美学)
   ============================================================ */

:root {
  /* 苹果Keynote深邃皇家海蓝 (深邃、通透、高雅、不发黑不发绿) */
  --bg-deep: #050b18;
  --bg-stage: radial-gradient(circle at 50% 10%, #11254e 0%, #081229 55%, #030712 100%);
  --bg-card: rgba(14, 27, 56, 0.72);
  --bg-card-hover: rgba(20, 38, 77, 0.85);
  --bg-card-solid: #0d1b38;
  --bg-elevated: #152b56;

  /* 苹果高质感毛玻璃与发丝线 */
  --border-subtle: rgba(255, 255, 255, 0.1);
  --border-card: rgba(56, 189, 248, 0.22);
  --border-active: rgba(56, 189, 248, 0.65);
  --border-focus: #38bdf8;

  /* 核心主色：苹果深海蔚蓝 (Apple System Blue) 与 典雅香槟金 */
  --apple-blue: #0071e3;
  --apple-blue-hover: #0077ed;
  --apple-blue-light: #38bdf8;
  --apple-cyan: #06b6d4;
  --apple-gold: #f59e0b;
  --apple-gold-light: #fbbf24;
  --apple-red: #ff453a;
  --apple-green: #30d158;

  /* 文本层次 (高对比度、清晰透亮) */
  --text-primary: #ffffff;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;
  --text-link: #38bdf8;
  --text-accent: #7dd3fc;

  /* 物理投影体系 (微质感、不溢出) */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.55);
  --shadow-glow: 0 0 30px rgba(56, 189, 248, 0.3);
  --glass-specular: inset 0 1px 0 rgba(255, 255, 255, 0.15);

  /* 字体系统 (对齐苹果 San Francisco 与 GitHub 规范) */
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "SF Mono", "DIN Alternate", ui-monospace, Menlo, Monaco, Consolas, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-deep);
  background-image: var(--bg-stage);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: var(--font-sans);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 舞台环境光晕 */
.ambient-stage-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  background: 
    radial-gradient(ellipse 70% 50% at 50% -10%, rgba(56, 189, 248, 0.16), transparent 70%),
    radial-gradient(ellipse 50% 50% at 85% 95%, rgba(0, 113, 227, 0.12), transparent 70%);
}

/* ============================================================
   苹果风格按钮系统 (Apple Button System)
   ============================================================ */

/* 1. 苹果主操作胶囊按钮 (Apple Primary Action Button) */
.btn-apple-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  padding: 12px 26px;
  border-radius: 9999px; /* 苹果全圆角胶囊 */
  background: linear-gradient(180deg, #0077ed 0%, #0062c4 100%);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 4px 14px rgba(0, 113, 227, 0.35),
    0 1px 2px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  outline: none;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.btn-apple-primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #0a84ff 0%, #0071e3 100%);
  transform: translateY(-1px);
  box-shadow: 
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    0 6px 20px rgba(0, 113, 227, 0.5),
    0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-apple-primary:active:not(:disabled) {
  transform: scale(0.97) translateY(1px);
  box-shadow: 
    inset 0 1px 0 rgba(0, 0, 0, 0.2),
    0 2px 6px rgba(0, 113, 227, 0.3);
}

.btn-apple-primary:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* 2. 苹果半透明毛玻璃次级按钮 (Apple Glass Button) */
.btn-apple-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15), 0 2px 8px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  outline: none;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-apple-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}

.btn-apple-secondary:active:not(:disabled) {
  transform: scale(0.97) translateY(1px);
  background: rgba(255, 255, 255, 0.06);
}

.btn-apple-secondary:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none !important;
}

/* 3. 苹果危险/警示按钮 (Apple Red) */
.btn-apple-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 9999px;
  background: rgba(255, 69, 58, 0.15);
  color: #ff6961;
  border: 1px solid rgba(255, 69, 58, 0.35);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-apple-danger:hover:not(:disabled) {
  background: rgba(255, 69, 58, 0.25);
  border-color: rgba(255, 69, 58, 0.6);
  transform: translateY(-1px);
}

.btn-apple-danger:active:not(:disabled) {
  transform: scale(0.97);
}

.btn-apple-danger:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none !important;
}

/* ============================================================
   苹果与 GitHub 材质卡片 (Liquid Glass Panel)
   ============================================================ */
.apple-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  box-shadow: var(--shadow-lg), var(--glass-specular);
  position: relative;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.apple-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

/* ============================================================
   苹果分段控制器 (Apple Segmented Control)
   ============================================================ */
.apple-segmented-control {
  display: inline-flex;
  background: rgba(0, 0, 0, 0.28);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}

.apple-segmented-item {
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.apple-segmented-item:hover {
  color: #ffffff;
}

.apple-segmented-item.active {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* ============================================================
   状态药丸 (iOS Pill)
   ============================================================ */
.apple-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary);
  backdrop-filter: blur(8px);
}

.apple-status-pill.live {
  background: rgba(0, 113, 227, 0.18);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}

.apple-status-pill.live .status-dot {
  background: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
}

.apple-status-pill.ended {
  background: rgba(255, 69, 58, 0.15);
  border-color: rgba(255, 69, 58, 0.3);
  color: #ff6961;
}

.apple-status-pill.ended .status-dot {
  background: #ff453a;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-tertiary);
}

/* ============================================================
   GitHub 级数据表格 (GitHub Primer Table)
   ============================================================ */
.primer-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.primer-table th {
  padding: 14px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.12);
}

.primer-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
}

.primer-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
}

.primer-table tr.selected td {
  background: rgba(0, 113, 227, 0.1);
  border-color: rgba(0, 113, 227, 0.25);
  color: var(--text-primary);
}

/* 高级等宽数字 (Tabular Typography) */
.tabular-num {
  font-family: var(--font-mono);
  font-feature-settings: "tnum" 1, "zero" 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

/* 滚动条定制 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}
