/* ============================================
   诸葛阿亮 H5 - 国风样式 V3
   ============================================ */

@font-face {
  font-family: 'ZCOOLKuaiLe';
  src: url('/m/assets/fonts/ZCOOLKuaiLe-Regular.ttf') format('truetype');
  font-display: swap;
}

:root {
  --zg-bg-light:      #F4E7C8;
  --zg-bg-warm:       #F9D8A1;
  --zg-bg-input:      #FAF3DD;
  --zg-bg-input-2:    #FDF8E8;
  --zg-accent:        #F6A623;
  --zg-primary:       #E85D24;
  --zg-blue:          #5B7FA6;
  --zg-brown:         #8A6A44;
  --zg-text:          #2D2D2D;
  --zg-muted:         #8A8073;
  --zg-grey-light:    #B5AC9A;
  --zg-card-bg:       rgba(253, 243, 217, 0.85);
  --zg-frame-bg:      #F9EDC8;
  --zg-frame-bg-light:#FDF8E8;
  --zg-border:        rgba(138, 106, 68, 0.25);
  --zg-border-strong: #C9A876;
  --zg-shadow:        0 4px 16px rgba(138, 106, 68, 0.15);
}

[x-cloak] { display: none !important; }
* { -webkit-tap-highlight-color: transparent; box-sizing: border-box; }
img { -webkit-touch-callout: none; user-select: none; }
input, select, textarea { font-size: 16px; }
button { font-family: inherit; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", sans-serif;
  color: var(--zg-text);
  background-color: var(--zg-bg-light);
  background-image: url('/m/assets/background_pic.png');
  background-size: cover;
  background-position: center center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  min-height: 100vh;
  overflow-x: hidden;
}

.zg-title {
  font-family: 'ZCOOLKuaiLe', "PingFang SC", sans-serif;
  letter-spacing: 2px;
}

/* ============================================
   首页 (Home)
   ============================================ */
.home-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 50px 20px 20px;   /* 顶部 50px 让标题下移 */
  position: relative;
  z-index: 0;
}
/* 底部 30% 渐变蒙板: 山水淡出 → 纯米色, 让图标更突出 */
.home-page::after {
  content: '';
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 32vh;
  background: linear-gradient(
    to top,
    var(--zg-bg-light)         0%,
    var(--zg-bg-light)        28%,
    rgba(244, 231, 200, 0.7)  62%,
    rgba(244, 231, 200, 0)   100%
  );
  z-index: 1;
  pointer-events: none;
}
/* 确保内容在蒙板上方 */
.home-hero,
.home-buttons,
.home-footer {
  position: relative;
  z-index: 2;
}
.home-hero {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

/* PNG 大标题 */
.home-title-img {
  width: 72%;
  max-width: 310px;
  height: auto;
  margin: 4px auto 4px;
  display: block;
  filter: drop-shadow(0 4px 8px rgba(232, 93, 36, 0.25));
}
.home-title-fallback {
  font-family: 'ZCOOLKuaiLe', sans-serif;
  font-size: 44px;
  color: var(--zg-primary);
  letter-spacing: 8px;
  text-shadow: 0 3px 6px rgba(232, 93, 36, 0.25),
               0 1px 2px rgba(232, 93, 36, 0.6);
  margin: 4px 0 6px 0;
  text-align: center;
  -webkit-text-stroke: 1px rgba(232, 93, 36, 0.4);
}
.home-subtitle {
  font-family: 'ZCOOLKuaiLe', sans-serif;
  font-size: 13px;
  color: var(--zg-brown);
  letter-spacing: 5px;
  margin: 0 0 14px 0;
  text-align: center;
}

/* 人物 + 八卦区 (再缩小一圈) */
.home-character-wrap {
  position: relative;
  width: 100%;
  max-width: 240px;            /* 容器小一圈 */
  aspect-ratio: 1 / 1.3;
  margin: 40px auto 8px;       /* ⭐ 顶部 margin 40px 让人物+八卦整体下移 */
  overflow: visible;           /* 允许八卦超出容器 */
}

/* 八卦图 - 围绕人物头部上半身, 仅左右上方露出弧形 */
.home-bagua {
  position: absolute;
  top: 38%;                    /* 45% → 38%, 八卦上移 */
  left: 50%;
  width: 115%;
  height: auto;
  aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%);
  opacity: 0.35;
  animation: bagua-spin 60s linear infinite;
  pointer-events: none;
}
@keyframes bagua-spin {
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* 人物 - 全身不透明遮住八卦, 仅脚部薄薄淡出 */
.home-character {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  height: 100%;
  width: auto;
  z-index: 3;
  filter: drop-shadow(0 6px 12px rgba(138, 106, 68, 0.25));
  opacity: 1;                  /* 完全不透明 */
  /* 关键: 整体 90% 完全实心, 只在最底部 10% 薄薄淡出 */
  -webkit-mask-image: linear-gradient(to bottom,
                       rgba(0,0,0,1)    0%,
                       rgba(0,0,0,1)    88%,
                       rgba(0,0,0,0.4)  96%,
                       rgba(0,0,0,0)    100%);
          mask-image: linear-gradient(to bottom,
                       rgba(0,0,0,1)    0%,
                       rgba(0,0,0,1)    88%,
                       rgba(0,0,0,0.4)  96%,
                       rgba(0,0,0,0)    100%);
}

/* 2 朵小祥云 - 位于山体下半部分 */
.home-cloud-1 {
  position: absolute;
  bottom: 8%;                  /* 移到下半部分 */
  left: 6%;
  width: 60px;                 /* 缩小 (90 → 60) */
  opacity: 0.55;
  z-index: 4;                  /* 在人物前面, 制造遮挡感 */
  animation: cloud-float 8s ease-in-out infinite;
  pointer-events: none;
}
.home-cloud-2 {
  position: absolute;
  bottom: 12%;
  right: 6%;
  width: 70px;                 /* 缩小 (110 → 70) */
  opacity: 0.55;
  z-index: 4;
  animation: cloud-float 10s ease-in-out infinite reverse;
  pointer-events: none;
}
@keyframes cloud-float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

/* 首页 3 个大按钮 */
.home-buttons {
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 8px;
  margin-top: -30px;           /* ⭐ 负 margin 让按钮上移, 跟人物拉近距离 */
  margin-bottom: 16px;
  position: relative;
  z-index: 3;                  /* 确保按钮在祥云/蒙板之上 */
}
.home-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: transparent;
  border: none;
  padding: 8px;
  cursor: pointer;
  transition: transform 0.2s;
}
.home-btn:active { transform: scale(0.94); }
.home-btn-icon {
  width: 78px;
  height: 78px;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(138, 106, 68, 0.3));
}
.home-btn-label {
  margin-top: 10px;
  font-family: 'ZCOOLKuaiLe', sans-serif;
  font-size: 18px;
  color: var(--zg-text);
  letter-spacing: 2px;
}

