/* ===== 基础 & 变量 ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Noto+Serif+SC:wght@400;600;700&display=swap');

:root {
  --bg-deep: #05030f;
  --bg-mid: #0b071e;
  --glass-bg: rgba(255, 255, 255, 0.02);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-hover: rgba(255, 255, 255, 0.05);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --text-primary: #f8f6fb;
  --text-secondary: rgba(248, 246, 251, 0.7);
  --text-muted: rgba(248, 246, 251, 0.4);
  --accent: #c084fc;
  --accent-glow: rgba(192, 132, 252, 0.4);

  /* 五行色提亮与高级化 */
  --wx-jin: #FDE047;
  --wx-mu: #6EE7B7;
  --wx-shui: #93C5FD;
  --wx-huo: #FDA4AF;
  --wx-tu: #FCD34D;

  --wx-jin-glow: rgba(253,224,71,0.4);
  --wx-mu-glow: rgba(110,231,183,0.4);
  --wx-shui-glow: rgba(147,197,253,0.4);
  --wx-huo-glow: rgba(253,164,175,0.4);
  --wx-tu-glow: rgba(252,211,77,0.4);

  --radius: 20px;
  --radius-sm: 12px;
  --transition: 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC', sans-serif;
  background: radial-gradient(circle at 50% 0%, var(--bg-mid) 0%, var(--bg-deep) 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

h1, h2, h3, .title, .bazi-row-gan .bazi-cell, .bazi-row-zhi .bazi-cell {
  font-family: 'Noto Serif SC', serif;
}

/* ===== 背景光球 ===== */
.bg-orbs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
  animation: orbFloat 20s ease-in-out infinite;
}

.orb-1 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, var(--wx-shui-glow), transparent 70%);
  top: -10%; left: -10%;
  animation-delay: 0s;
}

.orb-2 {
  width: 350px; height: 350px;
  background: radial-gradient(circle, var(--wx-huo-glow), transparent 70%);
  top: 40%; right: -15%;
  animation-delay: -7s;
}

.orb-3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, var(--wx-mu-glow), transparent 70%);
  bottom: -5%; left: 20%;
  animation-delay: -14s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -40px) scale(1.1); }
  66% { transform: translate(-20px, 30px) scale(0.95); }
}

/* ===== 布局 ===== */
.app {
  position: relative;
  z-index: 1;
  max-width: 520px;
  margin: 0 auto;
  padding: 24px 16px 80px;
}

.page { transition: opacity 0.4s ease; }
.hidden { display: none !important; }

/* ===== 玻璃卡片 ===== */
.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  position: relative;
  overflow: hidden;
}

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

/* ===== Hero ===== */
.hero {
  text-align: center;
  padding: 40px 0 32px;
}

.logo-ring {
  width: 88px; height: 88px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(167,139,250,0.2), rgba(251,113,133,0.2));
  border: 2px solid rgba(167,139,250,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: ringPulse 3s ease-in-out infinite;
}

.logo-icon { font-size: 40px; }

@keyframes ringPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(167,139,250,0.15); }
  50% { box-shadow: 0 0 40px rgba(167,139,250,0.3); }
}

.title {
  font-size: 2.4rem;
  font-weight: 700;
  background: linear-gradient(135deg, #fff, #c084fc, #f8f6fb);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 4px;
  text-shadow: 0 10px 30px rgba(192, 132, 252, 0.2);
}

.subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-top: 8px;
}

/* ===== 输入卡片 ===== */
.input-card {
  padding: 28px 24px;
  margin-top: 8px;
}

.form-group { margin-bottom: 20px; }

.form-group label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 500;
}

.form-row {
  display: flex;
  gap: 16px;
}

.flex-1 { flex: 1; }

.date-row, .time-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sep {
  color: var(--text-muted);
  font-size: 0.85rem;
}

select {
  appearance: none;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 10px 14px;
  font-size: 0.95rem;
  flex: 1;
  min-width: 0;
  cursor: pointer;
  transition: var(--transition);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='rgba(240,238,246,0.4)' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(167,139,250,0.15);
}

select option {
  background: #1a1a2e;
  color: var(--text-primary);
}

/* ===== 复选框 ===== */
.checkbox-label {
  display: flex !important;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  margin-top: 10px;
  font-size: 0.85rem !important;
  color: var(--text-muted) !important;
}

.checkbox-label input { display: none; }

.check-mark {
  width: 18px; height: 18px;
  border: 1.5px solid rgba(255,255,255,0.15);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  flex-shrink: 0;
}

