/* ============================================================
   鹤梅 · 梅花易数排盘  —  视觉系统（水墨宣纸 · 朱砂题款）
   ============================================================ */
:root {
  --ink:        #211c16;
  --ink-soft:   #5a5043;
  --ink-faint:  #8a7f6d;
  --paper:      #f1ebdd;
  --paper-2:    #f7f2e7;
  --paper-3:    #efe7d6;
  --card:       #fbf7ee;
  --cinnabar:      #9e2b25;
  --cinnabar-deep: #7c1d19;
  --cinnabar-soft: #c0584f;
  --gold:          #a8843e;
  --gold-soft:     #c4a35c;
  --gold-line:     #d9c7a0;
  --yao:      #241f19;
  --yao-dong: #9e2b25;
  --line:     #ddd0b6;
  --line-soft:#e7dcc6;
  --shadow-1: 0 1px 2px rgba(33,28,22,.05);
  --shadow-2: 0 8px 24px -12px rgba(33,28,22,.28);
  --font-serif: "Songti SC","STSong","Noto Serif CJK SC","SimSun","宋体",serif;
  --font-sans:  "PingFang SC","Hiragino Sans GB","Microsoft YaHei",system-ui,-apple-system,sans-serif;
  --r: 10px;
  --maxw: 980px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 18% 12%, rgba(168,132,62,.05) 0, transparent 42%),
    radial-gradient(circle at 84% 8%,  rgba(158,43,37,.04) 0, transparent 40%),
    radial-gradient(circle at 50% 100%, rgba(33,28,22,.05) 0, transparent 55%);
  line-height: 1.7;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

/* 合规常驻提示条 */
.compliance-bar {
  background: #fbf3e2;
  color: var(--ink-soft);
  text-align: center;
  font-size: 12.5px;
  letter-spacing: .5px;
  padding: 10px 16px;
  line-height: 1.7;
}

