/* 玄机 YuanJi - 深色文化风格 */
:root {
  /* 背景 - 深色墨色系 */
  --bg-primary: #12121a;
  --bg-secondary: #1a1a26;
  --bg-card: #1e1e2e;
  --bg-input: #252535;

  /* 文字 - 浅色系 */
  --text-primary: #e8e4dc;
  --text-secondary: #a8a49c;
  --text-muted: #6c6c7c;

  /* 主色调 - 古铜/暗金色系（内敛不浮夸） */
  --accent-gold: #c9a961;
  --accent-gold-light: #d4b878;
  --accent-purple: #8b7ba8;
  --accent-blue: #6b8db5;
  --accent-green: #6ba87c;
  --accent-red: #c96b6b;

  /* 边框 - 暗灰棕色 */
  --border-color: #3a3a4a;
  --border-light: #2d2d3d;

  /* 阴影 - 深色阴影 */
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.4);

  /* 圆角 - 小圆角 */
  --radius: 8px;
  --radius-sm: 5px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  background-color: var(--bg-primary);
  background-image:
    /* 宣纸纹理 - 细微纤维感 */
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' 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.05'/%3E%3C/svg%3E"),
    /* 水墨晕染 - 左上角 */
    radial-gradient(ellipse 600px 400px at 10% 5%, rgba(201, 169, 97, 0.08) 0%, transparent 70%),
    /* 水墨晕染 - 右下角 */
    radial-gradient(ellipse 500px 500px at 90% 95%, rgba(107, 168, 124, 0.06) 0%, transparent 70%),
    /* 淡色云纹 - 右上角 */
    url("data:image/svg+xml,%3Csvg width='300' height='200' viewBox='0 0 300 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M50 100 Q80 60 120 80 T200 70 T280 90' fill='none' stroke='%23c9a961' stroke-width='1.5' opacity='0.12'/%3E%3Cpath d='M30 130 Q70 100 110 110 T190 100 T270 120' fill='none' stroke='%23c9a961' stroke-width='1.5' opacity='0.1'/%3E%3Ccircle cx='250' cy='50' r='30' fill='none' stroke='%23c9a961' stroke-width='1' opacity='0.08'/%3E%3C/svg%3E"),
    /* 淡色回纹 - 左下角 */
    url("data:image/svg+xml,%3Csvg width='200' height='200' viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 180 L20 140 L60 140 L60 160 L40 160 L40 180 Z' fill='none' stroke='%236ba87c' stroke-width='1.5' opacity='0.12'/%3E%3Cpath d='M60 180 L60 150 L90 150 L90 170 L70 170 L70 180 Z' fill='none' stroke='%236ba87c' stroke-width='1.5' opacity='0.1'/%3E%3C/svg%3E");
  background-repeat: repeat, no-repeat, no-repeat, no-repeat, no-repeat;
  background-position: 0 0, 0 0, 100% 100%, 100% 0, 0 100%;
  background-attachment: fixed, fixed, fixed, fixed, fixed;
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
}

/* 背景装饰层 - 山水意境 */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    /* 远山剪影 - 底部 */
    url("data:image/svg+xml,%3Csvg width='1200' height='300' viewBox='0 0 1200 300' xmlns='http://www.w3.org/2000/svg' preserveAspectRatio='none'%3E%3Cpath d='M0 300 L0 200 Q150 120 300 180 Q450 240 600 160 Q750 80 900 150 Q1050 220 1200 140 L1200 300 Z' fill='%236ba87c' opacity='0.06'/%3E%3Cpath d='M0 300 L0 230 Q200 170 400 210 Q600 250 800 200 Q1000 150 1200 220 L1200 300 Z' fill='%236b8db5' opacity='0.05'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: bottom center;
  background-size: 100% auto;
  pointer-events: none;
  z-index: 0;
}

/* 卡片宣纸纹理 */
.card {
  background-color: var(--bg-card);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
}

/* 容器 */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 20px;
  position: relative;
  z-index: 1;
}

/* 头部 */
.header {
  text-align: center;
  padding: 32px 0 24px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 20px;
  position: relative;
}

