/* ============================================
   nav2 v1.0.0-beta — Global Styles
   Design: Warm-tone modern minimalist + Eastern elegance
   ============================================ */

/* ── Design Tokens ── */
:root {
  --bg-base: oklch(0.97 0.012 85);
  --bg-card: oklch(0.99 0.005 85);
  --bg-elevated: oklch(1 0 0);
  --text-primary: oklch(0.18 0.02 85);
  --text-secondary: oklch(0.42 0.03 85);
  --text-tertiary: oklch(0.58 0.02 85);
  --accent: oklch(0.62 0.14 66);
  --accent-dim: oklch(0.72 0.1 66);
  --accent-glow: oklch(0.62 0.14 66 / 0.15);
  --border: oklch(0.88 0.02 85);
  --border-light: oklch(0.93 0.01 85);
  --shadow-sm: 0 1px 3px oklch(0 0 0 / 0.04);
  --shadow-md: 0 4px 16px oklch(0 0 0 / 0.06);
  --shadow-lg: 0 12px 40px oklch(0 0 0 / 0.08);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --font-heading: "PingFang SC", "Hiragino Sans GB", "Noto Serif SC", "Source Han Serif SC", "STSong", serif;
  --font-body: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Source Han Sans SC", system-ui, -apple-system, sans-serif;
  --transition-smooth: 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
  --transition-quick: 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
}

[data-theme="dark"] {
  --bg-base: oklch(0.15 0.01 85);
  --bg-card: oklch(0.19 0.01 85);
  --bg-elevated: oklch(0.22 0.01 85);
  --text-primary: oklch(0.91 0.01 85);
  --text-secondary: oklch(0.68 0.02 85);
  --text-tertiary: oklch(0.48 0.02 85);
  --accent: oklch(0.68 0.14 66);
  --accent-dim: oklch(0.58 0.1 66);
  --accent-glow: oklch(0.68 0.14 66 / 0.18);
  --border: oklch(0.28 0.01 85);
  --border-light: oklch(0.24 0.01 85);
  --shadow-sm: 0 1px 3px oklch(0 0 0 / 0.2);
  --shadow-md: 0 4px 16px oklch(0 0 0 / 0.3);
  --shadow-lg: 0 12px 40px oklch(0 0 0 / 0.4);
}

/* ── Reset & Base ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  transition: background var(--transition-smooth), color var(--transition-smooth);
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, var(--accent-glow), transparent),
    radial-gradient(ellipse 60% 40% at 90% 80%, oklch(0.62 0.14 66 / 0.05), transparent);
  pointer-events: none; z-index: 0;
  transition: opacity var(--transition-smooth);
}

/* ── Layout ── */
.app-container {
  position: relative; z-index: 1;
  max-width: 1060px; margin: 0 auto;
  padding: clamp(20px, 4vw, 40px) clamp(16px, 4vw, 32px);
  min-height: 100vh;
  display: flex; flex-direction: column;
}

/* ── Top Bar ── */
.top-bar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: clamp(28px, 5vw, 44px); gap: 16px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-family: var(--font-heading); font-size: 1rem; font-weight: 700;
  box-shadow: 0 2px 12px oklch(0.62 0.14 66 / 0.3);
  transition: transform var(--transition-quick); user-select: none;
}
.brand-logo:hover { transform: scale(1.05); }
.brand-text h1 {
  font-family: var(--font-heading); font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  font-weight: 700; letter-spacing: 0.04em; color: var(--text-primary); line-height: 1.2;
}
.brand-text span {
  font-family: var(--font-body); font-size: 0.72rem; font-weight: 400;
  color: var(--text-tertiary); letter-spacing: 0.08em;
}
.top-actions { display: flex; align-items: center; gap: 8px; }

.btn-icon {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg-card); color: var(--text-secondary);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all var(--transition-quick); font-size: 1.15rem; position: relative;
}
.btn-icon:hover { background: var(--bg-elevated); color: var(--text-primary); border-color: var(--accent-dim); box-shadow: var(--shadow-sm); }
.btn-icon:active { transform: scale(0.95); }
.theme-toggle .icon-sun, .theme-toggle .icon-moon { position: absolute; transition: all 0.4s cubic-bezier(0.22, 0.61, 0.36, 1); }
[data-theme="light"] .icon-moon { opacity: 1; transform: rotate(0); }
[data-theme="light"] .icon-sun  { opacity: 0; transform: rotate(90deg) scale(0.5); }
[data-theme="dark"]  .icon-moon { opacity: 0; transform: rotate(-90deg) scale(0.5); }
[data-theme="dark"]  .icon-sun  { opacity: 1; transform: rotate(0); }

/* ── Search ── */
.search-section { text-align: center; margin-bottom: clamp(32px, 5vw, 44px); }
.search-section h2 {
  font-family: var(--font-heading); font-size: clamp(1.4rem, 3vw, 1.8rem);
  font-weight: 700; color: var(--text-primary); margin-bottom: 4px; letter-spacing: 0.02em;
}
.search-section .greeting-sub { color: var(--text-tertiary); font-size: 0.88rem; margin-bottom: 24px; }
.search-wrapper { position: relative; max-width: 520px; margin: 0 auto; }
.search-input {
  width: 100%; height: 48px; padding: 0 48px 0 18px;
  border: 2px solid var(--border); border-radius: var(--radius-lg);
  background: var(--bg-elevated); font-family: var(--font-body); font-size: 0.95rem;
  color: var(--text-primary); outline: none;
  transition: all var(--transition-smooth); box-shadow: var(--shadow-sm);
}
.search-input::placeholder { color: var(--text-tertiary); }
.search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-glow), var(--shadow-md); }
.search-btn {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border-radius: 50%; border: none;
  background: var(--accent); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 0.95rem;
  transition: all var(--transition-quick);
}
.search-btn:hover { background: oklch(0.55 0.16 50); transform: translateY(-50%) scale(1.08); }
.search-btn:active { transform: translateY(-50%) scale(0.94); }
.search-hint { margin-top: 10px; display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.search-hint kbd {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 6px;
  background: var(--bg-card); border: 1px solid var(--border-light);
  font-size: 0.73rem; font-family: var(--font-body); color: var(--text-tertiary);
}
.search-hint kbd .key {
  display: inline-block; padding: 1px 5px; border-radius: 3px;
  background: var(--bg-elevated); border: 1px solid var(--border);
  font-size: 0.68rem; font-weight: 600; color: var(--text-secondary);
}
.search-suggestion-item.active { background: var(--accent-glow) !important; }

/* ── Buttons ── */
.btn {
  padding: 10px 22px; border-radius: var(--radius-sm);
  font-family: var(--font-body); font-size: 0.875rem; font-weight: 600;
  cursor: pointer; border: none; transition: all var(--transition-quick);
  display: inline-flex; align-items: center; justify-content: center;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: oklch(0.55 0.16 50); transform: translateY(-1px); box-shadow: 0 4px 12px oklch(0.62 0.14 66 / 0.3); }
.btn-ghost { background: transparent; color: var(--text-secondary); border: 1px solid var(--border); text-decoration: none; }
.btn-ghost:hover { background: var(--bg-card); color: var(--text-primary); }

/* ── Footer ── */
.app-footer {
  margin-top: auto;
  padding-top: clamp(32px, 5vw, 48px);
  text-align: center;
  color: var(--text-tertiary);
  font-size: 0.78rem;
}
.footer-icp { margin-top: 4px; font-size: 0.75rem; color: var(--text-tertiary); }

/* ── Animations ── */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
