:root {
  color: #192e29;
  background: #f3f1e8;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  font-size: 15px;
  --ink: #192e29;
  --muted: #53645b;
  --teal: #21574a;
  --line: #d4d8cb;
  --paper: #fffcf4;
  --serif: "Noto Serif CJK SC", "Songti SC", "SimSun", serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .56; }
:focus-visible { outline: 3px solid #a36926; outline-offset: 3px; }
h1, h2, h3, p, dl, dd { margin: 0; }

.shell { width: min(1184px, 100% - 56px); margin: 0 auto; }
.masthead { background: #17332d; color: #f5f0db; }
.header-inner, .header-actions, .section-title {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.header-inner { min-height: 63px; }
.wordmark { color: inherit; text-decoration: none; font-weight: 700; letter-spacing: .13em; }
.wordmark span { margin-left: 12px; padding-left: 12px; border-left: 1px solid #819789; font-weight: 400; }
.connection { color: #c5d6cc; font-size: .83rem; }
.connection[data-online="true"]::before { content: "●"; color: #8ed9b2; margin-right: 7px; }
.hero {
  display: grid; grid-template-columns: minmax(375px, 1fr) 1fr; overflow: hidden;
  background: #163931; color: #f8f4e4; margin: 28px 0 27px; min-height: 277px;
  border-radius: 5px; border: 1px solid #244439; box-shadow: 0 12px 32px #243a2915;
}
.hero-copy { padding: 29px 31px 27px; }
.hero-map { min-width: 0; background: linear-gradient(90deg, #163931, #16393100 40%), url("/map.webp") center 49% / cover; }
.location { color: #d8be82; font-size: .85rem; letter-spacing: .16em; }
h1 { font: 700 clamp(2.15rem, 4.3vw, 3.3rem)/1.15 var(--serif); margin: 10px 0 12px; letter-spacing: .07em; }
#hero-description { max-width: 470px; line-height: 1.65; color: #d0ded3; }
.hero-link { display: inline-block; color: #f3d892; margin-top: 8px; }
.role-select, .account { display: flex; gap: 12px; margin-top: 23px; }
button {
  border: 1px solid transparent; padding: 8px 14px; min-height: 38px; border-radius: 4px;
  background: var(--teal); color: #fffdf0; font-weight: 700;
}
button:hover:enabled { filter: brightness(1.13); }
.hero button { background: #e6c980; color: #1c3228; }
.hero .outline { background: #24463b; color: #f4e8c7; border-color: #9aaf99; }
.role-select small { display: block; font-weight: 400; margin-top: 3px; }
.role-select:has(.invite-entry:not([hidden])) { flex-wrap: wrap; }
.invite-entry { display: grid; gap: 4px; flex-basis: 100%; }
.invite-entry input { width: min(100%, 290px); }
.text-button { background: transparent; color: var(--teal); padding: 4px 8px; }
.masthead .text-button { color: #f3d892; }
.account { gap: 21px; flex-wrap: wrap; }
.account div { border-left: 1px solid #7a9384; padding-left: 10px; }
.account dt { color: #c7d6ca; font-size: .77rem; }
.account dd { font-size: 1.2rem; margin-top: 5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.notice-wrap { display: flex; align-items: center; gap: 8px; padding: 8px 12px; margin-bottom: 16px; border-left: 3px solid #368366; background: #e5ede2; }
.notice-wrap[data-error="true"] { border-color: #9c5932; background: #f6e6d8; }
.world { display: grid; grid-template-columns: minmax(0, 1.77fr) minmax(280px, 1fr); gap: 26px; padding-bottom: 36px; }
.section-title { min-height: 37px; margin-bottom: 10px; border-bottom: 1px solid #acb9a8; }
.section-title span { color: var(--muted); font-size: .82rem; }
h2 { font: 700 1.42rem/1.35 var(--serif); }
h3 { font-size: 1rem; line-height: 1.35; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: 5px; }
.entry { display: flex; justify-content: space-between; gap: 12px; align-items: end; flex-wrap: wrap; padding: 15px; margin-bottom: 10px; }
.card p, .contract p { color: var(--muted); font-size: .85rem; margin-top: 5px; line-height: 1.55; }
.inline-form { display: flex; align-items: end; flex-wrap: wrap; gap: 8px; }
.inline-form label { display: grid; gap: 3px; font-size: .78rem; }
input { border: 1px solid #929f91; color: var(--ink); background: #fffef9; border-radius: 4px; min-height: 38px; padding: 5px 7px; width: 76px; }
.subhead { margin: 19px 0 9px; }
.contract-list { display: grid; gap: 7px; }
.contract { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 12px 15px; }
.contract strong, .npc strong, .ledger strong { font-variant-numeric: tabular-nums; }
.contract .outline { border-color: #98a998; color: var(--teal); background: #f5f8ee; }
.status { color: #275746; display: inline-block; border-left: 2px solid #83a591; padding-left: 7px; margin-right: 9px; font-size: .8rem; }
.status[data-status="scheduled"] { color: #78521e; border-color: #c4944c; }
.status[data-status="cancelled"], .status[data-status="expired"] { color: var(--muted); border-color: #a5aba0; }
.empty { color: var(--muted); padding: 14px 15px; font-size: .87rem; }
.sidebar { display: grid; gap: 20px; align-content: start; }
.npc { padding: 15px; }
.npc-total { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin: 10px 0; }
.npc-total strong { color: var(--teal); font-size: 1.42rem; }
.npc-total span { color: var(--muted); font-size: .83rem; }
.ledger { list-style: none; margin: 0; padding: 0; max-height: 365px; overflow: auto; }
.ledger li { padding: 11px 13px; }
.ledger li + li { border-top: 1px solid var(--line); }
.ledger li div { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 5px 12px; }
.ledger small { display: block; margin-top: 3px; color: var(--muted); line-height: 1.4; }
.positive { color: #235f46; }
.negative { color: #963e28; }

@media (max-width: 810px) {
  .shell { width: calc(100% - 32px); }
  .hero { grid-template-columns: minmax(320px, 1fr) .55fr; }
  .world { grid-template-columns: minmax(0, 1fr) minmax(245px, .7fr); gap: 14px; }
}
@media (max-width: 620px) {
  .shell { width: calc(100% - 24px); }
  .hero, .world { grid-template-columns: minmax(0, 1fr); }
  .hero { margin-top: 15px; min-height: 0; }
  .hero-copy { padding: 21px 16px; }
  .hero-map { min-height: 99px; background-image: linear-gradient(180deg, #163931, #16393100 55%), url("/map.webp"); }
  .wordmark { letter-spacing: 0; }
  .wordmark span { margin-left: 5px; padding-left: 5px; }
  .header-inner, .header-actions { gap: 5px; }
  .connection { text-align: right; }
  .account { gap: 10px; }
  .account dd { font-size: 1.05rem; }
}