/* 头部装饰 - 传统纹样分隔 */
.header::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent-gold), transparent);
}

.header h1 {
  font-family: "STSong", "SimSun", "KaiTi", serif;
  font-size: 2.2em;
  color: var(--text-primary);
  margin-bottom: 8px;
  letter-spacing: 12px;
  font-weight: 500;
  position: relative;
  display: inline-block;
  padding: 0 20px;
}

/* 标题两侧装饰线 */
.header h1::before,
.header h1::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 40px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-gold));
}

.header h1::before {
  left: -30px;
  background: linear-gradient(90deg, transparent, var(--accent-gold));
}

.header h1::after {
  right: -30px;
  background: linear-gradient(90deg, var(--accent-gold), transparent);
}

.header .subtitle {
  color: var(--text-secondary);
  font-size: 0.85em;
  letter-spacing: 4px;
  font-family: "STSong", "SimSun", serif;
  margin-top: 8px;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

/* 用户区域 */
.user-area {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.user-nickname {
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.9em;
}

.user-role-tag {
  font-size: 0.75em;
  padding: 2px 8px;
  background: var(--accent-gold);
  color: #fff;
  border-radius: var(--radius-sm);
}

/* 分类导航 */
.category-nav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 8px 0;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border-light);
  scrollbar-width: none;
}

.category-nav::-webkit-scrollbar {
  display: none;
}

.category-btn {
  padding: 8px 14px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.9em;
  cursor: pointer;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: all 0.2s;
  font-family: inherit;
}

.category-btn:hover {
  color: var(--accent-gold);
  background: rgba(184, 134, 11, 0.06);
}

.category-btn.active {
  color: var(--accent-gold);
  background: rgba(184, 134, 11, 0.1);
  font-weight: 500;
}

/* Tab 导航 */
.nav-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding: 8px 0;
  margin-bottom: 16px;
  scrollbar-width: none;
}

.nav-tabs::-webkit-scrollbar {
  display: none;
}

.tab-group {
  display: flex;
  gap: 4px;
}

.tab-group.hidden {
  display: none;
}

.nav-tab {
  padding: 6px 12px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-size: 0.85em;
  cursor: pointer;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  transition: all 0.2s;
  font-family: inherit;
}

.nav-tab:hover {
  color: var(--accent-gold);
  background: rgba(184, 134, 11, 0.05);
}

.nav-tab.active {
  color: var(--accent-gold);
  background: rgba(184, 134, 11, 0.1);
  border-color: var(--border-color);
  font-weight: 500;
}

/* Tab 内容 */
.tab-content {
  display: block;
}

.tab-content.hidden {
  display: none;
}

/* 卡片 */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s;
}

.card:hover {
  box-shadow: var(--shadow-hover);
}

.card-title {
  font-family: "STSong", "SimSun", serif;
  font-size: 1.15em;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  letter-spacing: 2px;
  position: relative;
}

/* 卡片标题装饰 - 小印章风格 */
.card-title::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 18px;
  background: var(--accent-gold);
  border-radius: 2px;
  margin-right: 4px;
}

.card-title .icon {
  font-size: 1em;
}

/* 表单 */
.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  color: var(--text-secondary);
  font-size: 0.85em;
  margin-bottom: 6px;
  font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.95em;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(184, 134, 11, 0.1);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.btn-group {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
}

/* 按钮 */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95em;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--accent-gold);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-gold-light);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--border-light);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.85em;
}

/* 标签 */
.tag {
  display: inline-block;
  padding: 3px 10px;
  font-size: 0.8em;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-light);
}

.tag-enabled {
  background: rgba(74, 124, 89, 0.1);
  color: var(--accent-green);
  border-color: rgba(74, 124, 89, 0.2);
}

.tag-pending {
  background: rgba(184, 134, 11, 0.1);
  color: var(--accent-gold);
  border-color: rgba(184, 134, 11, 0.2);
}

.tag-success {
  background: rgba(74, 124, 89, 0.1);
  color: var(--accent-green);
  border-color: rgba(74, 124, 89, 0.2);
}