/* 首页底部 - 免费体验/开通会员 小字 */
.home-footer {
  text-align: center;
  font-size: 11.5px;
  color: var(--zg-grey-light);
  padding: 4px 20px 6px;
  letter-spacing: 0.5px;
}
.home-footer b { color: var(--zg-muted); font-weight: 600; }
.home-footer a {
  color: var(--zg-primary);
  cursor: pointer;
  text-decoration: underline;
  opacity: 0.85;
}
.home-footer-divider {
  margin: 0 8px;
  color: var(--zg-grey-light);
  opacity: 0.6;
}

/* ============================================
   内页 (Inner Page) - 翻页结构
   ============================================ */
.inner-page {
  min-height: 100vh;
  padding: 14px 18px 30px;
  position: relative;
}

/* 顶部返回 */
.back-btn {
  position: fixed;
  top: 16px;
  left: 14px;
  z-index: 20;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 248, 230, 0.9);
  border: 1px solid var(--zg-border-strong);
  color: var(--zg-primary);
  font-size: 22px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(138, 106, 68, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0 3px 0;
}
.back-btn:active { transform: scale(0.92); }

/* 内页顶部 (标题 + 小诸葛) - 在框上方, 微微压在框上 */
.inner-page-top {
  text-align: center;
  padding: 30px 0 0;
  position: relative;
  z-index: 2;
  margin-bottom: -14px;          /* 仅 14px 轻微压框, 不挡内容 */
}
/* 内页标题 PNG */
.inner-title-img {
  width: 38%;
  max-width: 170px;
  height: auto;
  margin: 0 auto 6px;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(232, 93, 36, 0.2));
}
/* PNG fallback */
.inner-title-fallback {
  font-family: 'ZCOOLKuaiLe', sans-serif;
  font-size: 22px;
  color: var(--zg-primary);
  letter-spacing: 5px;
  margin: 0 0 6px 0;
  text-align: center;
  text-shadow: 0 2px 4px rgba(232,93,36,0.15);
}
.mini-zhuge {
  width: 92px;
  height: 92px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(138, 106, 68, 0.3));
}

/* ============================================
   中国风框架 (带四角装饰)
   ============================================ */
.cn-frame {
  position: relative;
  background: linear-gradient(180deg, var(--zg-frame-bg-light) 0%, var(--zg-frame-bg) 100%);
  border: 2px solid var(--zg-border-strong);
  border-radius: 16px;
  padding: 26px 20px 24px;
  width: 100%;
  box-sizing: border-box;
  /* 双层边框 + 阴影 */
  box-shadow:
    inset 0 0 0 4px var(--zg-frame-bg-light),
    inset 0 0 0 5px rgba(201, 168, 118, 0.45),
    0 8px 24px rgba(138, 106, 68, 0.2);
}

