/* ============================================================
   拾光游戏厅 · components.css
   通用组件：按钮 / 纸卡 / 游戏外壳 / 弹窗 / 吐司 / 存档馆
   ============================================================ */

/* ---------------- 通用文字与小件 ---------------- */
.muted { color: rgba(239, 225, 196, .5); }
.text-red { color: #d2705e; }
.text-jade { color: #7ec0ad; }
.serif { font-family: var(--font-display); }
.mono { font-family: var(--font-mono); }
.nowrap { white-space: nowrap; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border: 1px solid rgba(198, 160, 90, .28);
  border-radius: 2px;
  color: rgba(230, 201, 130, .78);
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: .04em;
  white-space: nowrap;
  background: rgba(198, 160, 90, .055);
}
.chip--red { color: #d98573; border-color: rgba(178, 58, 43, .45); background: rgba(178, 58, 43, .1); }
.chip--jade { color: #8ec7b7; border-color: rgba(47, 111, 98, .5); background: rgba(47, 111, 98, .12); }
.chip--solid { color: #2b1d0f; background: var(--brass); border-color: var(--brass-hi); font-weight: 600; }

.eyebrow--paper { color: rgba(91, 68, 38, .68); }
.divider-ornament {
  display: flex;
  align-items: center;
  gap: 9px;
  color: rgba(198, 160, 90, .4);
  font-size: 9px;
  letter-spacing: .22em;
}
.divider-ornament::before,
.divider-ornament::after { content: ""; height: 1px; flex: 1; background: currentColor; opacity: .45; }

/* ---------------- 按钮 ---------------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 17px;
  border: 1px solid rgba(198, 160, 90, .48);
  border-radius: 3px;
  color: #e8d6b2;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: .06em;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(0, 0, 0, .14)),
    linear-gradient(145deg, #4a3421, #332318);
  box-shadow:
    inset 0 1px 0 rgba(255, 230, 185, .13),
    0 3px 0 rgba(0, 0, 0, .24),
    0 5px 12px rgba(0, 0, 0, .2);
  transition: border-color .18s ease, color .18s ease, background .18s ease, transform .1s ease, box-shadow .18s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover {
  color: #f6e8ca;
  border-color: rgba(230, 201, 130, .75);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .1), rgba(0, 0, 0, .1)),
    linear-gradient(145deg, #594027, #3b291b);
}
.btn:active {
  transform: translateY(2px);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, .35), 0 1px 0 rgba(0, 0, 0, .3);
}
.btn svg { width: 15px; height: 15px; flex: 0 0 auto; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .42; pointer-events: none; filter: saturate(.7); }

.btn-primary {
  color: #2b1c0c;
  border-color: #e8cd8f;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .32), transparent 40%),
    linear-gradient(180deg, #e3c47c, #c09a50 55%, #a47f3a);
  box-shadow:
    inset 0 1px 0 rgba(255, 250, 225, .7),
    inset 0 -2px 3px rgba(82, 55, 14, .3),
    0 3px 0 #6b5124,
    0 8px 18px rgba(0, 0, 0, .3);
  font-weight: 700;
  text-shadow: 0 1px 0 rgba(255, 247, 220, .5);
}
.btn-primary:hover {
  color: #23170a;
  border-color: #f5e3b6;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .4), transparent 40%),
    linear-gradient(180deg, #f0d58e, #cea95e 55%, #b18a42);
}
.btn-primary:active {
  transform: translateY(2px);
  box-shadow: inset 0 2px 4px rgba(83, 57, 14, .35), 0 1px 0 #6b5124;
}

.btn-ghost {
  color: rgba(239, 225, 196, .7);
  background: rgba(255, 255, 255, .018);
  border-color: rgba(198, 160, 90, .24);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03);
}
.btn-ghost:hover { background: rgba(198, 160, 90, .09); color: var(--paper); }
.btn-ghost:active { box-shadow: inset 0 1px 3px rgba(0, 0, 0, .28); }

.btn-danger { color: #f0cbc2; border-color: rgba(178, 58, 43, .5); background: linear-gradient(180deg, #6e2a22, #4a1b15); }
.btn-danger:hover { background: linear-gradient(180deg, #843229, #5a221a); border-color: rgba(225, 133, 111, .7); }

.btn-sm { min-height: 30px; padding: 5px 10px; font-size: 11px; gap: 5px; }
.btn-sm svg { width: 12px; height: 12px; }
.btn-lg { min-height: 46px; padding: 11px 24px; font-size: 14px; }
.btn-block { width: 100%; }

.btn-icon {
  width: 34px; height: 34px;
  min-height: 0;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(198, 160, 90, .3);
  color: rgba(239, 225, 196, .75);
  background: rgba(0, 0, 0, .12);
  transition: background .18s ease, border-color .18s ease, color .18s ease, transform .12s ease;
}
.btn-icon:hover { color: var(--brass-hi); border-color: rgba(198, 160, 90, .6); background: rgba(198, 160, 90, .12); }
.btn-icon:active { transform: scale(.94); }
.btn-icon svg { width: 15px; height: 15px; }

/* 纸张上的按钮需要深色字 */
.paper-card .btn { color: #4a331d; border-color: rgba(109, 76, 38, .45); background: linear-gradient(180deg, #f4e7ca, #e2cca3); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 2px 0 rgba(104, 72, 35, .22); }
.paper-card .btn:hover { color: #2c1c0d; border-color: rgba(109, 76, 38, .7); background: linear-gradient(180deg, #fbf0d8, #ead6ad); }
.paper-card .btn:active { box-shadow: inset 0 2px 4px rgba(88, 59, 26, .22); }
.paper-card .btn-primary { color: #f5e9cf; border-color: #7b3326; background: linear-gradient(180deg, #b84a37, #8d2e22); box-shadow: inset 0 1px 0 rgba(255, 214, 188, .35), 0 2px 0 rgba(77, 24, 16, .3); text-shadow: 0 1px 1px rgba(56, 10, 5, .35); }
.paper-card .btn-primary:hover { background: linear-gradient(180deg, #c75743, #9b3527); color: #fff4e1; }
.paper-card .btn-ghost { color: #59432a; background: transparent; border-color: rgba(109, 76, 38, .3); box-shadow: none; }
.paper-card .btn-ghost:hover { background: rgba(109, 76, 38, .08); color: #2c1c0d; }
.paper-card .btn-danger { color: #f7e4df; border-color: #84392d; background: linear-gradient(180deg, #a54435, #7d2a20); }
.paper-card .btn[disabled] { opacity: .38; }

/* ---------------- 分段选择 ---------------- */
.segmented {
  display: inline-flex;
  align-items: stretch;
  gap: 2px;
  padding: 2px;
  border: 1px solid rgba(198, 160, 90, .25);
  border-radius: 3px;
  background: rgba(0, 0, 0, .18);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .2);
}
.seg-btn {
  min-height: 27px;
  padding: 4px 10px;
  border-radius: 2px;
  color: rgba(239, 225, 196, .56);
  font-size: 10.5px;
  line-height: 1.3;
  letter-spacing: .03em;
  transition: color .16s ease, background .16s ease;
}
.seg-btn:hover { color: var(--paper); background: rgba(198, 160, 90, .08); }
.seg-btn.active {
  color: #2c1d0e;
  background: linear-gradient(180deg, #ddc083, #bc9652);
  box-shadow: inset 0 1px 0 rgba(255, 245, 214, .55), 0 1px 2px rgba(0, 0, 0, .25);
  font-weight: 600;
}
.paper-card .segmented { border-color: rgba(109, 76, 38, .28); background: rgba(86, 59, 28, .09); box-shadow: none; }
.paper-card .seg-btn { color: rgba(72, 50, 26, .6); }
.paper-card .seg-btn:hover { color: #3a2714; background: rgba(86, 59, 28, .08); }
.paper-card .seg-btn.active { color: #f4e8cf; background: linear-gradient(180deg, #8f6b3b, #6e4e27); box-shadow: inset 0 1px 0 rgba(255, 240, 208, .25); }

/* ---------------- 纸卡与侧栏 ---------------- */
.paper-card {
  position: relative;
  padding: 16px 16px 15px;
  color: var(--ink);
  border: 1px solid #b39a70;
  border-radius: 3px;
  background:
    radial-gradient(ellipse at 22% 0%, rgba(255, 252, 235, .55), transparent 45%),
    repeating-linear-gradient(0deg, rgba(110, 79, 40, .025) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(110, 79, 40, .018) 0 1px, transparent 1px 4px),
    linear-gradient(160deg, #f2e4c6, #e8d6b1 72%, #ddc7a0);
  box-shadow:
    0 7px 16px rgba(0, 0, 0, .24),
    inset 0 1px 0 rgba(255, 255, 255, .55),
    inset 0 0 30px rgba(105, 71, 32, .055);
}
.paper-card::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(112, 82, 44, .1);
  border-radius: 1px;
  pointer-events: none;
}
.paper-card > * { position: relative; }
.paper-card--dark {
  color: var(--paper);
  border-color: rgba(198, 160, 90, .25);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .025), transparent 40%),
    linear-gradient(150deg, #2b2119, #1c1611);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .04);
}
.paper-card--dark::before { border-color: rgba(198, 160, 90, .1); }

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 11px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(95, 64, 30, .18);
  color: #6a4c26;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .12em;
}
.paper-card--dark .panel-heading { color: var(--brass-hi); border-bottom-color: rgba(198, 160, 90, .16); }
.panel-heading .ph-en {
  color: rgba(98, 67, 31, .42);
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 400;
  letter-spacing: .14em;
}
.paper-card--dark .panel-heading .ph-en { color: rgba(198, 160, 90, .35); }

.status-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 11px;
  border: 1px solid rgba(100, 67, 32, .2);
  border-radius: 2px;
  background: rgba(255, 249, 232, .35);
  color: #4a331d;
}
.status-band strong { font-size: 13px; letter-spacing: .03em; }
.status-band small { color: rgba(80, 55, 27, .55); font-size: 10.5px; }

.rule-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: rgba(58, 39, 20, .74);
  font-size: 11px;
  line-height: 1.7;
}
.rule-list li { position: relative; padding-left: 13px; }
.rule-list li::before { content: "·"; position: absolute; left: 2px; top: -1px; color: #9a6b32; font-weight: 700; }
.rule-list li b { color: #4a2e16; font-weight: 600; }

.rules-details { margin: 0; }
.rules-details summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #6a4c26;
  font-family: var(--font-display);
  font-size: 12.5px;
  letter-spacing: .1em;
  font-weight: 700;
}
.rules-details summary::-webkit-details-marker { display: none; }
.rules-details summary::after { content: "＋"; color: rgba(120, 83, 42, .55); font-family: var(--font-mono); font-size: 12px; }
.rules-details[open] summary::after { content: "－"; }
.rules-details[open] summary { margin-bottom: 9px; }
.rules-details .rule-list { max-height: 230px; overflow: auto; padding-right: 3px; }

/* ---------------- 游戏页外壳 ---------------- */
.game-page {
  width: min(calc(100% - 40px), 1380px);
  margin: 0 auto;
  padding: 20px 0 60px;
}
.game-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  flex-wrap: wrap;
  min-height: 56px;
  padding: 8px 0 13px;
  border-bottom: 1px solid rgba(198, 160, 90, .18);
  margin-bottom: 18px;
}
.game-topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.game-back {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px 5px 6px;
  border-radius: 3px;
  color: rgba(239, 225, 196, .58);
  font-size: 11px;
  letter-spacing: .05em;
  transition: color .18s ease, background .18s ease;
}
.game-back:hover { color: var(--brass-hi); background: rgba(198, 160, 90, .07); }
.game-back svg { width: 14px; height: 14px; }
.game-title-block { display: flex; align-items: center; gap: 11px; min-width: 0; }
.game-title-seal {
  width: 35px; height: 35px; flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(198, 160, 90, .4);
  color: var(--brass-hi);
  font-family: var(--font-display);
  font-size: 17px;
  background: rgba(198, 160, 90, .08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}
.game-title-text { display: flex; flex-direction: column; min-width: 0; }
.game-title-text b {
  font-family: var(--font-display);
  font-size: 19px;
  letter-spacing: .1em;
  font-weight: 700;
  color: #eedfbe;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.game-title-text small {
  color: rgba(198, 160, 90, .52);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .16em;
  margin-top: 2px;
}
.game-topbar-right { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.game-topbar-right .btn { min-height: 33px; padding: 5px 11px; font-size: 11px; }
.game-content { min-height: 400px; }

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 334px;
  gap: 20px;
  align-items: start;
}
.game-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 420px;
  padding: 22px;
  overflow: hidden;
  border: 1px solid rgba(198, 160, 90, .25);
  border-radius: 5px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255, 223, 166, .09), transparent 55%),
    repeating-linear-gradient(93deg, rgba(33, 18, 8, .22) 0 2px, rgba(255, 230, 183, .015) 2px 5px, transparent 5px 19px),
    linear-gradient(150deg, #3f2a1c, #2a1b11 78%);
  box-shadow: 0 18px 36px rgba(0, 0, 0, .38), inset 0 1px 0 rgba(255, 226, 175, .1), inset 0 0 60px rgba(0, 0, 0, .22);
}
.game-stage::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(198, 160, 90, .1);
  border-radius: 2px;
  pointer-events: none;
}
.game-stage--felt {
  background:
    radial-gradient(ellipse at 50% 20%, rgba(255, 230, 190, .09), transparent 55%),
    repeating-linear-gradient(35deg, rgba(0, 0, 0, .055) 0 2px, transparent 2px 4px),
    linear-gradient(150deg, #235543, #12392d);
}
.side-panel { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.side-note {
  color: rgba(239, 225, 196, .36);
  font-size: 10px;
  line-height: 1.7;
  text-align: center;
  letter-spacing: .03em;
}
.game-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }

.turn-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 5px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .18);
}

/* 加载 / 错误 / 正在装修 */
.game-loading, .game-error, .game-constructing {
  min-height: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 40px 20px;
}
.game-loading .spin {
  width: 27px; height: 27px;
  border-radius: 50%;
  border: 2px solid rgba(198, 160, 90, .18);
  border-top-color: var(--brass);
  animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.game-error h3, .game-constructing h3 { font-family: var(--font-display); font-size: 24px; color: var(--paper); letter-spacing: .08em; }
.game-error p, .game-constructing p { color: rgba(239, 225, 196, .5); font-size: 12px; max-width: 400px; }
.construction-art {
  position: relative;
  width: 84px; height: 84px;
  display: grid; place-items: center;
  border: 1px dashed rgba(198, 160, 90, .3);
  border-radius: 50%;
  color: rgba(198, 160, 90, .48);
  font-family: var(--font-display);
  font-size: 36px;
}
.construction-art::after {
  content: "施工中";
  position: absolute;
  bottom: -13px; left: 50%;
  transform: translateX(-50%);
  padding: 1px 7px;
  background: #1d1712;
  color: rgba(198, 160, 90, .44);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .12em;
  white-space: nowrap;
}

/* ---------------- 弹窗 ---------------- */
.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 20px;
  overflow-y: auto;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 6, 4, .7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fade-in .2s ease both;
}
.modal-panel {
  position: relative;
  width: min(100%, 460px);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  color: var(--ink);
  border: 1px solid #b79b70;
  border-radius: 4px;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(255, 252, 236, .6), transparent 46%),
    repeating-linear-gradient(0deg, rgba(110, 79, 40, .025) 0 1px, transparent 1px 3px),
    linear-gradient(160deg, #f4e6c9, #e6d1a8 75%, #d9c096);
  box-shadow:
    0 30px 70px rgba(0, 0, 0, .6),
    0 0 0 1px rgba(255, 242, 211, .14),
    inset 0 0 44px rgba(108, 72, 33, .08);
  animation: modal-in .25s cubic-bezier(.2, .8, .3, 1) both;
  z-index: 1;
}
.modal-panel::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(103, 72, 36, .16);
  border-radius: 2px;
  pointer-events: none;
}
.modal-panel--wide { width: min(100%, 580px); }
.modal-corner {
  position: absolute;
  width: 18px; height: 18px;
  border-color: rgba(111, 76, 36, .3);
  border-style: solid;
  pointer-events: none;
}
.modal-corner.tl { left: 10px; top: 10px; border-width: 1px 0 0 1px; }
.modal-corner.tr { right: 10px; top: 10px; border-width: 1px 1px 0 0; }
.modal-corner.bl { left: 10px; bottom: 10px; border-width: 0 0 1px 1px; }
.modal-corner.br { right: 10px; bottom: 10px; border-width: 0 1px 1px 0; }
.modal-head { padding: 23px 26px 0; text-align: center; position: relative; }
.modal-head h2 {
  font-family: var(--font-display);
  font-size: 23px;
  letter-spacing: .12em;
  color: #3f2a14;
  line-height: 1.3;
}
.modal-head .mh-sub {
  margin-top: 4px;
  color: rgba(91, 64, 32, .52);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.modal-head .mh-rule {
  width: 54px; height: 1px;
  margin: 13px auto 0;
  background: linear-gradient(90deg, transparent, rgba(116, 79, 37, .46), transparent);
  position: relative;
}
.modal-head .mh-rule::after {
  content: "◆";
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  padding: 0 5px;
  color: rgba(116, 79, 37, .5);
  font-size: 7px;
  background: #eedcbb;
}
.modal-body { padding: 16px 26px 4px; font-size: 12.5px; line-height: 1.8; color: rgba(58, 38, 17, .8); }
.modal-body p { margin: 0 0 8px; }
.modal-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 9px;
  padding: 17px 26px 23px;
}
.modal-close {
  position: absolute;
  top: 9px; right: 9px;
  width: 29px; height: 29px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: rgba(84, 55, 26, .55);
  transition: color .16s ease, background .16s ease, transform .16s ease;
  z-index: 2;
}
.modal-close:hover { color: #6d2a1e; background: rgba(109, 42, 30, .08); transform: rotate(90deg); }
.modal-close svg { width: 14px; height: 14px; }
.modal-panel .btn { min-height: 35px; }

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in {
  from { opacity: 0; transform: translateY(13px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* 表单 */
.form-field { margin-bottom: 13px; }
.form-field label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  color: #5f431f;
  font-size: 11.5px;
  letter-spacing: .05em;
  font-weight: 600;
}
.form-field label span { color: rgba(93, 64, 31, .45); font-size: 9.5px; font-weight: 400; font-family: var(--font-mono); }
.input-text {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  color: #3c2917;
  border: 1px solid rgba(104, 73, 37, .35);
  border-radius: 2px;
  background: rgba(255, 251, 239, .6);
  box-shadow: inset 0 1px 3px rgba(82, 55, 25, .1);
  font-size: 13px;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.input-text::placeholder { color: rgba(88, 61, 31, .32); }
.input-text:focus { border-color: rgba(130, 83, 36, .7); box-shadow: inset 0 1px 3px rgba(82, 55, 25, .1), 0 0 0 2px rgba(198, 160, 90, .18); }
.form-hint { margin-top: 6px; color: rgba(81, 55, 26, .48); font-size: 10px; line-height: 1.6; }
.save-preview {
  margin-top: 2px;
  padding: 10px 12px;
  border: 1px dashed rgba(109, 77, 39, .26);
  border-radius: 2px;
  background: rgba(255, 251, 239, .3);
  font-size: 10.5px;
  color: rgba(75, 51, 23, .66);
  line-height: 1.65;
}
.save-preview b { color: #52351a; }
.save-preview .mono { font-size: 9.5px; }

/* ---------------- Toast ---------------- */
#toast-root {
  position: fixed;
  z-index: 200;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  width: max-content;
  max-width: calc(100vw - 32px);
}
.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 8px 15px;
  border: 1px solid rgba(198, 160, 90, .32);
  border-radius: 3px;
  color: rgba(243, 231, 207, .9);
  font-size: 11.5px;
  line-height: 1.5;
  letter-spacing: .04em;
  background: rgba(24, 18, 13, .94);
  box-shadow: 0 9px 28px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .05);
  backdrop-filter: blur(7px);
  animation: toast-in .24s cubic-bezier(.2, .8, .3, 1) both;
}
.toast::before {
  content: "";
  width: 5px; height: 5px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--brass);
  box-shadow: 0 0 7px rgba(198, 160, 90, .6);
}
.toast--success::before { background: #8fd19a; box-shadow: 0 0 7px rgba(143, 209, 154, .7); }
.toast--error { border-color: rgba(178, 58, 43, .48); }
.toast--error::before { background: #de8a74; box-shadow: 0 0 7px rgba(222, 138, 116, .7); }
.toast.is-out { animation: toast-out .2s ease both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(5px); } }

/* ---------------- 存档馆 ---------------- */
.archive-page { max-width: 920px; margin: 0 auto; }
.archive-hero { padding: 24px 0 19px; border-bottom: 1px solid rgba(198, 160, 90, .17); }
.archive-title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.archive-title {
  font-family: var(--font-display);
  font-size: clamp(30px, 4.2vw, 42px);
  letter-spacing: .14em;
  color: #ecdcba;
  line-height: 1.2;
}
.archive-desc { margin-top: 6px; color: rgba(239, 225, 196, .45); font-size: 11.5px; }
.archive-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.archive-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 0;
  border-bottom: 1px solid rgba(198, 160, 90, .12);
}
.archive-filters { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.archive-chip {
  padding: 5px 10px;
  border: 1px solid rgba(198, 160, 90, .2);
  border-radius: 2px;
  color: rgba(239, 225, 196, .55);
  font-size: 10.5px;
  letter-spacing: .03em;
  transition: color .16s ease, border-color .16s ease, background .16s ease;
}
.archive-chip:hover { color: var(--paper); border-color: rgba(198, 160, 90, .4); }
.archive-chip.active { color: #2a1c0c; background: var(--brass); border-color: var(--brass-hi); font-weight: 600; }
.archive-count { color: rgba(239, 225, 196, .32); font-family: var(--font-mono); font-size: 9px; letter-spacing: .1em; }

.save-list { display: flex; flex-direction: column; gap: 9px; margin-top: 16px; }
.save-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid rgba(198, 160, 90, .17);
  border-left: 2px solid rgba(198, 160, 90, .32);
  border-radius: 3px;
  background:
    linear-gradient(90deg, rgba(198, 160, 90, .045), transparent 32%),
    rgba(28, 22, 16, .6);
  transition: border-color .18s ease, background .18s ease;
}
.save-row:hover { border-color: rgba(198, 160, 90, .35); border-left-color: var(--brass); background: rgba(38, 29, 20, .72); }
.save-seal {
  width: 41px; height: 41px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--brass-hi);
  border: 1px solid rgba(198, 160, 90, .3);
  background: rgba(198, 160, 90, .075);
  font-family: var(--font-display);
  font-size: 19px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07);
}
.save-info { min-width: 0; }
.save-info-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.save-info-top b {
  color: rgba(242, 230, 205, .9);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.save-info .save-sub {
  margin-top: 2px;
  color: rgba(239, 225, 196, .38);
  font-size: 10px;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.save-info .save-sub .dot { color: rgba(198, 160, 90, .3); }
.save-info .save-sub .mono { font-size: 9px; letter-spacing: .02em; }
.save-actions { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.save-actions .btn { min-height: 29px; padding: 4px 8px; font-size: 10px; }
.save-actions .btn svg { width: 12px; height: 12px; }
.save-actions .save-load-btn { color: var(--brass-hi); border-color: rgba(198, 160, 90, .4); }

.empty-state {
  position: relative;
  overflow: hidden;
  margin-top: 22px;
  padding: 54px 24px 48px;
  text-align: center;
  border: 1px dashed rgba(198, 160, 90, .22);
  border-radius: 5px;
  background: rgba(0, 0, 0, .1);
}
.empty-illustration {
  position: relative;
  width: 130px; height: 95px;
  margin: 0 auto 22px;
  opacity: .6;
}
.empty-illustration .cabinet {
  position: absolute;
  left: 50%; bottom: 0;
  width: 92px; height: 76px;
  transform: translateX(-50%);
  border: 2px solid rgba(198, 160, 90, .4);
  border-radius: 3px 3px 1px 1px;
  background:
    linear-gradient(180deg, rgba(198, 160, 90, .07), rgba(0, 0, 0, .1)),
    repeating-linear-gradient(0deg, transparent 0 16px, rgba(198, 160, 90, .08) 16px 17px);
}
.empty-illustration .cabinet::before {
  content: "";
  position: absolute;
  left: 15px; right: 15px; top: 13px;
  height: 30px;
  border: 1px solid rgba(198, 160, 90, .26);
  background: radial-gradient(ellipse at 50% 50%, rgba(158, 228, 147, .13), transparent 72%);
}
.empty-illustration .cabinet::after {
  content: "";
  position: absolute;
  left: 50%; top: 56px;
  width: 13px; height: 3px;
  transform: translateX(-50%);
  background: rgba(198, 160, 90, .32);
  box-shadow: 0 0 9px rgba(198, 160, 90, .25);
}
.empty-state h3 { color: rgba(239, 225, 196, .7); font-family: var(--font-display); font-size: 20px; letter-spacing: .12em; font-weight: 500; }
.empty-state p { margin-top: 7px; color: rgba(239, 225, 196, .34); font-size: 11.5px; line-height: 1.8; }
.empty-state .btn { margin-top: 18px; }
.archive-footnote {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 24px;
  padding: 12px 14px;
  border: 1px dashed rgba(198, 160, 90, .17);
  border-radius: 3px;
  color: rgba(239, 225, 196, .35);
  font-size: 10.5px;
  line-height: 1.8;
}
.archive-footnote svg { width: 14px; height: 14px; margin-top: 2px; flex: 0 0 auto; opacity: .6; }

/* ---------------- 404 ---------------- */
.notfound {
  min-height: 58vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
}
.notfound .nf-code {
  font-family: var(--font-mono);
  font-size: 68px;
  letter-spacing: .12em;
  color: rgba(198, 160, 90, .35);
  text-shadow: 0 0 24px rgba(198, 160, 90, .12);
}
.notfound h2 { font-family: var(--font-display); font-size: 24px; letter-spacing: .12em; color: var(--paper); }
.notfound p { color: rgba(239, 225, 196, .42); font-size: 12px; }

/* ---------------- 滚动条 ---------------- */
* { scrollbar-width: thin; scrollbar-color: rgba(198, 160, 90, .3) transparent; }
*::-webkit-scrollbar { width: 7px; height: 7px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(198, 160, 90, .26); border-radius: 4px; }
*::-webkit-scrollbar-thumb:hover { background: rgba(198, 160, 90, .44); }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1080px) {
  .game-layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; }
  .game-stage { padding: 16px; }
}

@media (max-width: 900px) {
  .game-layout { grid-template-columns: minmax(0, 1fr); }
  .side-panel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .side-panel > * { min-width: 0; }
  .side-panel .side-span-2 { grid-column: 1 / -1; }
  .game-page { width: calc(100% - 28px); padding-top: 12px; }
  .game-topbar { margin-bottom: 13px; padding-bottom: 10px; }
  .game-stage { min-height: 0; }
}

@media (max-width: 600px) {
  .game-page { width: calc(100% - 18px); padding-bottom: 40px; }
  .game-topbar { align-items: flex-start; gap: 8px; }
  .game-topbar-left { gap: 7px; }
  .game-topbar-right { width: 100%; justify-content: flex-end; }
  .game-topbar-right .btn { min-height: 30px; font-size: 10.5px; padding: 4px 9px; }
  .game-title-seal { width: 30px; height: 30px; font-size: 15px; }
  .game-title-text b { font-size: 16px; }
  .game-title-text small { font-size: 7px; letter-spacing: .1em; }
  .game-back { font-size: 10px; padding-left: 2px; padding-right: 5px; }
  .game-back .back-label { display: none; }
  .game-stage { padding: 10px; }
  .side-panel { grid-template-columns: minmax(0, 1fr); gap: 9px; }
  .paper-card { padding: 13px 13px 12px; }
  .modal-panel { width: min(100%, 420px); max-height: calc(100vh - 24px); }
  .modal-layer { padding: 12px; }
  .modal-head { padding: 20px 20px 0; }
  .modal-body { padding: 14px 20px 3px; }
  .modal-actions { padding: 15px 20px 20px; }
  .archive-hero { padding-top: 14px; }
  .archive-title-row { align-items: flex-start; flex-direction: column; gap: 12px; }
  .archive-actions { width: 100%; }
  .archive-actions .btn { flex: 1 1 auto; justify-content: center; }
  .save-row { grid-template-columns: 36px minmax(0, 1fr); gap: 9px; padding: 10px 11px; }
  .save-seal { width: 34px; height: 34px; font-size: 16px; }
  .save-actions { grid-column: 1 / -1; justify-content: flex-end; padding-top: 2px; }
  .save-actions .btn { min-height: 28px; }
  .toast { font-size: 10.5px; padding: 7px 12px; }
}

/* ---------------- 弹窗内按钮（纸张底色） ---------------- */
.modal-panel .btn {
  color: #4a331d;
  border-color: rgba(109, 76, 38, .42);
  background: linear-gradient(180deg, #f4e7ca, #e2cca3);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 2px 0 rgba(104, 72, 35, .2);
  text-shadow: none;
}
.modal-panel .btn:hover {
  color: #2c1c0d;
  border-color: rgba(109, 76, 38, .68);
  background: linear-gradient(180deg, #fbf0d8, #ead6ad);
}
.modal-panel .btn-primary {
  color: #2b1c0c;
  border-color: #e8cd8f;
  background: linear-gradient(180deg, rgba(255, 255, 255, .32), transparent 40%), linear-gradient(180deg, #e3c47c, #c09a50 55%, #a47f3a);
  box-shadow: inset 0 1px 0 rgba(255, 250, 225, .7), 0 2px 0 #6b5124, 0 5px 12px rgba(0, 0, 0, .16);
  font-weight: 700;
}
.modal-panel .btn-primary:hover {
  color: #23170a;
  border-color: #f5e3b6;
  background: linear-gradient(180deg, rgba(255, 255, 255, .4), transparent 40%), linear-gradient(180deg, #f0d58e, #cea95e 55%, #b18a42);
}
.modal-panel .btn-ghost {
  color: #5a4227;
  border-color: rgba(109, 76, 38, .28);
  background: rgba(255, 250, 237, .22);
  box-shadow: none;
}
.modal-panel .btn-ghost:hover { color: #352412; background: rgba(109, 76, 38, .08); }
.modal-panel .btn-danger {
  color: #f7e4df;
  border-color: #84392d;
  background: linear-gradient(180deg, #a54435, #7d2a20);
}
.modal-panel .btn-danger:hover { color: #fff2eb; background: linear-gradient(180deg, #b84e3e, #8c3025); }