.tag-failed {
  background: rgba(139, 58, 58, 0.1);
  color: var(--accent-red);
  border-color: rgba(139, 58, 58, 0.2);
}

.tag-info {
  background: rgba(58, 90, 124, 0.1);
  color: var(--accent-blue);
  border-color: rgba(58, 90, 124, 0.2);
}

/* 信息行 */
.info-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
}

.info-row:last-child {
  border-bottom: none;
}

.info-row .label {
  color: var(--text-secondary);
  font-size: 0.9em;
}

.info-row .value {
  color: var(--text-primary);
  font-weight: 500;
}

/* 结果网格 */
.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin: 12px 0;
}

.result-item {
  background: var(--bg-secondary);
  padding: 12px;
  border-radius: var(--radius-sm);
  text-align: center;
  border: 1px solid var(--border-light);
}

.result-item .label {
  font-size: 0.8em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.result-item .value {
  font-size: 1.1em;
  font-weight: 600;
  color: var(--text-primary);
}

/* 历史记录 */
.history-list {
  list-style: none;
}

.history-item {
  padding: 12px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background 0.2s;
}

.history-item:hover {
  background: var(--bg-secondary);
}

.history-item:last-child {
  border-bottom: none;
}

.history-title {
  color: var(--text-primary);
  font-weight: 500;
  margin-bottom: 4px;
}

.history-meta {
  font-size: 0.8em;
  color: var(--text-muted);
}

.history-empty {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

/* 加载动画 */
.loading-container {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

.loading-spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3px solid var(--border-light);
  border-top-color: var(--accent-gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 12px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Toast 提示 */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 24px;
  background: var(--text-primary);
  color: var(--bg-primary);
  border-radius: var(--radius-sm);
  font-size: 0.9em;
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  box-shadow: var(--shadow);
}

.toast.show {
  opacity: 1;
}

.toast.success {
  background: var(--accent-green);
  color: #fff;
}

.toast.error {
  background: var(--accent-red);
  color: #fff;
}

/* 模态框 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 420px;
  width: 90%;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
}

.modal-title {
  font-family: "STSong", "SimSun", serif;
  font-size: 1.2em;
  color: var(--text-primary);
  margin-bottom: 16px;
  text-align: center;
  letter-spacing: 2px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.modal-actions .btn {
  flex: 1;
}

/* 页脚 */
.footer {
  text-align: center;
  padding: 24px 0;
  color: var(--text-muted);
  font-size: 0.85em;
  border-top: 1px solid var(--border-light);
  margin-top: 20px;
}

.footer p {
  margin-bottom: 4px;
}

/* 档案完整度 */
.profile-completeness {
  margin-bottom: 20px;
}

/* 四柱排盘 */
.pillars-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 16px 0;
}

.pillar {
  background: var(--bg-secondary);
  padding: 14px;
  border-radius: var(--radius-sm);
  text-align: center;
  border: 1px solid var(--border-light);
}

.pillar .label {
  font-size: 0.8em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.pillar .gan {
  font-size: 1.4em;
  font-weight: 600;
  color: var(--accent-gold);
  font-family: "STSong", "SimSun", serif;
}

.pillar .zhi {
  font-size: 1.4em;
  font-weight: 600;
  color: var(--accent-blue);
  font-family: "STSong", "SimSun", serif;
  margin-top: 4px;
}

/* 行星列表 */
.planet-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.planet-item {
  background: var(--bg-secondary);
  padding: 10px;
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--border-light);
}

.planet-name {
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.9em;
}

.planet-sign {
  color: var(--accent-gold);
  font-size: 0.85em;
}

/* AI 解读 */
.ai-interpretation {
  margin-top: 16px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(184, 134, 11, 0.05), rgba(107, 76, 122, 0.05));
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent-gold);
}

.ai-badge {
  display: inline-block;
  padding: 2px 8px;
  background: var(--accent-gold);
  color: #fff;
  font-size: 0.75em;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.ai-content {
  color: var(--text-primary);
  line-height: 1.8;
  font-size: 0.95em;
  white-space: pre-wrap;
}

/* 场景卡片 */
.scene-card {
  cursor: pointer;
  background: var(--bg-card);
  padding: 20px;
  border-radius: var(--radius);
  text-align: center;
  transition: all 0.2s;
  border: 1px solid var(--border-light);
}

.scene-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent-gold);
}