/* 品牌带 */
.brand-bar {
  background: linear-gradient(180deg, #221d17 0%, #1b1712 100%);
  color: #f3ecdc;
  border-bottom: 3px solid var(--cinnabar);
  box-shadow: 0 6px 22px -10px rgba(0,0,0,.5);
}
.brand-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px 20px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand-id { display: flex; align-items: center; gap: 14px; }
.seal {
  width: 52px; height: 52px;
  flex: none;
  background: linear-gradient(160deg, var(--cinnabar) 0%, var(--cinnabar-deep) 100%);
  color: #f7efde;
  border-radius: 9px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 19px;
  line-height: 1.04;
  letter-spacing: 1px;
  box-shadow: inset 0 0 0 1.5px rgba(247,239,222,.35), 0 4px 12px -4px rgba(158,43,37,.6);
}
.seal--sm { width: 26px; height: 26px; font-size: 13px; border-radius: 6px; box-shadow: inset 0 0 0 1px rgba(247,239,222,.3); }
.brand-name { font-family: var(--font-serif); font-size: 26px; font-weight: 700; letter-spacing: 6px; color: #f5eede; line-height: 1.1; white-space: nowrap; }
.brand-sub { font-size: 12.5px; letter-spacing: 3px; color: var(--gold-soft); margin-top: 3px; white-space: nowrap; }
.brand-meta { font-size: 12px; letter-spacing: 1px; color: #b7ab93; display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.meta-dot { width: 7px; height: 7px; border-radius: 50%; background: #6fae7a; box-shadow: 0 0 0 3px rgba(111,174,122,.18); }
.module-tabs {
  max-width: var(--maxw); margin: 0 auto; padding: 0 20px;
  display: flex; gap: 4px; border-top: 1px solid rgba(247,239,222,.08);
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.tab { font-size: 14px; letter-spacing: 2px; padding: 11px 18px; color: #9c917b; position: relative; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.tab--on { color: #f5eede; font-weight: 600; }
.tab--on::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: -1px; height: 2.5px; background: var(--cinnabar); border-radius: 2px; }
.tab--off { cursor: default; }
.tab-lock { font-size: 9px; letter-spacing: .5px; color: #9c917b; background: rgba(156,145,123,.12); border-radius: 10px; padding: 1px 6px; line-height: 1; transform: scale(.92); transform-origin: left center; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 26px 18px 60px; }
.hero { margin: 6px 2px 22px; }
.hero-title { font-family: var(--font-serif); font-size: clamp(28px, 5vw, 40px); font-weight: 700; letter-spacing: 4px; color: var(--ink); }
.hero-desc { margin: 8px 0 0; color: var(--ink-soft); font-size: 14.5px; letter-spacing: .5px; }
.work { display: grid; grid-template-columns: 1.55fr 1fr; gap: 18px; align-items: start; }
@media (max-width: 820px) { .work { grid-template-columns: 1fr; } }

.panel { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r); padding: 20px 22px; box-shadow: var(--shadow-1); }
.panel-head { margin-bottom: 16px; }
.panel-head--with-rules { display: flex !important; flex-direction: row !important; justify-content: space-between; align-items: flex-end; gap: 12px; }
.panel-head--with-rules .panel-head-main { display: flex; flex-direction: column; }
.btn-rules { background: transparent; color: var(--cinnabar); border: none; padding: 4px 2px; font-size: 13px; letter-spacing: 1px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; flex: none; }
.btn-rules:hover { color: var(--cinnabar-deep); }
.panel-kicker { display: inline-block; font-size: 12px; letter-spacing: 4px; color: var(--gold); border: 1px solid var(--gold-line); border-radius: 4px; padding: 2px 9px; margin-bottom: 8px; }
.panel-title { font-family: var(--font-serif); font-size: 21px; font-weight: 700; letter-spacing: 3px; color: var(--ink); margin: 0; }
.row { display: flex; align-items: flex-start; flex-wrap: wrap; margin-bottom: 14px; gap: 8px; }
.row.row-center { justify-content: center; }
.lbl { flex: none; min-width: 38px; color: var(--ink-faint); font-size: 13.5px; text-align: right; margin-right: 6px; padding-top: 8px; letter-spacing: 1px; }
.lbl-inline { display: inline-block; min-width: 5em; text-align: justify; text-align-last: justify; color: var(--ink-faint); font-size: 13px; letter-spacing: 1px; margin-right: 8px; flex: none; }
.ipt { flex: 1; min-width: 120px; padding: 9px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 7px; font-family: var(--font-sans); font-size: 14px; color: var(--ink); outline: none; }
.ipt:focus { border-color: var(--cinnabar); box-shadow: 0 0 0 3px rgba(158,43,37,.1); }
.ipt-textarea { min-height: 56px; resize: vertical; line-height: 1.6; }
.gender-group { display: inline-flex; gap: 6px; padding-top: 3px; }
.radio, .check { display: inline-flex; align-items: center; margin-right: 4px; cursor: pointer; font-size: 14px; color: var(--ink-soft); user-select: none; }
.radio input, .check input { margin-right: 5px; accent-color: var(--cinnabar); }
.methods { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 3px; }
.radio.pill { margin: 0; border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 7px 16px; font-size: 13.5px; color: var(--ink-soft); }
.radio.pill input { position: absolute; opacity: 0; pointer-events: none; }
.radio.pill:has(input:checked) { background: var(--cinnabar); border-color: var(--cinnabar); color: #fff; box-shadow: 0 4px 12px -4px rgba(158,43,37,.5); }
.hint { color: var(--cinnabar); font-size: 13px; width: 100%; background: rgba(158,43,37,.06); border-left: 3px solid var(--cinnabar); padding: 7px 12px; border-radius: 0 6px 6px 0; line-height: 1.6; }
.param-area { width: 100%; }
#time_row { flex-wrap: nowrap !important; align-items: center; }
#time_row .time-selects { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: nowrap; align-items: center; gap: 4px; overflow: hidden; }
#time_row .time-selects select { min-width: 0; padding: 6px 6px; font-size: 12.5px; }
#time_row .time-selects .ts-fixed { flex: none; white-space: nowrap; color: var(--ink-soft); font-size: 13px; }
#time_row .btn-mini { flex: none; margin-left: 6px; white-space: nowrap; }

.time-selects { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sel-short { min-width: 64px; padding: 7px 8px; font-size: 13px; background: var(--card); border: 1px solid var(--line); border-radius: 7px; color: var(--ink); font-family: var(--font-sans); }
.btn-mini { background: var(--card); color: var(--cinnabar); border: 1px solid var(--cinnabar); border-radius: 7px; padding: 6px 12px; font-size: 12.5px; cursor: pointer; }
.btn-primary { background: linear-gradient(160deg, var(--cinnabar) 0%, var(--cinnabar-deep) 100%); color: #fff; border: none; border-radius: 8px; padding: 13px 70px; font-size: 17px; font-family: var(--font-serif); letter-spacing: 6px; cursor: pointer; box-shadow: 0 8px 20px -8px rgba(158,43,37,.6); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 24px -8px rgba(158,43,37,.7); }

.btn-link { background: transparent; color: var(--cinnabar); border: none; padding: 6px; font-size: 13px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; font-family: var(--font-sans); }
.btn-link:hover { color: var(--cinnabar-deep); }

.guide-panel { background: var(--paper-3); }
#guide_panel { margin-top: 18px; }
.guide-list { margin: 0; }
.guide-list dt { color: var(--cinnabar); font-weight: 700; font-size: 14.5px; letter-spacing: 2px; margin-top: 14px; padding-bottom: 3px; border-bottom: 1px dashed var(--gold-line); }
.guide-list dt:first-child { margin-top: 0; }
.guide-list dd { margin: 7px 0 0; color: var(--ink-soft); font-size: 13px; line-height: 1.65; }
.guide-list .b { color: var(--cinnabar); font-weight: 600; }

.result-panel { margin-top: 18px; }
.result-header { font-size: 13px; color: var(--ink-soft); margin-bottom: 10px; line-height: 1.6; background: var(--paper-3); border-radius: 8px; padding: 8px 12px; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.result-line { display: inline-flex; align-items: center; gap: 4px; }
.result-info { font-size: 14px; color: var(--ink); margin-bottom: 10px; line-height: 1.9; display: flex; flex-direction: column; gap: 4px; }
.result-info > div { display: flex; gap: 0; align-items: baseline; flex-wrap: wrap; }
.result-info .ganzhi { word-break: normal; overflow-wrap: normal; }
.result-info .shensha { letter-spacing: -0.2px; word-break: normal; overflow-wrap: normal; }
.result-info .rixiadasha { letter-spacing: -0.2px; word-break: normal; overflow-wrap: normal; color: var(--ink); }
.result-info .rixiadasha::before { content: "方位·"; color: var(--gold); font-size: 11px; margin-right: 2px; font-weight: 600; }
.link-accent { color: var(--cinnabar); }

.gua-grid { display: flex; justify-content: space-between; align-items: stretch; gap: 10px; margin: 14px 0 4px; padding: 16px 6px 16px 22px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); position: relative; }
.gua-col { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; background: var(--card); border: 1px solid var(--line-soft); border-radius: 9px; padding: 12px 6px 10px; }
.gua-name { color: var(--cinnabar); font-family: var(--font-serif); font-size: 16px; font-weight: 700; letter-spacing: 1px; margin-bottom: 2px; white-space: nowrap; }
.gua-sub { color: var(--ink-faint); font-size: 11.5px; margin-bottom: 6px; letter-spacing: .5px; }
.gua-gong { display: inline-block; color: var(--gold); font-size: 11px; border: 1px solid var(--gold-line); border-radius: 4px; padding: 0 7px; margin-bottom: 8px; min-height: 17px; line-height: 17px; font-weight: 600; letter-spacing: 1px; }
.gua-gong:empty { display: none; }
.gua-symbol { display: flex; flex-direction: column-reverse; gap: 5px; margin: 4px 0 8px; }
.yao { width: 50px; height: 9px; background: var(--yao); border-radius: 2px; position: relative; }
.yao.yin { background: transparent; }
.yao.yin::before, .yao.yin::after { content: ""; position: absolute; width: 20px; height: 9px; background: var(--yao); top: 0; border-radius: 2px; }
.yao.yin::before { left: 0; }
.yao.yin::after  { right: 0; }
.yao.dong { background: var(--yao-dong); box-shadow: 0 0 0 3px rgba(158,43,37,.16), 0 0 8px rgba(158,43,37,.45); }
.yao.yin.dong { background: transparent; }
.yao.yin.dong::before, .yao.yin.dong::after { background: var(--yao-dong); box-shadow: 0 0 0 2px rgba(158,43,37,.14); }
.yao:not(.yin).dong::after { content: ""; position: absolute; right: -12px; top: 50%; width: 5px; height: 5px; border-radius: 50%; background: var(--cinnabar); transform: translateY(-50%); box-shadow: 0 0 5px rgba(158,43,37,.6); }
.gua-pos { color: var(--ink-faint); font-size: 12px; letter-spacing: 2px; margin-top: 2px; }
/* 卦卡可点击 + 选中态(点击切换下方卦辞爻辞) */
.gua-col { cursor: pointer; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease, background .18s ease; }
.gua-col:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: var(--gold-line); }
.gua-col.active { border-color: var(--cinnabar); background: #fdf6ea; box-shadow: 0 0 0 2px rgba(158,43,37,.18), var(--shadow-2); }
.gua-col.active .gua-name { color: var(--cinnabar-deep); }
.gua-col.active .gua-pos { color: var(--cinnabar); font-weight: 600; }
.gua-grid-hint { text-align: center; font-size: 12px; color: var(--gold); letter-spacing: 1px; margin: -2px 0 6px; }
@media (prefers-reduced-motion: reduce) {
  .gua-col { transition: none; }
  .gua-col:hover { transform: none; }
}
/* 体/用 伪元素标签已撤(窄屏会被卦卡边框遮挡,效果差)。体用信息仍展示在"复制排盘"文本与结果区说明。 */
.tiyong-row { display: none; }
.result-bottom-buttons { display: flex; gap: 10px; margin: 28px auto 0; max-width: 720px; }
.btn-bottom { flex: 1; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 8px; padding: 11px; font-size: 14.5px; font-family: var(--font-sans); cursor: pointer; }
.btn-bottom:hover { border-color: var(--cinnabar); color: var(--cinnabar); }
.btn-bottom.btn-gray { background: #e7e1d3; color: #9a9081; cursor: not-allowed; border-color: #d8d0bf; }
.btn-bottom.btn-gray:hover { border-color: #d8d0bf; color: #9a9081; }

.yaoci-panel { margin-top: 18px; }
.gua-title-bar { font-family: var(--font-serif); color: var(--cinnabar); font-size: 20px; font-weight: 700; letter-spacing: 2px; }
.gua-ci { color: var(--ink); font-size: 14.5px; margin: 8px 0 6px; line-height: 1.8; }
.gua-ci b, .tuan-ci b { color: var(--gold); font-weight: 600; }
.tuan-ci { color: var(--ink-soft); font-size: 13.5px; margin-bottom: 12px; line-height: 1.8; font-style: italic; }
.yao-block { margin-bottom: 12px; padding: 10px 0 10px 14px; border-left: 3px solid var(--gold-line); border-bottom: 1px dashed var(--line-soft); }
.yao-block:last-child { border-bottom: none; }
.yao-block.yao-dong { background: rgba(158,43,37,.05); border-left: 3px solid var(--cinnabar); }
.yao-block .yao-name { color: var(--cinnabar); font-weight: 700; font-size: 14.5px; margin-bottom: 3px; }
.yao-block .yao-ci { color: var(--ink); font-size: 14px; line-height: 1.75; }
.yao-block .yao-xiang { color: var(--ink-soft); font-size: 13px; line-height: 1.7; margin-top: 2px; }

.disclaimer { margin-top: 16px; padding: 12px 14px; background: #fff9ed; border: 1px dashed var(--gold-line); border-radius: 8px; color: var(--ink-soft); font-size: 13px; line-height: 1.6; }
.disclaimer strong { color: var(--cinnabar); }

.brand-footer { max-width: var(--maxw); margin: 0 auto; padding: 22px 20px 40px; display: flex; align-items: center; gap: 10px; color: var(--ink-faint); font-size: 12.5px; letter-spacing: .5px; border-top: 1px solid var(--line); }

@media (max-width: 560px) {
  /* 输入面板在窄屏不溢出 */
  .panel { padding: 16px 14px; }
  .brand-inner { padding: 14px 14px 10px; }
  .ipt, .ipt-textarea { min-width: 0; max-width: 100%; }
  .ipt-textarea { width: 100%; }
  .lbl { min-width: 36px; margin-right: 4px; font-size: 13px; letter-spacing: 0.5px; }
  .radio.pill { padding: 6px 12px; font-size: 12.5px; }
  .row { gap: 6px; margin-bottom: 12px; }
  /* 起卦时间行在窄屏：年月日时分五行可以换到下一行 */
  #time_row { flex-wrap: wrap !important; }
  #time_row .time-selects { flex-wrap: wrap; }
  #time_row .time-selects select { font-size: 12px; padding: 5px 4px; }
  #time_row .btn-mini { margin-left: 0; margin-top: 6px; }
  /* 结果区 */
  .result-info { gap: 4px 12px; font-size: 13px; }
  .result-info > div { flex-basis: 100%; }
  .result-info .ganzhi { font-size: 13px; letter-spacing: -0.3px; }
  .result-info .shensha { font-size: 12.5px; letter-spacing: -0.3px; }
  .result-info .rixiadasha { font-size: 12.5px; letter-spacing: -0.3px; }
  .result-header { padding: 7px 10px; font-size: 12.5px; }
  /* 卦卡 */
  .gua-grid { padding-left: 18px; gap: 6px; }
  .gua-col { padding: 10px 4px 8px; }
  .gua-name { font-size: 14.5px; letter-spacing: 0; }
  .gua-sub { font-size: 10.5px; }
  .gua-symbol .yao { width: 40px; height: 8px; }
  .gua-symbol .yao.yin::before, .gua-symbol .yao.yin::after { width: 16px; height: 8px; }
  /* 其它 */
  .brand-name { font-size: 21px; letter-spacing: 4px; }
  .brand-sub { font-size: 11px; letter-spacing: 2px; }
  .brand-meta { display: none; }
  .module-tabs { padding: 0 12px; }
  .btn-primary { padding: 12px 48px; font-size: 16px; }
  .tab { padding: 9px 10px; font-size: 12.5px; letter-spacing: 1px; gap: 5px; }
  .tab-lock { font-size: 9px; padding: 0 5px; }
}
@media (max-width: 380px) {
  .gua-name { font-size: 13px; }
  .gua-sub { font-size: 10px; }
  .gua-symbol .yao { width: 32px; height: 7px; }
  .gua-symbol .yao.yin::before, .gua-symbol .yao.yin::after { width: 13px; height: 7px; }
}

/* ========== 账号区 / 登录弹窗 / 个人中心 ========== */
.user-area { display:flex; align-items:center; gap:14px; }
.ua-link { color:#e8dcc0; font-size:13px; text-decoration:none; opacity:.85; }
.ua-link:hover { opacity:1; color:var(--gold-soft); }
.ua-btn { background:transparent; border:1px solid var(--gold-soft); color:#f3ecdc; padding:6px 14px; border-radius:6px; font-size:13px; cursor:pointer; font-family:inherit; }
.ua-btn:hover { background:var(--cinnabar); border-color:var(--cinnabar); color:#fff; }
.ua-user { position:relative; cursor:pointer; display:flex; align-items:center; gap:4px; font-size:13px; color:#f5eede; }
.ua-name { color:#f5eede; }
.ua-caret { font-size:10px; opacity:.6; }
.ua-menu { display:none; position:absolute; right:0; top:130%; background:#fff; border:1px solid #e7dcc4; border-radius:8px; box-shadow:0 8px 24px rgba(0,0,0,.12); min-width:124px; overflow:hidden; z-index:50; }
.ua-menu.open { display:block; }
.ua-menu a { display:block; padding:9px 14px; font-size:13px; color:var(--ink); text-decoration:none; }
.ua-menu a:hover { background:#faf4e6; color:var(--cinnabar); }

/* 登录 / 注册 弹窗 */
.modal-mask { position:fixed; inset:0; background:rgba(40,28,18,.45); display:flex; align-items:center; justify-content:center; z-index:100; padding:16px; }
.modal-box { position:relative; width:100%; max-width:340px; background:var(--paper,#fbf7ee); border:1px solid #e7dcc4; border-radius:14px; padding:24px 22px 22px; box-shadow:0 18px 50px rgba(0,0,0,.22); }
.modal-close { position:absolute; top:8px; right:14px; border:none; background:none; font-size:22px; line-height:1; color:#999; cursor:pointer; }
.modal-close:hover { color:var(--cinnabar); }
.modal-tabs { display:flex; gap:18px; margin-bottom:16px; border-bottom:1px solid #ece2cd; padding-bottom:8px; }
.mtab { font-size:15px; color:#999; cursor:pointer; padding-bottom:6px; }
.mtab.active { color:var(--cinnabar); border-bottom:2px solid var(--cinnabar); font-weight:600; }
.modal-form { display:flex; flex-direction:column; gap:12px; }
.modal-form .ipt { width:100%; padding:11px 12px; font-size:14px; }
.modal-msg { font-size:12.5px; min-height:16px; }
.modal-msg.err { color:#c0392b; }
.modal-msg.ok { color:#2e7d32; }

/* 个人中心 */
.ac-panel { margin-top:14px; }
.ac-info { padding:4px 2px; }
.ac-row { display:flex; gap:14px; padding:6px 0; font-size:14px; border-bottom:1px dashed #efe6d2; }
.ac-label { color:#9a8c70; min-width:54px; }
.ac-value { color:var(--ink); }
.ac-muted { color:#9a8c70; }
.ac-hint { padding:18px 2px; font-size:14px; color:#9a8c70; }
.ac-hint a { color:var(--cinnabar); }
.case-list { display:flex; flex-direction:column; gap:12px; margin-top:6px; }
.case-item { display:flex; align-items:center; justify-content:space-between; gap:12px; border:1px solid #ece2cd; border-radius:10px; padding:12px 14px; background:#fffdf8; }
.case-main { min-width:0; }
.case-name { font-size:15px; color:var(--ink); font-weight:600; }
.case-meta { font-size:12.5px; color:#7a6f57; margin-top:3px; }
.case-time { font-size:11.5px; color:#a99c80; margin-top:4px; }
.case-del { flex:none; border:1px solid #e3c3c0; background:#fff; color:#c0392b; padding:6px 12px; border-radius:7px; font-size:13px; cursor:pointer; }
.case-del:hover { background:#c0392b; color:#fff; border-color:#c0392b; }
.case-empty { padding:18px 2px; font-size:13.5px; color:#9a8c70; }
.case-empty a { color:var(--cinnabar); }

@media (max-width:560px) {
  .brand-inner { flex-wrap:wrap; gap:8px; }
  .user-area { width:100%; justify-content:flex-end; }
}
