:root {
  --bg: #0b0d10;
  --bg2: #0f1216;
  --panel: #16191f;
  --panel2: #1c2027;
  --line: #2a303a;
  --line2: #363d48;
  --text: #e9e7e2;
  --muted: #9a958c;
  --amber: #d9a441;
  --amber-dim: #8a6a2a;
  --rep: #b23a3a;
  --cis: #3a6ea5;
  --ok: #7fbf7f;
  --err: #ff8f8f;
  --radius: 14px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.03), 0 8px 24px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(1200px 600px at 50% -10%, #14181f 0%, var(--bg) 60%);
  color: var(--text);
  font-family: "Noto Sans SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  line-height: 1.7;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--amber); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.3; }
h1 { font-size: 28px; margin: 0 0 8px; letter-spacing: 0.01em; }
h2 { font-size: 19px; margin: 0 0 12px; }
h3 { font-size: 16px; margin: 0 0 8px; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(11, 13, 16, 0.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1000px; margin: 0 auto; padding: 12px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { color: var(--text); font-weight: 700; font-size: 16px; letter-spacing: 0.04em; }
.brand:hover { text-decoration: none; color: var(--amber); }
.brand-mark { color: var(--amber); }
.topnav { display: flex; align-items: center; gap: 8px; }
.inline { display: inline; }

/* ---------- 布局 ---------- */
.wrap { width: 100%; max-width: 1000px; margin: 0 auto; padding: 28px 20px 60px; }
main.wrap { flex: 1; }
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.section-title { font-size: 13px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--amber); margin: 34px 0 14px; }
.page-head { margin-bottom: 18px; }
.page-head h1 { margin-bottom: 4px; }

/* ---------- 卡片 ---------- */
.card {
  background: linear-gradient(180deg, var(--panel), var(--bg2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.card h2 { color: var(--text); }
.empty { color: var(--muted); text-align: center; padding: 26px 18px; }
.empty.big { padding: 50px 18px; }
.locked-card { opacity: 0.72; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block;
  background: var(--amber); color: #141414;
  border: 0; border-radius: 10px;
  padding: 9px 16px; font-size: 14px; font-weight: 700;
  font-family: inherit; cursor: pointer; line-height: 1.2;
  transition: filter 0.15s ease, transform 0.05s ease;
}
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.ghost2 {
  background: transparent; color: var(--text);
  border: 1px solid var(--line2);
}
.btn.ghost2:hover { border-color: var(--amber-dim); color: var(--amber); }
.btn.lg { padding: 11px 22px; font-size: 15px; }
.btn.full { width: 100%; }

/* ---------- Hero ---------- */
.hero {
  padding: 34px 0 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
}
.hero-kicker { font-size: 12px; letter-spacing: 0.24em; color: var(--amber); text-transform: uppercase; }
.hero h1 { font-size: 42px; margin: 8px 0 4px; letter-spacing: 0.02em; }
.hero-sub { color: var(--muted); font-size: 15px; margin: 0 0 14px; }
.hero-lede { color: #cfcbc4; max-width: 560px; margin: 0 0 20px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; padding-bottom: 24px; }

/* ---------- 星球 ---------- */
.planet-head { display: flex; align-items: baseline; gap: 8px; }
.en { color: var(--muted); font-size: 12px; font-weight: 400; }
.bar { display: flex; gap: 3px; margin: 12px 0 6px; }
.bar i { flex: 1; height: 12px; border-radius: 3px; background: #232830; border: 1px solid #2e353f; }
.bar i.rep { background: var(--rep); border-color: var(--rep); }
.bar i.cis { background: var(--cis); border-color: var(--cis); }
.bar i.neu { background: var(--amber-dim); border-color: var(--amber-dim); }

/* ---------- 角色卡 ---------- */
.roster { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.char-card { padding: 0; overflow: hidden; display: flex; color: var(--text); }
.char-card:hover { text-decoration: none; border-color: var(--line2); transform: translateY(-1px); transition: 0.15s; }
.char-stripe { width: 6px; background: var(--fc, var(--amber)); }
.char-body { padding: 14px 16px; }
.char-name { font-weight: 700; font-size: 16px; }
.tag {
  display: inline-block; margin-top: 8px;
  padding: 2px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; color: #141414;
  background: var(--fc, var(--amber));
}

/* ---------- 角色主页 ---------- */
.profile-band {
  border: 1px solid var(--line); border-left: 6px solid var(--fc, var(--amber));
  border-radius: var(--radius); padding: 20px 22px;
  background: linear-gradient(180deg, var(--panel), var(--bg2));
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  box-shadow: var(--shadow);
}
.profile-name { font-size: 30px; font-weight: 800; letter-spacing: 0.01em; }
.profile-meta { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.profile-meta .tag { margin-top: 0; }
.profile-actions { display: flex; gap: 8px; }
.chips { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin: 18px 0; }
.chip { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.chip span { display: block; font-size: 12px; color: var(--muted); }
.chip b { font-size: 15px; }
.motivation {
  margin: 0 0 18px; padding: 16px 20px;
  border-left: 3px solid var(--fc, var(--amber));
  background: var(--panel2); border-radius: 0 12px 12px 0;
  font-size: 16px; color: #f0ede7;
}
.prose { font-size: 15.5px; color: #dcd8d1; white-space: pre-wrap; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.checklist li:last-child { border-bottom: 0; }
.checklist .dot { width: 20px; text-align: center; }
.checklist li.done .dot { color: var(--ok); }
.checklist li.locked { color: var(--muted); }

/* ---------- 登录/注册 ---------- */
.auth { max-width: 420px; margin: 20px auto; }
.auth h1 { text-align: center; }
.auth .muted { text-align: center; }
.center { text-align: center; }

/* ---------- 表单 ---------- */
.form .field { margin-bottom: 16px; }
label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.hint { color: #6f6a62; font-weight: 400; }
input, select, textarea {
  width: 100%; background: var(--bg2);
  border: 1px solid var(--line); border-radius: 10px;
  color: var(--text); padding: 10px 13px; font-size: 14px; font-family: inherit;
  transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--amber-dim); }
textarea { resize: vertical; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 6px; }

/* ---------- 对话 ---------- */
.chat {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; min-height: 320px; max-height: 56vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 12px;
}
.bubble { max-width: 82%; padding: 11px 15px; border-radius: 14px; font-size: 14.5px; white-space: pre-wrap; }
.bubble.ai { align-self: flex-start; background: var(--panel2); border: 1px solid var(--line); border-left: 3px solid var(--amber); }
.bubble.me { align-self: flex-end; background: #23303f; border: 1px solid #2f4054; }
.bubble.typing { display: flex; gap: 5px; align-items: center; }
.bubble.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.bubble.typing i:nth-child(2) { animation-delay: 0.2s; }
.bubble.typing i:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 60%, 100% { opacity: 0.25; } 30% { opacity: 1; } }
.composer { display: flex; gap: 8px; margin-top: 12px; }
.composer input { flex: 1; }
.chat-foot { display: flex; align-items: center; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.bio-editor { margin-top: 18px; }

/* ---------- 提示 ---------- */
.muted { color: var(--muted); }
.small { font-size: 13px; }
.error { color: var(--err); font-size: 13px; }
.success { color: var(--ok); font-size: 13px; }
.warn { color: var(--amber); font-size: 12px; font-weight: 700; margin-left: 6px; }

/* ---------- 页脚 ---------- */
.foot { border-top: 1px solid var(--line); margin-top: 30px; padding: 20px 0; color: var(--muted); font-size: 12.5px; }

/* ---------- 关系 / 任务 ---------- */
.rel-item { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.rel-item:last-child { border-bottom: 0; }
.rel-body { flex: 1; }
.rel-item .tag { margin-left: 8px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mission-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.mission-head h3 { margin: 0; }
.pts { background: var(--amber-dim); color: #f3e9d2; border-radius: 999px; padding: 1px 9px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.mission-done { opacity: 0.8; border-color: #3b5540; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.tbl th { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.plain { margin: 6px 0 0; padding-left: 18px; }
.plain li { margin: 3px 0; }

@media (max-width: 560px) {
  .hero h1 { font-size: 32px; }
  .profile-name { font-size: 24px; }
  .topbar-inner, .wrap { padding-left: 14px; padding-right: 14px; }
}
