/* =========================================================
 * style.css —— 《学海浮沉》暗色学术风
 * ========================================================= */
:root {
  --bg: #0e1210;
  --bg2: #141a17;
  --card: #1b231f;
  --card2: #222d28;
  --line: #2e3b35;
  --txt: #e8e6df;
  --mut: #9aa79f;
  --acc: #c9a227;
  --acc2: #d8b84a;
  --good: #4caf7d;
  --bad: #d26a5a;
  --blue: #5b8def;
  --radius: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: radial-gradient(1200px 800px at 20% -10%, #18231d 0%, var(--bg) 55%);
  color: var(--txt);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
  min-height: 100%;
}
button { font-family: inherit; cursor: pointer; }
.hidden { display: none !important; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px;
  background: rgba(14, 18, 16, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand {
  background: none; border: none; color: var(--txt);
  font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px;
}
.brand-mark { font-size: 20px; }
.corner-btn {
  background: var(--card2); color: var(--txt);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 16px; font-size: 13px;
}
.corner-btn:hover { border-color: var(--acc); color: var(--acc2); }

/* ---------- 视图容器 ---------- */
.view { max-width: 1080px; margin: 0 auto; padding: 28px 18px 120px; }

/* ---------- 首页 ---------- */
.intro { text-align: center; padding-top: 56px; }
.eyebrow {
  display: inline-block; font-size: 13px; letter-spacing: 4px;
  color: var(--acc2); border: 1px solid var(--acc); border-radius: 999px;
  padding: 4px 16px; margin-bottom: 22px;
}
.hero-title { font-size: clamp(30px, 5vw, 48px); line-height: 1.25; font-weight: 800; letter-spacing: 1px; }
.hero-sub { max-width: 560px; margin: 20px auto 34px; color: var(--mut); font-size: 15px; }
.segmented {
  display: inline-flex; background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px; gap: 4px;
}
.seg {
  background: none; border: none; color: var(--mut);
  padding: 8px 22px; border-radius: 999px; font-size: 14px;
}
.seg.selected { background: var(--acc); color: #141008; font-weight: 700; }
.seg-note { color: var(--mut); font-size: 13px; margin-top: 10px; }
.seed-box { margin: 26px auto 8px; max-width: 380px; display: flex; align-items: center; gap: 10px; }
.seed-box label { color: var(--mut); font-size: 14px; white-space: nowrap; }
.seed-box input {
  flex: 1; background: var(--card); border: 1px solid var(--line); color: var(--txt);
  border-radius: 10px; padding: 10px 14px; font-size: 14px; outline: none;
}
.seed-box input:focus { border-color: var(--acc); }
.btn-stack { display: flex; flex-direction: column; gap: 12px; align-items: center; margin-top: 26px; }
.btn {
  border-radius: 12px; border: 1px solid var(--line);
  background: var(--card2); color: var(--txt);
  padding: 12px 26px; font-size: 15px; transition: .15s;
}
.btn:hover { border-color: var(--acc); }
.btn-primary {
  background: linear-gradient(135deg, #e0b94e, #b98f1f);
  color: #161006; font-weight: 800; border: none;
  padding: 14px 48px; font-size: 16px;
}
.btn-primary:hover { filter: brightness(1.08); }

/* ---------- 身份流程 ---------- */
.step-head { text-align: center; margin-bottom: 26px; }
.step-title { font-size: 24px; font-weight: 800; }
.progress { max-width: 420px; margin: 14px auto 8px; height: 6px; background: var(--card); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--acc), var(--acc2)); transition: width .3s; }
.step-sub { color: var(--mut); font-size: 14px; }

.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.choice-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; text-align: left; display: flex; flex-direction: column; gap: 8px;
  transition: .15s;
}
.choice-card:hover { border-color: var(--acc); transform: translateY(-2px); }
.choice-card .cc-icon { font-size: 26px; }
.choice-card .cc-name { font-size: 16px; font-weight: 700; }
.choice-card .cc-desc { color: var(--mut); font-size: 13px; flex: 1; }
.choice-card .cc-tag {
  align-self: flex-start; font-size: 12px; color: var(--acc2);
  border: 1px solid var(--acc); border-radius: 999px; padding: 2px 10px;
}
.choice-card .cc-bonus { color: var(--good); font-size: 12px; }
.choice-card.warn .cc-tag { color: var(--bad); border-color: var(--bad); }

.form-card { max-width: 520px; margin: 0 auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.form-row { margin-bottom: 18px; }
.form-row label { display: block; color: var(--mut); font-size: 13px; margin-bottom: 6px; }
.form-row input, .form-row select {
  width: 100%; background: var(--bg2); border: 1px solid var(--line); color: var(--txt);
  border-radius: 10px; padding: 11px 14px; font-size: 15px; outline: none;
}
.form-row input:focus, .form-row select:focus { border-color: var(--acc); }
.form-hint { color: var(--mut); font-size: 12px; margin-top: 4px; }

/* ---------- 底部操作栏 ---------- */
.actionbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: space-between; gap: 12px;
  padding: 14px 18px calc(14px + env(safe-area-inset-bottom));
  background: rgba(14, 18, 16, 0.95); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
}
.actionbar .btn { flex: 0 0 auto; }

/* ---------- 生涯页 ---------- */
.career-layout { display: grid; grid-template-columns: 320px 1fr; gap: 18px; align-items: start; }
@media (max-width: 860px) { .career-layout { grid-template-columns: 1fr; } }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.panel h3 { font-size: 14px; color: var(--mut); letter-spacing: 2px; margin-bottom: 12px; font-weight: 700; }

.player-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, var(--card2), var(--acc));
  display: flex; align-items: center; justify-content: center; font-size: 24px;
  flex: 0 0 auto;
}
.player-name { font-size: 20px; font-weight: 800; }
.player-meta { color: var(--mut); font-size: 13px; }
.player-meta b { color: var(--acc2); font-weight: 600; }