/* 框内副标题 (静态居中, 不和小诸葛打架) */
.cn-frame-subtitle {
  text-align: center;
  font-family: 'ZCOOLKuaiLe', sans-serif;
  font-size: 18px;
  color: var(--zg-primary);
  letter-spacing: 4px;
  text-shadow: 0 1px 2px rgba(232, 93, 36, 0.15);
  margin: 0 0 14px 0;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--zg-border);
}
.cn-frame-subtitle::before,
.cn-frame-subtitle::after {
  content: '〜';
  color: var(--zg-accent);
  margin: 0 10px;
  font-size: 13px;
  opacity: 0.7;
  vertical-align: middle;
}

/* 4 个角装饰 (SVG via data URI, 仿中国风云纹) */
.cn-corner {
  position: absolute;
  width: 28px;
  height: 28px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'><g fill='%23C9A876' stroke='%23C9A876' stroke-width='1.2' fill-rule='evenodd'><path d='M3 3 L14 3 L14 5 L5 5 L5 14 L3 14 Z' opacity='0.9'/><circle cx='8.5' cy='8.5' r='2.5' fill='%23F6A623' opacity='0.9'/><path d='M10 6 Q14 6 14 10 L12 10 Q12 8 10 8 Z' opacity='0.7'/></g></svg>");
  background-size: contain;
  background-repeat: no-repeat;
  pointer-events: none;
}
.cn-corner-tl { top: 6px;    left: 6px; }
.cn-corner-tr { top: 6px;    right: 6px;  transform: scaleX(-1); }
.cn-corner-bl { bottom: 6px; left: 6px;   transform: scaleY(-1); }
.cn-corner-br { bottom: 6px; right: 6px;  transform: scale(-1, -1); }

/* 框内节标题 (一、二、三...) */
.section-title {
  font-family: 'ZCOOLKuaiLe', sans-serif;
  font-size: 14.5px;
  color: var(--zg-primary);
  letter-spacing: 2px;
  margin: 14px 0 8px;
  padding-left: 10px;
  border-left: 3px solid var(--zg-accent);
}

/* ============================================
   表单 - 横向紧凑布局 (参考图风格)
   ============================================ */
/* 横向行: 左标签 + 右输入 */
.form-row {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  gap: 12px;
}
.form-label {
  flex: 0 0 78px;              /* 固定标签宽度 */
  font-size: 13.5px;
  color: var(--zg-text);
  font-weight: 500;
  letter-spacing: 0.5px;
}
.form-input {
  flex: 1;
  background: var(--zg-bg-input);
  border: 1px solid var(--zg-border);
  border-radius: 8px;
  height: 36px;                /* 强制一致高度, 解决日期框比 select 高的问题 */
  padding: 0 12px;
  font-size: 14px;
  color: var(--zg-text);
  outline: none;
  transition: border 0.2s;
  width: 100%;
  box-sizing: border-box;
  min-width: 0;
  line-height: 1.4;
}
.form-input:focus {
  border-color: var(--zg-accent);
  box-shadow: 0 0 0 2px rgba(246, 166, 35, 0.12);
}
.form-input::placeholder { color: var(--zg-grey-light); }
.form-input[type="date"],
.form-input[type="text"],
select.form-input {
  background: var(--zg-bg-input);
  font-family: inherit;
}
textarea.form-input {
  height: auto;
  min-height: 70px;
  padding: 8px 12px;
  line-height: 1.5;
  background: var(--zg-bg-input);
  font-family: inherit;
}

/* 阳历/阴历 小字提示 */
.form-label-sub {
  display: block;          /* 强制单独占一行, 出现在主 label 文字下方 */
  font-size: 10px;
  color: var(--zg-grey-light);
  font-weight: normal;
  margin-left: 0;
  margin-top: 1px;
  line-height: 1.2;
}
.lunar-hint {
  font-size: 13.5px;
  color: var(--zg-text);
  text-align: left;
  padding: 0 4px;
  margin-top: -4px;
  margin-bottom: 8px;
  /* 与日期输入框左对齐: 左侧留出 label 宽度 (78px) + gap (12px) */
  margin-left: 90px;
}
.lunar-hint b {
  color: var(--zg-text);
  font-weight: 600;
}

/* 静态文字显示 (今日时间用) */
.display-value {
  flex: 1;
  font-size: 13.5px;
  color: var(--zg-text);
  padding: 8px 0;
  line-height: 1.5;
}

