/* ============================================================
   灵象 AI — Common Stylesheet
   Design: Chinese editorial × modern tech
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@300;400;500;600;700;900&family=Noto+Sans+SC:wght@300;400;500;700&display=swap');

/* ── CSS Variables ── */
:root {
  --bg:          #F5F0E8;
  --bg-dark:     #EDE8DF;
  --bg-card:     #FDFAF5;
  --ink:         #1A1612;
  --ink-soft:    #3D3530;
  --ink-muted:   #7A7068;
  --blue:        #1F5B8A;
  --blue-light:  #4A90D9;
  --blue-pale:   #E8F1FA;
  --pink:        #E87AA0;
  --pink-pale:   #FDEEF4;
  --gold:        #C49A3C;
  --border:      rgba(31,91,138,0.15);
  --border-soft: rgba(31,91,138,0.08);
  --shadow-sm:   0 2px 8px rgba(26,22,18,0.06);
  --shadow-md:   0 8px 32px rgba(26,22,18,0.10);
  --shadow-lg:   0 24px 64px rgba(26,22,18,0.14);
  --radius-sm:   8px;
  --radius-md:   16px;
  --radius-lg:   24px;
  --radius-xl:   36px;
  --nav-h:       68px;
  --sidebar-w:   280px;
  --transition:  0.3s cubic-bezier(0.4,0,0.2,1);
  --font-serif:  'Noto Serif SC', 'STSong', serif;
  --font-sans:   'Noto Sans SC', 'PingFang SC', sans-serif;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Grain texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: 0.4;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; font-family: var(--font-sans); }

/* ── Typography ── */
h1, h2, h3 { font-family: var(--font-serif); font-weight: 600; line-height: 1.25; }
h4, h5, h6 { font-family: var(--font-sans); font-weight: 500; }
p { color: var(--ink-soft); }

.text-serif { font-family: var(--font-serif); }
.text-muted  { color: var(--ink-muted); }

/* ── Navigation ── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(245,240,232,0.88);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  display: flex;
  align-items: center;
  padding: 0 40px;
  gap: 0;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.nav-logo-icon {
  width: 36px;
  height: 36px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 48px;
  flex: 1;
}

.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  padding: 6px 14px;
  border-radius: 20px;
  transition: var(--transition);
  white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
  background: var(--blue-pale);
  color: var(--blue);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-shrink: 0;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--ink-soft);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  transition: var(--transition);
}

.nav-user:hover { border-color: var(--blue-light); color: var(--blue); }

.nav-credits {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--gold);
  font-weight: 600;
  background: rgba(196,154,60,0.1);
  padding: 2px 8px;
  border-radius: 10px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 500;
  border: none;
  transition: var(--transition);
  white-space: nowrap;
  font-family: var(--font-sans);
}

.btn-primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 4px 16px rgba(31,91,138,0.3);
}
.btn-primary:hover {
  background: #174a72;
  box-shadow: 0 6px 24px rgba(31,91,138,0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--blue);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--blue-pale);
  border-color: var(--blue-light);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid transparent;
}
.btn-ghost:hover {
  background: var(--bg-dark);
  color: var(--ink);
}

.btn-gradient {
  background: linear-gradient(135deg, var(--blue) 0%, var(--blue-light) 100%);
  color: #fff;
  box-shadow: 0 4px 20px rgba(74,144,217,0.4);
}
.btn-gradient:hover {
  box-shadow: 0 8px 28px rgba(74,144,217,0.5);
  transform: translateY(-2px);
}

.btn-pink {
  background: var(--pink);
  color: #fff;
  box-shadow: 0 4px 16px rgba(232,122,160,0.3);
}
.btn-pink:hover {
  box-shadow: 0 6px 24px rgba(232,122,160,0.45);
  transform: translateY(-1px);
}

.btn-lg { padding: 14px 32px; font-size: 16px; border-radius: 30px; }
.btn-sm { padding: 7px 16px; font-size: 13px; border-radius: 18px; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ── Cards ── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border);
  transform: translateY(-2px);
}

/* ── Section Layout ── */
.section {
  padding: 80px 40px;
}

