/**
 * Nag 官方网站 - 核心样式
 * 遵循 Native iOS First 设计理念与 Apple HIG
 */

:root {
  /* 基础色彩体系 (默认跟随浅色/系统明亮) */
  --bg-page: #F5F5F7;
  --bg-card: #FFFFFF;
  --bg-card-secondary: #F2F2F7;
  --bg-card-hover: #EBEBF0;
  --bg-nav: rgba(245, 245, 247, 0.8);
  --border-color: rgba(60, 60, 67, 0.12);
  --border-subtle: rgba(60, 60, 67, 0.06);

  /* 文本语义色 (参考 iOS System Colors) */
  --text-primary: #1D1D1F;
  --text-secondary: #6E6E73;
  --text-tertiary: #86868B;
  --text-quaternary: #AEAEC2;

  /* 强调色与品牌点缀 */
  --accent-color: #000000;
  --accent-contrast: #FFFFFF;
  --accent-blue: #0071E3;
  --accent-orange: #FF9500;
  --accent-green: #34C759;
  --accent-red: #FF3B30;

  /* 阴影与圆角 */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-xl: 32px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.1);
  --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.05);

  /* 字体族 */
  --font-serif: -apple-system-ui-serif, ui-serif, 'New York', Georgia, 'Songti SC', 'Source Han Serif SC', serif;
  --font-sans: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'PingFang SC', 'Helvetica Neue', sans-serif;

  /* 动画 */
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 0.2s var(--ease-spring);
  --transition-normal: 0.35s var(--ease-spring);
}

[data-theme="dark"] {
  --bg-page: #000000;
  --bg-card: #1C1C1E;
  --bg-card-secondary: #2C2C2E;
  --bg-card-hover: #3A3A3C;
  --bg-nav: rgba(0, 0, 0, 0.75);
  --border-color: rgba(255, 255, 255, 0.12);
  --border-subtle: rgba(255, 255, 255, 0.06);

  --text-primary: #F5F5F7;
  --text-secondary: #8E8E93;
  --text-tertiary: #636366;
  --text-quaternary: #48484A;

  --accent-color: #FFFFFF;
  --accent-contrast: #000000;
  --accent-blue: #2997FF;
  --accent-orange: #FF9F0A;
  --accent-green: #30D158;
  --accent-red: #FF453A;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.6);
  --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
}

/* 全局重置与排版 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-primary);
  scroll-behavior: smooth;
  text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  outline: none;
}

/* 布局工具 */
.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: 96px 0;
}

.section-title-wrap {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 64px auto;
}

.section-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--bg-card-secondary);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-full);
  margin-bottom: 16px;
  border: 1px solid var(--border-subtle);
}

.section-title {
  font-family: var(--font-serif);
  font-size: 38px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
  color: var(--text-primary);
  line-height: 1.25;
}

.section-desc {
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* 按钮规范 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent-color);
  color: var(--accent-contrast);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  opacity: 0.92;
}

.btn-primary:active {
  transform: translateY(0) scale(0.98);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--bg-card-secondary);
  border-color: var(--text-tertiary);
}

.btn-pill {
  padding: 8px 16px;
  font-size: 13px;
}

/* 顶部导航 Header */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: var(--bg-nav);
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--transition-normal);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
}

.nav-brand img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
  list-style: none;
}

.nav-link {
  font-size: 14px;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
  font-weight: 450;
}

.nav-link:hover {
  color: var(--text-primary);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* 控件选择器 (外观/语言) */
.segmented-picker {
  display: inline-flex;
  align-items: center;
  background: var(--bg-card-secondary);
  border-radius: var(--radius-full);
  padding: 3px;
  border: 1px solid var(--border-subtle);
}

.segmented-picker button {
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
}

.segmented-picker button.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.mobile-menu-btn {
  display: none;
  font-size: 20px;
  padding: 8px;
  color: var(--text-primary);
}

/* 页脚 Footer */
.footer {
  border-top: 1px solid var(--border-color);
  background: var(--bg-page);
  padding: 64px 0 40px 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 40px;
  margin-bottom: 48px;
}

.footer-col h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col a {
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.footer-col a:hover {
  color: var(--text-primary);
}

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-disclaimer {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 8px;
  line-height: 1.5;
}
