/* 灵栖 Web — 消费者向 PC 界面（对齐官网设计系统） */
:root {
  --primary: #ab47bc;
  --primary-dark: #8e24aa;
  --primary-light: rgba(171, 71, 188, 0.1);
  --primary-mid: rgba(171, 71, 188, 0.65);
  --primary-glow: rgba(171, 71, 188, 0.25);
  --bg: #f8f7fa;
  --bg-warm: #faf9fc;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-solid: #ffffff;
  --text: #1a1a2e;
  --text-2: #5c5c7a;
  --muted: #9494ad;
  --border: rgba(171, 71, 188, 0.12);
  --border-strong: rgba(171, 71, 188, 0.22);
  --danger: #c62828;
  --yi: #2e7d5a;
  --ji: #c62828;
  --top-h: 72px;
  --container: 1200px;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  --shadow-soft: 0 4px 24px rgba(26, 26, 46, 0.05);
  --shadow-card: 0 8px 40px rgba(171, 71, 188, 0.1);
  --shadow-lifted: 0 20px 60px rgba(171, 71, 188, 0.14);
  --font-serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Helvetica Neue", sans-serif;
  --font-mono: "SF Mono", "Menlo", monospace;
  --ease: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* 氛围背景 */
.shell {
  position: relative;
  min-height: 100vh;
}

.scene-texture {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
  background-image:
    radial-gradient(circle at 18% 22%, rgba(171, 71, 188, 0.06) 0%, transparent 48%),
    radial-gradient(circle at 82% 68%, rgba(147, 51, 234, 0.05) 0%, transparent 50%);
}

.scene-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
}

.scene-glow-1 {
  width: 520px;
  height: 520px;
  background: rgba(171, 71, 188, 0.06);
  top: -160px;
  left: -120px;
  animation: drift-1 14s ease-in-out infinite;
}

.scene-glow-2 {
  width: 440px;
  height: 440px;
  background: rgba(147, 51, 234, 0.05);
  bottom: 10%;
  right: -140px;
  animation: drift-2 12s ease-in-out infinite;
}

@keyframes drift-1 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(50px, 60px); }
}

@keyframes drift-2 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-40px, -50px); }
}

/* 顶栏 */
.topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--top-h);
  background: rgba(248, 247, 250, 0.78);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--ease), box-shadow var(--ease);
}

.topnav:not(.hidden) {
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-soft);
}

.topnav-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 32px;
  height: 100%;
  max-width: calc(var(--container) + 80px);
  margin: 0 auto;
  padding: 0 40px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 18px;
  box-shadow: 0 4px 16px var(--primary-glow);
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 20px;
  letter-spacing: 0.14em;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.nav-link {
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-2);
  font-size: 15px;
  cursor: pointer;
  transition: background var(--ease), color var(--ease);
}

.nav-link:hover {
  background: var(--primary-light);
  color: var(--primary-dark);
}

.nav-link.is-active {
  background: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 500;
}

.nav-link {
  position: relative;
}

.nav-link.is-active::after {
  content: '';
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 6px;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  border-radius: 1px;
}

.nav-explore { position: relative; }

.explore-panel {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 420px;
  padding: 12px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lifted);
}

.explore-panel.is-open { display: block; }

.explore-panel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.explore-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  transition: background var(--ease);
}

.explore-item:hover { background: var(--primary-light); }

.explore-glyph {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--primary-light);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 16px;
}

.explore-item-title {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
}

.explore-item-desc {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.topnav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.nav-ghost {
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  transition: color var(--ease);
}

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

/* 档案菜单 */
.profile-menu { position: relative; }

.profile-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface-solid);
  cursor: pointer;
  transition: border-color var(--ease), box-shadow var(--ease);
}

.profile-trigger:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-soft);
}

.profile-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #7b1fa2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
}

.profile-avatar.lg {
  width: 44px;
  height: 44px;
  font-size: 16px;
}

.profile-brief { text-align: left; line-height: 1.35; }

.profile-name {
  display: block;
  font-size: 14px;
  font-weight: 500;
}

.profile-meta {
  display: block;
  font-size: 12px;
  color: var(--muted);
}

.profile-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 260px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lifted);
  padding: 10px;
  z-index: 200;
}

.profile-dropdown.is-open { display: block; }

.dropdown-head {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 10px 14px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.dropdown-name {
  font-size: 15px;
  font-weight: 600;
}

.dropdown-meta {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.dropdown-label {
  padding: 8px 10px 4px;
  font-size: 12px;
  color: var(--muted);
}

.dropdown-item {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  text-align: left;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
}

.dropdown-item:hover { background: var(--primary-light); }

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 6px;
}

.dropdown-danger { color: var(--danger); }

/* 主内容区 */
.viewport {
  position: relative;
  z-index: 1;
  width: min(var(--container), 100% - 80px);
  margin: 0 auto;
  padding: 48px 0 88px;
}

.shell.auth-mode .viewport {
  width: 100%;
  max-width: none;
  padding: 0;
  min-height: 100vh;
}

.shell.auth-mode .scene-glow { opacity: 0.85; }

.shell.auth-mode .topnav { display: none !important; }

/* 页面入场 */
.page-enter {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.45s var(--ease), transform 0.45s var(--ease);
}

.page-enter.is-visible {
  opacity: 1;
  transform: none;
}

.page-head { margin-bottom: 28px; }

.page-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.page-desc {
  margin: 8px 0 0;
  color: var(--text-2);
  font-size: 15px;
}

/* 卡片（替代生硬面板） */
.panel, .card {
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
}

.panel-head, .card-head {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.panel-body, .card-body { padding: 22px; }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.2s, box-shadow var(--ease), background var(--ease);
}

.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px var(--primary-glow);
}

