/* 《科员模拟器》v0.1 样式 —— 公文纸质感 + 藏青 / 印章红 */
:root {
  --ink: #1f3a5f;
  --ink-2: #2c4a70;
  --ink-soft: rgba(31, 58, 95, 0.72);
  --paper: #f4eee2;
  --paper-2: #fffdf7;
  --paper-3: #faf6ec;
  --red: #c8102e;
  --red-soft: rgba(200, 16, 46, 0.78);
  --gold: #a98b55;
  --green: #3f7d5a;
  --amber: #b7791f;
  --muted: #7c7468;
  --line: rgba(31, 58, 95, 0.14);
  --line-strong: rgba(31, 58, 95, 0.28);
  --shadow: 0 2px 0 rgba(31, 58, 95, 0.06), 0 12px 30px -18px rgba(31, 58, 95, 0.45);
  --serif: "Songti SC", "STSong", "Noto Serif SC", "SimSun", serif;
  --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: "SF Mono", "Menlo", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--sans);
  color: #2f2a24;
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 12% 4%, rgba(200, 16, 46, 0.05), transparent 42%),
    radial-gradient(circle at 88% 0%, rgba(31, 58, 95, 0.07), transparent 45%),
    repeating-linear-gradient(0deg, rgba(31, 58, 95, 0.022) 0 1px, transparent 1px 28px);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

.app {
  min-height: 100vh;
}

button {
  font-family: inherit;
  cursor: pointer;
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

/* ---------- 通用 ---------- */

.btn {
  border: 1px solid var(--line-strong);
  background: var(--paper-2);
  color: var(--ink);
  font-size: 15px;
  padding: 10px 20px;
  border-radius: 8px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  box-shadow: 0 1px 0 rgba(31, 58, 95, 0.08);
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn.primary {
  background: var(--ink);
  border-color: var(--ink);
  color: #f7f2e8;
}

.btn.primary:hover { background: var(--ink-2); }

.btn.ghost {
  background: transparent;
  border-color: var(--line-strong);
}

.btn.wide { width: 100%; margin-top: 10px; }

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.link {
  border: 0;
  background: none;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 14px;
  padding: 4px;
}

.muted { color: var(--muted); }

.fineprint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.8;
  margin: 18px 0 0;
}

/* ---------- 首页 ---------- */

.landing {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 18px;
}

.hero {
  width: min(560px, 100%);
  text-align: center;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 48px 34px 34px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(200, 16, 46, 0.2);
  border-radius: 10px;
  pointer-events: none;
}

.seal-big {
  width: 84px;
  height: 84px;
  margin: 0 auto 18px;
  border: 3px solid var(--red-soft);
  border-radius: 50%;
  color: var(--red);
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotate(-6deg);
  box-shadow: inset 0 0 0 4px rgba(200, 16, 46, 0.08);
  letter-spacing: 2px;
}

.hero h1 {
  font-family: var(--serif);
  font-size: clamp(30px, 6vw, 40px);
  letter-spacing: 4px;
  margin: 0 0 6px;
  color: var(--ink);
  font-weight: 700;
}

.hero .sub {
  margin: 0;
  color: var(--red);
  font-size: 13px;
  letter-spacing: 3px;
}

.tagline {
  margin: 22px auto 28px;
  color: #4a443b;
  font-size: 15px;
  line-height: 1.9;
  max-width: 400px;
}

.newbox {
  display: flex;
  gap: 10px;
  max-width: 380px;
  margin: 0 auto;
}

.newbox input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line-strong);
  background: var(--paper-3);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 15px;
  color: var(--ink);
  font-family: var(--sans);
}

.newbox input::placeholder { color: #a49c8e; }

.save-line {
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--muted);
}

.landing-actions { margin-top: 14px; }