/* 响应式 */
@media (max-width: 640px) {
  .container {
    padding: 12px;
  }

  .header h1 {
    font-size: 1.6em;
    letter-spacing: 4px;
  }

  .card {
    padding: 16px;
  }

  .pillars-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .btn-group {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}


/* ========== 手机端完善适配 ========== */

/* 平板及以下 (max-width: 1024px) */
@media (max-width: 1024px) {
  .container {
    max-width: 100%;
    padding: 16px;
  }

  .category-nav {
    flex-wrap: wrap;
    gap: 8px;
  }

  .category-btn {
    flex: 1 1 calc(33.333% - 8px);
    min-width: auto;
    font-size: 0.9em;
    padding: 10px 12px;
  }
}

/* 手机端 (max-width: 768px) */
@media (max-width: 768px) {
  body {
    font-size: 14px;
  }

  .container {
    padding: 12px;
  }

  /* 头部适配 */
  .header {
    padding: 16px 0;
  }

  .header-top {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .header h1 {
    font-size: 1.8em;
    letter-spacing: 6px;
  }

  .subtitle {
    font-size: 0.85em;
  }

  .user-area {
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
  }

  /* 导航适配 - 横向滚动 */
  .category-nav {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
    padding: 8px 0;
    margin: 0 -12px;
    padding-left: 12px;
    padding-right: 12px;
    scrollbar-width: none;
  }

  .category-nav::-webkit-scrollbar {
    display: none;
  }

  .category-btn {
    flex: 0 0 auto;
    white-space: nowrap;
    font-size: 0.85em;
    padding: 8px 14px;
    border-radius: 20px;
  }

  .nav-tabs {
    flex-wrap: wrap;
    gap: 6px;
  }

  .nav-tab {
    flex: 1 1 calc(25% - 6px);
    font-size: 0.85em;
    padding: 8px 10px;
  }

  /* 卡片适配 */
  .card {
    padding: 16px;
    border-radius: 12px;
  }

  .card-title {
    font-size: 1.1em;
  }

  /* 网格布局适配 */
  .grid-2 {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  /* 场景卡片适配 */
  .scene-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .scene-card {
    padding: 14px 10px;
  }

  .scene-card .scene-icon {
    font-size: 2em;
  }

  .scene-card .scene-name {
    font-size: 0.9em;
  }

  /* 表单适配 */
  .form-group {
    margin-bottom: 14px;
  }

  .form-label {
    font-size: 0.9em;
    margin-bottom: 6px;
  }

  .form-input,
  .form-select,
  .form-textarea {
    font-size: 16px; /* 防止iOS缩放 */
    padding: 10px 12px;
  }

  .form-row {
    flex-direction: column;
    gap: 14px;
  }

  .form-row .form-group {
    width: 100%;
  }

  /* 按钮适配 */
  .btn-group {
    flex-direction: column;
    gap: 10px;
  }

  .btn {
    width: 100%;
    padding: 12px 16px;
    font-size: 0.95em;
  }

  .btn-sm {
    width: auto;
    padding: 6px 12px;
    font-size: 0.8em;
  }

  /* 表格适配 - 横向滚动 */
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -16px;
    padding: 0 16px;
  }

  table {
    min-width: 600px;
    font-size: 0.85em;
  }

  th, td {
    padding: 8px 10px;
  }

  /* 模态框适配 */
  .modal {
    padding: 16px;
  }

  .modal-content {
    width: 100%;
    max-width: 100%;
    max-height: 90vh;
    margin: 5vh auto;
    border-radius: 16px;
  }

  .modal-header {
    padding: 16px;
  }

  .modal-body {
    padding: 16px;
    max-height: calc(90vh - 120px);
    overflow-y: auto;
  }

  .modal-footer {
    padding: 12px 16px;
  }

  /* 八字排盘适配 */
  .pillars-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .pillar-item {
    padding: 12px 8px;
  }

  .pillar-stem,
  .pillar-branch {
    font-size: 1.6em;
  }

  /* 运势评分适配 */
  .score-circle {
    width: 100px;
    height: 100px;
  }

  .score-number {
    font-size: 2em;
  }

  .score-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  /* 宜忌适配 */
  .yi-ji-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  /* 标签云适配 */
  .tag-cloud {
    gap: 6px;
  }

  .tag {
    font-size: 0.8em;
    padding: 4px 10px;
  }

  /* 用户档案适配 */
  .profile-header {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }

  .profile-avatar {
    width: 80px;
    height: 80px;
  }

  .profile-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .stat-item {
    padding: 10px 6px;
  }

  .stat-value {
    font-size: 1.3em;
  }

  .stat-label {
    font-size: 0.75em;
  }

  /* 记录列表适配 */
  .record-item {
    padding: 12px;
  }

  .record-header {
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
  }

  /* 术语解释适配 */
  .term-card {
    padding: 12px;
  }

  .term-name {
    font-size: 1em;
  }

  /* 加载动画适配 */
  .loading-spinner {
    width: 40px;
    height: 40px;
  }

  /* Toast适配 */
  .toast {
    max-width: 90%;
    font-size: 0.9em;
    padding: 10px 16px;
  }

  /* 空状态适配 */
  .empty-state {
    padding: 40px 20px;
  }

  .empty-icon {
    font-size: 3em;
  }

  .empty-text {
    font-size: 0.95em;
  }
}

/* 小屏手机 (max-width: 480px) */
@media (max-width: 480px) {
  body {
    font-size: 13px;
  }

  .container {
    padding: 10px;
  }

  .header h1 {
    font-size: 1.6em;
    letter-spacing: 4px;
  }

  .subtitle {
    font-size: 0.8em;
  }

  .category-btn {
    font-size: 0.8em;
    padding: 7px 12px;
  }

  .nav-tab {
    flex: 1 1 calc(33.333% - 6px);
    font-size: 0.8em;
    padding: 7px 8px;
  }

  .scene-grid {
    grid-template-columns: 1fr;
  }

  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .score-grid {
    grid-template-columns: 1fr;
  }

  .pillars-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .card {
    padding: 14px;
  }

  .btn {
    padding: 11px 14px;
    font-size: 0.9em;
  }

  .form-input,
  .form-select,
  .form-textarea {
    font-size: 15px;
    padding: 9px 10px;
  }

  .modal-content {
    max-height: 95vh;
    margin: 2.5vh auto;
  }

  .modal-body {
    max-height: calc(95vh - 120px);
  }
}

/* 横屏手机适配 */
@media (max-height: 500px) and (orientation: landscape) {
  .modal-content {
    max-height: 95vh;
    margin: 2.5vh auto;
  }

  .modal-body {
    max-height: calc(95vh - 100px);
  }

  .header {
    padding: 10px 0;
  }

  .header h1 {
    font-size: 1.4em;
  }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
  .card {
    border-width: 2px;
  }
}

/* 减少动画模式支持 */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* 安全区域适配（iPhone刘海屏） */
@supports (padding: max(0px)) {
  .container {
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }

  .header {
    padding-top: max(16px, env(safe-area-inset-top));
  }

  .modal-content {
    margin-bottom: max(16px, env(safe-area-inset-bottom));
  }
}


/* ========== 广告位预留 ========== */
.guest-ad-banner {
  max-width: 1200px;
  margin: 20px auto;
  padding: 0 20px;
}

.ad-placeholder {
  background: linear-gradient(135deg, rgba(212,175,55,0.08), rgba(155,89,182,0.08));
  border: 1px dashed rgba(212,175,55,0.3);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  min-height: 80px;
}

.ad-label {
  background: rgba(212,175,55,0.2);
  color: var(--accent-gold);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.75em;
  font-weight: 600;
}

.ad-text {
  color: var(--text-muted);
  font-size: 0.9em;
  flex: 1;
  text-align: center;
}

/* 游客标识 */
.guest-badge {
  animation: pulse-gold 2s ease-in-out infinite;
}

@keyframes pulse-gold {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* 手机适配 */
@media (max-width: 768px) {
  .ad-placeholder {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }
  .ad-text {
    font-size: 0.8em;
  }
}


/* ==================== 统一个人信息中心 - 高级感设计 ==================== */

/* 个人信息条 - 优雅横向设计 */
.birth-info-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: linear-gradient(135deg, rgba(212,175,55,0.06) 0%, rgba(155,89,182,0.04) 100%);
  border: 1px solid rgba(212,175,55,0.15);
  border-radius: 12px;
  margin-bottom: 18px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.birth-info-bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212,175,55,0.4), transparent);
}