.stat-line { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.stat-label { width: 48px; font-size: 13px; color: var(--mut); flex: 0 0 auto; }
.stat-bar { flex: 1; height: 8px; background: var(--bg2); border-radius: 999px; overflow: hidden; }
.stat-fill { height: 100%; border-radius: 999px; transition: width .4s; }
.stat-num { width: 34px; text-align: right; font-size: 13px; font-weight: 700; flex: 0 0 auto; }
.fill-ability { background: linear-gradient(90deg, #5b8def, #8fb2ff); }
.fill-guanxi  { background: linear-gradient(90deg, #c9a227, #e6c95c); }
.fill-clean   { background: linear-gradient(90deg, #4caf7d, #7fd6a5); }
.fill-fame    { background: linear-gradient(90deg, #b06ad9, #d09bf0); }
.fill-fund    { background: linear-gradient(90deg, #4f9d9d, #7cc9c9); }
.fill-health  { background: linear-gradient(90deg, #d26a5a, #e89a8b); }

.kv { display: flex; justify-content: space-between; font-size: 13px; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.kv:last-child { border-bottom: none; }
.kv span:first-child { color: var(--mut); }
.kv span:last-child { font-weight: 600; }

.hats { display: flex; flex-wrap: wrap; gap: 6px; }
.hat { font-size: 12px; background: var(--card2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; color: var(--acc2); }

/* 事件 / 决策卡 */
.pending-title { font-size: 18px; font-weight: 800; margin-bottom: 8px; }
.pending-desc { color: var(--mut); font-size: 14px; margin-bottom: 18px; }
.event-icon { font-size: 40px; margin-bottom: 10px; }
.opt-list { display: flex; flex-direction: column; gap: 10px; }
.opt {
  background: var(--card2); border: 1px solid var(--line); border-radius: 12px;
  padding: 13px 16px; text-align: left; font-size: 14px; color: var(--txt); transition: .15s;
}
.opt:hover { border-color: var(--acc); background: #28342e; }
.opt .opt-info { display: block; color: var(--mut); font-size: 12px; margin-top: 2px; }
.opt .opt-tag { float: right; color: var(--acc2); font-size: 12px; border: 1px solid var(--acc); border-radius: 999px; padding: 0 8px; }

/* 事件结果 */
.result-box { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 14px 0; }
.result-text { font-size: 14px; margin-bottom: 10px; }
.delta-list { display: flex; flex-wrap: wrap; gap: 6px; }
.delta { font-size: 12px; padding: 3px 10px; border-radius: 999px; }
.delta.up { background: rgba(76, 175, 125, .15); color: var(--good); border: 1px solid rgba(76, 175, 125, .4); }
.delta.down { background: rgba(210, 106, 90, .15); color: var(--bad); border: 1px solid rgba(210, 106, 90, .4); }

/* 年度报告 */
.season-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.season-table th { text-align: left; color: var(--mut); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.season-table td { padding: 7px 8px; border-bottom: 1px solid rgba(46, 59, 53, .5); }
.season-table tr:last-child td { border-bottom: none; }
.season-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.promo { margin-top: 14px; color: var(--good); font-size: 14px; font-weight: 700; }
.report-sum { margin-top: 12px; color: var(--mut); font-size: 13px; }

/* 生涯记录列表 */
.log { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; }
.log-item { font-size: 12px; color: var(--mut); border-left: 2px solid var(--line); padding: 2px 10px; }
.log-item b { color: var(--txt); }

/* ---------- 结算页 ---------- */
.summary-wrap { max-width: 760px; margin: 0 auto; }
.ending-card {
  text-align: center; padding: 34px 24px; border-radius: 18px;
  background: linear-gradient(160deg, #222d28, #161d19);
  border: 1px solid var(--acc); margin-bottom: 22px; position: relative; overflow: hidden;
}
.ending-card .end-tier { font-size: 12px; letter-spacing: 3px; color: var(--acc2); margin-bottom: 8px; }
.ending-card .end-title { font-size: 32px; font-weight: 900; color: var(--acc2); }
.ending-card .end-desc { color: var(--mut); font-size: 14px; max-width: 520px; margin: 12px auto 0; }
.ending-card .end-reason { margin-top: 14px; font-size: 13px; color: var(--mut); }
.resume { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.resume h3 { font-size: 16px; margin-bottom: 14px; letter-spacing: 2px; }
.resume-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px 18px; }
.resume-section { margin-top: 16px; }
.resume-section h4 { font-size: 13px; color: var(--mut); margin-bottom: 8px; letter-spacing: 2px; }
.uni-timeline { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.uni-timeline .tl { display: flex; justify-content: space-between; border-bottom: 1px dashed var(--line); padding: 3px 0; }
.uni-timeline .tl b { font-weight: 600; }
.ending-actions { display: flex; gap: 12px; justify-content: center; margin-top: 22px; flex-wrap: wrap; }

/* ---------- 档案 ---------- */
.archive-list { display: flex; flex-direction: column; gap: 12px; }
.archive-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  cursor: pointer; transition: .15s;
}
.archive-card:hover { border-color: var(--acc); }
.archive-card .ac-title { font-size: 16px; font-weight: 800; color: var(--acc2); }
.archive-card .ac-meta { color: var(--mut); font-size: 12px; margin-top: 2px; }
.archive-empty { text-align: center; color: var(--mut); padding: 40px 0; }

/* ---------- 弹窗 ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(8, 10, 9, .7); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  background: var(--bg2); border: 1px solid var(--line); border-radius: 16px;
  max-width: 540px; width: 100%; max-height: 82vh; overflow-y: auto;
  padding: 26px; position: relative;
}
.modal h2 { font-size: 20px; margin-bottom: 14px; }
.modal h3 { font-size: 15px; margin: 16px 0 6px; color: var(--acc2); }
.modal p, .modal li { font-size: 14px; color: var(--mut); }
.modal ul { padding-left: 20px; display: flex; flex-direction: column; gap: 5px; }
.modal-close { position: absolute; top: 14px; right: 14px; background: none; border: none; color: var(--mut); font-size: 18px; }
.modal-close:hover { color: var(--txt); }


/* ---------- 稀有度徽章 ---------- */
.rarity-badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; border: 1px solid; margin-right: 6px; vertical-align: 2px; }
.rarity-gold   { color: #f3c74e; border-color: rgba(243, 199, 78, .55); background: rgba(243, 199, 78, .12); }
.rarity-silver { color: #cfd8e3; border-color: rgba(207, 216, 227, .5); background: rgba(207, 216, 227, .1); }
.rarity-bronze { color: #cd8a5a; border-color: rgba(205, 138, 90, .5); background: rgba(205, 138, 90, .1); }
.end-rarity { font-size: 12px; letter-spacing: 2px; margin: 2px 0 8px; }
.end-rarity.rarity-gold { color: #f3c74e; }
.end-rarity.rarity-silver { color: #cfd8e3; }
.end-rarity.rarity-bronze { color: #cd8a5a; }


/* ---------- 心语（关键决定后的感人话） ---------- */
.heart-note {
  background: rgba(201, 162, 39, .07);
  border: 1px solid rgba(201, 162, 39, .3);
  border-left: 3px solid var(--acc);
  border-radius: 10px;
  padding: 12px 14px;
  color: #d8c78a;
  font-size: 13px;
  line-height: 1.75;
  margin-bottom: 16px;
}


/* ---------- 心语全屏浮层 ---------- */
.note-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(9, 11, 10, .94);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 30px;
  animation: note-fade-in .5s ease;
}
.note-overlay.fade-out { animation: note-fade-out .6s ease forwards; }
.note-overlay-inner { max-width: 640px; text-align: center; }
.note-icon { font-size: 44px; margin-bottom: 22px; }
#note-overlay-text {
  font-size: clamp(19px, 3.4vw, 27px);
  line-height: 1.9;
  color: #e8e6df;
  letter-spacing: 2px;
  font-weight: 600;
}
@keyframes note-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes note-fade-out { from { opacity: 1; } to { opacity: 0; } }

/* ---------- 页脚 ---------- */
.footer { text-align: center; color: var(--mut); font-size: 12px; padding: 20px; border-top: 1px solid var(--line); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