.checkbox-label input:checked + .check-mark {
  background: var(--accent);
  border-color: var(--accent);
}

.checkbox-label input:checked + .check-mark::after {
  content: '✓';
  font-size: 12px;
  color: #fff;
}

/* ===== 按钮 ===== */
.btn-analyze {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #8b5cf6, #d946ef);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  position: relative;
  overflow: hidden;
  margin-top: 10px;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.btn-analyze::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent, rgba(255,255,255,0.1), transparent);
  transform: translateX(-100%);
  transition: 0.5s;
}

.btn-analyze:hover::before { transform: translateX(100%); }
.btn-analyze:hover { box-shadow: 0 12px 30px rgba(217, 70, 239, 0.4); transform: translateY(-2px); }
.btn-analyze:active { transform: translateY(1px); box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3); }
.btn-analyze:disabled { opacity: 0.6; cursor: not-allowed; }

.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 4px;
}

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

/* ===== 返回按钮 ===== */
.btn-back {
  background: none;
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 20px;
}

.btn-back:hover { background: var(--glass-hover); color: var(--text-primary); }

/* ===== 结果头部 ===== */
.result-header {
  padding: 24px;
  margin-bottom: 16px;
  text-align: center;
}

/* ===== 八字四柱表格 ===== */
.bazi-table {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bazi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
  gap: 4px;
  text-align: center;
}

.bazi-cell {
  padding: 6px 4px;
  border-radius: 6px;
  transition: var(--transition);
}

.bazi-row-shishen .bazi-cell {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.bazi-row-shishen .daymaster {
  color: var(--accent);
  font-weight: 600;
}

.bazi-row-gan .bazi-cell {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 2px;
}

.bazi-row-gan .daymaster {
  position: relative;
}

.bazi-row-gan .daymaster::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

.bazi-row-zhi .bazi-cell {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-primary);
}

.bazi-cang {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 2px;
}

.bazi-nayin {
  font-size: 0.65rem;
  color: var(--text-muted);
  opacity: 0.6;
}

.bazi-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  opacity: 0.5;
}

.bazi-note {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 10px;
}

/* ===== 大运时间线 ===== */
.dayun-section {
  padding: 20px 24px;
  margin-bottom: 16px;
  overflow-x: auto;
}

.dayun-section .section-title {
  margin-bottom: 12px;
}

.dayun-timeline {
  display: flex;
  gap: 6px;
  padding-bottom: 4px;
  min-width: min-content;
}

.dayun-item {
  flex-shrink: 0;
  text-align: center;
  padding: 10px 8px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.02);
  border: 1px solid transparent;
  min-width: 58px;
  transition: var(--transition);
  position: relative;
}

.dayun-item.current {
  background: rgba(167,139,250,0.1);
  border-color: rgba(167,139,250,0.3);
}

.dayun-item.past {
  opacity: 0.45;
}

