/* AI 梦境绘景 & 塔罗运势 - 全局样式 v2.0 */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0a0a1a;
  --bg-card: rgba(255,255,255,0.05);
  --bg-card-hover: rgba(255,255,255,0.1);
  --text: #e0e0e0;
  --text-secondary: #a0a0b0;
  --accent: #b388ff;
  --accent2: #7c4dff;
  --gold: #ffd54f;
  --pink: #ff4081;
  --success: #69f0ae;
  --danger: #ff5252;
  --border: rgba(255,255,255,0.12);
  --radius: 16px;
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
  --sidebar-width: 220px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(120, 50, 255, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(255, 64, 129, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(255, 213, 79, 0.04) 0%, transparent 50%);
  display: flex;
}

/* ==================== 侧边栏 ==================== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: rgba(15, 15, 35, 0.95);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 10000;
  backdrop-filter: blur(10px);
  transition: transform 0.3s ease;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent2), var(--pink));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85em;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-title {
  font-size: 1em;
  font-weight: 600;
  color: var(--text);
}

.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.9em;
  transition: all 0.2s;
  text-align: left;
  font-family: inherit;
}

.nav-item:hover {
  background: var(--bg-card-hover);
  color: var(--text);
}

.nav-item.active {
  background: rgba(124, 77, 255, 0.2);
  color: var(--accent);
  font-weight: 600;
  box-shadow: 0 0 0 1px rgba(124, 77, 255, 0.3);
}

.nav-icon {
  font-size: 1.2em;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.nav-label {
  white-space: nowrap;
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.version {
  font-size: 0.75em;
  color: var(--text-secondary);
  opacity: 0.5;
}

/* ==================== 移动端导航 ==================== */
.mobile-nav {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 50px;
  background: rgba(15, 15, 35, 0.95);
  border-bottom: 1px solid var(--border);
  z-index: 99;
  align-items: center;
  padding: 0 16px;
  backdrop-filter: blur(10px);
}

.mobile-menu-btn {
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.4em;
  cursor: pointer;
  padding: 4px;
}

.mobile-title {
  font-size: 0.95em;
  font-weight: 600;
  color: var(--text);
  margin-left: 12px;
}

/* 移动端浮动菜单按钮 */
.mobile-menu-float {
  display: none;
  position: fixed;
  bottom: calc(80px + env(safe-area-inset-bottom, 20px));
  right: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  color: #fff;
  border: none;
  font-size: 1.4em;
  cursor: pointer;
  z-index: 9999;
  box-shadow: 0 4px 20px rgba(124, 77, 255, 0.5);
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
.mobile-menu-float:active {
  transform: scale(0.9);
}

/* 移动端菜单引导文字 */
.mobile-menu-guide {
  display: none;
  position: fixed;
  bottom: calc(140px + env(safe-area-inset-bottom, 20px));
  right: 16px;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  font-size: 0.8em;
  padding: 8px 14px;
  border-radius: 20px;
  white-space: nowrap;
  z-index: 9999;
  pointer-events: none;
  animation: guidePulse 2s ease-in-out infinite;
  box-shadow: 0 2px 12px rgba(124, 77, 255, 0.3);
}
.mobile-menu-guide::after {
  content: '';
  position: absolute;
  bottom: -6px;
  right: 18px;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid rgba(0, 0, 0, 0.85);
}
.mobile-menu-guide.hidden {
  display: none !important;
}

@keyframes guidePulse {
  0%, 100% { opacity: 0.7; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-4px); }
}

/* 移动端侧边栏遮罩 */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.6);
  z-index: 9998;
}

/* ==================== 主内容区 ==================== */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

/* 头部 */
.header {
  text-align: center;
  padding: 40px 20px 30px;
}
.header h1 {
  font-size: 2.2em;
  background: linear-gradient(135deg, var(--accent), var(--pink), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}
.header .subtitle {
  color: var(--text-secondary);
  font-size: 0.95em;
}

/* 广告位 */
.ad-banner {
  text-align: center;
  margin: 0 auto 20px;
  max-width: 800px;
  min-height: 90px;
  background: var(--bg-card);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 0.85em;
  overflow: hidden;
}

/* 面板 */
.panel {
  display: none;
  animation: fadeIn 0.4s ease;
}
.panel.active {
  display: block;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 卡片 */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  backdrop-filter: blur(10px);
}
.card h3 {
  font-size: 1.1em;
  margin-bottom: 16px;
  color: var(--accent);
}

/* 表单 */
.form-group {
  margin-bottom: 16px;
}
.form-group label {
  display: block;
  margin-bottom: 6px;
  color: var(--text-secondary);
  font-size: 0.9em;
}
.form-group textarea,
.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  color: var(--text);
  font-size: 0.95em;
  transition: border-color 0.3s;
  font-family: inherit;
  resize: vertical;
}
.form-group textarea:focus,
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent2);
  box-shadow: 0 0 0 3px rgba(124, 77, 255, 0.15);
}
.form-group textarea {
  min-height: 100px;
}
.form-group select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23a0a0b0' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.form-row {
  display: flex;
  gap: 12px;
}
.form-row .form-group {
  flex: 1;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 24px;
  border: none;
  border-radius: 12px;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  font-family: inherit;
}
.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  color: #fff;
  box-shadow: 0 4px 20px rgba(124, 77, 255, 0.35);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(124, 77, 255, 0.5);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
