/* ===== 知时塔罗 — 全局样式 & CSS 变量 ===== */

:root {
  /* 深色背景 */
  --bg-deep: #07060e;
  --bg-card: #0e0d1e;
  --bg-elevated: #13122a;

  /* 紫色主色调（替换金色） */
  --violet: #9b6dff;
  --violet-light: #c4a4ff;
  --violet-dark: #7c4fff;
  --violet-deeper: #5b21b6;
  --violet-glow: rgba(155, 109, 255, 0.15);
  --violet-soft: rgba(155, 109, 255, 0.06);
  --violet-medium: rgba(155, 109, 255, 0.25);

  /* 文本 */
  --text-primary: #e8e0f0;
  --text-secondary: #a098b8;
  --text-dim: #6a6280;

  /* 边框 */
  --border-subtle: rgba(255, 255, 255, 0.05);
  --border-violet: rgba(155, 109, 255, 0.12);
  --border-violet-active: rgba(155, 109, 255, 0.35);

  /* 圆角 */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;

  /* 字体 */
  --font-cn: 'Noto Serif SC', 'Source Han Serif SC', 'Songti SC', 'SimSun', serif;
  --font-kai: 'STKaiti', 'KaiTi', 'FangSong', cursive;
  --font-sans: 'PingFang SC', 'Microsoft YaHei', 'Source Han Sans SC', sans-serif;

  /* 阴影 */
  --shadow-card: 0 0 0 1px rgba(255, 255, 255, 0.03), 0 8px 40px rgba(0, 0, 0, 0.4);
  --shadow-violet: 0 0 40px rgba(155, 109, 255, 0.1), 0 0 0 1px rgba(155, 109, 255, 0.06);
  --shadow-violet-strong: 0 0 60px rgba(155, 109, 255, 0.15), 0 0 0 1px rgba(155, 109, 255, 0.1);

  --transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-cn);
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.7;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

a { color: var(--violet-light); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--violet); }

/* ===== Canvas 背景 ===== */
#mxhCanvas {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  z-index: 0; pointer-events: none;
}

/* ===== 应用容器 ===== */
.app {
  position: relative; z-index: 1;
  max-width: 520px; margin: 0 auto;
  padding: 48px 20px 72px;
  animation: fadeUp 0.8s ease-out;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes titleBreath {
  0%,100% { filter: drop-shadow(0 0 36px rgba(155,109,255,.2)); }
  50% { filter: drop-shadow(0 0 56px rgba(155,109,255,.35)); }
}

@keyframes shimmer {
  0%,100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ===== 品牌头部 ===== */
.header {
  text-align: center; margin-bottom: 36px;
}

.header-line {
  width: 60px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--violet-light), transparent);
  margin: 0 auto 20px;
}

.header h1 {
  font-family: var(--font-kai);
  font-size: 48px; font-weight: 400;
  letter-spacing: 18px;
  background: linear-gradient(135deg, var(--violet-dark) 0%, var(--violet-light) 50%, var(--violet) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: titleBreath 4s ease-in-out infinite;
  margin-bottom: 10px;
}

.header .tagline {
  font-size: 14px; color: var(--text-secondary);
  letter-spacing: 8px; margin-top: 6px;
}

/* ===== 卡片 ===== */
.card {
  width: 100%;
  background: linear-gradient(135deg, rgba(14,13,30,.92), rgba(19,18,42,.88));
  border: 1px solid var(--border-violet);
  border-radius: var(--radius-lg);
  padding: 36px 28px 32px;
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  box-shadow: var(--shadow-violet);
  position: relative; overflow: hidden;
}

.card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(155,109,255,.2), transparent);
}

.card::after {
  content: ''; position: absolute; bottom: 0; right: 0;
  width: 200px; height: 200px;
  background: radial-gradient(circle at 100% 100%, rgba(155,109,255,.025) 0%, transparent 70%);
  pointer-events: none;
}