.btn-secondary {
  background: var(--surface-solid);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-secondary:hover:not(:disabled) { background: var(--primary-light); }

.btn-danger {
  background: #fff5f5;
  color: var(--danger);
  border-color: rgba(198, 40, 40, 0.2);
}

.btn-block { width: 100%; }

.btn-link {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  padding: 0;
  font-size: 14px;
}

.btn-link.danger { color: var(--danger); }

/* 表单 */
.field { margin-bottom: 18px; }

.field label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 15px;
  background: var(--surface-solid);
  color: var(--text);
  transition: border-color var(--ease), box-shadow var(--ease);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
}

.field-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.field-row input { flex: 1; }

.field-prefix {
  display: flex;
  align-items: center;
  padding: 0 14px;
  background: var(--bg-warm);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 14px;
}

.radio-inline {
  display: flex;
  gap: 24px;
  padding-top: 6px;
}

.muted { color: var(--muted); }

.error-text { color: var(--danger); font-size: 14px; margin-top: 10px; }

.tag-yi, .tag-ji {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  margin-right: 8px;
}

.tag-yi { background: rgba(46, 125, 90, 0.1); color: var(--yi); }
.tag-ji { background: rgba(198, 40, 40, 0.08); color: var(--ji); }

.chip-list { display: flex; flex-wrap: wrap; gap: 10px; }

.chip {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface-solid);
  font-size: 14px;
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--ease);
}

.chip:hover { border-color: var(--border-strong); }

.chip.is-active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary-dark);
}

.kline-canvas {
  width: 100%;
  height: 360px;
  display: block;
}

.period-tabs { display: flex; gap: 6px; }

.period-tab {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface-solid);
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  transition: all var(--ease);
}

.period-tab.is-active {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  border-color: transparent;
}

.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 22px;
  background: var(--text);
  color: #fff;
  font-size: 14px;
  border-radius: var(--radius-full);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
  z-index: 300;
  box-shadow: var(--shadow-lifted);
}

.toast.show { opacity: 1; }

.page-loading {
  padding: 100px 20px;
  text-align: center;
  color: var(--muted);
}

/* 登录 / 建档 — 杂志分栏 */
.auth-split {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  min-height: 100vh;
  width: 100%;
}

.auth-visual {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 72px 64px 72px 80px;
  position: relative;
}

.auth-eyebrow {
  margin: 0 0 28px;
  font-size: 12px;
  letter-spacing: 0.28em;
  color: var(--primary-mid);
  text-transform: uppercase;
}

.auth-hero-title {
  margin: 0 0 24px;
  font-family: var(--font-serif);
  font-size: clamp(40px, 4.5vw, 56px);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: 0.08em;
  background: linear-gradient(135deg, var(--text) 20%, var(--primary-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-hero-desc {
  margin: 0 0 36px;
  max-width: 420px;
  font-size: 16px;
  line-height: 1.85;
  color: var(--text-2);
}

.auth-features {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-features li {
  position: relative;
  padding-left: 22px;
  font-size: 15px;
  color: var(--text-2);
}

.auth-features li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow: 0 0 12px var(--primary-glow);
}

.auth-form-side {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 56px 48px 32px;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(12px);
  border-left: 1px solid var(--border);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  padding: 40px 36px 36px;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lifted);
}

.auth-card.flat {
  box-shadow: var(--shadow-card);
}

.auth-brand {
  text-align: center;
  margin-bottom: 32px;
}

.auth-brand.compact {
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
  margin-bottom: 28px;
}

.auth-brand.compact .auth-logo {
  width: 52px;
  height: 52px;
  margin: 0;
  font-size: 22px;
  flex-shrink: 0;
}

.auth-brand.compact h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 22px;
  letter-spacing: 0.08em;
}

.auth-brand.compact p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400 !important;
  color: var(--text-2) !important;
  cursor: pointer;
}

.auth-logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-serif);
  font-size: 28px;
  box-shadow: 0 8px 28px var(--primary-glow);
}

.auth-brand h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 28px;
  letter-spacing: 0.16em;
}

.auth-brand p {
  margin: 10px 0 0;
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.7;
}

.auth-card h2 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 600;
}

.auth-card .lead {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 14px;
}

.onboard-card {
  max-width: 640px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

@media (max-width: 900px) {
  .topnav-inner {
    padding: 0 20px;
    gap: 16px;
  }

  .profile-brief { display: none; }

  .main-nav .nav-link {
    padding: 8px 12px;
    font-size: 14px;
  }

  .viewport {
    width: calc(100% - 40px);
    padding-top: 24px;
  }

  .form-grid { grid-template-columns: 1fr; }

  .auth-split { grid-template-columns: 1fr; }

  .auth-visual {
    padding: 48px 32px 32px;
    min-height: auto;
  }

  .auth-form-side {
    padding: 32px 24px 48px;
    border-left: none;
    border-top: 1px solid var(--border);
  }

  .explore-panel { min-width: 300px; }
  .explore-panel-grid { grid-template-columns: 1fr; }
}