.birth-info-bar:hover {
  border-color: rgba(212,175,55,0.3);
  background: linear-gradient(135deg, rgba(212,175,55,0.1) 0%, rgba(155,89,182,0.06) 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(212,175,55,0.1);
}

.birth-info-bar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.birth-info-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(212,175,55,0.15), rgba(155,89,182,0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1em;
  flex-shrink: 0;
  border: 1px solid rgba(212,175,55,0.2);
}

.birth-info-text {
  flex: 1;
  min-width: 0;
}

.birth-info-label {
  font-size: 0.72em;
  color: var(--text-muted);
  margin-bottom: 2px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.birth-info-value {
  font-size: 0.92em;
  color: var(--text-primary);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.birth-info-value .birth-info-sep {
  color: var(--text-muted);
  margin: 0 6px;
  font-weight: 300;
}

.birth-info-edit-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(212,175,55,0.2);
  background: rgba(212,175,55,0.05);
  color: var(--accent-gold);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9em;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.birth-info-edit-btn:hover {
  background: rgba(212,175,55,0.15);
  border-color: rgba(212,175,55,0.4);
  transform: scale(1.05);
}

/* 游客引导条 - 渐进式引导 */
.birth-info-guide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(212,175,55,0.08) 0%, rgba(46,204,113,0.05) 100%);
  border: 1px solid rgba(212,175,55,0.2);
  border-radius: 12px;
  margin-bottom: 18px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  animation: guideGlow 3s ease-in-out infinite;
}

@keyframes guideGlow {
  0%, 100% { box-shadow: 0 0 0 rgba(212,175,55,0); }
  50% { box-shadow: 0 0 20px rgba(212,175,55,0.1); }
}

.birth-info-guide:hover {
  border-color: rgba(212,175,55,0.4);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(212,175,55,0.15);
}

.birth-info-guide-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.birth-info-guide-icon {
  font-size: 1.4em;
  animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.8; }
}