/* 当前时间 两行垂直布局 (主行 + 阴历小字行) */
.today-row {
  align-items: flex-start;
}
.today-row .form-label {
  margin-top: 6px;
}
.display-value-stack {
  flex: 1;
  display: flex;
  flex-direction: column;
  font-size: 13.5px;
  color: var(--zg-text);
  padding: 6px 0;
  line-height: 1.5;
}
.display-value-stack .sub-line {
  font-size: 11px;
  color: var(--zg-grey-light);
  margin-top: 2px;
}

/* Phase 2/3: 精确时间 checkbox + time input */
.precise-time-row {
  margin-left: 90px;         /* 跟日期框左对齐 (label 78 + gap 12) */
  margin-top: -4px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.precise-time-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--zg-muted);
  cursor: pointer;
  user-select: none;
}
.precise-time-checkbox input[type="checkbox"] {
  cursor: pointer;
  accent-color: var(--zg-primary);
}
.precise-time-input {
  flex: 1;
  min-width: 110px;
  max-width: 180px;
  height: 30px !important;
  font-size: 13px !important;
}

/* Phase 2: 出生地点 联动 Select (省 + 市) */
.form-input-half {
  flex: 1 1 0;
  min-width: 0;
}

/* 出生日期 3 个下拉 (年/月/日 独立选择, 避免 iOS picker 误关闭) */
.date-picker-group {
  flex: 1;
  display: flex;
  gap: 6px;
  min-width: 0;
}
.date-select {
  flex: 1 1 0;
  min-width: 0;
  padding: 0 6px !important;   /* 三个并排, 内边距小一点 */
  font-size: 13px !important;
  text-align: center;
  text-align-last: center;     /* 让 select 显示的文本居中 */
}
.solar-hint {
  font-size: 11px;
  color: var(--zg-grey-light);
  margin-left: 90px;
  margin-top: -4px;
  margin-bottom: 8px;
}
.solar-offset {
  color: var(--zg-grey-light);
  font-size: 11px;
  margin-left: 4px;
}

/* ============================================
   Phase 4: 紫微斗数 12 宫展示
   ============================================ */
.ziwei-section {
  margin: 16px 0 12px;
  border: 1px solid var(--zg-border);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(232, 93, 36, 0.04), rgba(246, 166, 35, 0.06));
  overflow: hidden;
}
.ziwei-header {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--zg-text);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  background: rgba(232, 93, 36, 0.08);
  border-bottom: 1px solid var(--zg-border);
}
.ziwei-header b {
  color: var(--zg-primary);
  font-weight: 600;
}
.ziwei-toggle {
  font-size: 11px;
  color: var(--zg-muted);
}
.ziwei-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 10px;
}
.ziwei-palace {
  border: 1px solid var(--zg-border);
  border-radius: 6px;
  padding: 6px 8px;
  background: var(--zg-bg-input);
  min-height: 64px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ziwei-palace.soul {
  border-color: var(--zg-primary);
  background: rgba(232, 93, 36, 0.08);
}
.ziwei-palace.body {
  border-color: var(--zg-accent);
}
.ziwei-palace-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 11px;
  border-bottom: 1px dashed var(--zg-border);
  padding-bottom: 2px;
  margin-bottom: 2px;
}
.ziwei-palace-name {
  font-weight: 600;
  color: var(--zg-text);
}
.ziwei-palace.soul .ziwei-palace-name {
  color: var(--zg-primary);
}
.ziwei-palace-gz {
  color: var(--zg-muted);
  font-size: 10px;
}
.ziwei-palace-stars {
  font-size: 11px;
  color: var(--zg-text);
  line-height: 1.4;
  word-break: break-all;
}
.ziwei-palace-minor {
  font-size: 10px;
  color: var(--zg-grey-light);
  line-height: 1.3;
  word-break: break-all;
  margin-top: 2px;
}

/* 老 zg-label / zg-input / zg-gender 保留以兼容 */
.zg-label {
  display: block;
  font-size: 13px;
  color: var(--zg-muted);
  margin: 10px 0 5px;
  font-weight: 500;
}
.zg-input {
  width: 100%;
  background: var(--zg-bg-input);
  border: 1px solid var(--zg-border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--zg-text);
  outline: none;
}
.zg-input:focus {
  border-color: var(--zg-accent);
  box-shadow: 0 0 0 2px rgba(246, 166, 35, 0.12);
}
.zg-input::placeholder { color: var(--zg-grey-light); }
.zg-gender-row { display: flex; gap: 8px; }
.zg-gender-btn {
  flex: 1;
  padding: 9px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--zg-border);
  background: var(--zg-bg-input);
  color: var(--zg-muted);
  cursor: pointer;
}
.zg-gender-btn.active {
  background: linear-gradient(135deg, var(--zg-accent), var(--zg-primary));
  color: white;
  border-color: var(--zg-primary);
}

/* 紧凑节标题 (字段分组用, 不带左 border 那么粗) */
.section-title-compact {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--zg-primary);
  margin: 14px 0 8px;
  padding-left: 8px;
  border-left: 3px solid var(--zg-accent);
  letter-spacing: 1px;
}

