/* ============================================
   晶灵AI 官网共享样式 v3
   设计 token / 通用组件 / 导航 / 页脚 / 预约演示 / 管理后台
   ============================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

:root {
  /* 品牌色 - 对齐 logo 的蓝紫水晶感 */
  --brand: #18C6A2;
  --brand-deep: #0FA888;
  --brand-cyan: #2FD6B4;
  --brand-purple: #19C8C0;
  --brand-light: rgba(24, 198, 162, 0.10);
  --brand-gradient: linear-gradient(120deg, #19C8B6 0%, #45C97C 100%);

  /* 中性色 */
  --bg: #F3F4F6;
  --surface: #ECEEF1;
  --surface-dark: #0E1116;
  --text: #15181E;
  --text-muted: #5B6270;
  --text-light: #8C93A1;
  --border: rgba(16, 19, 26, 0.10);
  --border-strong: rgba(16, 19, 26, 0.16);
  --danger: #D8453E;
  --success: #2EA660;

  /* 圆角 */
  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-full: 999px;

  /* 字体 */
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  --font-mono: "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* ============ 滚动触发动画 ============ */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity 1000ms cubic-bezier(0.22, 1, 0.36, 1), transform 1000ms cubic-bezier(0.22, 1, 0.36, 1); }
.reveal.in { opacity: 1; transform: translateY(0); }
.slide-left { opacity: 0; transform: translateX(-40px); transition: opacity 1000ms cubic-bezier(0.22, 1, 0.36, 1), transform 1000ms cubic-bezier(0.22, 1, 0.36, 1); }
.slide-left.in { opacity: 1; transform: translateX(0); }
.slide-right { opacity: 0; transform: translateX(40px); transition: opacity 1000ms cubic-bezier(0.22, 1, 0.36, 1), transform 1000ms cubic-bezier(0.22, 1, 0.36, 1); }
.slide-right.in { opacity: 1; transform: translateX(0); }
.delay-1 { transition-delay: 100ms; }
.delay-2 { transition-delay: 200ms; }
.delay-3 { transition-delay: 300ms; }
.delay-4 { transition-delay: 400ms; }
.delay-5 { transition-delay: 500ms; }
.delay-6 { transition-delay: 600ms; }

/* ============ 顶部导航 ============ */
.nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 48px;
  background: rgba(243, 244, 246, 0.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid var(--border);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}
.brand-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  display: block;
}
.brand-name {
  font-weight: 600;
  font-size: 16px;
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  letter-spacing: 0.02em;
}

.nav-links { display: flex; gap: 32px; font-size: 14px; }
.nav-links a {
  color: var(--text);
  transition: color 200ms;
  display: inline-flex; align-items: center; gap: 6px;
  position: relative;
}
.nav-links a:hover { color: var(--brand); }
.nav-links a.active { color: var(--brand); }
.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -20px; left: 0; right: 0;
  height: 2px;
  background: var(--brand);
}
.badge-pro {
  font-size: 10px;
  background: var(--brand);
  color: white;
  padding: 2px 6px;
  border-radius: var(--r-sm);
  font-weight: 500;
  letter-spacing: 0.05em;
}

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

