:root {
  color-scheme: dark;
  --ink: #eaf4f4;
  --muted: #8fa9ad;
  --deep: #06131c;
  --deep-2: #0a1e29;
  --panel: rgba(12, 34, 44, 0.84);
  --panel-line: rgba(164, 209, 207, 0.14);
  --teal: #35c1b5;
  --teal-soft: #8ce0d8;
  --gold: #ddb86a;
  --red: #d95f56;
  --paper: #f4f0e6;
  --paper-ink: #18262b;
  --paper-muted: #6d7775;
  --safe-start: 20%;
  --safe-width: 60%;
  --radius-lg: 22px;
  --radius-md: 14px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--deep);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  background:
    linear-gradient(rgba(68, 141, 146, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(68, 141, 146, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 20% -10%, #123d4b 0, transparent 38%),
    radial-gradient(circle at 95% 90%, #102e3a 0, transparent 35%),
    var(--deep);
  background-size: 28px 28px, 28px 28px, auto, auto, auto;
}

button,
dialog {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
[tabindex="0"]:focus-visible {
  outline: 3px solid rgba(53, 193, 181, 0.72);
  outline-offset: 3px;
}

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(90px);
  opacity: 0.18;
  pointer-events: none;
}

.ambient-a {
  top: 18%;
  left: -12rem;
  width: 30rem;
  height: 30rem;
  background: #1fa7a6;
}

.ambient-b {
  right: -10rem;
  bottom: -12rem;
  width: 34rem;
  height: 34rem;
  background: #1b5267;
}

.app-shell {
  width: min(1220px, calc(100% - 40px));
  min-height: 100vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.topbar {
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--panel-line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.brand-mark {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(140, 224, 216, 0.45);
  border-radius: 13px;
  color: var(--teal-soft);
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 1.45rem;
  font-weight: 700;
  background: rgba(31, 128, 126, 0.13);
  box-shadow: inset 0 0 18px rgba(53, 193, 181, 0.08);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.brand-copy strong {
  font-family: "STSong", "Songti SC", serif;
  font-size: 1.13rem;
  letter-spacing: 0.12em;
}

.brand-copy small {
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.04em;
}

.ghost-button,
.icon-button,
.text-button,
.trait-button,
.site-footer button {
  color: var(--ink);
  border: 0;
  cursor: pointer;
}

.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid var(--panel-line);
  border-radius: 11px;
  background: rgba(16, 44, 54, 0.54);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.ghost-button:hover {
  border-color: rgba(140, 224, 216, 0.35);
  background: rgba(22, 60, 71, 0.68);
  transform: translateY(-1px);
}

.game-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: clamp(28px, 4vw, 64px);
  padding: 40px 0 28px;
}

.status-panel {
  align-self: start;
  padding: 24px;
  border: 1px solid var(--panel-line);
  border-radius: var(--radius-lg);
  background: linear-gradient(155deg, rgba(15, 43, 53, 0.93), rgba(9, 27, 37, 0.9));
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2), inset 0 1px rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(20px);
}

.panel-heading,
.stage-heading,
.archive-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.eyebrow {
  margin: 0 0 5px;
  color: #75aaa9;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.15em;
}

.panel-heading h2,
.stage-heading h2,
.archive-head h2 {
  margin: 0;
  font-family: "STSong", "Songti SC", serif;
  font-size: 1.25rem;
  font-weight: 650;
}

.live-badge,
.risk-label {
  display: inline-flex;
  align-items: center;
  flex: none;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(53, 193, 181, 0.22);
  border-radius: 999px;
  color: var(--teal-soft);
  font-size: 0.74rem;
  background: rgba(53, 193, 181, 0.07);
}

.live-badge i {
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(53, 193, 181, 0.1);
}

.stat-list {
  display: grid;
  gap: 22px;
  margin-top: 29px;
}

.stat {
  --stat-color: var(--teal);
  position: relative;
}

.stat.warning {
  --stat-color: var(--gold);
}

.stat.danger {
  --stat-color: var(--red);
}

.stat-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.stat-copy > span {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #d8e7e6;
  font-size: 0.87rem;
}

.stat-icon {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(150, 196, 194, 0.17);
  border-radius: 8px;
  color: #9dc7c5;
  font-size: 0.69rem;
  font-style: normal;
  background: rgba(91, 144, 144, 0.08);
}

.stat-value {
  color: var(--stat-color);
  font: 600 0.95rem/1 ui-monospace, "SFMono-Regular", Consolas, monospace;
  transition: color 180ms ease;
}

.meter {
  position: relative;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #07161e;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.52);
}

.meter-safe {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--safe-start);
  width: var(--safe-width);
  background: rgba(80, 168, 160, 0.09);
}

.meter-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 50%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2b6970, var(--stat-color));
  background: linear-gradient(90deg, color-mix(in srgb, var(--stat-color) 55%, #2b6970), var(--stat-color));
  opacity: 0.42;
  transition: width 380ms cubic-bezier(.22,.7,.25,1), background 180ms ease;
}

.meter-marker {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  border: 2px solid #e5f2f0;
  border-radius: 50%;
  background: var(--stat-color);
  box-shadow: 0 0 0 3px rgba(7, 22, 30, 0.92), 0 0 16px rgba(53, 193, 181, 0.35);
  box-shadow: 0 0 0 3px rgba(7, 22, 30, 0.92), 0 0 16px color-mix(in srgb, var(--stat-color) 70%, transparent);
  transform: translate(-50%, -50%);
  transition: left 380ms cubic-bezier(.22,.7,.25,1), background 180ms ease;
}

.stat.preview-up .meter-marker,
.stat.preview-down .meter-marker {
  animation: previewPulse 750ms ease-in-out infinite alternate;
}

.stat.preview-up::after,
.stat.preview-down::after {
  position: absolute;
  top: 1px;
  right: 32px;
  color: var(--teal-soft);
  font-size: 0.72rem;
  font-weight: 800;
}

.stat.preview-up::after { content: "↑"; }
.stat.preview-down::after { content: "↓"; color: #e4a29b; }

@keyframes previewPulse {
  to { transform: translate(-50%, -50%) scale(1.24); }
}

.stat-foot {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  margin-top: 7px;
  color: #58777c;
  font-size: 0.61rem;
}

.stat-foot b {
  color: #668e90;
  font-weight: 600;
}

.director-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 27px;
  padding-top: 20px;
  border-top: 1px solid var(--panel-line);
}

.director-avatar,
.speaker-avatar {
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
  font-family: "STKaiti", "KaiTi", serif;
  font-weight: 700;
}

.director-avatar {
  width: 45px;
  height: 45px;
  color: #0c2b32;
  background: linear-gradient(145deg, #aee4db, #5cbab2);
  box-shadow: 0 7px 22px rgba(50, 175, 165, 0.13);
}

.director-card > div {
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2px 8px;
}

.director-kicker {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 0.68rem;
}

.director-card strong {
  font-family: "STSong", "Songti SC", serif;
  font-size: 0.98rem;
}

.trait-button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  color: var(--teal-soft);
  font-size: 0.68rem;
  background: none;
}

.trait-button i {
  width: 15px;
  height: 15px;
  display: inline-grid;
  place-items: center;
  border: 1px solid rgba(140, 224, 216, 0.25);
  border-radius: 50%;
  font-style: normal;
}

.trait-description {
  display: none;
  margin: 10px 0 0 57px;
  color: #8eaaaa;
  font-size: 0.71rem;
  line-height: 1.65;
}

.trait-description.open {
  display: block;
}

.decision-stage {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stage-heading {
  width: min(100%, 720px);
  margin-bottom: 16px;
}

.risk-label.warning {
  color: #f0cd83;
  border-color: rgba(221, 184, 106, 0.32);
  background: rgba(221, 184, 106, 0.08);
}

.risk-label.danger {
  color: #f0aaa3;
  border-color: rgba(217, 95, 86, 0.36);
  background: rgba(217, 95, 86, 0.09);
}

.card-zone {
  position: relative;
  width: min(100%, 720px);
  height: 430px;
  display: grid;
  place-items: center;
  perspective: 1100px;
}

.card-shadow,
.decision-card {
  position: absolute;
  width: min(100%, 558px);
  height: 382px;
  border-radius: 18px;
}

.card-shadow {
  border: 1px solid rgba(179, 210, 205, 0.1);
  background: rgba(21, 51, 60, 0.64);
}

.shadow-one {
  transform: translateY(10px) scale(0.965);
  opacity: 0.6;
}

.shadow-two {
  transform: translateY(21px) scale(0.925);
  opacity: 0.34;
}

.decision-card {
  z-index: 2;
  display: flex;
  flex-direction: column;
  padding: 29px 34px 25px;
  overflow: hidden;
  color: var(--paper-ink);
  border: 1px solid rgba(255, 255, 255, 0.66);
  background:
    linear-gradient(rgba(21, 48, 50, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 100% 30px, auto;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.34), 0 2px 2px rgba(0, 0, 0, 0.12);
  cursor: grab;
  touch-action: none;
  user-select: none;
  transform-origin: 50% 115%;
  transition: transform 210ms ease, opacity 210ms ease, box-shadow 180ms ease;
}

.decision-card:hover {
  box-shadow: 0 30px 78px rgba(0, 0, 0, 0.39), 0 2px 2px rgba(0, 0, 0, 0.12);
}

.decision-card.dragging {
  cursor: grabbing;
  transition: none;
}

.decision-card.exit-left {
  transform: translateX(-125%) rotate(-13deg) !important;
  opacity: 0;
}

.decision-card.exit-right {
  transform: translateX(125%) rotate(13deg) !important;
  opacity: 0;
}

.decision-card.entering {
  animation: cardEnter 320ms cubic-bezier(.2,.82,.28,1);
}

@keyframes cardEnter {
  from { opacity: 0; transform: translateY(28px) scale(0.965); }
  to { opacity: 1; transform: none; }
}

.memo-head,
.memo-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.memo-head {
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(25, 51, 53, 0.14);
}

.memo-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 4px;
  color: #2b6868;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: #d9e7e1;
}

.memo-number {
  color: var(--paper-muted);
  font: 0.7rem/1 ui-monospace, "SFMono-Regular", Consolas, monospace;
}

.speaker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
}

.speaker-avatar {
  width: 47px;
  height: 47px;
  color: #f5f2e9;
  font-size: 1.15rem;
  background: #315d61;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.12);
}

.speaker > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.speaker strong {
  font-family: "STSong", "Songti SC", serif;
  font-size: 1.04rem;
}

.speaker span:last-child {
  color: var(--paper-muted);
  font-size: 0.75rem;
}

blockquote {
  flex: 1;
  margin: 24px 0 18px;
  color: #20383b;
  font-family: "STSong", "Songti SC", serif;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  font-weight: 600;
  line-height: 1.88;
  letter-spacing: 0.025em;
}

.memo-footer {
  color: #798481;
  font-size: 0.65rem;
}

.confidential {
  padding: 2px 6px;
  border: 1px solid rgba(159, 63, 57, 0.35);
  border-radius: 3px;
  color: #a95049;
  font-weight: 700;
  letter-spacing: 0.16em;
  transform: rotate(-3deg);
}

.choice-preview {
  position: absolute;
  z-index: 3;
  top: 70px;
  max-width: 46%;
  padding: 9px 12px;
  border: 2px solid currentColor;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.84) rotate(-4deg);
  transition: opacity 90ms linear;
}

.choice-preview span {
  display: block;
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.choice-preview strong {
  display: block;
  margin-top: 3px;
  font-size: 0.75rem;
}

.choice-preview-left {
  left: 24px;
  color: #a74d46;
  transform: scale(0.84) rotate(-5deg);
}

.choice-preview-right {
  right: 24px;
  color: #207b74;
  text-align: right;
  transform: scale(0.84) rotate(5deg);
}

.decision-controls {
  width: min(100%, 720px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
  margin-top: 4px;
}

.decision-button {
  min-width: 0;
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 17px;
  border: 1px solid var(--panel-line);
  border-radius: var(--radius-md);
  color: var(--ink);
  cursor: pointer;
  background: rgba(13, 37, 47, 0.86);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.16);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.decision-button:hover {
  transform: translateY(-2px);
}

.decision-button.reject:hover {
  border-color: rgba(217, 95, 86, 0.4);
  background: rgba(83, 34, 35, 0.34);
}

.decision-button.approve {
  justify-content: flex-end;
  text-align: right;
}

.decision-button.approve:hover {
  border-color: rgba(53, 193, 181, 0.42);
  background: rgba(22, 76, 74, 0.4);
}

.decision-button > span:not(.button-arrow) {
  min-width: 0;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 3px;
}

.decision-button small {
  color: #78999c;
  font-size: 0.67rem;
}

.decision-button strong {
  overflow: hidden;
  font-size: 0.88rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.button-arrow {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: none;
  border: 1px solid var(--panel-line);
  border-radius: 10px;
  color: #a2c0c0;
  background: rgba(255, 255, 255, 0.025);
}

.control-hint {
  margin: 14px 0 0;
  color: #658287;
  font-size: 0.71rem;
}

kbd {
  min-width: 23px;
  display: inline-block;
  margin-right: 5px;
  padding: 3px 6px;
  border: 1px solid rgba(148, 187, 187, 0.15);
  border-bottom-color: rgba(148, 187, 187, 0.28);
  border-radius: 5px;
  color: #94b7b8;
  font: inherit;
  text-align: center;
  background: rgba(255, 255, 255, 0.03);
}

.site-footer {
  min-height: 57px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--panel-line);
  color: #5f7d81;
  font-size: 0.7rem;
}

.site-footer button {
  padding: 8px 0;
  color: #7f9ca0;
  background: none;
}

.site-footer button:hover {
  color: #d4e5e4;
}

.toast {
  position: fixed;
  z-index: 40;
  left: 50%;
  bottom: 28px;
  max-width: calc(100% - 32px);
  padding: 11px 16px;
  border: 1px solid rgba(140, 224, 216, 0.25);
  border-radius: 10px;
  color: #dff0ee;
  font-size: 0.78rem;
  background: rgba(7, 26, 34, 0.94);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.36);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 14px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

dialog {
  max-width: none;
  max-height: none;
  padding: 0;
  color: var(--ink);
  border: 0;
  background: transparent;
}

dialog::backdrop {
  background: rgba(2, 10, 15, 0.76);
  backdrop-filter: blur(10px);
}

.start-dialog,
.turnover-dialog,
.confirm-dialog {
  width: min(100% - 28px, 570px);
}

.appointment-letter,
.turnover-sheet,
.confirm-sheet {
  position: relative;
  overflow: hidden;
  padding: clamp(28px, 6vw, 48px);
  border: 1px solid rgba(225, 239, 235, 0.12);
  border-radius: 23px;
  background: linear-gradient(150deg, #102f3a, #091e29 72%);
  box-shadow: var(--shadow);
}

.appointment-letter::before,
.turnover-sheet::before {
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  content: "";
  background: linear-gradient(90deg, transparent, var(--teal), transparent);
}

.appointment-seal {
  position: absolute;
  top: 32px;
  right: 35px;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border: 2px solid rgba(217, 95, 86, 0.55);
  border-radius: 50%;
  color: rgba(237, 117, 107, 0.75);
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 1.65rem;
  font-weight: 800;
  transform: rotate(-9deg);
}

.appointment-letter h1 {
  margin: 19px 0 17px;
  font-family: "STSong", "Songti SC", serif;
  font-size: clamp(2rem, 8vw, 3.2rem);
  letter-spacing: 0.05em;
}

.opening-copy {
  max-width: 440px;
  margin: 0;
  color: #a8bec0;
  font-size: 0.92rem;
  line-height: 1.9;
}

.opening-rule {
  display: grid;
  grid-template-columns: 1fr 40px 1fr;
  align-items: center;
  gap: 12px;
  margin: 28px 0;
  color: #a8c5c5;
  font-size: 0.74rem;
}

.opening-rule span:last-child {
  text-align: right;
}

.opening-rule i {
  height: 1px;
  background: rgba(140, 224, 216, 0.24);
}

.primary-button,
.danger-button {
  width: 100%;
  min-height: 50px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.primary-button {
  color: #062024;
  background: linear-gradient(135deg, #8bded6, #42bcb2);
  box-shadow: 0 12px 30px rgba(53, 193, 181, 0.18);
}

.primary-button:hover {
  filter: brightness(1.05);
}

.text-button {
  width: 100%;
  margin-top: 8px;
  padding: 11px;
  color: #a5c2c2;
  background: none;
}

.appointment-letter > small {
  display: block;
  margin-top: 20px;
  color: #58767b;
  font-size: 0.66rem;
  text-align: center;
}

.ending-code {
  display: inline-flex;
  padding: 5px 9px;
  border: 1px solid rgba(217, 95, 86, 0.32);
  border-radius: 4px;
  color: #e4928b;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.ending-overline {
  margin: 25px 0 5px;
  color: #76979a;
  font-size: 0.75rem;
}

.turnover-sheet h2 {
  margin: 0 0 10px;
  font-family: "STSong", "Songti SC", serif;
  font-size: clamp(1.75rem, 6vw, 2.5rem);
}

#endingText {
  margin: 0;
  color: #a4bbbd;
  font-size: 0.88rem;
  line-height: 1.8;
}

.tenure-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 25px 0;
  overflow: hidden;
  border: 1px solid var(--panel-line);
  border-radius: 12px;
  background: var(--panel-line);
}

.tenure-summary div {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 10px;
  text-align: center;
  background: #0b2530;
}

.tenure-summary small,
.successor-preview small {
  color: #6d8c90;
  font-size: 0.64rem;
}

.tenure-summary strong {
  color: #d9e9e7;
  font-size: 0.87rem;
}

.successor-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 11px;
}

.successor-preview > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.inheritance-note {
  margin: 0 0 22px;
  padding: 12px 14px;
  border-left: 3px solid var(--gold);
  color: #9cb3b5;
  font-size: 0.75rem;
  line-height: 1.7;
  background: rgba(221, 184, 106, 0.06);
}

.archive-dialog {
  width: min(100%, 470px);
  height: 100%;
  margin: 0 0 0 auto;
}

.archive-dialog[open] {
  animation: drawerIn 220ms ease-out;
}

@keyframes drawerIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.archive-sheet {
  min-height: 100%;
  padding: 31px;
  border-left: 1px solid var(--panel-line);
  background: #091d27;
  box-shadow: -25px 0 70px rgba(0, 0, 0, 0.28);
}

.icon-button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--panel-line);
  border-radius: 10px;
  color: #a5c1c2;
  font-size: 1.3rem;
  background: rgba(255, 255, 255, 0.025);
}

.archive-sheet section {
  margin-top: 30px;
}

.archive-sheet h3 {
  margin: 0 0 13px;
  color: #d4e5e4;
  font-size: 0.84rem;
}

.legacy-list,
.history-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.legacy-list {
  display: grid;
  gap: 9px;
}

.legacy-list li,
.history-list li {
  padding: 12px 13px;
  border: 1px solid var(--panel-line);
  border-radius: 10px;
  color: #a7bdbe;
  font-size: 0.76rem;
  line-height: 1.55;
  background: rgba(255, 255, 255, 0.018);
}

.legacy-list li.empty,
.history-list li.empty {
  color: #638185;
  font-style: italic;
}

.legacy-list strong {
  display: block;
  margin-bottom: 3px;
  color: #cfe2e0;
  font-size: 0.76rem;
}

.history-list {
  counter-reset: history;
  display: grid;
  gap: 8px;
}

.history-list li {
  display: grid;
  grid-template-columns: 27px 1fr;
  gap: 8px;
}

.history-list li:not(.empty)::before {
  counter-increment: history;
  content: counter(history, decimal-leading-zero);
  color: #5f8385;
  font: 0.66rem/1.7 ui-monospace, Consolas, monospace;
}

.confirm-sheet h2 {
  margin: 0 0 9px;
  font-family: "STSong", "Songti SC", serif;
}

.confirm-sheet p {
  margin: 0 0 22px;
  color: #91aaad;
  font-size: 0.84rem;
  line-height: 1.7;
}

.confirm-sheet > div {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.danger-button {
  color: #fff3f1;
  background: #9f4540;
}

.game-layout.locked {
  filter: saturate(0.7);
}

@media (max-width: 860px) {
  .app-shell {
    width: min(100% - 28px, 720px);
  }

  .game-layout {
    grid-template-columns: 1fr;
    gap: 25px;
    padding-top: 25px;
  }

  .status-panel {
    width: 100%;
    padding: 18px;
  }

  .stat-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 25px;
    margin-top: 19px;
  }

  .stat-foot {
    display: none;
  }

  .director-card {
    margin-top: 20px;
    padding-top: 16px;
  }

  .trait-description {
    margin-left: 57px;
  }
}

@media (max-width: 600px) {
  .app-shell {
    width: min(100% - 20px, 520px);
  }

  .topbar {
    min-height: 73px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 11px;
  }

  .brand-copy strong {
    font-size: 0.98rem;
  }

  .brand-copy small {
    font-size: 0.66rem;
  }

  .topbar .ghost-button {
    width: 41px;
    padding: 0;
    font-size: 0;
  }

  .topbar .ghost-button span {
    font-size: 1rem;
  }

  .game-layout {
    padding-top: 16px;
  }

  .status-panel {
    padding: 15px;
    border-radius: 17px;
  }

  .panel-heading h2 {
    font-size: 1rem;
  }

  .panel-heading .eyebrow,
  .live-badge {
    display: none;
  }

  .stat-list {
    gap: 15px 16px;
    margin-top: 15px;
  }

  .stat-copy {
    margin-bottom: 8px;
  }

  .stat-copy > span {
    gap: 6px;
    font-size: 0.76rem;
  }

  .stat-icon {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    font-size: 0.61rem;
  }

  .stat-value {
    font-size: 0.8rem;
  }

  .director-card {
    margin-top: 16px;
  }

  .director-avatar {
    width: 39px;
    height: 39px;
  }

  .trait-description {
    margin-left: 51px;
  }

  .stage-heading {
    margin-bottom: 6px;
  }

  .stage-heading h2 {
    font-size: 1.04rem;
  }

  .risk-label {
    min-height: 25px;
    padding: 0 8px;
    font-size: 0.66rem;
  }

  .card-zone {
    height: min(394px, 54vh);
    min-height: 330px;
  }

  .card-shadow,
  .decision-card {
    width: calc(100% - 4px);
    height: calc(100% - 27px);
    min-height: 310px;
  }

  .decision-card {
    padding: 22px 23px 19px;
    border-radius: 16px;
  }

  .memo-head {
    padding-bottom: 11px;
  }

  .speaker {
    margin-top: 17px;
  }

  .speaker-avatar {
    width: 41px;
    height: 41px;
  }

  blockquote {
    margin-top: 18px;
    font-size: 1rem;
    line-height: 1.72;
  }

  .decision-controls {
    gap: 9px;
  }

  .decision-button {
    min-height: 64px;
    gap: 8px;
    padding: 10px 11px;
  }

  .decision-button small {
    display: none;
  }

  .decision-button strong {
    font-size: 0.76rem;
  }

  .button-arrow {
    width: 29px;
    height: 29px;
    border-radius: 8px;
  }

  .control-hint {
    display: none;
  }

  .site-footer {
    min-height: 48px;
  }

  .site-footer > span {
    max-width: 68%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .appointment-letter,
  .turnover-sheet,
  .confirm-sheet {
    padding: 27px 23px;
    border-radius: 18px;
  }

  .appointment-seal {
    top: 25px;
    right: 23px;
    width: 52px;
    height: 52px;
    font-size: 1.3rem;
  }

  .opening-rule {
    grid-template-columns: 1fr 25px 1fr;
    gap: 7px;
    font-size: 0.65rem;
  }

  .archive-dialog {
    width: min(100%, 420px);
  }

  .archive-sheet {
    padding: 24px 19px;
  }

  .tenure-summary strong {
    font-size: 0.76rem;
  }
}

@media (max-height: 720px) and (min-width: 861px) {
  .topbar {
    min-height: 72px;
  }

  .game-layout {
    padding-top: 23px;
  }

  .status-panel {
    padding: 19px 22px;
  }

  .stat-list {
    gap: 16px;
    margin-top: 20px;
  }

  .director-card {
    margin-top: 18px;
    padding-top: 15px;
  }

  .card-zone {
    height: 370px;
  }

  .card-shadow,
  .decision-card {
    height: 330px;
  }

  .decision-card {
    padding: 23px 30px 20px;
  }

  .speaker {
    margin-top: 17px;
  }

  blockquote {
    margin-top: 18px;
    font-size: 1.05rem;
  }

  .decision-button {
    min-height: 64px;
  }
}

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