.birth-info-guide-text {
  font-size: 0.9em;
  color: var(--text-primary);
  font-weight: 500;
}

.birth-info-guide-text small {
  display: block;
  font-size: 0.8em;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 2px;
}

.birth-info-guide-arrow {
  color: var(--accent-gold);
  font-size: 1.1em;
  transition: transform 0.2s ease;
}

.birth-info-guide:hover .birth-info-guide-arrow {
  transform: translateX(3px);
}

/* 信息完整性提示 - 温柔提醒 */
.birth-info-incomplete {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75em;
  color: var(--accent-gold);
  background: rgba(212,175,55,0.1);
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.birth-info-incomplete:hover {
  background: rgba(212,175,55,0.2);
}

/* 个人信息设置弹窗 - 高级感 */
#birthInfoModal .modal {
  background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  border: 1px solid rgba(212,175,55,0.2);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 40px rgba(212,175,55,0.1);
}

#birthInfoModal h3 {
  text-align: center;
  margin-bottom: 4px;
  background: linear-gradient(135deg, var(--accent-gold), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

#birthInfoModal .modal-subtitle {
  text-align: center;
  font-size: 0.85em;
  color: var(--text-muted);
  margin-bottom: 20px;
}

#birthInfoModal .modal-actions {
  margin-top: 24px;
}

#birthInfoModal .btn-primary {
  background: linear-gradient(135deg, var(--accent-gold), #c9a227);
  border: none;
  color: #1a1a2e;
  font-weight: 600;
}

#birthInfoModal .btn-primary:hover {
  background: linear-gradient(135deg, #e0c060, var(--accent-gold));
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(212,175,55,0.3);
}
