:root {
  --gold: #D4A84C;
  --gold-deep: #B8935D;
  --dark: #1a1816;
  --paper: #ffffff;
  --muted: #999999;
  --bg: #f0f0f0;
  --line: #f0f0f0;
  --soft: #f6f2ea;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: #333;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { border: 0; cursor: pointer; }
.app-shell {
  width: 100%;
  max-width: 520px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  box-shadow: 0 0 40px rgba(0,0,0,.08);
}
.page { min-height: 100vh; padding-bottom: 24px; }
.container { padding: 15px 12px; position: relative; }
.card {
  background: #fff;
  border-radius: 18px;
  padding: 26px 20px;
  box-shadow: 0 4px 18px rgba(0,0,0,.05);
}
.form-row { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.row-between { justify-content: space-between; gap: 10px; }
.label { width: 92px; flex-shrink: 0; font-size: 15px; color: #333; }
.label-required { font-size: 12px; color: var(--muted); margin-left: 2px; }
.input-field {
  min-width: 0;
  flex: 1;
  height: 42px;
  line-height: 42px;
  padding: 0 12px;
  border: 0;
  outline: none;
  background: transparent;
  color: #333;
  font-size: 15px;
  text-align: right;
}
.picker-style {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  color: var(--muted);
  cursor: pointer;
  border-radius: 12px;
}
.picker-style:hover { background: #fafafa; }
.picker-text { color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.arrow { margin-left: 6px; color: #bbb; font-size: 22px; }
.gender-group, .tab-group, .pill-tabs {
  display: flex;
  align-items: center;
  background: #f5f1ea;
  border-radius: 999px;
  padding: 3px;
}
.pill, .tab-item, .pill-tab {
  padding: 7px 15px;
  color: #666;
  border-radius: 999px;
  background: transparent;
  font-size: 14px;
}
.tab-item { padding: 7px 12px; }
.pill-active, .tab-active {
  background: var(--gold-deep);
  color: #fff;
}
.pill-tab-active {
  background: #fff;
  color: #222;
  font-weight: 650;
  box-shadow: 0 2px 8px rgba(0,0,0,.07);
}
.info-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; gap: 14px; }
.info-text, .info-text-block { color: var(--muted); font-size: 13px; }
.info-text-block { margin: 8px 0 12px; }
.save-switch-wrap { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.switch { width: 42px; height: 24px; border-radius: 99px; background: #ddd; position: relative; display: inline-block; vertical-align: middle; transition: .2s; }
.switch::after { content: ''; width: 20px; height: 20px; border-radius: 50%; background: #fff; position: absolute; top: 2px; left: 2px; transition: .2s; box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.switch.checked { background: var(--gold-deep); }
.switch.checked::after { left: 20px; }
.option-label { color: #333; font-size: 14px; }
.btn-wrap { padding: 12px 0 4px; }
.main-btn {
  width: 100%;
  height: 52px;
  border-radius: 999px;
  background: #1a1a1a;
  color: var(--gold);
  font-size: 17px;
  letter-spacing: 5px;
  font-weight: 550;
}
.main-btn:active { opacity: .86; }
.floating-note {
  position: fixed;
  right: max(16px, calc((100vw - 520px) / 2 + 16px));
  bottom: 24px;
  background: var(--dark);
  color: var(--gold);
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
}
/* 弹窗 */
.popup-mask {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0,0,0,.38);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-top: 24px;
}
.popup-sheet {
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow: hidden;
  background: #fff;
  border-radius: 18px 18px 0 0;
  padding: 16px 12px 24px;
  display: flex;
  flex-direction: column;
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.sheet-actions { display: flex; align-items: center; gap: 8px; }
.today-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #f5f1ea;
  color: #666;
}
.confirm-btn {
  background: #1a1a1a;
  color: var(--gold);
  padding: 8px 18px;
  border-radius: 999px;
  font-weight: 550;
}
.quick-row, .search-row {
  display: flex;
  align-items: center;
  background: #f5f5f5;
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 10px;
}
.quick-input, .search-input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 8px 12px;
  font-size: 14px;
}
.quick-btn {
  background: #fff;
  color: #555;
  padding: 8px 16px;
  border-radius: 999px;
}
.search-icon { padding-left: 12px; color: #aaa; }
.col-headers, .col-h-row { display: flex; padding: 8px 0; border-bottom: 1px solid #f1f1f1; }
.col-h { flex: 1; text-align: center; color: #999; font-size: 13px; }
.picker-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; padding: 14px 0; }
.picker-grid.sizhu { grid-template-columns: repeat(4, 1fr); }
.picker-grid select {
  width: 100%;
  height: 46px;
  border: 1px solid #eee;
  border-radius: 12px;
  text-align: center;
  background: #fff;
  color: #333;
  outline: none;
}
.sheet-bottom { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding-top: 10px; }
.help-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%; border: 1px solid #ccc;
  color: #999; font-size: 12px;
}
.help-text { color: #666; font-size: 14px; }
.addr-lists { display: grid; grid-template-columns: repeat(3, 1fr); min-height: 330px; max-height: 52vh; overflow: hidden; }
.addr-list { overflow-y: auto; border-right: 1px solid #f5f5f5; }
.addr-list:last-child { border-right: 0; }
.addr-item { padding: 13px 8px; color: #999; text-align: center; font-size: 14px; border-radius: 8px; }
.addr-item-active { color: #222; font-weight: 650; background: #faf4e5; }
.oversea-empty { min-height: 240px; display:flex; align-items:center; justify-content:center; color:#999; }
/* 结果页 */
.top-tabs { display: flex; background: #1a1816; border-bottom: 1px solid #333; position: sticky; top: 0; z-index: 20; }
.top-tab { flex: 1; text-align: center; padding: 14px 0; color: #aaa; font-size: 15px; position: relative; background: transparent; }
.top-tab-active { color: var(--gold); font-weight: 650; }
.top-tab-active::after { content: ''; position:absolute; left:30%; right:30%; bottom:0; height:2px; border-radius:2px; background: var(--gold); }
.header { background: linear-gradient(135deg, #2a2824 0%, #1a1816 60%, #0f0e0d 100%); padding: 18px 16px; display: flex; align-items: center; color: #fff; }
.avatar { width: 58px; height: 58px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, #D4A84C, #9c7933); display: flex; align-items: center; justify-content: center; margin-right: 14px; box-shadow: 0 0 0 2px rgba(212,168,76,.4); }
.zodiac-emoji { font-size: 28px; }
.header-main { flex: 1; min-width: 0; }
.name-row { display:flex; align-items:center; gap:8px; margin-bottom: 6px; }
.name { font-size: 19px; font-weight: 650; color:#fff; letter-spacing:1px; }
.meta-row { display:flex; align-items:center; font-size: 12px; color:#e5d8a8; margin-top:4px; flex-wrap: wrap; gap: 4px; }
.meta-label { color: var(--gold); font-weight: 600; }
.meta-text { color: #f0e4be; }
.meta-tag { color: #aaa; }
.back-link { color: var(--gold); background: rgba(255,255,255,.08); border-radius: 999px; padding: 6px 10px; font-size: 13px; }
.info-card { background:#fff; padding:16px; }
.info-line { display:flex; align-items:center; padding:10px 0; border-bottom:1px solid #f5f5f5; font-size:14px; }
.info-line .k { color:#999; width:86px; flex-shrink: 0; }
.info-line .sub { color:#999; margin-left:4px; font-size:12px; }
.table-card { background:#fff; overflow-x: auto; }
.bazi-table { min-width: 500px; }
.row { display:flex; align-items:stretch; min-height:42px; border-bottom:1px solid var(--line); }
.row-head { background:#fafafa; min-height:36px; }
.row-head .col { color:#999; font-size:13px; }
.row-big { min-height:54px; }
.row-multi { min-height:68px; align-items:flex-start; padding:8px 0; }
.col { flex:1; display:flex; align-items:center; justify-content:center; text-align:center; padding:0 4px; font-size:14px; color:#333; }
.col-label { flex: 0 0 56px; color:#999; font-size:13px; }
.col-multi { flex-direction:column; justify-content:flex-start; align-items:center; gap:3px; }
.big-char { font-size:24px; font-weight:700; margin-right:2px; }
.wx-emoji { font-size:14px; }
.multi-line { font-size:12px; line-height:1.45; text-align:center; }
.multi-line.sub { color:#666; }
.multi-line.shensha { color:#b89060; font-size:12px; line-height:1.55; }
.pro-wrap { padding: 0; }
.pro-section { background:#fff; margin-top:8px; padding:12px; }
.pro-title { font-size:15px; font-weight:650; color:#333; margin-bottom:9px; padding-left:8px; border-left:3px solid var(--gold-deep); }
.pro-line { font-size:13px; line-height:1.6; }
.pro-k { color:#888; }
.pro-v { color:#333; }
.scroll-row { overflow-x:auto; white-space:nowrap; }
.scroll-line { display:inline-flex; padding:4px 0; }
.dayun-cell, .liunian-cell, .liuyue-cell { flex-shrink:0; width:62px; padding:8px 0; display:flex; flex-direction:column; align-items:center; border-right:1px solid #f2f2f2; font-size:12px; color:#444; }
.cell-age { font-size:11px; color:#999; line-height:1.4; }
.cell-age.small { font-size:10px; }
.cell-gan, .cell-zhi { font-size:16px; color:#333; font-weight:650; line-height:1.3; }
.dayun-active, .liunian-active { background:#f8efdd; border-radius:8px; }
.dayun-active .cell-gan, .dayun-active .cell-zhi, .liunian-active .cell-gan, .liunian-active .cell-zhi { color: var(--gold-deep); }
.phase-bar { display:flex; justify-content:space-between; background:linear-gradient(90deg, #B8935D, #D4A84C); padding:10px 14px; margin-top:8px; }
.phase-pill { color:#fff; font-size:14px; font-weight:650; }
.pro-actions { display:flex; gap:10px; padding:12px; background:#fff; margin-top:1px; }
.pro-btn { flex:1; height:42px; line-height:42px; background:#f6f2ea; border-radius:999px; text-align:center; color:#333; font-size:14px; }
.pro-btn.dark { background:#1a1a1a; color:var(--gold); }
.pro-row { display:flex; align-items:flex-start; padding:7px 0; font-size:13px; }
.pro-row .pro-k { width:88px; flex-shrink:0; line-height:28px; }
.pro-tags { flex:1; display:flex; flex-wrap:wrap; gap:6px; }
.tag { background:#f6f2ea; color:#7a5a26; padding:5px 10px; border-radius:999px; font-size:12px; }
.shensha-row { display:flex; align-items:flex-start; padding:9px 0; border-bottom:1px solid #f5f5f5; }
.shensha-row.shensha-active { background:#faf4e5; border-radius:8px; padding:9px 8px; }
.shensha-name { width:62px; font-size:15px; font-weight:650; color:#333; flex-shrink:0; }
.shensha-list { flex:1; display:flex; flex-wrap:wrap; gap:6px 12px; color:#7a5a26; }
.shensha-tag { font-size:12px; }
.note-wrap { background:#fff; padding:16px; margin-top:8px; min-height:280px; }
.note-hint { color:#999; font-size:13px; margin-bottom:10px; }
.note-input { width:100%; min-height:220px; background:#fafafa; padding:12px; font-size:14px; color:#333; border:0; border-radius:10px; outline:0; resize:vertical; }
.footer-tip { text-align:center; color:#bbb; font-size:12px; padding:22px 15px 12px; }
.toast { position: fixed; left:50%; bottom:72px; transform: translateX(-50%); z-index: 999; background: rgba(0,0,0,.78); color:#fff; padding:9px 14px; border-radius:999px; font-size:14px; max-width:80vw; text-align:center; }
@media (max-width: 390px) {
  .label { width: 78px; }
  .pill, .tab-item, .pill-tab { padding-left: 11px; padding-right: 11px; }
  .card { padding-left: 16px; padding-right: 16px; }
}