/* ---------- 顶栏 ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 10px clamp(14px, 3vw, 28px);
  background: rgba(250, 246, 236, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--ink);
  box-shadow: 0 1px 0 rgba(200, 16, 46, 0.5);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.seal-mini {
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 2px solid var(--red-soft);
  border-radius: 50%;
  color: var(--red);
  font-family: var(--serif);
  font-weight: 700;
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotate(-6deg);
}

.seal-mini.big {
  width: 60px;
  height: 60px;
  font-size: 26px;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.brand-text strong { font-family: var(--serif); font-size: 17px; letter-spacing: 1px; color: var(--ink); white-space: nowrap; }
.brand-text small { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.hud {
  display: flex;
  gap: 22px;
  margin-left: auto;
  flex-wrap: wrap;
}

.hud-item { display: flex; flex-direction: column; line-height: 1.35; }
.hud-label { font-size: 10px; letter-spacing: 1px; color: var(--muted); }
.hud-item strong { font-size: 14px; color: var(--ink); font-weight: 600; white-space: nowrap; }
.hud-item .rank-name { color: var(--red); }

.top-actions { display: flex; gap: 6px; }
.ghost.small {
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink-soft);
}
.ghost.small:hover { background: rgba(31, 58, 95, 0.06); }

/* ---------- 主布局 ---------- */

.layout {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr) 286px;
  gap: 16px;
  align-items: start;
  max-width: 1360px;
  margin: 0 auto;
  padding: 18px clamp(12px, 2vw, 24px) 60px;
}

