/* /css/common.css — 多产品平台共享样式（设计令牌 + 通用组件） */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Design Tokens ── */
:root {
  --bg-base:        oklch(0.99 0 0);
  --bg-surface:     oklch(0.95 0 0);
  --bg-elevated:    oklch(0.9 0 0);
  --bg-hover:       oklch(0.85 0 0);
  --accent:         oklch(0.58 0.24 27);
  --accent-dim:     oklch(0.48 0.21 27);
  --accent-glow:    oklch(0.64 0.25 27);
  --accent-subtle:  oklch(0.58 0.24 27 / 0.1);
  --accent-subtle2: oklch(0.58 0.24 27 / 0.05);
  --text-primary:   oklch(0.12 0 0);
  --text-secondary: oklch(0.42 0 0);
  --text-tertiary:  oklch(0.58 0 0);
  --border:         oklch(0.86 0 0);
  --border-light:   oklch(0.78 0 0);
  --danger:         oklch(0.55 0.2 25);
  --success:        oklch(0.55 0.18 160);
  --radius-sm:      6px;
  --radius-md:      10px;
  --radius-lg:      16px;
  --radius-xl:      24px;
  --font-heading:   'Mona Sans', system-ui, -apple-system, sans-serif;
  --font-body:      system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

/* ── Typography ── */
h1, h2, h3, h4, .ff-heading {
  font-family: var(--font-heading);
  font-stretch: 95%;
  letter-spacing: -0.02em;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Nav ── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 0.875rem 0;
  background: oklch(0.99 0 0 / 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 1px 0 var(--border);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  width: min(1200px, 100% - 3rem); margin-inline: auto;
}
.nav-logo {
  display: flex; align-items: center; gap: 0.625rem; text-decoration: none;
  color: var(--text-primary); font-family: var(--font-heading);
  font-weight: 750; font-size: 1.2rem; letter-spacing: -0.01em; font-stretch: 90%;
}
.nav-logo:hover { text-decoration: none; }
.nav-logo-icon {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  background: var(--accent); display: flex; align-items: center;
  justify-content: center; font-size: 1rem; font-weight: 800;
  color: oklch(0.99 0 0);
}
.nav-links {
  display: flex; align-items: center; gap: 1.5rem;
}
.nav-links a {
  font-family: var(--font-heading); font-size: 0.875rem; font-weight: 550;
  font-stretch: 95%; color: var(--text-secondary);
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text-primary); text-decoration: none; }

/* ── Nav user dropdown ── */
.nav-user {
  position: relative;
  display: flex; align-items: center; gap: 0.625rem;
}
.nav-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border);
  cursor: pointer;
  object-fit: cover;
}
.nav-email {
  font-family: var(--font-heading); font-size: 0.85rem; font-weight: 550;
  color: var(--text-secondary); font-stretch: 95%;
}
.dropdown {
  display: none;
  position: absolute; top: 100%; right: 0;
  margin-top: 0.5rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.5rem;
  min-width: 180px;
  box-shadow: 0 8px 24px oklch(0 0 0 / 0.1);
  z-index: 200;
}
.dropdown.open { display: block; }
.dropdown a, .dropdown button {
  display: block; width: 100%; text-align: left;
  padding: 0.5rem 0.75rem;
  font-family: var(--font-heading); font-size: 0.875rem; font-weight: 550;
  font-stretch: 95%;
  color: var(--text-primary); text-decoration: none;
  background: none; border: none; cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}
.dropdown a:hover, .dropdown button:hover { background: var(--bg-hover); text-decoration: none; }
.dropdown .logout-btn { color: var(--danger); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-family: var(--font-heading); font-weight: 650; font-size: 0.9375rem; font-stretch: 95%;
  border-radius: var(--radius-sm); border: none; cursor: pointer;
  text-decoration: none; white-space: nowrap;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  letter-spacing: -0.01em;
}
.btn:active { transform: scale(0.975); }
.btn-primary {
  background: var(--accent); color: oklch(0.99 0 0);
  box-shadow: 0 0 0 0 var(--accent-subtle);
}
.btn-primary:hover { background: var(--accent-glow); box-shadow: 0 0 24px var(--accent-subtle); text-decoration: none; }
.btn-secondary {
  background: transparent; color: var(--text-primary);
  box-shadow: inset 0 0 0 1px var(--border-light);
}
.btn-secondary:hover { background: var(--bg-hover); box-shadow: inset 0 0 0 1px var(--text-tertiary); text-decoration: none; }
.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 0.75rem;
  width: 100%; padding: 0.875rem 1.25rem;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font-heading); font-weight: 550; font-size: 0.975rem;
  font-stretch: 95%;
  color: var(--text-primary);
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.btn-google:hover {
  border-color: var(--text-tertiary);
  box-shadow: 0 2px 8px oklch(0 0 0 / 0.08);
}
.btn-google:active { transform: scale(0.985); }
.btn-google svg { width: 20px; height: 20px; flex-shrink: 0; }

/* ── Cards ── */
.card {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: 0 0 0 1px var(--border-light), 0 4px 16px oklch(0 0 0 / 0.04);
}
.card h3 {
  font-size: 1rem; font-weight: 650;
  margin-bottom: 1rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Badge ── */
.badge {
  display: inline-block;
  font-family: var(--font-heading); font-size: 0.7rem; font-weight: 650;
  font-stretch: 95%;
  padding: 0.2rem 0.65rem;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.badge-license { background: var(--accent-subtle); color: var(--accent); }
.badge-subscription { background: oklch(0.55 0.2 280 / 0.12); color: oklch(0.5 0.2 270); }

/* ── Page Footer ── */
.page-footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.8rem;
  color: var(--text-tertiary);
  border-top: 1px solid var(--border);
}
.page-footer a { color: var(--text-secondary); }

/* ── Container ── */
.container {
  width: min(1200px, 100% - 3rem);
  margin-inline: auto;
  padding-top: 6rem;
  padding-bottom: 4rem;
}

/* ── Skeleton / loading ── */
@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--bg-surface) 25%, var(--bg-elevated) 50%, var(--bg-surface) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

/* ── Toast ── */
.toast {
  position: fixed; bottom: 2rem; left: 50%; transform: translateX(-50%);
  background: var(--text-primary); color: white;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-family: var(--font-heading); font-size: 0.875rem; font-weight: 550;
  font-stretch: 95%;
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.toast.show { opacity: 1; }
.toast.error { background: var(--danger); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .container { padding-top: 5rem; }
  .card { padding: 1.25rem; }
  .nav-email { display: none; }
  .nav-links { gap: 1rem; }
}