.btn-generate {
  flex-shrink: 0;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  color: #fff;
  box-shadow: 0 4px 20px rgba(124, 77, 255, 0.35);
  white-space: nowrap;
}
.btn-generate:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(124, 77, 255, 0.5);
}
.btn-generate:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
.btn-gold {
  background: linear-gradient(135deg, var(--gold), #ffab00);
  color: #1a1a2e;
  font-weight: 700;
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
}
.btn-outline:hover {
  background: rgba(179, 136, 255, 0.1);
}
.btn-sm {
  padding: 8px 16px;
  font-size: 0.85em;
  border-radius: 8px;
}

/* ==================== MBTI 模式切换 ==================== */
.mbti-mode-card {
  padding: 12px 24px;
}
.mbti-mode-switch {
  display: flex;
  gap: 8px;
}
.mode-btn {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.9em;
  font-weight: 500;
  transition: all 0.2s;
  font-family: inherit;
}
.mode-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text);
}
.mode-btn.active {
  background: rgba(124, 77, 255, 0.2);
  border-color: var(--accent2);
  color: var(--accent);
  font-weight: 600;
}

.mbti-sub-panel {
  display: none;
  animation: fadeIn 0.3s ease;
}
.mbti-sub-panel.active {
  display: block;
}

/* ==================== MBTI 在线测试 ==================== */
.test-progress {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  margin-bottom: 12px;
  overflow: hidden;
}
.test-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent2), var(--accent));
  border-radius: 3px;
  transition: width 0.4s ease;
}
.test-progress-text {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85em;
  margin-bottom: 20px;
}

.test-question {
  font-size: 1.05em;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 20px;
  line-height: 1.6;
  padding: 16px;
  background: rgba(255,255,255,0.03);
  border-radius: 10px;
  border-left: 3px solid var(--accent);
}

.test-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.test-option {
  display: flex;
  align-items: center;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 0.9em;
  transition: all 0.2s;
  text-align: left;
  font-family: inherit;
  line-height: 1.5;
}
.test-option:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent2);
  transform: translateX(4px);
}
.test-option:active {
  transform: scale(0.98);
}

.test-option .option-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(124, 77, 255, 0.15);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.85em;
  margin-right: 12px;
  flex-shrink: 0;
}

/* 测试结果 */
.test-result-header {
  text-align: center;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.test-result-type {
  font-size: 3.5em;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent2), var(--accent), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 4px;
  margin-bottom: 8px;
}

.test-result-name {
  font-size: 1.1em;
  color: var(--text-secondary);
}

.test-dimensions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.test-dimension {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(255,255,255,0.03);
  border-radius: 10px;
}

.dim-label {
  font-size: 0.85em;
  font-weight: 600;
  color: var(--accent);
  width: 50px;
  text-align: center;
  flex-shrink: 0;
}

.dim-bar-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dim-left, .dim-right {
  font-size: 0.75em;
  color: var(--text-secondary);
  width: 24px;
  text-align: center;
}

.dim-bar {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.dim-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s ease;
}

.dim-bar-fill.ei { background: linear-gradient(90deg, #4fc3f7, var(--accent2)); }
.dim-bar-fill.sn { background: linear-gradient(90deg, var(--success), var(--accent2)); }
.dim-bar-fill.tf { background: linear-gradient(90deg, var(--pink), var(--accent2)); }
.dim-bar-fill.jp { background: linear-gradient(90deg, var(--gold), var(--accent2)); }

.dim-percent {
  font-size: 0.8em;
  color: var(--text-secondary);
  width: 40px;
  text-align: right;
  flex-shrink: 0;
}

/* 加载动画 */
.loading {
  display: none;
  text-align: center;
  padding: 40px 20px;
}
.loading.active {
  display: block;
}
.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.loading-text {
  color: var(--text-secondary);
  font-size: 0.9em;
}

/* 结果展示 */
.result {
  display: none;
  animation: fadeIn 0.5s ease;
}
.result.active {
  display: block;
}
.result-image {
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
  position: relative;
  background: var(--bg-card);
}
.result-image img {
  width: 100%;
  display: block;
}
.result-image .watermark {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.7);
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 0.9em;
  text-align: center;
  backdrop-filter: blur(4px);
}
.result-image .watermark .lock-icon {
  font-size: 2em;
  display: block;
  margin-bottom: 4px;
}
.result-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.result-actions .btn {
  flex: 1;
  min-width: 120px;
}

/* 报告预览 */
.report-preview {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 16px;
  white-space: pre-line;
  font-size: 0.9em;
  line-height: 1.8;
  color: var(--text-secondary);
  max-height: 200px;
  overflow: hidden;
  position: relative;
}
.report-preview::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(transparent, var(--bg-card));
}
.report-full {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 16px;
  white-space: pre-line;
  font-size: 0.9em;
  line-height: 1.8;
  max-height: 500px;
  overflow-y: auto;
}