.section-inner {
  max-width: 1140px;
  margin: 0 auto;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue-light);
  margin-bottom: 16px;
}

.section-label::before {
  content: '';
  display: block;
  width: 20px;
  height: 2px;
  background: var(--blue-light);
}

.section-title {
  font-size: clamp(28px, 4vw, 42px);
  color: var(--ink);
  margin-bottom: 16px;
}

.section-subtitle {
  font-size: 16px;
  color: var(--ink-muted);
  max-width: 520px;
}

/* ── Divider ── */
.divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border), transparent);
  margin: 0;
}

/* ── Tag / Badge ── */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.tag-blue   { background: var(--blue-pale); color: var(--blue); }
.tag-pink   { background: var(--pink-pale); color: var(--pink); }
.tag-gold   { background: rgba(196,154,60,0.12); color: var(--gold); }
.tag-green  { background: rgba(60,160,90,0.1); color: #3CA05A; }

/* ── Loading / Spinner ── */
.spinner {
  width: 24px;
  height: 24px;
  border: 2.5px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-dots {
  display: inline-flex;
  gap: 4px;
}
.loading-dots span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--blue);
  animation: dot-bounce 1.2s ease-in-out infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dot-bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* ── Toast ── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  animation: toast-in 0.3s ease;
  max-width: 320px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast-success { background: #1a472a; color: #fff; }
.toast-error   { background: #7a1f1f; color: #fff; }
.toast-info    { background: var(--blue); color: #fff; }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Footer ── */
.footer {
  background: var(--ink);
  color: rgba(255,255,255,0.7);
  padding: 60px 40px 36px;
}

.footer-inner {
  max-width: 1140px;
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 32px;
}

.footer-brand .nav-logo { color: #fff; margin-bottom: 14px; }
.footer-brand p { font-size: 14px; line-height: 1.7; color: rgba(255,255,255,0.5); max-width: 240px; }

.footer-col h4 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #fff;
  margin-bottom: 16px;
  text-transform: uppercase;
}

.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.footer-col li a {
  font-size: 14px;
  color: rgba(255,255,255,0.5);
  transition: var(--transition);
}
.footer-col li a:hover { color: var(--blue-light); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: rgba(255,255,255,0.35);
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26,22,18,0.6);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 40px;
  max-width: 480px;
  width: 90%;
  box-shadow: var(--shadow-lg);
  transform: translateY(16px) scale(0.97);
  transition: var(--transition);
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); }
.modal-close { position: absolute; top: 16px; right: 16px; }

/* ── Form Fields ── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-soft); letter-spacing: 0.03em; }
.field input,
.field textarea,
.field select {
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  transition: var(--transition);
  outline: none;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--blue-light);
  background: var(--bg-card);
  box-shadow: 0 0 0 3px rgba(74,144,217,0.12);
}
.field textarea { resize: vertical; min-height: 100px; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--blue-light); }

/* ── Page Entry Animation ── */
.page-enter { animation: page-enter 0.5s ease both; }
@keyframes page-enter {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-up { animation: fade-up 0.6s ease both; }
.fade-up-d1 { animation-delay: 0.1s; }
.fade-up-d2 { animation-delay: 0.2s; }
.fade-up-d3 { animation-delay: 0.3s; }
.fade-up-d4 { animation-delay: 0.4s; }
@keyframes fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Elephant SVG Icon ── */
.elephant-icon {
  width: 100%;
  height: 100%;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .nav { padding: 0 24px; }
  .section { padding: 64px 24px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}

@media (max-width: 768px) {
  :root { --nav-h: 60px; }
  .nav-links { display: none; }
  .nav { padding: 0 20px; }
  .section { padding: 48px 20px; }
  .footer { padding: 48px 20px 28px; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
  .btn-lg { padding: 12px 24px; font-size: 15px; }
}
