:root {
  color-scheme: light;
  --ink: #12303a;
  --muted: #66808a;
  --paper: #f8fbf8;
  --panel: rgba(255, 255, 255, .88);
  --line: rgba(21, 61, 70, .11);
  --cyan: #3bc3d0;
  --cyan-dark: #168998;
  --green: #25a875;
  --amber: #f2a13a;
  --coral: #f06e66;
  --navy: #102f3d;
  --shadow: 0 18px 55px rgba(25, 72, 80, .12);
  font-family: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; color: var(--ink); background: #eaf7f5; overflow-x: hidden; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.ambient { position: fixed; border-radius: 50%; filter: blur(4px); pointer-events: none; opacity: .5; z-index: -1; }
.ambient-a { width: 36rem; height: 36rem; top: -15rem; right: -8rem; background: radial-gradient(circle, #7ee4e5, transparent 68%); }
.ambient-b { width: 30rem; height: 30rem; bottom: -12rem; left: -10rem; background: radial-gradient(circle, #ffd5a5, transparent 68%); }
.topbar { height: 78px; padding: 0 clamp(18px, 4vw, 58px); display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); background: rgba(246, 252, 250, .78); backdrop-filter: blur(18px); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; background: var(--navy); color: #fff; font-weight: 900; box-shadow: 5px 5px 0 #9be0da; }
.brand b, .brand small { display: block; }
.brand b { letter-spacing: .02em; }
.brand small { color: var(--muted); margin-top: 2px; }
.top-actions { display: flex; align-items: center; gap: 9px; }
.last-updated { font-size: 12px; color: var(--muted); margin-right: 6px; }
.soft-button, .icon-button { border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 999px; padding: 9px 15px; transition: .18s ease; }
.soft-button:hover, .soft-button.is-active { color: #fff; background: var(--navy); transform: translateY(-1px); }
.page-shell { width: min(1440px, calc(100% - 36px)); margin: 28px auto 64px; }
.panel, .metric-card { border: 1px solid rgba(255,255,255,.8); background: var(--panel); box-shadow: var(--shadow); backdrop-filter: blur(12px); border-radius: 24px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 20px; }
.code-card { min-height: 360px; padding: clamp(24px, 4vw, 52px); display: flex; flex-direction: column; align-items: flex-start; justify-content: center; background: linear-gradient(135deg, rgba(255,255,255,.95), rgba(222,250,244,.9)); position: relative; overflow: hidden; }
.code-card::after { content: ""; position: absolute; width: min(42%, 330px); aspect-ratio: 1; right: -34px; bottom: -55px; background: url("/pokopia_stamp_emblem.png") center / contain no-repeat; opacity: .2; mix-blend-mode: multiply; pointer-events: none; }
.code-card > * { position: relative; z-index: 1; }
.status-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.status-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 13px; border-radius: 999px; background: #eef2f2; color: #5d7077; font-weight: 800; font-size: 13px; }
.status-pill i { width: 9px; height: 9px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 5px color-mix(in srgb, currentColor 15%, transparent); }
.status-pill.is-open { background: #ddf8ea; color: #16835a; }
.status-pill.is-reopening, .status-pill.is-starting, .status-pill.is-waiting, .status-pill.is-running { background: #fff0d8; color: #a66410; }
.status-pill.is-error { background: #ffe4e1; color: #bd443b; }
.status-pill.is-offline, .status-pill.is-standby { background: #e9eeee; color: #607078; }
.phase-label { color: var(--muted); font-size: 13px; }
.eyebrow { margin: 0 0 7px; color: var(--cyan-dark); letter-spacing: .16em; font-size: 11px; font-weight: 900; text-transform: uppercase; }
.code-card > .eyebrow { margin-top: 36px; }
.code-value { font-family: "Arial Rounded MT Bold", "Trebuchet MS", sans-serif; font-size: clamp(58px, 9vw, 118px); line-height: .95; font-weight: 900; letter-spacing: .08em; color: var(--navy); text-shadow: 0 7px 0 rgba(59,195,208,.15); user-select: all; z-index: 1; }
.copy-code { margin-top: 22px; padding: 10px 18px; border: 0; border-radius: 12px; background: var(--cyan); color: #07343b; font-weight: 900; }
.copy-code:disabled { opacity: .35; cursor: default; }
.round-label { margin: 17px 0 0; color: var(--muted); }
.screenshot-card { padding: 24px; min-height: 360px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-heading.compact { margin-bottom: 14px; }
.section-heading h2 { font-size: 21px; margin: 0; }
.live-dot { font-size: 10px; font-weight: 900; letter-spacing: .16em; color: var(--coral); }
.screenshot-stage { height: 278px; border-radius: 17px; overflow: hidden; background: #dbe7e6; display: grid; place-items: center; position: relative; }
.screenshot-stage img { width: 100%; height: 100%; object-fit: cover; }
.empty-visual, .empty-state { color: #789097; text-align: center; font-size: 13px; padding: 24px; }
.pulse-grid { display: grid; grid-template-columns: 1.25fr 1.25fr repeat(3, 1fr); gap: 14px; margin: 20px 0; }
.metric-card { min-height: 148px; padding: 23px; box-shadow: 0 10px 30px rgba(25,72,80,.08); }
.metric-card p { margin: 0 0 13px; color: var(--muted); font-size: 13px; font-weight: 700; }
.metric-card strong { font-size: 38px; line-height: 1; }
.metric-card strong small { font-size: 18px; color: var(--muted); }
.metric-card > small { color: var(--muted); margin-left: 7px; }
.metric-sub { display: block; margin-top: 13px; color: var(--muted); font-size: 12px; }
.metric-sub b { color: var(--coral); }
.task-card { background: linear-gradient(145deg, #143c48, #0d2b37); color: #fff; }
.task-card p, .task-card strong small { color: #a9c9ce; }
.task-card strong { font-size: 56px; }
.progress-track { height: 8px; background: rgba(255,255,255,.13); border-radius: 99px; margin-top: 17px; overflow: hidden; }
.progress-track span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #63dfc2, #fbcb65); border-radius: inherit; transition: width .35s ease; }
.timer-card strong { font-variant-numeric: tabular-nums; }
.timer-card > small { display: block; margin: 12px 0 0; }
.content-grid, .log-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.room-panel, .summary-panel, .timeline-panel, .recent-panel { padding: 25px; }
.count-badge { background: #e4f8f3; color: #167b69; border-radius: 999px; padding: 7px 11px; font-weight: 900; font-size: 12px; }
.player-list { display: grid; gap: 10px; }
.player-row { display: flex; justify-content: space-between; align-items: center; padding: 13px 15px; border: 1px solid var(--line); border-radius: 14px; background: rgba(247,251,249,.8); }
.player-row b { font-size: 15px; }
.player-state { padding: 5px 9px; border-radius: 999px; font-size: 11px; font-weight: 900; background: #e7f5ff; color: #21799a; }
.player-state.arrived { background: #ddf8ea; color: #16835a; }
.summary-block { padding: 16px 17px; border-left: 4px solid var(--cyan); background: #f1f9f7; border-radius: 5px 14px 14px 5px; margin-bottom: 12px; }
.summary-block.accent { border-color: var(--amber); background: #fff8ed; }
.summary-block span { font-size: 11px; font-weight: 900; color: var(--muted); letter-spacing: .08em; }
.summary-block p { margin: 7px 0 0; line-height: 1.65; font-size: 14px; }
.announcement-details { margin-top: 16px; }
.announcement-details summary { color: var(--cyan-dark); cursor: pointer; font-weight: 800; font-size: 13px; }
.announcement-details pre { white-space: pre-wrap; font: 12px/1.7 inherit; color: #526d75; border: 1px solid var(--line); padding: 14px; border-radius: 12px; background: #fbfdfc; }
.timeline { list-style: none; padding: 0; margin: 0; max-height: 350px; overflow: auto; }
.timeline li:not(.empty-state) { position: relative; padding: 0 0 17px 24px; border-left: 1px solid #cce4df; margin-left: 5px; }
.timeline li:not(.empty-state)::before { content: ""; width: 9px; height: 9px; border-radius: 50%; position: absolute; left: -5px; top: 5px; background: var(--cyan); box-shadow: 0 0 0 4px #e5f6f3; }
.timeline time { display: block; color: var(--muted); font-size: 11px; margin-bottom: 3px; }
.timeline b { font-size: 14px; }
.timeline p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.recent-rounds { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.round-chip { padding: 16px; border-radius: 15px; border: 1px solid var(--line); background: #f9fcfb; }
.round-chip header { display: flex; justify-content: space-between; font-weight: 900; }
.round-chip p { color: var(--muted); font-size: 12px; margin: 9px 0 0; }
.drawer-backdrop { position: fixed; inset: 0; background: rgba(7,24,31,.3); backdrop-filter: blur(3px); z-index: 39; }
.side-drawer { position: fixed; right: 0; top: 0; bottom: 0; width: min(620px, 94vw); padding: 28px; background: #f8fcfa; box-shadow: -20px 0 70px rgba(7,31,39,.2); transform: translateX(105%); transition: transform .28s ease; z-index: 40; overflow-y: auto; }
.side-drawer.open { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; position: sticky; top: -28px; padding: 16px 0; background: rgba(248,252,250,.94); backdrop-filter: blur(12px); z-index: 2; }
.drawer-head h2 { margin: 0; font-size: 25px; }
.icon-button { width: 42px; height: 42px; padding: 0; font-size: 25px; }
.segmented { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; padding: 5px; border-radius: 14px; background: #e7f1ef; }
.segmented button { border: 0; border-radius: 10px; background: transparent; padding: 9px 5px; color: var(--muted); font-weight: 800; }
.segmented button.active { background: #fff; color: var(--ink); box-shadow: 0 3px 12px rgba(12,48,57,.1); }
.range-caption, .query-meta { color: var(--muted); font-size: 12px; line-height: 1.6; }
.ranking-group { margin-top: 25px; }
.ranking-group h3 { font-size: 14px; margin: 0 0 10px; }
.ranking-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 7px; counter-reset: ranks; }
.ranking-list li { display: grid; grid-template-columns: 32px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.rank-number { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; background: #edf4f2; color: var(--muted); font-size: 11px; font-weight: 900; }
.ranking-list li:nth-child(-n+3) .rank-number { background: #ffedc9; color: #9a6713; }
.ranking-note { grid-column: 2 / 4; color: var(--muted); font-size: 10px; }
.query-form { display: grid; gap: 13px; }
.query-form label { display: grid; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 800; }
.query-form input, .query-form select { border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 11px 12px; border-radius: 11px; outline: none; }
.query-form input:focus, .query-form select:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(59,195,208,.15); }
.date-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.primary-button { border: 0; border-radius: 12px; padding: 12px 18px; color: #fff; background: var(--navy); font-weight: 900; }
.mini-summary { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin: 16px 0; }
.mini-summary div { padding: 11px; background: #edf7f4; border-radius: 11px; font-size: 11px; color: var(--muted); }
.mini-summary b { display: block; color: var(--ink); font-size: 20px; margin-top: 3px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
table { border-collapse: collapse; width: 100%; min-width: 500px; font-size: 12px; }
th, td { padding: 10px; text-align: right; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child { text-align: left; }
th { color: var(--muted); font-weight: 900; background: #f3f8f6; }
tfoot td { font-weight: 900; background: #edf7f4; }
footer { padding: 25px clamp(18px,4vw,58px); display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; border-top: 1px solid var(--line); }
.toast { position: fixed; left: 50%; bottom: 25px; transform: translate(-50%, 20px); opacity: 0; background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 999px; z-index: 60; transition: .2s; pointer-events: none; font-size: 12px; }
.toast.show { opacity: 1; transform: translate(-50%,0); }
@media (max-width: 1000px) {
  .hero-grid, .content-grid, .log-grid { grid-template-columns: 1fr; }
  .pulse-grid { grid-template-columns: repeat(3, 1fr); }
  .task-card, .timer-card { grid-column: span 1; }
}
@media (max-width: 700px) {
  .topbar { height: auto; padding: 13px 16px; align-items: flex-start; }
  .brand small, .last-updated { display: none; }
  .soft-button { padding: 8px 10px; font-size: 12px; }
  .page-shell { width: min(100% - 20px, 1440px); margin-top: 12px; }
  .code-card { min-height: 300px; padding: 25px; }
  .code-card::after { width: 48%; right: -28px; bottom: -24px; opacity: .16; }
  .code-value { font-size: clamp(48px, 17vw, 78px); }
  .pulse-grid { grid-template-columns: 1fr 1fr; }
  .pulse-grid .metric-card:last-child { grid-column: span 2; }
  .metric-card { min-height: 132px; padding: 18px; }
  .metric-card strong { font-size: 32px; }
  .side-drawer { width: 100%; top: 8vh; border-radius: 24px 24px 0 0; }
  .date-pair { grid-template-columns: 1fr; }
  footer { flex-direction: column; gap: 5px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