/* ============ 按钮 ============ */
.btn {
  border: none;
  padding: 10px 20px;
  border-radius: var(--r-full);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 200ms;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  white-space: nowrap;
  text-decoration: none;
}
.btn-primary {
  background: var(--surface-dark);
  color: white;
}
.btn-primary:hover { background: #000; }
.btn-gradient {
  background: var(--surface-dark);
  color: white;
  background-size: 200% 100%;
  background-position: 0% 0%;
  transition: background-position 600ms, transform 200ms;
}
.btn-gradient:hover { background-position: 100% 0%; }
.btn-secondary {
  background: white;
  color: var(--text);
  border: 0.5px solid var(--border-strong);
}
.btn-secondary:hover { background: var(--surface); }
.btn-dark {
  background: var(--surface-dark);
  color: white;
}
.btn-dark:hover { background: #000; }
.btn-ghost {
  background: transparent;
  color: var(--text);
}
.btn-ghost:hover { background: var(--surface); }
.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover { background: #B73730; }
.btn-lg { padding: 14px 28px; font-size: 15px; }
.btn-sm { padding: 6px 14px; font-size: 13px; }

/* ============ 用户头像菜单 ============ */
.user-menu { position: relative; }
.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--brand-gradient);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 500;
  cursor: pointer;
  border: none;
  transition: transform 200ms;
}
.user-avatar:hover { transform: scale(1.05); }
.user-dropdown {
  position: absolute;
  top: 48px; right: 0;
  background: white;
  border: 0.5px solid var(--border);
  border-radius: var(--r-md);
  min-width: 220px;
  padding: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  opacity: 0;
  transform: translateY(-8px);
  pointer-events: none;
  transition: opacity 200ms, transform 200ms;
}
.user-menu.open .user-dropdown {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.user-info {
  padding: 12px;
  border-bottom: 0.5px solid var(--border);
  margin-bottom: 4px;
}
.user-info-name { font-size: 14px; font-weight: 500; margin-bottom: 2px; }
.user-info-email { font-size: 12px; color: var(--text-muted); }
.user-info-tier {
  display: inline-block;
  font-size: 11px;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: var(--r-sm);
}
.tier-free { background: var(--surface); color: var(--text-muted); }
.tier-premium { background: var(--brand-light); color: var(--brand); }
.tier-admin { background: rgba(216, 69, 62, 0.1); color: var(--danger); }
.dropdown-item {
  display: block;
  padding: 10px 12px;
  font-size: 13px;
  border-radius: var(--r-sm);
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
}
.dropdown-item:hover { background: var(--surface); }
.dropdown-item-danger { color: var(--danger); }

/* ============ 页面容器 ============ */
.container { max-width: 1200px; margin: 0 auto; padding: 0 48px; }
.section { padding: 100px 48px; max-width: 1200px; margin: 0 auto; }
.section-alt-bg { background: var(--surface); }
.section-alt-bg .section-inner { max-width: 1200px; margin: 0 auto; padding: 0 48px; }

.section-head { text-align: center; margin-bottom: 60px; }
.section-num {
  display: inline-block;
  font-size: 13px;
  color: var(--brand);
  font-family: var(--font-mono);
  letter-spacing: 0.15em;
  margin-bottom: 12px;
}
.section-title {
  font-size: 48px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.section-sub {
  font-size: 17px;
  color: var(--text-muted);
  margin-top: 16px;
  line-height: 1.6;
}

/* ============ 页头 (子页面通用) ============ */
.page-header {
  text-align: center;
  padding: 100px 48px 60px;
  max-width: 900px;
  margin: 0 auto;
}
.page-header h1 {
  font-size: 56px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin-bottom: 20px;
}
.page-header p {
  font-size: 18px;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ============ 卡片 ============ */
.card {
  background: white;
  border-radius: var(--r-lg);
  border: 0.5px solid var(--border);
  overflow: hidden;
  transition: transform 400ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 400ms;
}
.card-hover:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.06);
}

/* ============ 页脚 ============ */
.footer {
  background: var(--bg);
  border-top: 0.5px solid var(--border);
  padding: 60px 48px 40px;
}
.footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 60px;
  margin-bottom: 48px;
}
.footer-brand { max-width: 320px; }
.footer-brand-row { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.footer-brand-row img { width: 24px; height: 24px; }
.footer-brand-name { font-weight: 600; font-size: 16px; }
.footer-brand-desc { font-size: 13px; color: var(--text-muted); line-height: 1.7; }
.footer-col h4 { font-size: 13px; font-weight: 500; margin-bottom: 16px; }
.footer-col a {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  padding: 4px 0;
  transition: color 200ms;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
}
.footer-col a:hover { color: var(--brand); }
.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 32px;
  border-top: 0.5px solid var(--border);
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--text-light);
}

