/* 团队站公用样式。暗色，跟占星页一个调子。
   内部工具，不追求花哨——可读性优先。 */
:root {
  --bg: #0b0d14;
  --card: #141824;
  --card-2: #1b2030;
  --line: rgba(255, 255, 255, .10);
  --line-strong: rgba(255, 255, 255, .20);
  --text: #e8eaf0;
  --text-dim: rgba(232, 234, 240, .58);
  --text-faint: rgba(232, 234, 240, .38);
  --accent: #c9a96e;
  --err: #f5824a;
  --ok: #5a9e8f;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --serif: "Songti SC", "Noto Serif SC", Georgia, serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  -webkit-text-size-adjust: 100%;
}

.wrap { max-width: 760px; margin: 0 auto; padding: 28px 18px 80px; }

/* 顶栏 */
.top {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding-bottom: 18px; margin-bottom: 26px;
  border-bottom: 1px solid var(--line);
}
.top .brand { font-size: 15px; letter-spacing: .08em; color: var(--text); text-decoration: none; }
.top .spacer { flex: 1; }
.top a.nav { color: var(--text-dim); text-decoration: none; font-size: 13px; }
.top a.nav:hover { color: var(--accent); }
.top .who {
  color: var(--accent); text-decoration: none; font-size: 13px;
  padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px;
}

h1 { font-size: 20px; font-weight: 500; letter-spacing: .04em; margin: 0 0 22px; }

/* 登录页的切换 */
.tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.tab {
  width: auto; flex: 0 0 auto; padding: 8px 18px;
  background: transparent; border: 1px solid var(--line); border-radius: 999px;
  color: var(--text-dim); font-size: 14px; letter-spacing: 0; cursor: pointer;
}
.tab.on { color: var(--text); border-color: var(--accent); }

/* 首页：入口一行一个，点哪算哪 */
.menu { display: grid; gap: 12px; margin-top: 8px; }
.menu a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 22px;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  color: var(--text); text-decoration: none; font-size: 16px;
  transition: border-color .15s, background .15s;
}
.menu a:hover { border-color: var(--line-strong); background: var(--card-2); }
.menu a .arrow { color: var(--text-faint); font-size: 13px; }

/* 表单 */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 22px; margin-bottom: 18px;
}
.row { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 14px; margin-bottom: 14px; }
.row > label { color: var(--text-dim); font-size: 14px; }
.row:last-child { margin-bottom: 0; }

input[type=text], input[type=password], input[type=date], select {
  width: 100%; padding: 11px 12px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 7px;
  font-size: 15px; font-family: inherit; outline: none;
}
input:focus, select:focus { border-color: var(--accent); }
select { appearance: none; }