/* ===== 按钮 ===== */
.btn-primary {
  display: inline-block; width: 100%;
  padding: 16px; margin-top: 14px;
  font-family: inherit; font-size: 16px; font-weight: 700;
  letter-spacing: 6px;
  color: #fff;
  background: linear-gradient(135deg, var(--violet-deeper) 0%, var(--violet-dark) 40%, var(--violet) 100%);
  background-size: 200% 100%;
  border: none; border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: 0 4px 28px rgba(155,109,255,.25);
  animation: shimmer 3.5s ease-in-out infinite;
  transition: var(--transition);
  position: relative; overflow: hidden;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 40px rgba(155,109,255,.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary.loading {
  pointer-events: none; opacity: 0.7;
}

.btn-secondary {
  display: inline-block; width: 100%;
  padding: 14px;
  font-family: inherit; font-size: 15px; font-weight: 600;
  letter-spacing: 4px;
  color: var(--violet-light);
  background: var(--violet-soft);
  border: 1px solid var(--border-violet);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary:hover {
  background: var(--violet-glow);
  border-color: var(--border-violet-active);
  box-shadow: var(--shadow-violet);
}

/* ===== 抽屉/手风琴 ===== */
.section-drawer {
  margin-bottom: 18px;
  border: 1px solid var(--border-violet);
  border-radius: var(--radius);
  overflow: hidden;
  background: linear-gradient(135deg, rgba(14,13,30,.5), rgba(19,18,42,.4));
  transition: var(--transition);
}

.section-drawer.drawer-open {
  border-color: var(--border-violet-active);
  box-shadow: var(--shadow-violet);
}

.drawer-toggle {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  cursor: pointer;
  background: rgba(155,109,255,.02);
  border-bottom: 1px solid rgba(155,109,255,.06);
  transition: var(--transition);
  user-select: none;
}

.drawer-toggle:hover {
  background: rgba(155,109,255,.06);
}

.drawer-toggle h3 {
  flex: 1;
  font-size: 16px; font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 3px;
}

.drawer-arrow {
  font-size: 14px; color: var(--violet-light);
  transition: transform 0.35s ease;
  min-width: 20px; text-align: center;
}

.section-drawer.drawer-open .drawer-arrow {
  transform: rotate(90deg);
}

.drawer-body {
  max-height: 0; overflow: hidden;
  transition: max-height 0.55s ease;
}

.section-drawer.drawer-open .drawer-body {
  max-height: 6000px;
}

.drawer-content {
  padding: 20px 18px;
  color: var(--text-secondary);
  line-height: 1.9;
  font-size: 15px;
}

/* ===== 页脚 ===== */
.footer {
  text-align: center; padding: 32px 16px 24px;
  font-size: 13px; color: var(--text-dim);
  line-height: 2;
}

.footer .disclaimer {
  font-size: 12px; color: rgba(255,255,255,.15);
  margin-top: 8px;
}

/* ===== 响应式 ===== */
@media(max-width: 480px) {
  html { font-size: 15px; }
  .app { max-width: 100%; padding: 28px 12px 48px; }
  .card { padding: 24px 14px 22px; border-radius: var(--radius); }
  .header h1 { font-size: 34px; letter-spacing: 10px; }
  .header .tagline { font-size: 12px; letter-spacing: 4px; }
  .btn-primary { font-size: 15px; letter-spacing: 4px; padding: 14px; }
  .drawer-toggle { padding: 12px 14px; }
  .drawer-toggle h3 { font-size: 14px; letter-spacing: 2px; }
  .drawer-content { padding: 14px 12px; font-size: 14px; }
}

@media(max-width: 360px) {
  html { font-size: 14px; }
  .app { padding: 20px 8px 36px; }
  .card { padding: 18px 10px 16px; }
  .header h1 { font-size: 28px; letter-spacing: 6px; }
}

/* ===== 骨架屏 ===== */
.skeleton {
  background: linear-gradient(90deg, rgba(155,109,255,.05) 0%, rgba(155,109,255,.1) 50%, rgba(155,109,255,.05) 100%);
  background-size: 200% 100%;
  animation: shimmer 2s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

.skeleton-line {
  height: 16px; margin-bottom: 12px;
}

.skeleton-line.short { width: 60%; }
.skeleton-line.medium { width: 80%; }

/* ===== 全局加载旋转 ===== */
.spinner {
  display: inline-block; width: 28px; height: 28px;
  border: 2px solid var(--border-violet);
  border-top-color: var(--violet-light);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* ===== 淡入动画 ===== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fade-in {
  animation: fadeIn 0.6s ease-out;
}