/* 塔罗牌展示 */
.tarot-cards {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 16px 0;
}
.tarot-card {
  background: var(--bg-card);
  border: 1px solid var(--gold);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  min-width: 100px;
  flex: 1;
  max-width: 160px;
}
.tarot-card .card-name {
  color: var(--gold);
  font-weight: 600;
  font-size: 0.95em;
  margin-bottom: 2px;
}
.tarot-card .card-number {
  font-size: 0.7em;
  color: var(--accent);
  margin-bottom: 4px;
}
.tarot-card .card-orientation {
  font-size: 0.8em;
  color: var(--text-secondary);
}
.tarot-card .card-keywords {
  font-size: 0.72em;
  color: var(--text-secondary);
  margin-top: 6px;
  line-height: 1.4;
}

/* 分享弹窗 */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.modal-overlay.active {
  display: flex;
}
.modal {
  background: #1a1a2e;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px;
  max-width: 420px;
  width: 90%;
  text-align: center;
  box-shadow: var(--shadow);
}
.modal h3 {
  margin-bottom: 16px;
  color: var(--accent);
}
.modal .share-stats {
  margin: 16px 0;
  font-size: 0.9em;
  color: var(--text-secondary);
}
.modal .share-progress {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  margin: 12px 0;
  overflow: hidden;
}
.modal .share-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  border-radius: 3px;
  transition: width 0.5s;
}
.modal .share-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 16px 0;
}
.modal .share-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9em;
  font-weight: 500;
  color: #fff;
  transition: transform 0.2s;
}
.modal .share-btn:active {
  transform: scale(0.95);
}
.share-wechat { background: #07c160; }
.share-weibo { background: #e6162d; }
.share-qq { background: #12b7f5; }
.share-copy { background: var(--accent2); }

.modal .close-btn {
  margin-top: 16px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 8px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9em;
}

/* 广告弹窗 */
.ad-modal {
    max-width: 520px;
    width: 95%;
    padding: 20px;
}
.ad-modal-header {
    text-align: center;
    margin-bottom: 16px;
}
.ad-modal-header h3 {
    margin-bottom: 6px;
    color: var(--accent);
}
.ad-timer-text {
    font-size: 0.85em;
    color: var(--text-secondary);
}
.ad-timer-text span {
    color: var(--gold);
    font-weight: 700;
    font-size: 1.1em;
}
.ad-iframe-wrapper {
    width: 100%;
    height: 320px;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 16px;
    background: #fff;
}
.ad-iframe-wrapper iframe {
    width: 100%;
    height: 100%;
    border: none;
}
.ad-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}
.ad-modal-actions .btn-gold {
    width: 100%;
}
.ad-modal-actions .close-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 8px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    font-family: inherit;
}

/* Toast */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a2e;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 24px;
  color: #fff;
  font-size: 0.9em;
  z-index: 2000;
  box-shadow: var(--shadow);
  animation: slideDown 0.3s ease;
  max-width: 90%;
}
@keyframes slideDown {
  from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ==================== 周易算卦 · 硬币动画 ==================== */
.coin-toss-area {
  text-align: center;
}

.coins-container {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin: 24px 0;
  perspective: 600px;
}

.coin {
  width: 72px;
  height: 72px;
  font-size: 48px;
  line-height: 72px;
  text-align: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffd54f, #ffab00);
  box-shadow: 0 4px 16px rgba(255, 171, 0, 0.4), inset 0 2px 4px rgba(255,255,255,0.3);
  transition: transform 0.1s, box-shadow 0.3s;
  cursor: default;
  user-select: none;
}

.coin.flip {
  transform: rotateY(180deg);
}

.coin.heads {
  background: linear-gradient(135deg, #ffd54f, #ffab00);
  box-shadow: 0 4px 20px rgba(255, 171, 0, 0.6), inset 0 2px 4px rgba(255,255,255,0.3);
}

.coin.tails {
  background: linear-gradient(135deg, #b0bec5, #78909c);
  box-shadow: 0 4px 20px rgba(120, 144, 156, 0.5), inset 0 2px 4px rgba(255,255,255,0.2);
}

.coins-container.tossing .coin {
  animation: coinSpin 0.1s ease-in-out infinite alternate;
}

@keyframes coinSpin {
  0% { transform: rotateY(0deg) scale(1); }
  100% { transform: rotateY(180deg) scale(1.1); }
}

/* 六爻进度条 */
.lines-progress {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 20px;
  padding: 16px;
  background: var(--bg-card);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.line-slot {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px;
  border-radius: 8px;
  transition: all 0.3s;
  opacity: 0.4;
}

.line-slot.filled {
  opacity: 1;
  background: rgba(124, 77, 255, 0.1);
}

.line-slot.changing {
  background: rgba(255, 171, 0, 0.15);
  border: 1px solid rgba(255, 171, 0, 0.3);
}

.line-slot .line-label {
  font-size: 0.8em;
  color: var(--text-secondary);
  width: 36px;
  text-align: right;
  flex-shrink: 0;
}

.line-slot .line-value {
  font-size: 1.2em;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 2px;
}

.line-slot.changing .line-value {
  color: var(--gold);
}

/* ==================== 周易算卦结果展示 ==================== */
.iching-result {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hexagram-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.hexagram-card.main-hexagram {
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(124, 77, 255, 0.1);
}

.hexagram-card.changed-hexagram {
  border-color: var(--gold);
  box-shadow: 0 0 20px rgba(255, 213, 79, 0.1);
}

.hexagram-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.hexagram-symbol {
  font-size: 2.5em;
  line-height: 1;
}

.hexagram-name {
  font-size: 1.2em;
  font-weight: 700;
  color: var(--accent);
}

.changed-hexagram .hexagram-name {
  color: var(--gold);
}

.hexagram-trigram {
  font-size: 0.8em;
  color: var(--text-secondary);
  margin-top: 2px;
}

.hexagram-judgment,
.hexagram-image,
.hexagram-interpretation {
  margin-bottom: 12px;
  padding: 10px 14px;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
  border-left: 3px solid var(--accent);
}

.changed-hexagram .hexagram-judgment,
.changed-hexagram .hexagram-image,
.changed-hexagram .hexagram-interpretation {
  border-left-color: var(--gold);
}

.hexagram-judgment .label,
.hexagram-image .label,
.hexagram-interpretation .label {
  font-size: 0.75em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.changed-hexagram .label {
  color: var(--gold);
}

.hexagram-judgment div:last-child,
.hexagram-image div:last-child,
.hexagram-interpretation div:last-child {
  font-size: 0.9em;
  line-height: 1.7;
  color: var(--text);
}

/* 六爻详情 */
.hexagram-lines-detail {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.section-title {
  font-size: 0.9em;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.line-detail-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.85em;
  transition: background 0.2s;
}

.line-detail-item:hover {
  background: rgba(255,255,255,0.03);
}

.line-detail-item.changing-line {
  background: rgba(255, 171, 0, 0.08);
  border: 1px solid rgba(255, 171, 0, 0.2);
}

.line-pos {
  color: var(--text-secondary);
  width: 36px;
  flex-shrink: 0;
}

.line-type {
  color: var(--text);
  font-weight: 500;
  width: 48px;
}

.line-sym {
  font-size: 1.1em;
  font-weight: 700;
  color: var(--accent);
  width: 40px;
  text-align: center;
}

.changing-line .line-sym {
  color: var(--gold);
}

.line-coins {
  color: var(--text-secondary);
  flex: 1;
  font-size: 0.8em;
}

.changing-badge {
  background: rgba(255, 171, 0, 0.2);
  color: var(--gold);
  font-size: 0.75em;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  flex-shrink: 0;
}

/* ==================== 卦象多维度详细分析 ==================== */
.hexagram-details {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
}

.details-title {
  font-size: 0.95em;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 14px;
  text-align: center;
}

.changed-hexagram .details-title {
  color: var(--gold);
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.detail-item {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.detail-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.detail-love {
  border-left: 3px solid var(--pink);
}

.detail-career {
  border-left: 3px solid var(--accent);
}

.detail-wealth {
  border-left: 3px solid var(--gold);
}

.detail-study {
  border-left: 3px solid var(--success);
}

.detail-health {
  border-left: 3px solid #4fc3f7;
}

.detail-advice {
  border-left: 3px solid #ffab00;
  grid-column: 1 / -1;
}

.detail-icon {
  font-size: 1.5em;
  margin-bottom: 6px;
}

.detail-label {
  font-size: 0.85em;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text);
}

.detail-love .detail-label { color: var(--pink); }
.detail-career .detail-label { color: var(--accent); }
.detail-wealth .detail-label { color: var(--gold); }
.detail-study .detail-label { color: var(--success); }
.detail-health .detail-label { color: #4fc3f7; }
.detail-advice .detail-label { color: #ffab00; }

.detail-content {
  font-size: 0.82em;
  line-height: 1.7;
  color: var(--text-secondary);
}

/* ==================== 废话生成器 ==================== */
.keyword-input-wrapper {
  display: flex;
  gap: 10px;
  align-items: center;
}

.keyword-input-wrapper input {
  flex: 1;
}

.nonsense-output-area {
  animation: fadeIn 0.5s ease;
}

.nonsense-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.nonsense-keyword-badge {
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  color: #fff;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 0.85em;
  font-weight: 600;
}

.nonsense-typing-indicator {
  color: var(--accent);
  font-size: 0.85em;
  display: flex;
  align-items: center;
  gap: 4px;
}

.typing-dots::after {
  content: '';
  animation: typingDots 1.5s steps(3, end) infinite;
}

@keyframes typingDots {
  0%   { content: ''; }
  25%  { content: '.'; }
  50%  { content: '..'; }
  75%  { content: '...'; }
  100% { content: ''; }
}

.nonsense-content {
  font-size: 0.95em;
  line-height: 2;
  color: var(--text);
  white-space: pre-line;
  min-height: 60px;
}

.nonsense-error {
  color: var(--danger);
  text-align: center;
  padding: 20px;
}

.nonsense-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  justify-content: center;
}

/* ==================== AI 梦境解析 ==================== */
.dream-char-count {
  text-align: right;
  font-size: 0.75em;
  color: var(--text-secondary);
  margin-top: 6px;
}

.dream-char-count span {
  color: var(--accent);
}

#dream-input {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.95em;
  line-height: 1.7;
  resize: vertical;
  font-family: inherit;
  transition: border-color 0.2s;
}

#dream-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(124, 77, 255, 0.15);
}

#dream-input::placeholder {
  color: var(--text-secondary);
  opacity: 0.6;
}

/* ==================== AI 命理大师 ==================== */
.fortune-chat-container {
  display: flex;
  flex-direction: column;
  height: 450px;
  overflow-y: auto;
  margin-bottom: 16px;
  padding-right: 8px;
}

.fortune-messages {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fortune-msg {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  animation: fadeIn 0.3s ease;
}

.fortune-msg-user {
  flex-direction: row-reverse;
}

.fortune-msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2em;
  flex-shrink: 0;
}

.fortune-msg-user .fortune-msg-avatar {
  background: linear-gradient(135deg, var(--accent2), var(--accent));
  font-size: 0.9em;
  color: #fff;
}

.fortune-msg-bubble {
  max-width: 75%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 0.9em;
  line-height: 1.7;
  word-break: break-word;
}

.fortune-msg-system .fortune-msg-bubble,
.fortune-msg-bot .fortune-msg-bubble {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-top-left-radius: 4px;
}

.fortune-msg-user .fortune-msg-bubble {
  background: linear-gradient(135deg, rgba(124, 77, 255, 0.25), rgba(179, 136, 255, 0.15));
  border: 1px solid rgba(124, 77, 255, 0.3);
  border-top-right-radius: 4px;
  color: var(--text);
}

.fortune-msg-bubble p {
  margin: 0;
}

.fortune-msg-bubble p + p {
  margin-top: 8px;
}

.fortune-typing {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 4px 0;
}

.fortune-typing-bubble {
  color: var(--accent) !important;
  font-style: italic;
}

.fortune-input-area {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.fortune-quick-questions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.fortune-quick-btn {
  padding: 6px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 0.8em;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  white-space: nowrap;
}

.fortune-quick-btn:hover {
  background: rgba(124, 77, 255, 0.15);
  border-color: var(--accent);
  color: var(--accent);
}

.fortune-input-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.fortune-input-row input {
  flex: 1;
}

.fortune-input-row .btn-generate {
  white-space: nowrap;
}

/* 滚动条 */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ==================== 阳安加密工具 ==================== */
.encrypt-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.encrypt-tab {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.9em;
  font-weight: 500;
  transition: all 0.2s;
  font-family: inherit;
  text-align: center;
}
.encrypt-tab:hover {
  background: var(--bg-card-hover);
  color: var(--text);
}
.encrypt-tab.active {
  background: rgba(124, 77, 255, 0.2);
  border-color: var(--accent2);
  color: var(--accent);
  font-weight: 600;
}
.encrypt-panel {
  display: none;
  animation: fadeIn 0.3s ease;
}
.encrypt-panel.active {
  display: block;
}
.encrypt-result {
  margin-top: 16px;
  padding: 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.encrypt-result-label {
  font-size: 0.8em;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.encrypt-result-content {
  word-break: break-all;
  font-family: 'Courier New', monospace;
  font-size: 0.85em;
  color: #4ade80;
  line-height: 1.6;
}

/* ==================== 熊大快跑游戏 ==================== */
.game-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.game-container {
  position: relative;
  width: 400px;
  height: 600px;
  max-width: 95vw;
  max-height: 70vh;
  background: linear-gradient(180deg, #4a90d9 0%, #4a90d9 60%, #228B22 60%, #32CD32 100%);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  margin: 0 auto;
}
#gameCanvas {
  display: block;
  width: 100%;
  height: 100%;
}
.game-ui-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}
.game-score-display {
  position: absolute;
  top: 15px;
  left: 15px;
  color: white;
  font-size: 22px;
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}
.game-level-display {
  position: absolute;
  top: 15px;
  right: 15px;
  color: #FFD700;
  font-size: 18px;
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}
.game-mode-display {
  position: absolute;
  top: 40px;
  right: 15px;
  color: #90EE90;
  font-size: 12px;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}
.game-combo-display {
  position: absolute;
  top: 45px;
  left: 15px;
  color: #FFD700;
  font-size: 16px;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}
.game-distance-display {
  position: absolute;
  top: 70px;
  left: 15px;
  color: #87CEEB;
  font-size: 14px;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}
.game-endless-score {
  position: absolute;
  top: 70px;
  right: 15px;
  color: #FF69B4;
  font-size: 14px;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}
.game-power-indicator {
  position: absolute;
  top: 95px;
  left: 15px;
  display: flex;
  gap: 8px;
}
.game-power-badge {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  color: white;
  font-weight: bold;
}
.game-power-badge.shield { background: #4169E1; }
.game-power-badge.magnet { background: #FF4500; }
.game-power-badge.speed { background: #32CD32; }

.game-screen {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.9);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  pointer-events: auto;
}
.game-hidden { display: none !important; }
.game-bear-icon {
  font-size: 80px;
  margin-bottom: 15px;
  animation: gameBounce 1s infinite;
}
@keyframes gameBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}
.game-title-text {
  font-size: 42px;
  color: #8B4513;
  text-shadow: 3px 3px 0 #DEB887, 5px 5px 10px rgba(0,0,0,0.3);
  margin-bottom: 10px;
}
.game-level-title {
  font-size: 32px;
  color: #FFD700;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}
.game-mode-title-text {
  font-size: 28px;
  color: #FF69B4;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}
.game-instructions {
  color: white;
  font-size: 14px;
  text-align: center;
  margin: 15px;
  line-height: 1.8;
}
.game-level-desc {
  color: white;
  font-size: 16px;
  text-align: center;
  margin: 15px;
  line-height: 1.6;
  max-width: 300px;
}
.game-level-stats {
  color: #90EE90;
  font-size: 14px;
  text-align: center;
  margin: 10px;
  line-height: 1.8;
}
.game-endless-stats-text {
  color: #FF69B4;
  font-size: 14px;
  text-align: center;
  margin: 10px;
  line-height: 1.8;
}
.game-mode-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}
.game-mode-tab {
  padding: 10px 20px;
  background: rgba(255,255,255,0.1);
  border: 2px solid transparent;
  border-radius: 20px;
  color: white;
  cursor: pointer;
  transition: all 0.3s;
  font-family: inherit;
  font-size: 14px;
}
.game-mode-tab.active {
  background: rgba(255,215,0,0.3);
  border-color: #FFD700;
}
.game-mode-tab:hover {
  background: rgba(255,255,255,0.2);
}
.game-btn {
  padding: 15px 40px;
  font-size: 22px;
  background: linear-gradient(180deg, #FF6B6B, #EE5A5A);
  color: white;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  margin: 8px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  transition: transform 0.1s, box-shadow 0.1s;
  pointer-events: auto;
  font-family: inherit;
}
.game-btn:hover { transform: scale(1.05); }
.game-btn:active { transform: scale(0.95); }
.game-btn-level {
  background: linear-gradient(180deg, #4CAF50, #45a049);
  padding: 12px 25px;
  font-size: 18px;
  margin: 5px;
}
.game-btn-level.locked {
  background: linear-gradient(180deg, #666, #555);
  cursor: not-allowed;
}
.game-btn-endless {
  background: linear-gradient(180deg, #FF69B4, #FF1493);
  padding: 12px 25px;
  font-size: 18px;
  margin: 5px;
}
.game-btn-back {
  background: linear-gradient(180deg, #607D8B, #546E7A);
  padding: 10px 25px;
  font-size: 16px;
}
.game-level-select {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 20px;
}
.game-level-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.game-stats-panel {
  background: rgba(0,0,0,0.5);
  padding: 15px 25px;
  border-radius: 15px;
  margin: 15px;
}
.game-stat-row {
  display: flex;
  justify-content: space-between;
  color: white;
  margin: 8px 0;
  font-size: 14px;
}
.game-stat-label { color: #aaa; }
.game-stat-value { color: #FFD700; font-weight: bold; }
.game-final-score {
  font-size: 32px;
  color: #FFD700;
  margin: 15px;
}
.game-high-score {
  font-size: 18px;
  color: #90EE90;
  margin-bottom: 15px;
}
.game-level-complete {
  font-size: 28px;
  color: #4CAF50;
  margin: 10px;
}
.game-stars {
  font-size: 40px;
  margin: 15px;
}
.game-endless-final {
  font-size: 24px;
  color: #FF69B4;
  margin: 10px;
}
.game-new-record {
  font-size: 20px;
  color: #FFD700;
  margin: 10px;
}

/* ==================== 反应速度测试 ==================== */
.reaction-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.reaction-stat-card {
  background: rgba(255,255,255,0.05);
  padding: 14px 10px;
  border-radius: 12px;
  text-align: center;
}
.reaction-stat-label {
  font-size: 0.8em;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.reaction-stat-value {
  font-size: 1.6em;
  font-weight: bold;
  color: #f6e05e;
}
.reaction-light {
  width: 200px;
  height: 200px;
  background: #2d3748;
  border-radius: 50%;
  margin: 20px auto;
  cursor: pointer;
  transition: background 0.3s, transform 0.2s, box-shadow 0.3s;
  border: 8px solid rgba(255,255,255,0.15);
  box-shadow: 0 10px 30px rgba(0,0,0,0.3), inset 0 0 20px rgba(0,0,0,0.4);
}
.reaction-light.waiting {
  background: #e53e3e;
  animation: rxPulse 1.5s infinite;
  box-shadow: 0 0 25px rgba(229,62,62,0.5), 0 10px 30px rgba(0,0,0,0.3);
}
.reaction-light.go {
  background: #48bb78;
  transform: scale(1.08);
  box-shadow: 0 0 35px rgba(72,187,120,0.6), 0 10px 30px rgba(0,0,0,0.3);
}
@keyframes rxPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(229,62,62,0.4); }
  50% { box-shadow: 0 0 40px rgba(229,62,62,0.8); }
}
.reaction-result {
  font-size: 1.5em;
  margin: 16px 0;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}
.reaction-controls {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 16px 0;
  flex-wrap: wrap;
}

/* ==================== 小游戏面板 ==================== */
.minigame-mode-card {
  padding: 12px 24px;
}
.minigame-mode-switch {
  display: flex;
  gap: 8px;
}
.minigame-mode-btn {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 0.9em;
  font-weight: 500;
  transition: all 0.2s;
  font-family: inherit;
}
.minigame-mode-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text);
}
.minigame-mode-btn.active {
  background: rgba(124, 77, 255, 0.2);
  border-color: var(--accent2);
  color: var(--accent);
  font-weight: 600;
}
.minigame-sub-panel {
  display: none;
  animation: fadeIn 0.3s ease;
}
.minigame-sub-panel.active {
  display: block;
}

/* ==================== 网站声明弹窗 ==================== */
.disclaimer-modal {
  max-width: 440px;
}
.disclaimer-icon {
  font-size: 3em;
  margin-bottom: 12px;
  text-align: center;
}
.disclaimer-content {
  text-align: left;
  font-size: 0.9em;
  color: var(--text-secondary);
  line-height: 1.8;
  margin: 16px 0;
  padding: 14px 18px;
  background: rgba(255,255,255,0.03);
  border-radius: 10px;
  border-left: 3px solid var(--accent);
}
.disclaimer-content strong {
  color: var(--accent);
  font-weight: 700;
}
.disclaimer-content p {
  margin-bottom: 6px;
}
.disclaimer-content p:last-child {
  margin-bottom: 0;
}

/* 粒子背景 */
#particles {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
}

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .sidebar-overlay.active {
    display: block;
  }

  .mobile-nav {
    display: none;
  }
  .mobile-menu-float {
    display: flex;
  }
  .mobile-menu-guide {
    display: block;
  }

  .main-content {
    margin-left: 0;
    padding-top: 0;
  }

  .header h1 { font-size: 1.6em; }
  .container { padding: 12px; }
  .card { padding: 16px; }
  .form-row { flex-direction: column; }
  .result-actions .btn { min-width: 100%; }
  .tarot-card { min-width: 80px; max-width: 120px; }
  .keyword-input-wrapper { flex-direction: column; }
  .keyword-input-wrapper .btn-generate { width: 100%; }
  .detail-grid { grid-template-columns: 1fr; }
  .hexagram-symbol { font-size: 2em; }
  .line-detail-item { flex-wrap: wrap; gap: 6px; }
  .test-result-type { font-size: 2.5em; }
}

@media (max-width: 600px) {
  .header h1 { font-size: 1.4em; }
  .header { padding: 20px 12px 16px; }
  .test-dimension { flex-wrap: wrap; }
  .dim-left, .dim-right { width: 20px; font-size: 0.7em; }
  .fortune-chat-container { height: 350px; }
  .fortune-msg-bubble { max-width: 85%; }
  .fortune-input-row { flex-direction: column; }
  .fortune-input-row .btn-generate { width: 100%; }
  .fortune-quick-questions { gap: 6px; }
  .fortune-quick-btn { font-size: 0.75em; padding: 5px 10px; }
  #dream-input { min-height: 100px; }
}

/* ==================== 首页测试卡片（灵魂碎片/人生剧本/五行人格） ==================== */
.home-test-cards {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 0 0 40px;
}

.home-test-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 28px 24px;
  cursor: pointer;
  transition: all 0.3s;
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
}

.home-test-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  transition: height 0.3s;
}

.home-test-card:nth-child(1)::before { background: linear-gradient(90deg, #1a1a2e, #8b5cf6, #6b5b7b); }
.home-test-card:nth-child(2)::before { background: linear-gradient(90deg, #1a1a2e, #e8b830, #c0392b); }
.home-test-card:nth-child(3)::before { background: linear-gradient(90deg, #1a1a2e, #4a9c5d, #3b6fb6); }

.home-test-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255,255,255,0.1);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.home-test-card:hover::before { height: 4px; }

.home-test-card .card-icon {
  font-size: 40px;
  margin-bottom: 12px;
}
.home-test-card h3 {
  font-size: 1.3em;
  margin-bottom: 6px;
  color: var(--text);
}
.home-test-card .card-desc {
  color: var(--text-secondary);
  font-size: 0.9em;
  line-height: 1.5;
}
.home-test-card .card-meta {
  display: flex;
  gap: 16px;
  margin-top: 14px;
  font-size: 0.8em;
  color: var(--text-secondary);
  opacity: 0.7;
}

/* ==================== 三合一测试通用样式 ==================== */
@keyframes testFadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.tests-panel-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.tests-back-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--text-secondary);
  width: 40px; height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  transition: all 0.3s;
  display: flex; align-items: center; justify-content: center;
}
.tests-back-btn:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.3);
}

.tests-title-area { flex: 1; }
.tests-title-area h2 {
  font-size: 1.2em;
  margin-bottom: 4px;
  color: var(--text);
}

.tests-progress-wrap {
  width: 100%; height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  margin-top: 8px;
}
.tests-progress-bar {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s ease;
  background: linear-gradient(90deg, var(--accent2), var(--accent));
}
.tests-progress-text {
  font-size: 0.8em;
  color: var(--text-secondary);
  margin-top: 4px;
  text-align: right;
}

.tests-question-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  margin-bottom: 20px;
  animation: testFadeInUp 0.4s ease;
}

.tests-question-num {
  font-size: 0.75em;
  color: var(--gold);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.tests-question-text {
  font-size: 1.1em;
  line-height: 1.8;
  margin-bottom: 28px;
  color: var(--text);
}

.tests-result-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 28px;
  width: 100%;
  text-align: center;
  animation: testFadeInUp 0.6s ease;
  position: relative;
  overflow: hidden;
}

.tests-result-card::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 0%, rgba(255,255,255,0.03) 0%, transparent 70%);
}

.tests-result-title {
  font-size: 1.6em;
  margin-bottom: 6px;
  color: var(--text);
  font-weight: 700;
}

.tests-result-subtitle {
  color: var(--text-secondary);
  font-size: 0.9em;
  margin-bottom: 28px;
  font-style: italic;
}

/* 灵魂碎片结果 */
.tests-fragments-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 24px 0;
  flex-wrap: wrap;
}

.tests-fragment-card {
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius);
  padding: 22px 16px;
  text-align: center;
  transition: all 0.3s;
  border: 2px solid transparent;
  width: 160px;
}

.tests-fragment-card.primary {
  width: 180px;
  transform: scale(1.05);
  border-color: rgba(255,255,255,0.15);
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}

.tests-frag-icon { font-size: 44px; margin-bottom: 10px; }
.tests-frag-name { font-size: 1.05em; font-weight: 600; margin-bottom: 4px; color: var(--text); }
.tests-frag-en { font-size: 0.7em; color: var(--text-secondary); letter-spacing: 1px; margin-bottom: 10px; }
.tests-frag-desc { font-size: 0.8em; color: var(--text-secondary); line-height: 1.5; }
.tests-frag-bar { height: 3px; border-radius: 2px; margin-top: 12px; }

.tests-summary-quote {
  margin-top: 24px;
  padding: 16px;
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  font-size: 1.05em;
  color: var(--gold);
  font-style: italic;
}

/* 人生剧本结果 */
.tests-script-poster {
  background: rgba(255,255,255,0.03);
  border-radius: var(--radius);
  padding: 36px 24px;
  margin: 20px 0;
  position: relative;
  overflow: hidden;
}

.tests-script-genre {
  font-size: 2em;
  margin-bottom: 4px;
  font-weight: 700;
}

.tests-script-tagline {
  font-style: italic;
  color: var(--text-secondary);
  font-size: 0.95em;
  margin-bottom: 24px;
  line-height: 1.6;
}

.tests-script-acts {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tests-script-act {
  padding: 16px;
  border-left: 3px solid rgba(255,255,255,0.15);
  border-radius: 0 10px 10px 0;
  background: rgba(255,255,255,0.02);
}

.tests-act-title {
  font-weight: bold;
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 6px;
}

.tests-act-text {
  font-size: 0.9em;
  color: var(--text-secondary);
  line-height: 1.6;
}

.tests-script-companion {
  margin-top: 20px;
  padding: 14px;
  background: rgba(255,255,255,0.03);
  border-radius: 10px;
  font-size: 0.85em;
  color: var(--text-secondary);
}
.tests-script-companion strong { color: var(--gold); }

/* 五行结果 */
.tests-elements-chart {
  margin: 20px auto;
  position: relative;
  width: 300px;
  height: 300px;
}

.tests-elements-chart svg {
  width: 100%;
  height: 100%;
}

.tests-element-details {
  text-align: left;
  margin-top: 20px;
}

.tests-element-detail {
  padding: 14px 16px;
  border-radius: 10px;
  background: rgba(255,255,255,0.02);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.tests-elem-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.tests-elem-info { flex: 1; }
.tests-elem-name { font-weight: bold; font-size: 0.9em; color: var(--text); }
.tests-elem-pct { font-size: 0.8em; color: var(--text-secondary); }
.tests-elem-desc { font-size: 0.8em; color: var(--text-secondary); margin-top: 2px; }

.tests-element-signature {
  margin-top: 20px;
  padding: 16px;
  background: rgba(255,255,255,0.03);
  border-radius: 10px;
  font-size: 1.05em;
  color: var(--gold);
  font-style: italic;
}

/* 测试结果操作按钮 */
.tests-result-actions {
  margin-top: 28px;
  text-align: center;
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.tests-btn-retry {
  background: none;
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--text-secondary);
  padding: 12px 28px;
  border-radius: 30px;
  font-size: 0.9em;
  cursor: pointer;
  transition: all 0.3s;
  font-family: inherit;
}
.tests-btn-retry:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.4);
}

.tests-btn-home {
  background: none;
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--text-secondary);
  padding: 12px 28px;
  border-radius: 30px;
  font-size: 0.9em;
  cursor: pointer;
  transition: all 0.3s;
  font-family: inherit;
}
.tests-btn-home:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.4);
}

/* 测试广告解锁遮罩 */
.tests-lock-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 60px 20px 30px;
  background: rgba(15,12,25,0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 10;
  pointer-events: auto;
}
.tests-lock-icon {
  font-size: 40px;
  animation: testLockPulse 2s ease-in-out infinite;
}
@keyframes testLockPulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}
.tests-lock-text {
  color: var(--text-secondary);
  font-size: 0.9em;
  margin-bottom: 4px;
}
.tests-unlock-btn {
  padding: 12px 30px;
  font-size: 1em;
  cursor: pointer;
}

/* 响应式 */
@media (max-width: 768px) {
  .tests-fragments-display { flex-direction: column; gap: 12px; }
  .tests-fragment-card { width: 100% !important; max-width: 280px; }
  .tests-fragment-card.primary { width: 100% !important; transform: none; }
  .tests-elements-chart { width: 260px; height: 260px; }
  .tests-result-title { font-size: 1.3em; }
  .tests-script-genre { font-size: 1.5em; }
  .tests-result-actions { flex-direction: column; align-items: center; }
}