.dayun-gz {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.dayun-age {
  font-size: 0.65rem;
  color: var(--text-secondary);
}

.dayun-year {
  font-size: 0.6rem;
  color: var(--text-muted);
}

.dayun-current-tag {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.55rem;
  background: var(--accent);
  color: #fff;
  padding: 1px 8px;
  border-radius: 8px;
  font-weight: 600;
}

/* ===== 格局强弱 ===== */
.strength-section {
  padding: 16px 24px;
  margin-bottom: 16px;
  text-align: center;
}

.strength-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.strength-label .tag {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-left: 6px;
}

.tag-strong {
  background: rgba(251,113,133,0.15);
  color: var(--wx-huo);
  border: 1px solid rgba(251,113,133,0.2);
}

.tag-weak {
  background: rgba(96,165,250,0.15);
  color: var(--wx-shui);
  border: 1px solid rgba(96,165,250,0.2);
}

.tag-cong {
  background: rgba(167,139,250,0.15);
  color: var(--accent);
  border: 1px solid rgba(167,139,250,0.25);
}

.cong-tip {
  font-size: 0.75rem;
  color: var(--accent);
  margin-top: 8px;
  opacity: 0.8;
}

/* ===== 五行力量可视化 ===== */
.wuxing-visual {
  padding: 24px;
  margin-bottom: 16px;
}

.wuxing-visual h2 {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
  font-weight: 500;
}

.wx-bar-group {
  margin-bottom: 14px;
}

.wx-bar-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.wx-element {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.95rem;
}

.wx-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.wx-value {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.wx-bar-track {
  height: 8px;
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
  overflow: hidden;
}

.wx-bar-fill {
  height: 100%;
  border-radius: 4px;
  width: 0;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.wx-bar-fill.xi { box-shadow: 0 0 12px var(--bar-glow); }

/* ===== 喜忌标签 ===== */
.xiji-section {
  padding: 24px;
  margin-bottom: 16px;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-desc {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: -8px;
  margin-bottom: 20px;
}

.xiji-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.xiji-tag {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.xiji-tag.xi {
  background: rgba(74,222,128,0.1);
  border: 1px solid rgba(74,222,128,0.2);
  color: #4ADE80;
}

.xiji-tag.ji {
  background: rgba(251,113,133,0.08);
  border: 1px solid rgba(251,113,133,0.15);
  color: rgba(251,113,133,0.7);
}

.xiji-detail {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.8;
  padding: 16px;
  background: rgba(255,255,255,0.02);
  border-radius: var(--radius-sm);
}

.xiji-detail .yongshen {
  color: var(--accent);
  font-weight: 600;
}

/* ===== 手串推荐 ===== */
.bracelet-section {
  margin-bottom: 16px;
}

.bracelet-section .section-title {
  margin-bottom: 4px;
}

.bracelet-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 16px;
}

.bracelet-element-group {
  animation: fadeSlideUp 0.6s ease both;
}

.bracelet-element-group:nth-child(2) { animation-delay: 0.1s; }
.bracelet-element-group:nth-child(3) { animation-delay: 0.2s; }

.element-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-left: 4px;
}

.element-badge {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
}

.element-header span:last-child {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.bracelet-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.bracelet-card {
  border-radius: var(--radius);
  overflow: hidden;
  transition: var(--transition);
  cursor: default;
  border: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.02);
  backdrop-filter: blur(10px);
}

.bracelet-card:hover {
  transform: translateY(-5px) scale(1.02);
  border-color: var(--card-accent);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 0 25px var(--card-glow);
}

.bracelet-img {
  width: 100%;
  aspect-ratio: 1;
  background: linear-gradient(135deg, rgba(255,255,255,0.03), rgba(255,255,255,0.01));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.bracelet-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bracelet-img .placeholder-icon {
  font-size: 2.5rem;
  opacity: 0.6;
}

.bracelet-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(10,10,26,0.8));
}

.bracelet-info {
  padding: 12px;
}

.bracelet-name {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.bracelet-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.bracelet-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.bracelet-tags span {
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  color: var(--text-muted);
}

/* ===== 忌避提示 ===== */
.avoid-section {
  padding: 20px 24px;
  margin-bottom: 16px;
}

.avoid-section h3 {
  font-size: 0.95rem;
  color: rgba(251,113,133,0.8);
  margin-bottom: 10px;
  font-weight: 600;
}

.avoid-list {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.avoid-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 4px;
}

.avoid-item::before {
  content: '⚠️';
  font-size: 0.75rem;
  flex-shrink: 0;
  margin-top: 2px;
}

/* ===== 动画 ===== */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.result-header { animation: fadeSlideUp 0.5s ease both; }
.dayun-section { animation: fadeSlideUp 0.5s ease 0.1s both; }
.strength-section { animation: fadeSlideUp 0.5s ease 0.15s both; }
.wuxing-visual { animation: fadeSlideUp 0.5s ease 0.2s both; }
.xiji-section { animation: fadeSlideUp 0.5s ease 0.3s both; }
.bracelet-section { animation: fadeSlideUp 0.5s ease 0.4s both; }
.avoid-section { animation: fadeSlideUp 0.5s ease 0.5s both; }

/* ===== Footer ===== */
.footer {
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(30,30,50,0.95);
  color: var(--text-primary);
  padding: 10px 24px;
  border-radius: 20px;
  font-size: 0.85rem;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  z-index: 100;
  border: 1px solid var(--glass-border);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== 门户矩阵 (Portal) 专用样式 ===== */
.portal-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 20px;
  text-align: center;
}

.portal-title {
  font-size: 3.5rem;
  letter-spacing: 12px;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.4) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.portal-subtitle {
  font-size: 1rem;
  color: rgba(255,255,255,0.5);
  letter-spacing: 4px;
  margin-bottom: 60px;
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  max-width: 600px;
  width: 100%;
}

.portal-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 30px 20px;
  border-radius: 24px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  backdrop-filter: blur(10px);
}

.portal-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}

.card-icon {
  font-size: 2.5rem;
  margin-bottom: 16px;
  display: block;
}

.portal-card h3 {
  margin-bottom: 10px;
  font-size: 1.25rem;
  color: #fff;
}

.portal-card p {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
  line-height: 1.5;
  margin-bottom: 20px;
}

.btn-enter {
  font-size: 0.8rem;
  color: var(--primary);
  opacity: 0.8;
  font-weight: 600;
}

.portal-card.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.portal-aura {
  position: fixed;
  width: 40vw;
  height: 40vw;
  filter: blur(100px);
  z-index: -1;
  opacity: 0.15;
  border-radius: 50%;
  pointer-events: none;
}

.portal-aura.top-right {
  top: -10%;
  right: -10%;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
}

.portal-aura.bottom-left {
  bottom: -10%;
  left: -10%;
  background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
}

@media (max-width: 480px) {
  .portal-grid { grid-template-columns: 1fr; }
  .portal-title { font-size: 2.5rem; }
}

/* 布局结构微调：对话框前置 */
.result-sections {
  display: flex;
  flex-direction: column;
}

/* 聊天框在测算结果页的专用紧凑样式 */
#pageResult .chat-section {
  margin-top: 20px;
  margin-bottom: 20px;
  order: 2; /* 确保在排盘下方 */
}