.panel {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 16px 16px 18px;
  animation: rise 0.35s ease both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 2px 0 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.panel-head h3 {
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 2px;
  margin: 0;
  color: var(--ink);
  font-weight: 700;
}

.panel-head .muted { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 属性 */

.attr-list { display: flex; flex-direction: column; gap: 9px; }

.attr-row .attr-top {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: #4a443b;
  margin-bottom: 3px;
}

.attr-row .attr-top b { font-family: var(--mono); font-weight: 600; color: var(--ink); }
.attr-row.low .attr-top b { color: var(--red); }

.bar {
  height: 7px;
  background: rgba(31, 58, 95, 0.09);
  border-radius: 99px;
  overflow: hidden;
}

.bar.small { height: 5px; }

.bar > i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #4d6d92, var(--ink));
  transition: width 0.4s ease;
}

.bar.perf > i { background: linear-gradient(90deg, var(--gold), #c9a86a); }
.attr-row.low .bar > i { background: linear-gradient(90deg, #d05555, var(--red)); }

.risk-box {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--line-strong);
}

.risk-line {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  margin-bottom: 6px;
  color: #4a443b;
}

.risk { font-size: 13px; }
.risk.safe { color: var(--green); }
.risk.watch { color: var(--amber); }
.risk.warn { color: #c46a12; }
.risk.high { color: #c0392b; }
.risk.danger { color: var(--red); }

.risk-meter {
  height: 6px;
  background: rgba(31, 58, 95, 0.09);
  border-radius: 99px;
  overflow: hidden;
}

.risk-meter > i { display: block; height: 100%; transition: width 0.4s ease; }
.risk-meter > i.safe { background: var(--green); }
.risk-meter > i.watch { background: var(--amber); }
.risk-meter > i.warn { background: #c46a12; }
.risk-meter > i.high { background: #c0392b; }
.risk-meter > i.danger { background: var(--red); }

.risk-hint { font-size: 11px; color: var(--muted); margin-top: 8px; line-height: 1.6; }

/* 中间区 */

.center { padding: 18px; }

.turn-head {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.ap-box { min-width: 150px; }

.ap-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 12.5px;
  color: #4a443b;
}

.ap-line strong {
  font-family: var(--serif);
  font-size: 30px;
  color: var(--ink);
  line-height: 1;
}

.ap-line small { font-size: 14px; color: var(--muted); font-family: var(--sans); }

.ap-dots { display: flex; gap: 5px; margin-top: 8px; }

.ap-dots i {
  width: 16px;
  height: 6px;
  border-radius: 99px;
  background: rgba(31, 58, 95, 0.14);
}

.ap-dots i.on { background: var(--red); }

.energy-box { flex: 1; min-width: 190px; max-width: 340px; }

.mini-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  margin: 6px 0 3px;
}

.btn.end {
  margin-left: auto;
  background: var(--ink);
  color: #f7f2e8;
  border: 1px solid var(--ink);
  font-size: 14px;
  padding: 11px 20px;
  border-radius: 8px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn.end:hover { transform: translateY(-1px); box-shadow: var(--shadow); }

.section-label {
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--muted);
  margin: 18px 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.action {
  position: relative;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 2px 10px;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--paper-3);
  border-radius: 9px;
  padding: 10px 12px;
  transition: transform 0.13s ease, box-shadow 0.13s ease, border-color 0.13s ease, background 0.13s ease;
}

.action:hover:not(.disabled) {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  background: #fffef9;
  box-shadow: 0 8px 18px -14px rgba(31, 58, 95, 0.6);
}

.a-icon {
  grid-row: span 2;
  font-size: 21px;
  line-height: 1.4;
  align-self: center;
}

.a-main { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }

.a-name { font-size: 14px; font-weight: 600; color: var(--ink); }

.a-cost { font-size: 10.5px; color: var(--muted); white-space: nowrap; font-family: var(--mono); }

.a-desc {
  font-size: 11.5px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.4);
}

/* 日志 */

.log-box { margin-top: 4px; }

.log {
  max-height: 260px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-right: 6px;
}

.log-item {
  display: flex;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 6px;
  font-size: 12.5px;
  line-height: 1.55;
  border-left: 2px solid transparent;
}

.log-item:nth-child(odd) { background: rgba(31, 58, 95, 0.025); }

.log-time {
  flex: 0 0 74px;
  color: #a49c8e;
  font-family: var(--mono);
  font-size: 10.5px;
  padding-top: 2px;
}

.log-text { flex: 1; color: #4a443b; }

.log-item.story { border-left-color: var(--gold); }
.log-item.story .log-text { font-family: var(--serif); color: #3a362f; }
.log-item.warn { border-left-color: var(--red); background: rgba(200, 16, 46, 0.04) !important; }
.log-item.promo { border-left-color: var(--green); background: rgba(63, 125, 90, 0.055) !important; }
.log-item.promo .log-text { color: #2f5d43; }

.log-empty { color: var(--muted); font-size: 12.5px; padding: 10px 4px; }

/* 侧栏 */

.records { display: flex; flex-direction: column; gap: 6px; }

.rec-row {
  display: grid;
  grid-template-columns: 64px 60px 1fr;
  gap: 8px;
  align-items: baseline;
  font-size: 12px;
  color: #4a443b;
  padding: 5px 0;
  border-bottom: 1px dashed var(--line);
}

.rec-row em { font-style: normal; color: var(--muted); text-align: right; font-family: var(--mono); font-size: 11px; }
.rec-row b { font-size: 12px; color: var(--ink); }
.rec-row b.grade.good { color: var(--green); }
.rec-row b.grade.bad { color: var(--red); }
.rec-row.promo { grid-template-columns: 64px 42px 1fr; background: rgba(63, 125, 90, 0.05); }
.rec-divider { font-size: 11px; color: var(--muted); margin: 8px 0 2px; letter-spacing: 1px; }
.rec-empty { font-size: 12px; color: var(--muted); padding: 4px 0; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.stat-grid > div {
  background: var(--paper-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 6px;
  text-align: center;
}

.stat-grid b { display: block; font-family: var(--serif); font-size: 19px; color: var(--ink); line-height: 1.3; }
.stat-grid span { font-size: 10.5px; color: var(--muted); }

.tips p {
  font-size: 12px;
  color: #55503f;
  margin: 0 0 7px;
  padding-left: 12px;
  position: relative;
  line-height: 1.65;
}

.tips p::before {
  content: "·";
  position: absolute;
  left: 2px;
  color: var(--red);
  font-weight: 700;
}

.save-state {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 10.5px;
  color: #a49c8e;
  text-align: center;
}

/* ---------- 弹窗 ---------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(24, 32, 44, 0.58);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  animation: fade 0.2s ease both;
}

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: min(620px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--paper-2);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.7);
  padding: 26px 26px 24px;
  position: relative;
  animation: pop 0.22s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

@keyframes pop {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(31, 58, 95, 0.08);
  border-radius: 9px;
  pointer-events: none;
}

.modal h2 {
  font-family: var(--serif);
  font-size: clamp(21px, 4vw, 26px);
  letter-spacing: 1px;
  margin: 12px 0 16px;
  color: var(--ink);
  line-height: 1.4;
}

.evt-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tag {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 1px;
  padding: 3px 10px;
  border-radius: 99px;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  background: rgba(31, 58, 95, 0.05);
}

.tag.lv-daily { color: var(--green); border-color: rgba(63, 125, 90, 0.4); background: rgba(63, 125, 90, 0.07); }
.tag.lv-dept { color: var(--amber); border-color: rgba(183, 121, 31, 0.4); background: rgba(183, 121, 31, 0.07); }
.tag.lv-global { color: var(--red); border-color: rgba(200, 16, 46, 0.4); background: rgba(200, 16, 46, 0.06); }
.tag.lv-story { color: var(--ink); border-color: var(--ink); background: rgba(31, 58, 95, 0.08); }

.evt-date { font-size: 11.5px; color: var(--muted); font-family: var(--mono); }

.evt-text {
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.95;
  color: #3a362f;
  margin: 4px 0 20px;
  padding: 14px 16px;
  background: var(--paper-3);
  border-left: 3px solid var(--gold);
  border-radius: 0 8px 8px 0;
}

.evt-text.result-text { border-left-color: var(--ink); }

.evt-options { display: flex; flex-direction: column; gap: 9px; }

.opt {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
  border: 1px solid var(--line);
  background: var(--paper-3);
  border-radius: 9px;
  padding: 12px 14px;
  font-size: 14px;
  color: #3a362f;
  transition: transform 0.13s ease, border-color 0.13s ease, background 0.13s ease, box-shadow 0.13s ease;
}

.opt:hover {
  transform: translateX(3px);
  border-color: var(--ink);
  background: #fffef9;
  box-shadow: 0 10px 22px -18px rgba(31, 58, 95, 0.8);
}

.opt-idx {
  flex: 0 0 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.opt-text { flex: 1; line-height: 1.6; }

.changes {
  font-size: 12px;
  color: var(--ink);
  background: rgba(31, 58, 95, 0.05);
  border-radius: 6px;
  padding: 8px 12px;
  margin: 0 0 16px;
  font-family: var(--mono);
  line-height: 1.7;
}

/* 结算 */

.report-money {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--ink);
  margin-bottom: 14px;
}

.report-money span {
  background: rgba(31, 58, 95, 0.05);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 4px 12px;
}

.report-notes {
  font-size: 13px;
  color: #4a443b;
  margin-bottom: 8px;
}

.report-notes p { margin: 0 0 6px; }

.report-block {
  margin: 14px 0;
  padding: 12px 14px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--paper-3);
}

.report-block .block-title {
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: 1px;
  color: var(--ink);
  margin-bottom: 4px;
}

.report-block p { margin: 4px 0 0; font-size: 12.5px; color: #55503f; line-height: 1.7; }
.block-line { font-size: 12px; color: var(--muted); font-family: var(--mono); }

.report-block.assess.good { border-color: rgba(63, 125, 90, 0.4); background: rgba(63, 125, 90, 0.06); }
.report-block.assess.good .block-title { color: var(--green); }
.report-block.assess.bad { border-color: rgba(200, 16, 46, 0.35); background: rgba(200, 16, 46, 0.05); }
.report-block.assess.bad .block-title { color: var(--red); }

.report-block.promo { border-color: rgba(169, 139, 85, 0.6); background: rgba(169, 139, 85, 0.08); }
.report-block.promo .block-title { color: #8a6f3d; }

.report-block.warn { border-color: rgba(200, 16, 46, 0.5); background: rgba(200, 16, 46, 0.07); }
.report-block.warn .block-title { color: var(--red); }

/* 帮助 */

.help-body p {
  font-size: 13.5px;
  color: #4a443b;
  margin: 0 0 12px;
  line-height: 1.85;
}

.help-body b { color: var(--ink); }

/* ---------- 结局 ---------- */

.ending-screen {
  min-height: 100vh;
  padding: 40px 16px 60px;
  display: flex;
  justify-content: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(200, 16, 46, 0.08), transparent 55%),
    linear-gradient(180deg, #1d2b3d 0%, #24384f 48%, #1b2738 100%);
}

.ending-card {
  width: min(720px, 100%);
  background: var(--paper-2);
  border-radius: 16px;
  box-shadow: 0 40px 100px -40px rgba(0, 0, 0, 0.9);
  padding: 40px 38px 32px;
  position: relative;
  animation: rise 0.55s ease both;
}

.ending-card::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(200, 16, 46, 0.22);
  border-radius: 10px;
  pointer-events: none;
}

.ending-head { display: flex; gap: 18px; align-items: center; }

.ending-titles { flex: 1; }

.ending-kicker {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--muted);
  text-transform: uppercase;
}

.ending-kicker.bad { color: var(--red); }
.ending-kicker.good { color: var(--green); }

.ending-card h1 {
  font-family: var(--serif);
  font-size: clamp(26px, 5vw, 36px);
  letter-spacing: 2px;
  color: var(--ink);
  margin: 2px 0 4px;
  line-height: 1.35;
}

.ending-sub { margin: 0; font-size: 13px; color: var(--muted); letter-spacing: 1px; }

.ending-desc {
  font-family: var(--serif);
  font-size: 16px;
  line-height: 2;
  color: #3a362f;
  margin: 22px 0;
  padding: 16px 18px;
  background: var(--paper-3);
  border-left: 3px solid var(--red);
  border-radius: 0 8px 8px 0;
}

.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }

.tag-chip {
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 99px;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  background: rgba(31, 58, 95, 0.05);
}

.ending-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 24px;
}

.ending-stats > div {
  text-align: center;
  background: var(--paper-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 4px;
}

.ending-stats b { display: block; font-family: var(--serif); font-size: 19px; color: var(--ink); line-height: 1.3; }
.ending-stats span { font-size: 10px; color: var(--muted); }

.poster-wrap {
  display: flex;
  justify-content: center;
  margin: 4px 0 22px;
  padding: 14px;
  background: rgba(31, 58, 95, 0.035);
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
}

.poster-wrap canvas {
  display: block;
  width: 100%;
  max-width: 420px;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 18px 40px -24px rgba(0, 0, 0, 0.55);
}

.ending-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.ending-actions .btn { min-width: 132px; }

.ending-card .fineprint { text-align: center; }

/* ---------- Toast / 错误 ---------- */

#toast-root {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.toast {
  background: rgba(31, 58, 95, 0.94);
  color: #f7f2e8;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 99px;
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  max-width: calc(100vw - 40px);
  text-align: center;
}

.toast.show { opacity: 1; transform: translateY(0); }
.toast.warn { background: rgba(160, 24, 42, 0.95); }

.err-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
  background: #7a1020;
  color: #fff;
  font-size: 12px;
  padding: 8px 14px;
  text-align: center;
}

/* ---------- 滚动条 ---------- */

.log::-webkit-scrollbar,
.modal::-webkit-scrollbar { width: 8px; }
.log::-webkit-scrollbar-thumb,
.modal::-webkit-scrollbar-thumb { background: rgba(31, 58, 95, 0.2); border-radius: 99px; }

/* ---------- v0.2 动态局面 ---------- */

.worldbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 7px clamp(14px, 3vw, 28px);
  background: var(--paper-3);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  flex-wrap: wrap;
}

.world-chips { display: flex; gap: 6px; flex-wrap: wrap; }

.wchip {
  border: 1px solid var(--line);
  background: var(--paper-2);
  border-radius: 99px;
  padding: 2px 10px;
  color: var(--ink);
  white-space: nowrap;
  font-size: 11.5px;
}

.wchip b { color: var(--muted); font-weight: 500; margin-right: 4px; font-size: 10px; }

.wchip.mode { border-color: rgba(200, 16, 46, 0.35); color: var(--red); background: rgba(200, 16, 46, 0.04); }

.news-line {
  flex: 1;
  min-width: 200px;
  color: #55503f;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11.5px;
}

.news-tag {
  display: inline-block;
  background: var(--ink);
  color: #f7f2e8;
  font-size: 10px;
  padding: 1px 7px;
  border-radius: 99px;
  margin-right: 8px;
  vertical-align: 1px;
}

/* ---------- v0.2 标签页 ---------- */

.tabs {
  display: flex;
  gap: 2px;
  margin-top: 14px;
  border-bottom: 1px solid var(--line);
}

.tab {
  position: relative;
  border: 0;
  background: transparent;
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: 2px;
  color: var(--muted);
  padding: 9px 18px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, background 0.15s ease;
}

.tab:hover { background: rgba(31, 58, 95, 0.04); color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--red); font-weight: 700; }
.tab em { font-style: normal; font-size: 10px; background: var(--red); color: #fff; border-radius: 99px; padding: 0 5px; margin-left: 5px; vertical-align: 2px; font-family: var(--sans); letter-spacing: 0; }
.lock-mini { font-size: 10px; margin-left: 4px; opacity: 0.7; }

.tab-body { padding-top: 4px; min-height: 140px; }

/* 属性上限 / 管理威信 */

.attr-top .cap { font-size: 9.5px; color: #a49c8e; font-family: var(--mono); margin-left: 2px; }
.attr-top .cap.at-cap { color: var(--red); }

.mgmt-row {
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px dashed var(--line);
}

.mgmt-top { display: flex; justify-content: space-between; font-size: 12.5px; color: #4a443b; margin-bottom: 3px; }
.mgmt-top b { font-family: var(--mono); color: var(--green); }
.mgmt-label { font-size: 10.5px; color: var(--muted); margin-top: 3px; }
.bar.mgmt > i { background: linear-gradient(90deg, #6f9b7f, var(--green)); }

/* 锁定行动 */

.action.locked { opacity: 0.58; border-style: dashed; }
.action.locked .a-icon { filter: grayscale(1); }

.btn.small { font-size: 12px; padding: 7px 11px; }
.btn.small small { font-size: 10px; color: var(--muted); font-weight: 400; }

/* 未解锁管理页 */

.locked-panel {
  text-align: center;
  padding: 26px 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: var(--paper-3);
}

.lock-icon { font-size: 26px; margin-bottom: 8px; opacity: 0.6; }
.locked-panel h3 { font-family: var(--serif); color: var(--ink); margin: 0 0 8px; letter-spacing: 1px; }
.locked-panel p { font-size: 13px; color: #55503f; line-height: 1.8; max-width: 520px; margin: 0 auto; }
.locked-panel b { color: var(--red); }

.unlock-list {
  margin: 18px auto 0;
  max-width: 520px;
  text-align: left;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
}

.unlock-title { font-size: 11px; letter-spacing: 1px; color: var(--muted); margin-bottom: 4px; }
.unlock-list ul { margin: 0; padding-left: 18px; }
.unlock-list li { font-size: 12px; color: #55503f; line-height: 1.8; }
.unlock-list b { color: var(--ink); }

/* 团队 */

.team-head {
  display: flex;
  gap: 16px;
  align-items: stretch;
  flex-wrap: wrap;
  padding: 4px 0 6px;
}

.mgmt-box { flex: 1; min-width: 220px; }
.mgmt-title { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; color: #4a443b; margin-bottom: 5px; }
.mgmt-title b { font-family: var(--serif); font-size: 26px; color: var(--green); line-height: 1; }
.mgmt-title em { font-style: normal; font-size: 11px; color: var(--muted); }
.mgmt-desc { font-size: 10.5px; color: var(--muted); margin-top: 6px; line-height: 1.6; }

.team-ops { display: flex; flex-direction: column; gap: 6px; justify-content: center; }

.sub-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.sub-card {
  border: 1px solid var(--line);
  background: var(--paper-3);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sub-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.sub-name b { font-family: var(--serif); font-size: 16px; color: var(--ink); }
.sub-trait {
  font-size: 10px;
  color: var(--ink);
  background: rgba(31, 58, 95, 0.07);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 1px 7px;
  margin-left: 6px;
  white-space: nowrap;
}
.sub-task-label { font-size: 10px; color: var(--muted); white-space: nowrap; }
.sub-desc { font-size: 11px; color: var(--muted); line-height: 1.6; }

.sub-bars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sub-bar-top { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); margin-bottom: 3px; }
.sub-bar-top b { color: var(--ink); font-family: var(--mono); font-weight: 600; }
.bar.small > i.bad { background: linear-gradient(90deg, #d05555, var(--red)); }

.sub-diligence { font-size: 10px; color: var(--muted); }

.sub-tasks { display: flex; flex-wrap: wrap; gap: 4px; }

.task-chip {
  font-size: 10.5px;
  border: 1px solid var(--line);
  background: var(--paper-2);
  color: #4a443b;
  border-radius: 99px;
  padding: 3px 8px;
  transition: background 0.13s ease, color 0.13s ease, border-color 0.13s ease;
}

.task-chip:hover { border-color: var(--ink); }
.task-chip.active { background: var(--ink); border-color: var(--ink); color: #f7f2e8; }

.sub-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 2px; }

.mini-btn {
  font-size: 11.5px;
  border: 1px solid var(--line-strong);
  background: var(--paper-2);
  color: var(--ink);
  border-radius: 6px;
  padding: 5px 9px;
  transition: background 0.13s ease;
}

.mini-btn:hover:not(:disabled) { background: rgba(31, 58, 95, 0.06); }
.mini-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.mini-btn small { font-size: 9.5px; color: var(--muted); }
.mini-hint { font-size: 10px; color: #a49c8e; }

.sub-empty {
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  padding: 18px;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
  background: var(--paper-3);
}

.team-hint {
  margin-top: 12px;
  padding: 10px 12px;
  background: rgba(31, 58, 95, 0.035);
  border-radius: 8px;
  border-left: 2px solid var(--gold);
}

.team-hint p { margin: 0 0 5px; font-size: 11px; color: #6b6458; line-height: 1.7; }
.team-hint p:last-child { margin-bottom: 0; }

/* 团队侧栏 */

.team-mini { display: flex; flex-direction: column; gap: 6px; padding-bottom: 4px; }
.team-mini-label { font-size: 10.5px; color: var(--muted); margin-top: 2px; }

/* 生活 */

.assets-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 4px;
}

.asset {
  border: 1px solid var(--line);
  background: var(--paper-3);
  border-radius: 9px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.asset span { font-size: 17px; }
.asset b { font-family: var(--serif); font-size: 13.5px; color: var(--ink); }
.asset small { font-size: 10px; color: var(--muted); }

.link-btn {
  border: 0;
  background: none;
  padding: 0;
  color: var(--red);
  text-decoration: underline;
  font-size: 10px;
  font-family: var(--sans);
}

.life-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }

.life-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--line);
  background: var(--paper-3);
  border-radius: 9px;
  padding: 10px 12px;
}

.life-card.disabled { opacity: 0.55; }
.life-icon { font-size: 22px; line-height: 1.3; }
.life-main { flex: 1; min-width: 0; }
.life-name { font-size: 13px; font-weight: 600; color: var(--ink); }
.life-name small { font-size: 10px; color: var(--muted); font-weight: 400; margin-left: 4px; }
.life-desc { font-size: 11px; color: var(--muted); line-height: 1.55; margin-top: 2px; }
.life-status { font-size: 10px; color: #a49c8e; margin-top: 4px; }
.life-card.disabled .life-status { color: var(--red); }
.life-card .mini-btn { flex: 0 0 auto; margin-top: 2px; }

/* 结算扩展 */

.report-money.extra { margin-top: -4px; }
.report-money.extra span { background: rgba(63, 125, 90, 0.06); border-color: rgba(63, 125, 90, 0.3); color: #2f5d43; }

.report-block.team { border-color: rgba(31, 58, 95, 0.3); background: rgba(31, 58, 95, 0.04); }
.report-block.world { border-color: rgba(169, 139, 85, 0.45); background: rgba(169, 139, 85, 0.06); }
.report-block.world .block-title { color: #8a6f3d; }
.unlock-note { color: var(--green) !important; }

/* 突发 */

.tag.lv-urgent {
  color: #fff;
  background: var(--red);
  border-color: var(--red);
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(200, 16, 46, 0.35); }
  50% { box-shadow: 0 0 0 5px rgba(200, 16, 46, 0); }
}

.modal.urgent-modal { border-color: rgba(200, 16, 46, 0.55); }
.modal.urgent-modal::before { border-color: rgba(200, 16, 46, 0.28); }
.modal.urgent-modal h2 { color: #9a1025; }

/* ---------- 响应式 ---------- */

@media (max-width: 1120px) {
  .layout { grid-template-columns: 250px minmax(0, 1fr) 250px; gap: 12px; }
  .hud { gap: 14px; }
}

@media (max-width: 940px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .layout .center { order: 1; }
  .layout .attrs { order: 2; }
  .layout .side { order: 3; }
  .topbar { flex-wrap: wrap; gap: 10px; }
  .hud { order: 3; width: 100%; margin-left: 0; justify-content: space-between; gap: 8px; }
  .top-actions { margin-left: auto; }
  .attr-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }
  .risk-box { grid-column: 1 / -1; }
  .ending-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .hero { padding: 40px 20px 28px; }
  .newbox { flex-direction: column; }
  .newbox .btn { width: 100%; }
  .topbar { padding: 8px 12px; }
  .brand-text strong { font-size: 15px; }
  .hud-item strong { font-size: 12.5px; }
  .layout { padding: 12px 10px 50px; }
  .panel { padding: 14px 13px 16px; }
  .modal { padding: 22px 16px 20px; max-height: 92vh; }
  .evt-text { font-size: 15px; padding: 12px 13px; }
  .actions { grid-template-columns: minmax(0, 1fr); }
  .turn-head { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .ap-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
  .energy-box { min-width: 0; max-width: none; }
  .btn.end { width: 100%; margin-left: 0; }
  .ending-card { padding: 30px 20px 24px; }
  .ending-head { gap: 12px; }
  .ending-desc { font-size: 15px; padding: 13px 14px; }
  .ending-actions { flex-direction: column; }
  .ending-actions .btn { width: 100%; }
  .attr-list { grid-template-columns: minmax(0, 1fr); }
  .log-time { flex-basis: 62px; }
  .poster-wrap { padding: 8px; }

  .worldbar { padding: 6px 12px; gap: 8px; }
  .news-line { min-width: 0; width: 100%; white-space: normal; line-height: 1.5; }
  .tab { padding: 8px 12px; font-size: 13px; letter-spacing: 1px; }
  .team-head { gap: 10px; }
  .team-ops { flex-direction: row; flex-wrap: wrap; }
  .sub-list { grid-template-columns: minmax(0, 1fr); }
  .life-grid { grid-template-columns: minmax(0, 1fr); }
  .assets-row { grid-template-columns: minmax(0, 1fr); }
  .ending-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- v0.3：职位 / 团队扩展 / 选项条件 ---------- */

.opt:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.opt:disabled:hover {
  transform: none;
  border-color: var(--line);
  background: var(--paper-3);
  box-shadow: none;
}

.opt-req {
  display: block;
  margin-top: 4px;
  font-size: 10.5px;
  color: var(--red);
  font-family: var(--sans);
}

.mgmt-title .cap { font-size: 10px; color: #8a8377; font-family: var(--mono); }

.cohesion-line {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: #4a443b;
  margin: 8px 0 3px;
}

.cohesion-line b { color: var(--green); font-family: var(--mono); }
.cohesion-line b.bad { color: var(--red); }
.bar.cohesion > i { background: linear-gradient(90deg, #8aa4c0, #4d6d92); }

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.project-card {
  border: 1px solid var(--line);
  background: var(--paper-3);
  border-radius: 9px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.project-card.disabled { opacity: 0.55; }
.project-name { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.project-name small { font-size: 10px; color: var(--muted); font-weight: 400; margin-left: 4px; }
.project-desc { font-size: 11px; color: var(--muted); line-height: 1.55; }
.project-fx { font-size: 10.5px; color: #6b6458; }
.project-card .mini-btn { align-self: flex-start; margin-top: 4px; }

.sub-label {
  font-size: 10px;
  color: #a49c8e;
  letter-spacing: 1px;
}

.role-chip { font-size: 10px; }
.sub-card.deputy { border-color: rgba(169, 139, 85, 0.6); box-shadow: inset 0 0 0 1px rgba(169, 139, 85, 0.15); }

.deputy-badge {
  font-size: 9.5px;
  color: #8a6f3d;
  border: 1px solid rgba(169, 139, 85, 0.5);
  background: rgba(169, 139, 85, 0.1);
  border-radius: 99px;
  padding: 1px 6px;
  margin-left: 6px;
  white-space: nowrap;
}

.mini-btn.danger { color: var(--red); border-color: rgba(200, 16, 46, 0.35); }
.mini-btn.danger:hover:not(:disabled) { background: rgba(200, 16, 46, 0.06); }

@media (max-width: 620px) {
  .project-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- v0.4：绩效百分比 / 事件分层 / 团队放松 ---------- */

.tier-chip {
  font-size: 10px;
  letter-spacing: 1px;
  padding: 2px 8px;
  border-radius: 99px;
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  margin-left: auto;
  margin-right: -4px;
}

.bar.perf > i.bad { background: linear-gradient(90deg, #d05555, var(--red)); }

.report-block.perf.good { border-color: rgba(63, 125, 90, 0.4); background: rgba(63, 125, 90, 0.06); }
.report-block.perf.good .block-title { color: var(--green); }
.report-block.perf.bad { border-color: rgba(200, 16, 46, 0.35); background: rgba(200, 16, 46, 0.05); }
.report-block.perf.bad .block-title { color: var(--red); }

.project-card.relax { border-color: rgba(63, 125, 90, 0.25); background: rgba(63, 125, 90, 0.04); }
.project-card.relax .project-name { color: #2f5d43; }
#poster { }

@media (max-width: 620px) {
  .tier-chip { display: none; }
}