/* ============ 预约演示 Modal ============ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(29, 29, 31, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: center; justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal-overlay.show { display: flex; }
.modal-card {
  background: white;
  border-radius: var(--r-lg);
  padding: 40px 36px;
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: modalIn 400ms cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-close {
  position: absolute;
  top: 16px; right: 16px;
  background: var(--surface);
  border: none;
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  color: var(--text-muted);
}
.modal-close:hover { background: var(--border); }
.modal-title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.modal-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.6;
}

/* ============ 表单 ============ */
.form-group {
  margin-bottom: 16px;
}
.form-label {
  display: block;
  font-size: 13px;
  margin-bottom: 8px;
  color: var(--text);
}
.form-label .req {
  color: var(--danger);
}
.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 11px 14px;
  border: 0.5px solid var(--border-strong);
  border-radius: var(--r-md);
  font-size: 14px;
  font-family: inherit;
  background: white;
  transition: border-color 200ms, box-shadow 200ms;
  resize: vertical;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-light);
}
.form-row {
  display: flex;
  gap: 12px;
}
.form-row > * {
  flex: 1;
}
.form-help {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}
.error-msg {
  color: var(--danger);
  font-size: 13px;
  margin-top: 8px;
  display: none;
}
.error-msg.show { display: block; }

/* ============ 通知 toast ============ */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface-dark);
  color: white;
  padding: 12px 20px;
  border-radius: var(--r-md);
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms, transform 300ms;
  z-index: 2000;
  max-width: 90%;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============ 文件上传组件 ============ */
.upload-zone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-md);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 200ms, background 200ms;
  background: var(--surface);
  position: relative;
}
.upload-zone:hover {
  border-color: var(--brand);
  background: var(--brand-light);
}
.upload-zone.dragging {
  border-color: var(--brand);
  background: var(--brand-light);
}
.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.upload-zone-icon {
  font-size: 28px;
  margin-bottom: 8px;
  color: var(--text-muted);
}
.upload-zone-text {
  font-size: 13px;
  color: var(--text);
  margin-bottom: 4px;
}
.upload-zone-hint {
  font-size: 11px;
  color: var(--text-muted);
}

.upload-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 12px;
}
.upload-item {
  position: relative;
  aspect-ratio: 1/1;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--surface);
  border: 0.5px solid var(--border);
}
.upload-item img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.upload-item-remove {
  position: absolute;
  top: 4px; right: 4px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,0.7);
  color: white;
  border: none;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 200ms;
}
.upload-item:hover .upload-item-remove { opacity: 1; }

.upload-video-preview {
  position: relative;
  aspect-ratio: 16/9;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--surface-dark);
  margin-top: 12px;
}
.upload-video-preview video {
  width: 100%; height: 100%;
  object-fit: cover;
}
.upload-video-preview .upload-item-remove {
  opacity: 1;
}

/* ============ 提示词可编辑(玩法详情) ============ */
.prompt-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.prompt-reset-btn {
  background: rgba(255,255,255,0.08);
  color: var(--text-muted);
  border: 0.5px solid var(--border);
  padding: 5px 12px;
  border-radius: var(--r-sm);
  font-size: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 200ms;
}
.prompt-reset-btn:hover {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}
.prompt-reset-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ============ 响应式 ============ */
@media (max-width: 768px) {
  .nav { padding: 12px 20px; }
  .nav-links { display: none; }
  .container, .section { padding-left: 20px; padding-right: 20px; }
  .section { padding-top: 60px; padding-bottom: 60px; }
  .section-alt-bg .section-inner { padding: 0 20px; }
  .page-header { padding: 60px 20px 40px; }
  .page-header h1 { font-size: 36px; }
  .section-title { font-size: 32px; }
  .footer { padding: 40px 20px 24px; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { padding: 24px 0; flex-direction: column; gap: 8px; }
  .modal-card { padding: 28px 24px; }
  .modal-title { font-size: 20px; }
  .form-row { flex-direction: column; gap: 0; }
}

/* new horizontal logo */
.brand .brand-logo-h { height: 34px; width: auto; display: block; }
.footer-brand-row .footer-logo-h { height: 30px; width: auto; display: block; }
