:root {
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: #302619;
  background: #fff;
  font-size: 16px;
  --ink: #352318;
  --red: #9d3124;
  --gold: #e2ba79;
  --muted: #786a59;
  --line: #d7c8b2;
  --paper: #faf5e8;
  --serif: "STKaiti", "KaiTi", "Noto Serif CJK SC", "Songti SC", SimSun, serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid #5386ce;
  outline-offset: 3px;
}
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
.search-screen { min-height: 100vh; min-height: 100dvh; background: white; padding: clamp(112px, 20vh, 200px) 22px 36px; }
.search-center { max-width: 656px; margin: auto; }
.baidu-logo { display: flex; align-items: flex-end; justify-content: center; color: #e53023; font: 800 50px/1 Arial, sans-serif; letter-spacing: -4px; margin: 0 auto 27px; user-select: none; }
.baidu-cn { font: 900 44px/.98 "Microsoft YaHei", sans-serif; letter-spacing: -4px; margin-left: 2px; }
.baidu-paw { width: 57px; height: 61px; display: inline-block; position: relative; color: #2935c8; }
.baidu-paw b { position: absolute; inset: auto 1px 0 2px; height: 37px; border-radius: 68% 62% 39% 43%; background: currentColor; transform: rotate(-5deg); }
.baidu-paw b::after { content: "du"; color: white; display: block; text-align: center; font: bold 30px/38px Arial, sans-serif; letter-spacing: -2px; }
.baidu-paw b { font-size: 0; }
.baidu-paw i { position: absolute; display: block; width: 10px; height: 17px; border-radius: 70%; background: currentColor; }
.baidu-paw i:nth-child(1) { left: 0; top: 14px; transform: rotate(-22deg); }
.baidu-paw i:nth-child(2) { left: 12px; top: 2px; transform: rotate(-12deg); }
.baidu-paw i:nth-child(3) { left: 29px; top: 0; transform: rotate(8deg); }
.baidu-paw i:nth-child(4) { left: 45px; top: 9px; transform: rotate(25deg); }
.search-form { display: flex; height: 46px; border: 2px solid #c4c7ce; border-radius: 10px; }
.search-form:focus-within { border-color: #4e6ef2; }
.search-form input { min-width: 0; flex: 1; border: 0; padding: 4px 15px; border-radius: 9px 0 0 9px; outline: none; background: white; color: #16171a; font: 17px Arial,sans-serif; }
.search-form input:focus-visible { outline: none; }
.search-form button { border: 0; margin: -2px; color: #fff; background: #4e6ef2; border-radius: 0 10px 10px 0; width: 110px; font-size: 17px; }
.search-form button:hover { background: #4662d9; }
.search-error { color: #9c332a; padding-top: 12px; }

.login-screen { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: clamp(20px, 4vw, 60px); background: radial-gradient(ellipse at 40% 25%, #514332, #272019 72%); }
.login-frame { width: min(100%, 970px); display: grid; grid-template-columns: minmax(300px, .91fr) minmax(340px, 1fr); background: var(--paper); box-shadow: 0 22px 80px #150f0b80; border: 1px solid #ab9270; }
.login-poster { background: #e1cba3; min-width: 0; }
.login-poster img { display: block; width: 100%; height: 100%; object-fit: cover; }
.login-panel { align-self: center; padding: clamp(30px, 5vw, 65px); }
.login-name { display: flex; align-items: center; gap: 12px; color: #775e3a; font-size: .95rem; overflow-wrap: anywhere; }
.red-seal { display: inline-grid; place-content: center; width: 31px; height: 31px; flex: none; border: 2px solid currentColor; box-shadow: inset 0 0 0 1px var(--paper), inset 0 0 0 2px currentColor; color: var(--red); font: 700 19px var(--serif); }
.login-panel h1 { color: var(--ink); font: 700 clamp(30px, 4vw, 42px)/1.3 var(--serif); letter-spacing: .08em; margin: 18px 0 30px; }
.login-switch { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border: 1px solid #d6c8ac; border-radius: 6px; background: #eae1ce; margin-bottom: 25px; }
.login-switch button { background: transparent; border: 0; color: #695a44; min-height: 40px; border-radius: 3px; }
.login-switch button[aria-pressed=true] { color: #592b1d; background: #fffaf0; box-shadow: 0 1px 4px #5a3e231f; font-weight: 700; }
.field { display: grid; gap: 7px; margin-bottom: 17px; font-size: .94rem; font-weight: 600; }
.field input, .field select { width: 100%; min-width: 0; height: 46px; background: #fffdf7; border: 1px solid #c3b296; border-radius: 5px; color: #2b231d; padding: 9px 13px; font-size: 1rem; }
.field input:focus-visible { outline: 2px solid #936540; outline-offset: 1px; }
.primary { width: 100%; min-height: 46px; border: 1px solid #81281c; border-radius: 5px; font-weight: 700; color: #fff9e8; background: #963426; }
.primary:hover { background: #812a20; }
.primary:disabled { opacity: .65; }
.error { color: #a12821; font-size: .92rem; line-height: 1.55; }
.error:not(:empty) { margin: 12px 0; }
.quiet-button { border: 0; background: transparent; padding: 7px 0; color: #765f46; font-size: .9rem; }
.login-back { margin-top: 16px; }
.mobile-platform { display: none; }

.game-screen { color: #f4e7cc; min-height: 100vh; min-height: 100dvh; background: #1d140f; padding-bottom: 22px; }
.game-screen, .game-sheet, .game-notice, .game-sheet .field { font-weight: 700; }
.game-frame { max-width: 950px; margin: auto; min-height: 100vh; border-left: 1px solid #765537; border-right: 1px solid #765537; background-color: #422410; background-image: repeating-linear-gradient(3deg, #542e160a 0 3px, #2715090a 3px 5px), linear-gradient(135deg,#37200f,#613719 52%,#362010); }
.round-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 57px; padding: 10px clamp(12px,2.6vw,26px); border-bottom: 1px solid #796044; color: #d9ad70; background: #25170ef0; }
.round-head strong { color: #f4c854; font-size: 1.25rem; }
.round-count { display: grid; line-height: 1.2; }
#session-no { font-size: .85rem; }
.round-clock { display: flex; gap: 9px; align-items: baseline; font-size: .95rem; }
.round-status { display: grid; justify-items: center; gap: 2px; }
#draw-method { color: #f3d499; font-size: .88rem; }
#frozen-note { display: inline-block; color: #e4c3a2; }
.round-clock b { color: #f0ca7d; letter-spacing: .03em; font-variant-numeric: tabular-nums; }
.round-clock b.closed { color: #ef9379; }
.round-head .refresh { border: 1px solid #675039; border-radius: 7px; width: 37px; height: 36px; display: grid; place-items: center; color: #ddb77e; background: transparent; font: 700 25px/1 Arial,sans-serif; }
.round-head .refresh:hover { background: #4c3425; }
.table-area { padding: clamp(9px,1.6vw,17px); }
.board { padding: clamp(7px,1.25vw,13px); border: 2px solid #9f8159; border-radius: 12px; background: #2e1a0f; box-shadow: inset 0 0 0 2px #382419; }
.pieces, .groups { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: clamp(5px,.75vw,9px); }
.piece, .group-tile { position: relative; display: flex; align-items: center; justify-content: center; flex-direction: column; border: 2px solid #735744; border-radius: 8px; color: #231c18; box-shadow: 0 2px 4px #190e0966; }
.piece { width: 100%; min-width: 0; padding: 4px 0; aspect-ratio: 1.02; background: linear-gradient(155deg,#fffdf6,#f0e8db); }
.piece-name { font: 900 clamp(32px,5vw,66px)/1.12 var(--serif); -webkit-text-stroke: .033em currentColor; }
.piece.red .piece-name { color: #a52e20; }
.piece-no { font-size: clamp(16px,2.4vw,30px); font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1.2; -webkit-text-stroke: .035em currentColor; }
.with-totals .piece { display: grid; grid-template-rows: 1fr auto 1fr; justify-content: stretch; justify-items: center; aspect-ratio: auto; min-height: clamp(118px,23vw,225px); padding: 16px 2px 5px; }
.with-totals .piece-name { align-self: end; }
.piece-total { align-self: start; width: 100%; min-width: 0; margin-top: 2px; color: #53371f; font-size: clamp(.75rem,1.6vw,1rem); font-weight: 800; line-height: 1.15; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.piece-total span, .piece-total b { display: block; }
.piece-total span { color: #71583c; font-size: .73rem; }
.piece:disabled, .group-tile:disabled { cursor: default; }
.piece.excluded { background: #aea092; }
.board:not(.with-totals) .piece.excluded { min-height: 76px; padding-top: 17px; }
.piece.excluded::after { content: "停押"; position: absolute; right: 3px; top: 3px; color: #48382b; border: 1px solid #79634e; font-size: clamp(10px,1.3vw,13px); font-weight: 900; -webkit-text-stroke: .025em currentColor; line-height: 1.25; padding: 1px 3px; border-radius: 2px; }
.piece.selected, .group-tile.selected { border-color: #edbc36; box-shadow: inset 0 0 0 2px #dba719, 0 0 7px #d68d186e; background: #fff3c4; }
.piece.winner { background: #fff; border-color: #2eab68; box-shadow: inset 0 0 0 2px #49c77d,0 0 6px #58bf7b; }
.board.finished .piece:not(.winner) { background: #b9afa3; }
.piece.prior-winner { border-color: #42875b; box-shadow: inset 0 0 0 1px #78a87a; background: #c4cdba; }
.piece.prior-winner::after { content: "上局中·停押"; right: 2px; white-space: nowrap; padding-inline: 1px; letter-spacing: -.03em; color: #25422b; border-color: #739276; }
.groups { padding: 11px clamp(7px,1.25vw,13px) 0; }
.group-tile { min-height: clamp(51px,6.5vw,68px); padding: 3px; border-color: #8d7050; background: linear-gradient(#fff8e8,#eeddb6); }
.group-tile span { font: 900 clamp(22px,3vw,34px)/1.12 var(--serif); -webkit-text-stroke: .033em currentColor; }
.group-tile small { color: #9f211c; font-size: clamp(14px,1.8vw,19px); font-weight: 900; line-height: 1.25; -webkit-text-stroke: .032em currentColor; }
.game-panel { margin: 0 clamp(9px,1.6vw,17px) 12px; padding: clamp(12px,2vw,20px); border: 1px solid #84623e; border-radius: 10px; background: #301b10d9; }
.result-line { text-align: center; color: #f5c65d; font-weight: 700; line-height: 1.45; }
.player-strip, .stake-line, .panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.player-strip { padding: 13px 0; border-bottom: 1px solid #604731; flex-wrap: wrap; color: #cdbb9c; font-size: .94rem; }
.player-strip strong { color: #fff3da; }
.balance { color: #e1be81; }
.stake-form { margin-top: 15px; }
.stake-line { margin-bottom: 10px; flex-wrap: wrap; }
.stake-line span { color: #d3b58b; font-size: .9rem; }
.stake-entry { display: flex; align-items: stretch; gap: 9px; }
.stake-entry input { min-width: 0; flex: 1; border: 1px solid #a08560; background: #fff9e9; color: #35251b; border-radius: 5px; padding: 10px 11px; }
.stake-entry button { width: min(44%,190px); min-height: 45px; padding: 7px 12px; background: #e5b869; border: 1px solid #e2c789; color: #382210; font-weight: 700; border-radius: 5px; }
.stake-entry button:disabled { opacity: .55; }
.quick-amounts { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.quick-amounts button { flex: 1; min-width: 42px; min-height: 34px; border: 1px solid #92754e; border-radius: 4px; background: #503621; color: #f4dfbd; font-size: .9rem; }
.quick-amounts #clear-choices { min-width: 74px; color: #dac19a; background: transparent; }
.game-hint { margin-top: 10px; color: #d5ba93; font-size: .88rem; line-height: 1.5; }
.game-screen .error { color: #ffbca8; }
.game-actions { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.game-actions button { min-width: 0; min-height: 42px; border: 1px solid #8c7050; border-radius: 5px; color: #f0dab6; background: #432d1e; padding: 6px; font-size: .92rem; }
.game-actions button:hover { background: #5b3d25; }
.floating-guide { position: fixed; z-index: 2; right: max(12px,env(safe-area-inset-right)); bottom: max(12px,env(safe-area-inset-bottom)); width: 52px; height: 52px; padding: 5px; overflow-wrap: anywhere; color: #fff4d6; background: #7a3324; border: 2px solid #d7b277; border-radius: 50%; box-shadow: 0 3px 12px #25120680; font: 700 15px/1.1 var(--serif); }
.floating-guide:hover { background: #94432e; }
@media (max-width: 1100px) {
  .game-frame { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
}

#sheet { width: min(520px,calc(100% - 24px)); max-height: min(82dvh,780px); margin: auto; padding: 0; border: 1px solid #a98c65; border-radius: 12px; background: var(--paper); color: var(--ink); box-shadow: 0 14px 70px #100c0a66; }
#sheet::backdrop { background: #20150db3; }
.sheet-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--paper); border-bottom: 1px solid var(--line); padding: 14px 19px; }
.sheet-head h2 { font: 700 1.4rem var(--serif); }
.sheet-head button { display: grid; place-content: center; width: 36px; height: 36px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: #634c36; font: 25px/1 Arial,sans-serif; }
.game-sheet .sheet-head button { font-weight: 700; }
.sheet-body { padding: 20px; }
.sheet-body .primary { margin-top: 5px; }
.settlement-outcome { margin: 0 0 18px; font: 700 1.6rem/1.35 var(--serif); }
.sheet-text, .sheet-note, .empty { font-size: .95rem; line-height: 1.65; }
.sheet-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.sheet-note, .empty { color: var(--muted); }
.sheet-note { margin: 0 0 16px; }
.sheet-body h3 { font: 700 1.13rem var(--serif); margin: 21px 0 10px; }
.line-list { list-style: none; padding: 0; margin: 0; }
.line-list li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.line-list li:first-child { padding-top: 2px; }
.line-list li:last-child { border-bottom: 0; }
.list-main { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.list-main strong { overflow-wrap: anywhere; }
.list-meta { margin: 5px 0 0; font-size: .85rem; line-height: 1.5; color: var(--muted); overflow-wrap: anywhere; }
.delta-plus { color: #226646; font-weight: 700; }
.delta-minus { color: #9c3024; font-weight: 700; }
.data-line { display: flex; justify-content: space-between; align-items: baseline; gap: 15px; margin: 11px 0; }
.data-line span { color: var(--muted); }
.data-line b { text-align: right; overflow-wrap: anywhere; }
.more { min-height: 40px; width: 100%; margin-top: 12px; border: 1px solid var(--line); border-radius: 5px; background: #f0e6d2; color: #604730; }
.toast { position: fixed; z-index: 3; right: 16px; bottom: max(18px, env(safe-area-inset-bottom)); max-width: calc(100vw - 32px); color: #fff8e6; border: 1px solid #ab8964; background: #342318; box-shadow: 0 4px 16px #140d0940; border-radius: 8px; padding: 12px 16px; font-size: .95rem; }
@media (max-width: 680px) {
  .login-screen { background: #ebd9b9; padding: 0; display: block; }
  .login-frame { display: flex; flex-direction: column; border: 0; min-height: 100dvh; background: #f6eddb; }
  .login-poster { flex: 1 0 auto; min-height: 235px; height: calc(100dvh - 171px - env(safe-area-inset-bottom)); background: radial-gradient(ellipse at center,#eddfbb,#ddc7a2); }
  .login-poster img { object-fit: contain; width: 100%; height: 100%; }
  .login-panel { width: min(100%,500px); padding: 13px 20px max(12px,env(safe-area-inset-bottom)); }
  .login-panel h1, .login-panel #login-form { display: none; }
  .login-panel .login-name { margin-bottom: 10px; font-weight: 700; }
  .login-panel .red-seal { width: 25px; height: 25px; font-size: 16px; }
  .login-switch { padding: 0; margin: 0; gap: 9px; border: 0; background: transparent; }
  .login-switch button { min-height: 43px; border: 1px solid #b89f7a; border-radius: 5px; color: #543b28; background: #fff9ec; font-weight: 700; }
  .login-switch button[data-entry=member], .login-switch button[data-entry=member][aria-pressed=true] { color: #fff8e7; background: #963426; border-color: #81281c; }
  .login-back { margin-top: 4px; }
  .mobile-platform { display: block; }
  .field { margin-bottom: 13px; }
  .piece { aspect-ratio: 1.05; }
  .game-screen { padding-bottom: 0; }
  .game-frame { border: 0; }
  .round-head { gap: 6px; min-height: 51px; }
  .round-clock { gap: 4px; font-size: .85rem; }
  .sheet-body { padding: 16px; }
}
@media (max-width: 350px) {
  .round-head { padding: 7px; }
  .search-screen { padding-left: 12px; padding-right: 12px; }
  .search-form button { width: 86px; }
  .round-clock { font-size: .78rem; }
}
@media (prefers-reduced-motion: no-preference) {
  .piece, .group-tile { transition: background .12s, border-color .12s, box-shadow .12s; }
}