#pageResult .recommendation-section {
  order: 3; /* 推荐水晶在最下 */
}

/* 复制报告按钮 */
.btn-copy-report {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.6);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  cursor: pointer;
  margin-left: auto;
  transition: all 0.3s;
}

.btn-copy-report:hover {
  background: rgba(255,255,255,0.1);
  color: #fff;
}


/* ===== AI 聊天系统 ===== */
.chat-section { display: flex; flex-direction: column; margin-top: 24px; margin-bottom: 24px; border-radius: var(--radius); overflow: hidden; height: 500px; background: rgba(20, 18, 40, 0.4); }
.chat-header { padding: 16px; background: rgba(255, 255, 255, 0.05); border-bottom: 1px solid var(--glass-border); display: flex; align-items: center; gap: 12px; }
.chat-icon { font-size: 1.5rem; background: rgba(167,139,250,0.2); width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 1px solid rgba(167,139,250,0.4); }
.chat-box { flex: 1; padding: 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; scroll-behavior: smooth; }
.chat-box::-webkit-scrollbar { width: 4px; }
.chat-box::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
.msg { display: flex; max-width: 88%; animation: fadeSlideUp 0.4s cubic-bezier(0.2,0.8,0.2,1); flex-direction: column; }
.msg.bot { align-self: flex-start; }
.msg.user { align-self: flex-end; }
.msg-content { padding: 14px 18px; border-radius: 18px; font-size: 0.95rem; line-height: 1.6; word-break: break-word; box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
.msg.bot .msg-content { background: rgba(255, 255, 255, 0.06); border-top-left-radius: 4px; color: var(--text-primary); border: 1px solid var(--glass-border); }
.msg.user .msg-content { background: linear-gradient(135deg, #8b5cf6, #d946ef); border-top-right-radius: 4px; color: #fff; }
.chat-input-area { display: flex; gap: 12px; padding: 16px 20px; background: rgba(0,0,0,0.2); border-top: 1px solid var(--glass-border); backdrop-filter: blur(10px); }
.chat-input-area input { flex: 1; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.15); color: var(--text-primary); padding: 14px 20px; border-radius: 30px; outline: none; font-size: 0.95rem; transition: 0.3s; box-shadow: inset 0 2px 4px rgba(0,0,0,0.1); }
.chat-input-area input:focus { border-color: var(--accent); background: rgba(255,255,255,0.08); box-shadow: inset 0 2px 4px rgba(0,0,0,0.1), 0 0 15px var(--accent-glow); }
.btn-send { background: linear-gradient(135deg, #8b5cf6, #d946ef); border: none; color: white; padding: 0 24px; border-radius: 30px; cursor: pointer; font-weight: 600; transition: all 0.3s cubic-bezier(0.2,0.8,0.2,1); white-space: nowrap; box-shadow: 0 4px 15px rgba(217, 70, 239, 0.3); }
.btn-send:hover { opacity: 1; transform: scale(1.05) translateY(-2px); box-shadow: 0 8px 25px rgba(217, 70, 239, 0.5); }
.btn-send:disabled { background: #333; color: #777; cursor: not-allowed; transform: none; box-shadow: none; }

/* ===== Markdown 内容样式 ===== */
.markdown-body p { margin-bottom: 12px; line-height: 1.6; }
.markdown-body p:last-child { margin-bottom: 0; }
.markdown-body ul, .markdown-body ol { margin-bottom: 12px; padding-left: 20px; }
.markdown-body li { margin-bottom: 4px; }
.markdown-body strong { color: var(--accent); font-weight: 600; }
.markdown-body img { max-width: 100%; border-radius: 12px; margin-top: 10px; box-shadow: 0 4px 15px rgba(0,0,0,0.2); }
/* 城市搜索建议列表 */
.city-select-group {
    position: relative;
    z-index: 100;
}
.city-search-wrapper {
    position: relative;
}
.city-suggest-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(30, 30, 60, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    margin-top: 8px;
    max-height: 200px;
    overflow-y: auto;
    backdrop-filter: blur(20px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    z-index: 1000;
}
.city-item {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.2s;
}
.city-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary);
}
.city-item:last-child {
    border-bottom: none;
}
.hidden { display: none !important; }

/* 占星行星列表样式 */
.astro-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 20px;
}
.astro-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 10px;
    border-radius: 12px;
    text-align: center;
}
.p-name { display: block; font-weight: 600; color: var(--primary); margin-bottom: 4px; }
.p-sign { font-size: 0.85rem; color: #fff; }
.p-deg { font-size: 0.75rem; color: rgba(255,255,255,0.4); display: block; }

/* 流年展示样式 */
#liunianDisplay {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}
.liunian-pith {
    background: linear-gradient(135deg, rgba(251, 113, 133, 0.2), rgba(251, 113, 133, 0.05));
    border: 1px solid rgba(251, 113, 133, 0.3);
    padding: 8px 20px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 15px rgba(251, 113, 133, 0.2);
}
.ln-year { font-size: 0.9rem; color: rgba(255,255,255,0.6); }
.ln-pillar { font-size: 1.25rem; font-weight: 700; color: #fb7185; letter-spacing: 2px; }
.ln-tag { font-size: 0.7rem; background: #fb7185; color: #fff; padding: 2px 6px; border-radius: 4px; }

/* 返回中台按钮 */
.btn-back-portal {
    background: none;
    border: 1px solid rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.4);
    padding: 8px 16px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s;
}
.btn-back-portal:hover {
    color: #fff;
    border-color: rgba(255,255,255,0.5);
}

/* ===== 命理多维展示扩展样式 ===== */

/* 占星优化版 */
.astro-big-three { display: flex; justify-content: space-around; margin-bottom: 24px; padding: 20px; background: rgba(255,255,255,0.03); border-radius: 16px; border: 1px solid rgba(255,255,255,0.05); }
.big-three-item { text-align: center; }
.big-three-item span { display: block; font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 4px; }
.big-three-item strong { font-size: 1.4rem; color: var(--accent); }
.astro-grid-container { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.astro-sub-section h4 { margin-bottom: 12px; font-size: 0.9rem; color: var(--text-muted); border-left: 3px solid var(--accent); padding-left: 8px; }
.astro-mini-list { display: flex; flex-direction: column; gap: 8px; }
.astro-mini-item { display: flex; justify-content: space-between; font-size: 0.85rem; padding: 6px 10px; background: rgba(255,255,255,0.02); border-radius: 6px; }

/* 紫微斗数 12宫标准网格系统 (4x4) */
.ziwei-12-grid { display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(4, 1fr); gap: 10px; margin-top: 16px; width: 100%; max-width: 800px; margin-left: auto; margin-right: auto; }
.zw-center-cell { grid-area: 2 / 2 / 4 / 4; background: radial-gradient(circle, rgba(167,139,250,0.1), rgba(0,0,0,0.2)); border: 1px solid rgba(167,139,250,0.3); border-radius: 12px; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 20px; box-shadow: 0 0 20px rgba(167,139,250,0.1) inset; }
.zw-palace-cell { background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.1); border-radius: 8px; padding: 8px; display: flex; flex-direction: column; justify-content: space-between; position: relative; min-height: 120px; transition: all 0.3s ease; }
.zw-palace-cell.highlight { border-color: var(--accent); background: rgba(167,139,250,0.15); box-shadow: 0 0 10px rgba(167,139,250,0.2); }
.zw-palace-cell:hover { transform: scale(1.02); z-index: 2; border-color: rgba(255,255,255,0.3); background: rgba(255,255,255,0.07); }

/* 十二地支宫位坐标映射 (顺时针) */
.zw-cell-si { grid-area: 1 / 1 / 2 / 2; }   /* 巳 */
.zw-cell-wu { grid-area: 1 / 2 / 2 / 3; }   /* 午 */
.zw-cell-wei { grid-area: 1 / 3 / 2 / 4; }  /* 未 */
.zw-cell-shen { grid-area: 1 / 4 / 2 / 5; } /* 申 */
.zw-cell-chen { grid-area: 2 / 1 / 3 / 2; } /* 辰 */
.zw-cell-you { grid-area: 2 / 4 / 3 / 5; }  /* 酉 */
.zw-cell-mao { grid-area: 3 / 1 / 4 / 2; }  /* 卯 */
.zw-cell-xu { grid-area: 3 / 4 / 4 / 5; }   /* 戌 */
.zw-cell-yin { grid-area: 4 / 1 / 5 / 2; }  /* 寅 */
.zw-cell-chou { grid-area: 4 / 2 / 5 / 3; } /* 丑 */
.zw-cell-zi { grid-area: 4 / 3 / 5 / 4; }   /* 子 */
.zw-cell-hai { grid-area: 4 / 4 / 5 / 5; }  /* 亥 */

/* 紫微星曜样式 */
.zw-limit { position: absolute; top: 4px; right: 4px; font-size: 0.65rem; color: rgba(255,255,255,0.4); background: rgba(0,0,0,0.3); border-radius: 4px; padding: 1px 4px; }
.zw-stars { display: flex; flex-direction: column; gap: 4px; flex: 1; margin-top: 16px; overflow: hidden; }
.zw-stars-major { display: flex; flex-wrap: wrap; gap: 4px; font-weight: bold; font-size: 0.9rem; color: #fff; }
.zw-stars-minor { display: flex; flex-wrap: wrap; gap: 4px; font-size: 0.75rem; color: #93c5fd; }
.zw-stars-adj { font-size: 0.65rem; color: rgba(255,255,255,0.4); white-space: normal; line-height: 1.2; margin-top: 4px; }
.s-major { text-shadow: 0 0 5px rgba(255,255,255,0.3); color: #fbbf24; }

.zw-bottom { display: flex; justify-content: space-between; margin-top: 8px; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 4px; }
.zw-stem-branch { font-size: 0.75rem; color: var(--text-muted); }
.zw-name { font-size: 0.8rem; font-weight: bold; color: #a78bfa; }

/* 奇门 3x3 细节 */
.qimen-cell { min-height: 100px; text-align: center; }
.qm-deity { font-size: 0.75rem; color: #f472b6; }
.qm-mid { display: flex; justify-content: center; gap: 8px; margin: 8px 0; font-size: 1.1rem; font-weight: 700; }
.qm-star { color: #60a5fa; }
.qm-gate { color: #fb7185; }
.qm-stems { font-size: 0.9rem; display: flex; justify-content: space-around; color: #fbbf24; }
.qm-pos { font-size: 0.65rem; color: var(--text-muted); margin-top: 4px; }
.tag-zf, .tag-zs { font-size: 0.6rem; padding: 1px 3px; border-radius: 3px; margin-left: 4px; color: #fff; }
.tag-zf { background: #ef4444; }
.tag-zs { background: #10b981; }

/* 玛雅印记十字 */
.mayan-header { text-align: center; margin-bottom: 24px; }
.mayan-cross { display: grid; grid-template-areas: ". guide ." "antipode main analog" ". occult ."; gap: 12px; justify-content: center; align-items: center; }
.cross-cell { width: 80px; height: 80px; border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(255,255,255,0.03); font-size: 0.75rem; color: var(--text-muted); }
.cross-cell span { font-size: 0.6rem; margin-bottom: 4px; opacity: 0.6; }
.cross-cell.main { grid-area: main; width: 120px; height: 120px; border-width: 2px; border-radius: 20px; color: #fff; }
.guide { grid-area: guide; }
.antipode { grid-area: antipode; }
.analog { grid-area: analog; }
.occult { grid-area: occult; }
.m-kin { font-size: 0.8rem; opacity: 0.8; }
.m-seal { font-size: 1.3rem; font-weight: 700; margin: 4px 0; }
.m-tone { font-size: 0.85rem; }
.m-icon { font-size: 1.2rem; color: #fff; }
.mayan-details { margin-top: 24px; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--text-secondary); font-size: 0.85rem; }

@media (max-width: 480px) {
    .ziwei-grid { grid-template-columns: repeat(3, 1fr); }
    .astro-grid-container { grid-template-columns: 1fr; }
    .mayan-cross { transform: scale(0.9); }
}