button {
  width: 100%; padding: 13px;
  background: var(--card-2); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: 8px;
  font-size: 15px; font-family: inherit; letter-spacing: .1em;
  cursor: pointer; transition: border-color .15s, background .15s;
}
button:hover:not(:disabled) { border-color: var(--accent); background: #232941; }
button:disabled { opacity: .5; cursor: default; }

.hint { color: var(--text-faint); font-size: 13px; margin: 10px 0 0; }
.err { color: var(--err); }
.ok { color: var(--ok); }

/* 两人并排（合盘） */
.two { display: grid; gap: 18px; }
@media (min-width: 680px) { .two { grid-template-columns: 1fr 1fr; } }

/* 报告 */
.status { text-align: center; padding: 34px 0; color: var(--text-dim); }
.status .dot { display: inline-block; animation: blink 1.2s infinite; }
@keyframes blink { 0%,100% { opacity: 1 } 50% { opacity: .25 } }

.report h2 {
  font-family: var(--serif); font-size: 18px; font-weight: 500;
  margin: 30px 0 12px; padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.report p { margin: 0 0 15px; line-height: 1.95; }
.report .head { font-family: var(--serif); font-size: 22px; margin-bottom: 6px; }
.report .meta { color: var(--text-faint); font-size: 13px; margin-bottom: 20px; }
.report .raw { white-space: pre-wrap; line-height: 1.95; }

/* 列表 */
.list { display: grid; gap: 10px; }
.item {
  display: flex; align-items: stretch; gap: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: 9px;
  padding: 14px 16px;
}
.item .main { flex: 1; min-width: 0; color: var(--text); text-decoration: none; display: block; }
.item .main:hover .t { color: var(--accent); }
.item .t { font-size: 15px; }
.item .m { color: var(--text-dim); font-size: 13px; margin-top: 3px; }
.item .m.dim { color: var(--text-faint); }
.item .ops { display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.item .ops button {
  width: auto; padding: 5px 12px; font-size: 13px; letter-spacing: 0;
  border-radius: 6px; background: transparent;
}
.item .ops button.danger { color: var(--err); }
.item .ops button.danger:hover { border-color: var(--err); }

.empty { color: var(--text-faint); padding: 30px 0; text-align: center; }

@media (max-width: 520px) {
  .row { grid-template-columns: 78px 1fr; }
  .item { flex-direction: column; }
  .item .ops { flex-direction: row; }
}

/* ── 密码门：全屏遮罩（跟占星页以前那个一个路子）───────────────────
   入口在 app.js 的 showGate()，两道屏：先密码，再填名字建账号。 */
#gate {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.gate-box { width: 100%; max-width: 380px; text-align: center; }
.gate-title {
  font-family: var(--serif); font-size: 28px; letter-spacing: .12em;
  margin-bottom: 12px;
}
.gate-sub { color: var(--text-dim); font-size: 14px; margin-bottom: 26px; }
.gate-box input {
  text-align: center; margin-bottom: 14px;
  padding: 14px; font-size: 16px;
}
.gate-box button { padding: 14px; font-size: 15px; }
.gate-err { color: var(--err); font-size: 13px; margin-top: 12px; min-height: 20px; }
.gate-note { color: var(--text-faint); font-size: 12px; margin-top: 18px; line-height: 1.6; }

/* 八字生成中：还没写完的板块占位。七个标题先按顺序立好、谁写完填谁，
   免得只按到达顺序显示时，最早写完的「掏心话」跑到报告最前面去。 */
.report p.pending { color: var(--text-faint); }


/* ── 占星页：快捷城市 + 盘面表 ─────────────────────────────────── */
.cities { display: flex; flex-wrap: wrap; gap: 6px; }
.cities .city {
  width: auto; padding: 4px 11px; font-size: 13px; letter-spacing: 0;
  background: transparent; border: 1px solid var(--line); border-radius: 999px;
  color: var(--text-dim); cursor: pointer; transition: border-color .15s, color .15s;
}
.cities .city:hover { border-color: var(--line-strong); }
.cities .city.on { color: var(--text); border-color: var(--accent); }

/* 地点搜索下拉。跟老占星页一个行为：打字 → 出候选 → 点一条自动填经纬度。 */
.cty-wrap { position: relative; }
.cty-dd {
  position: absolute; z-index: 30; left: 0; right: 0; top: 100%; margin-top: 4px;
  max-height: 240px; overflow-y: auto;
  background: var(--card-2); border: 1px solid var(--line-strong); border-radius: 8px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .45);
  display: none;
}
.cty-dd.open { display: block; }
.cty-opt { padding: 7px 11px; font-size: 13.5px; color: var(--text-dim); cursor: pointer; }
.cty-opt:hover, .cty-opt.active { background: rgba(255, 255, 255, .06); color: var(--text); }
.cty-opt-hint { padding: 8px 11px; font-size: 13px; color: var(--text-faint); }

table.astro td { padding: 5px 8px; border-bottom: 1px solid var(--line); color: var(--text-dim); }
table.astro td:first-child { color: var(--text); }
table.astro tr:last-child td { border-bottom: none; }


/* ★ 星盘图 ★ */
#natal-svg, #sr-svg, #tr-svg, #sn-svg-a, #sn-svg-b {
  display: block; width: 100%; max-width: 460px; height: auto; margin: 0 auto;
}
.chartbox { padding: 2px 0 4px; }
.pp-dot { animation: pp-breathe 4s ease-in-out infinite; }
@keyframes pp-breathe { 0%, 100% { opacity: 1 } 50% { opacity: .45 } }

/* ★ 追问面板（app.js 的 mountChat）★ */
.chat {
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); padding: 18px 18px 16px;
}
.chat-h {
  font-family: var(--serif); font-size: 17px; margin-bottom: 14px;
  display: flex; align-items: baseline; gap: 10px;
}
.chat-h .chat-sub { color: var(--text-faint); font-size: 12px; font-family: var(--sans); flex: 1; }
.chat-h .chat-clear {
  width: auto; padding: 3px 10px; font-size: 12px; letter-spacing: 0;
  background: transparent; border-radius: 6px;
}
.chat-log { max-height: 440px; overflow-y: auto; padding-right: 4px; }
.chat-m { margin-bottom: 14px; line-height: 1.9; }
.chat-m p { margin: 0 0 8px; }
/* 用户的话靠右、给个淡底；老韩的话直接排（像正文，不用气泡） */
.chat-m.me { text-align: right; }
.chat-m.me p {
  display: inline-block; text-align: left;
  background: var(--card-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 12px;
}
.chat-m.lao { color: var(--text); }
.chat-m .pending { color: var(--text-faint); }
.chat-m .hint { margin: 4px 0 0; }
.chat-in { display: flex; gap: 10px; align-items: flex-end; margin-top: 12px; }
.chat-in textarea {
  flex: 1; padding: 11px 12px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 7px;
  font-size: 15px; font-family: inherit; line-height: 1.6;
  resize: vertical; outline: none;
}
.chat-in textarea:focus { border-color: var(--accent); }
.chat-in button { width: auto; padding: 11px 20px; letter-spacing: 0; flex: 0 0 auto; }

@media (max-width: 520px) {
  .chat-log { max-height: 340px; }
  .chat-in { flex-direction: column; align-items: stretch; }
  .chat-in button { width: 100%; }
}