/* ===== 召唤按钮 ===== */
.summon-btn, .generation-btn {
  display: block;
  margin: 18px auto 8px;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  width: 180px;
  height: 90px;
  transition: transform 0.2s;
}
.summon-btn:active, .generation-btn:active { transform: scale(0.94); }
.summon-btn img, .generation-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(232, 93, 36, 0.35));
}
.summon-btn.disabled, .generation-btn.disabled { opacity: 0.45; pointer-events: none; }

/* ============================================
   结果卡
   ============================================ */
.result-text, .ming-ge-text {
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--zg-text);
  text-align: justify;
}

.rating-row {
  display: flex;
  align-items: center;
  padding: 6px 0;
  font-size: 13.5px;
}
.rating-label {
  color: var(--zg-text);
  min-width: 60px;
  font-weight: 500;
}
.rating-stars {
  color: var(--zg-accent);
  margin: 0 10px;
  letter-spacing: 3px;
  font-size: 16px;
}
.rating-tip {
  color: var(--zg-muted);
  flex: 1;
  font-size: 12.5px;
}

.lucky-row {
  font-size: 13.5px;
  padding: 4px 0;
  color: var(--zg-text);
}
.lucky-row b { color: var(--zg-primary); }

.punchline-box {
  background: linear-gradient(135deg, rgba(246, 166, 35, 0.18), rgba(232, 93, 36, 0.1));
  border-radius: 12px;
  padding: 14px;
  margin-top: 14px;
  font-style: italic;
  text-align: center;
  font-size: 13.5px;
  color: var(--zg-primary);
  border-left: 3px solid var(--zg-accent);
  border-right: 3px solid var(--zg-accent);
  font-weight: 500;
}

.bazi-meta {
  background: rgba(255, 248, 230, 0.6);
  border: 1px dashed var(--zg-border);
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 12px;
  font-size: 11.5px;
  line-height: 1.85;
  color: var(--zg-muted);
}
.bazi-meta b { color: var(--zg-primary); }

/* ============================================
   大乐透
   ============================================ */
.lotto-slider {
  display: flex;
  gap: 6px;
  margin: 10px 0;
}
.lotto-slider-item {
  flex: 1;
  text-align: center;
  padding: 10px 8px;
  font-size: 14px;
  color: var(--zg-muted);
  background: var(--zg-bg-input);
  border: 1px solid var(--zg-border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
}
.lotto-slider-item.active {
  background: linear-gradient(135deg, var(--zg-accent), var(--zg-primary));
  color: white;
  font-weight: bold;
  border-color: var(--zg-primary);
  box-shadow: 0 3px 8px rgba(232, 93, 36, 0.3);
}
.balls-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: 14px 0;
}
.ball-front {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: radial-gradient(circle at 12px 12px, #ff8a65, var(--zg-primary));
  color: white; font-weight: bold;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  box-shadow: 0 3px 8px rgba(232, 93, 36, 0.3);
}
.ball-back {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: radial-gradient(circle at 12px 12px, #91b5d9, var(--zg-blue));
  color: white; font-weight: bold;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  box-shadow: 0 3px 8px rgba(91, 127, 166, 0.3);
}
.balls-divider {
  font-size: 24px;
  color: var(--zg-grey-light);
  margin: 0 4px;
}
.analysis-item {
  font-size: 12.5px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--zg-border);
  display: flex;
}
.analysis-item:last-child { border-bottom: none; }
.analysis-label { color: var(--zg-muted); min-width: 88px; }
.analysis-value { color: var(--zg-primary); font-weight: 500; flex: 1; }
.data-source-tip {
  text-align: center;
  font-size: 11px;
  color: var(--zg-grey-light);
  font-style: italic;
  margin-top: 10px;
}

/* ============================================
   会员徽章 (内页右上)
   ============================================ */
.trial-badge {
  position: fixed;
  top: 18px;
  right: 14px;
  z-index: 20;
  font-size: 11px;
  color: var(--zg-grey-light);
  background: rgba(255, 248, 230, 0.6);
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid rgba(181, 172, 154, 0.3);
}
.member-badge {
  position: fixed;
  top: 18px;
  right: 14px;
  z-index: 20;
  font-size: 11px;
  color: white;
  background: linear-gradient(135deg, var(--zg-accent), var(--zg-primary));
  padding: 4px 12px;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(232, 93, 36, 0.3);
  white-space: nowrap;
  text-align: center;
  max-width: calc(100vw - 60px);  /* 防止文字过长被切 */
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 会员浮层 */
.member-info-popup {
  position: fixed;
  top: 56px; right: 14px;
  width: 240px;
  background: var(--zg-frame-bg);
  border: 1px solid var(--zg-accent);
  border-radius: 14px;
  padding: 16px;
  z-index: 45;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}
.member-info-row {
  font-size: 12px;
  color: var(--zg-muted);
  padding: 4px 0;
}
.member-info-row b { color: var(--zg-primary); }
.logout-btn {
  width: 100%;
  background: rgba(232, 93, 36, 0.1);
  border: 1px solid var(--zg-primary);
  color: var(--zg-primary);
  border-radius: 8px;
  padding: 6px;
  font-size: 12px;
  margin-top: 10px;
  cursor: pointer;
}

/* ============================================
   弹窗
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(45, 45, 45, 0.65);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}
.modal-card {
  background: var(--zg-bg-light);
  border-radius: 20px;
  padding: 22px 18px;
  width: 100%;
  max-width: 340px;
  border: 2px solid var(--zg-accent);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}
.modal-title {
  font-family: 'ZCOOLKuaiLe', sans-serif;
  font-size: 20px;
  color: var(--zg-primary);
  text-align: center;
  letter-spacing: 3px;
  margin-bottom: 6px;
}
.modal-subtitle {
  text-align: center;
  font-size: 12px;
  color: var(--zg-muted);
  margin-bottom: 16px;
}
.modal-features {
  list-style: none;
  padding: 0;
  margin: 12px 0;
}
.modal-features li {
  padding: 5px 0;
  font-size: 13px;
  color: var(--zg-text);
}
.modal-features li::before {
  content: '✓ ';
  color: var(--zg-primary);
  font-weight: bold;
  margin-right: 4px;
}
.invite-input {
  width: 100%;
  border: 2px solid var(--zg-accent);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 15px;
  font-family: 'Consolas', monospace;
  text-align: center;
  letter-spacing: 3px;
  margin: 10px 0;
  background: white;
  outline: none;
  text-transform: uppercase;
}
.modal-btn-primary {
  width: 100%;
  background: linear-gradient(135deg, var(--zg-accent), var(--zg-primary));
  color: white;
  border: none;
  border-radius: 12px;
  padding: 12px;
  font-size: 15px;
  font-weight: bold;
  letter-spacing: 2px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(232, 93, 36, 0.3);
}
.modal-btn-primary:disabled { background: #ccc; cursor: not-allowed; }
.modal-error {
  text-align: center;
  font-size: 12px;
  color: var(--zg-primary);
  margin-top: 8px;
}
.modal-hint {
  text-align: center;
  font-size: 11px;
  color: var(--zg-grey-light);
  margin-top: 12px;
}
.modal-pricing { display: flex; gap: 6px; margin-top: 12px; }
.pricing-item {
  flex: 1;
  text-align: center;
  padding: 9px 4px;
  background: rgba(246, 166, 35, 0.12);
  border: 1px solid var(--zg-accent);
  border-radius: 10px;
  font-size: 12px;
}
.pricing-item .price {
  display: block;
  font-size: 15px;
  font-weight: bold;
  color: var(--zg-primary);
}
.pricing-item .duration {
  font-size: 10px;
  color: var(--zg-muted);
  margin-top: 2px;
}
/* 可点击购买的卡片 (链动跳转) */
.pricing-item.buyable {
  text-decoration: none;
  display: block;
  cursor: pointer;
  transition: all 0.15s;
}
.pricing-item.buyable:active {
  transform: scale(0.96);
  background: rgba(232, 93, 36, 0.18);
}
.pricing-item.disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.pricing-item.disabled:active { transform: none; }
.pricing-item .buy-hint {
  font-size: 10px;
  color: var(--zg-primary);
  margin-top: 4px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.pricing-item.disabled .buy-hint {
  color: var(--zg-grey-light);
  font-weight: normal;
}
.modal-skip {
  display: block;
  text-align: center;
  color: var(--zg-muted);
  font-size: 12px;
  margin-top: 12px;
  text-decoration: underline;
  cursor: pointer;
}

/* Toast */
.toast {
  position: fixed;
  top: 70px;
  left: 16px; right: 16px;
  background: rgba(45, 45, 45, 0.92);
  color: white;
  padding: 12px 16px;
  border-radius: 12px;
  text-align: center;
  font-size: 14px;
  z-index: 60;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.zg-loading {
  text-align: center;
  padding: 30px 20px;
  font-size: 14px;
  color: var(--zg-muted);
}
.zg-loading::after {
  content: ' ⋯';
  animation: dots 1.5s steps(4) infinite;
}
@keyframes dots {
  0%, 20%   { content: ' ⋯'; }
  40%       { content: ' ⋮⋯'; }
  60%       { content: ' ⋯⋮'; }
  80%, 100% { content: ' ⋯⋮⋯'; }
}

.muted-tip {
  font-size: 11px;
  color: var(--zg-grey-light);
  margin-top: 6px;
  text-align: center;
}

/* ============================================
   股票模块
   ============================================ */

/* 顶部搜索栏 + Meta 信息 */
.stock-search-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.stock-search-input {
  flex: 1;
  background: var(--zg-bg-input);
  border: 1px solid var(--zg-border);
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 14px;
  outline: none;
}
.stock-search-input:focus {
  border-color: var(--zg-accent);
  box-shadow: 0 0 0 2px rgba(246, 166, 35, 0.12);
}
.stock-search-btn {
  background: linear-gradient(135deg, var(--zg-accent), var(--zg-primary));
  color: white;
  border: none;
  border-radius: 10px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 500;
}

.stock-meta-bar {
  font-size: 11px;
  color: var(--zg-grey-light);
  text-align: center;
  padding: 4px 0 8px;
}
.stock-meta-bar b { color: var(--zg-muted); }

/* 排序 / 过滤 chip 行 */
.stock-filter-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 2px 10px;
  margin: 0 -4px 4px;
}
.stock-filter-chip {
  flex-shrink: 0;
  font-size: 12px;
  padding: 5px 12px;
  background: var(--zg-bg-input);
  border: 1px solid var(--zg-border);
  border-radius: 999px;
  color: var(--zg-muted);
  cursor: pointer;
  white-space: nowrap;
}
.stock-filter-chip.active {
  background: linear-gradient(135deg, var(--zg-accent), var(--zg-primary));
  color: white;
  border-color: var(--zg-primary);
  font-weight: 500;
}

/* 行业聚集横滑条 */
.sector-aggregation {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 6px 2px 10px;
  margin: 0 -4px;
}
.sector-chip {
  flex-shrink: 0;
  font-size: 11px;
  padding: 5px 10px;
  background: rgba(246, 166, 35, 0.12);
  border: 1px solid rgba(246, 166, 35, 0.4);
  border-radius: 999px;
  color: var(--zg-primary);
  white-space: nowrap;
  cursor: pointer;
}
.sector-chip.active {
  background: var(--zg-primary);
  color: white;
}
.sector-chip-count {
  font-size: 10px;
  opacity: 0.75;
  margin-left: 2px;
}

/* 股票卡片 */
.stock-card {
  background: rgba(253, 248, 232, 0.92);
  border: 1px solid var(--zg-border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 10px;
  display: flex;
  gap: 10px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}
.stock-card:active {
  transform: scale(0.99);
  box-shadow: 0 4px 12px rgba(138, 106, 68, 0.18);
}
.stock-card-main {
  flex: 1;
  min-width: 0;
}
.stock-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.stock-code {
  font-family: 'Consolas', monospace;
  font-size: 13px;
  color: var(--zg-muted);
  font-weight: 600;
}
.stock-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--zg-text);
}
.stock-sector-tag {
  font-size: 10px;
  color: var(--zg-muted);
  background: rgba(138, 106, 68, 0.1);
  padding: 1px 6px;
  border-radius: 4px;
}
.stock-opp-tag {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 500;
}
.stock-opp-tag.golden  { background: linear-gradient(135deg, #ffb74d, #f57c00); color: white; }
.stock-opp-tag.good    { background: rgba(76, 175, 80, 0.18);  color: #2e7d32; border: 1px solid rgba(76, 175, 80, 0.4); }
.stock-opp-tag.normal  { background: rgba(246, 166, 35, 0.18); color: var(--zg-primary); border: 1px solid rgba(246, 166, 35, 0.4); }
.stock-opp-tag.caution { background: rgba(245, 124, 0, 0.18);  color: #e65100; border: 1px solid rgba(245, 124, 0, 0.4); }
.stock-opp-tag.avoid   { background: rgba(198, 40, 40, 0.15);  color: #c62828; border: 1px solid rgba(198, 40, 40, 0.4); }

.stock-concepts {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin: 4px 0;
}
.stock-concept {
  font-size: 10px;
  color: #5b7fa6;
  background: rgba(91, 127, 166, 0.1);
  padding: 1px 6px;
  border-radius: 4px;
}

.stock-price-row {
  font-size: 12px;
  color: var(--zg-muted);
  margin: 6px 0 4px;
}
.stock-price {
  font-size: 14px;
  font-weight: bold;
  color: var(--zg-text);
}
.stock-pct-up   { color: #c62828; font-weight: bold; }
.stock-pct-down { color: #2e7d32; font-weight: bold; }
.stock-pe-pb {
  font-size: 11px;
  color: var(--zg-grey-light);
  margin-left: 10px;
}

.stock-risk-tags {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin: 6px 0 4px;
}
.stock-risk-tag {
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(138, 106, 68, 0.08);
  color: var(--zg-text);
  border: 1px solid rgba(138, 106, 68, 0.2);
  line-height: 1.5;
}

.stock-reason {
  font-size: 11px;
  color: var(--zg-muted);
  margin-top: 4px;
}

/* 右侧 3 个评分框 */
.stock-scores {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: stretch;
  flex-shrink: 0;
}
.stock-score-box {
  width: 56px;
  background: var(--zg-bg-input);
  border: 1px solid var(--zg-border);
  border-radius: 8px;
  padding: 6px 4px;
  text-align: center;
}
.stock-score-box.tech    { border-color: var(--zg-primary); }
.stock-score-box.aux     { border-style: dashed; }
.stock-score-label {
  font-size: 9px;
  color: var(--zg-muted);
  margin-bottom: 2px;
}
.stock-score-value {
  font-size: 17px;
  font-weight: bold;
  color: var(--zg-primary);
  line-height: 1;
}
.stock-score-box.fund .stock-score-value { color: #5b7fa6; }
.stock-score-box.aux  .stock-score-value { color: #8a6a44; }

/* 加载更多 / 加载中 */
.stock-load-more {
  text-align: center;
  padding: 12px;
  font-size: 13px;
  color: var(--zg-muted);
  cursor: pointer;
}
.stock-load-more:hover { color: var(--zg-primary); }

/* 详情页大评分 */
.stock-detail-scores {
  display: flex;
  gap: 8px;
  margin: 12px 0;
}
.stock-detail-score {
  flex: 1;
  background: var(--zg-bg-input);
  border: 1px solid var(--zg-border);
  border-radius: 10px;
  padding: 10px;
  text-align: center;
}
.stock-detail-score-label {
  font-size: 11px;
  color: var(--zg-muted);
  margin-bottom: 4px;
}
.stock-detail-score-value {
  font-size: 24px;
  font-weight: bold;
  color: var(--zg-primary);
}

/* ============================================
   大运时间线 + 详解模态
   ============================================ */
.dayun-timeline-section {
  margin: 14px 0 12px;
  padding: 12px 12px 10px;
  background: rgba(246, 166, 35, 0.06);
  border: 1px solid rgba(201, 168, 118, 0.3);
  border-radius: 10px;
}
.dayun-timeline-title {
  font-size: 12px;
  color: var(--zg-muted);
  margin-bottom: 8px;
}
.dayun-timeline-title b { color: var(--zg-primary); }
.dayun-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 2px 6px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.dayun-chip {
  flex-shrink: 0;
  min-width: 64px;
  padding: 7px 8px;
  background: white;
  border: 1px solid var(--zg-border);
  border-radius: 9px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
  scroll-snap-align: center;
}
.dayun-chip:active { transform: scale(0.94); }
.dayun-chip.active {
  background: linear-gradient(135deg, var(--zg-accent), var(--zg-primary));
  color: white;
  border-color: var(--zg-primary);
  box-shadow: 0 3px 10px rgba(232, 93, 36, 0.28);
}
.dayun-chip-gz {
  font-weight: bold;
  font-size: 14px;
  font-family: 'ZCOOLKuaiLe', sans-serif;
  letter-spacing: 1px;
}
.dayun-chip-age {
  font-size: 10px;
  margin-top: 2px;
  opacity: 0.85;
}

/* 大运详解 - 底部抽屉模态 */
.dayun-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 80;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(2px);
}
.dayun-modal {
  background: linear-gradient(180deg, var(--zg-frame-bg-light), var(--zg-frame-bg));
  border-radius: 18px 18px 0 0;
  width: 100%;
  max-width: 520px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  border-top: 2px solid var(--zg-border-strong);
  border-left: 2px solid var(--zg-border-strong);
  border-right: 2px solid var(--zg-border-strong);
  animation: slide-up-modal 0.3s ease-out;
}
@keyframes slide-up-modal {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.dayun-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px 10px;
  border-bottom: 1px dashed var(--zg-border);
}
.dayun-modal-title {
  font-family: 'ZCOOLKuaiLe', sans-serif;
  font-size: 18px;
  color: var(--zg-primary);
  letter-spacing: 2px;
  margin: 0;
}
.dayun-modal-close {
  background: rgba(138, 106, 68, 0.1);
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 18px;
  color: var(--zg-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0 2px 0;
}
.dayun-modal-body {
  padding: 14px 18px 24px;
  overflow-y: auto;
  flex: 1;
  white-space: pre-wrap;
  line-height: 1.8;
  font-size: 14px;
  color: var(--zg-text);
}

/* 翻页动画 */
.page-view {
  animation: slide-in-right 0.32s cubic-bezier(0.22, 0.61, 0.36, 1);
}
@keyframes slide-in-right {
  from { transform: translateX(28%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
.page-view.back-direction {
  animation: slide-in-left 0.32s cubic-bezier(0.22, 0.61, 0.36, 1);
}
@keyframes slide-in-left {
  from { transform: translateX(-28%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
