:root {
  color-scheme: dark;
  --background: #202220;
  --surface: #303331;
  --surface-raised: #383c37;
  --inset: #232623;
  --edge: #181b18;
  --line: #484d46;
  --text: #f5f6f2;
  --muted: #bdc4ba;
  --green: #a6db89;
  --amber: #f0d188;
  --font: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  --mono: "Cascadia Mono", Consolas, ui-monospace, monospace;
  font: 14px/1.6 var(--font);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-width: 290px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text);
  background: radial-gradient(ellipse at 51% 0%, #30352e 0%, transparent 680px), var(--background);
}
a { color: var(--green); }
input, button, textarea, select { font: inherit; }
button, select, summary { cursor: pointer; }
button:disabled { cursor: wait; opacity: .63; }
:focus-visible { outline: 2px solid #c5f3aa; outline-offset: 3px; }
p, h1, h2, h3 { margin: 0; overflow-wrap: anywhere; }
h2 { font-size: 20px; line-height: 1.35; }
h3 { font-size: 16px; line-height: 1.5; }
.skip { position: fixed; top: -90px; left: 10px; z-index: 20; background: #202220; padding: 10px; }
.skip:focus { top: 8px; }
.frame { width: min(1176px, calc(100% - 64px)); margin-inline: auto; }

.topbar { background: #e6e8eb; color: #222520; border-bottom: 4px solid #adb1ac; box-shadow: 0 2px #171a17; }
.topbar-inner { width: min(1176px, calc(100% - 64px)); min-height: 66px; margin-inline: auto; display: flex; align-items: center; gap: 42px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: inherit; font: 900 23px/1 var(--mono); white-space: nowrap; letter-spacing: -1px; }
.brand small { font: 750 14px/1 var(--font); margin-left: 8px; letter-spacing: 0; }
.brand-mark { width: 34px; height: 34px; background: #2c3528; border: 2px solid #1e231c; box-shadow: inset 0 2px #50624a, inset 0 -3px #171e16; display: grid; place-items: center; }
.brand-mark span { width: 19px; height: 17px; background: linear-gradient(#a4d475 0 26%, #659345 26% 47%, #855b37 47% 72%, #603d28 72%); clip-path: polygon(0 0, 100% 0, 100% 68%, 84% 68%, 84% 84%, 67% 84%, 67% 100%, 33% 100%, 33% 84%, 16% 84%, 16% 68%, 0 68%); }
.topbar nav { align-self: stretch; display: flex; align-items: stretch; gap: 3px; }
.topbar nav a, .admin-link { color: #353a33; text-decoration: none; font-weight: 750; white-space: nowrap; }
.topbar nav a { display: grid; place-items: center; padding: 0 17px; border-bottom: 4px solid transparent; margin-bottom: -4px; }
.topbar nav a:hover, .topbar nav a[aria-current] { background: #d5d8d3; color: #222921; border-bottom-color: #4a8a37; }
.admin-link { margin-left: auto; display: flex; align-items: center; gap: 7px; font-size: 13px; padding: 7px 10px; }
.admin-link:hover, .admin-link[aria-current] { background: #d5d8d3; }
.topbar :focus-visible { outline-color: #265a19; outline-offset: -2px; }

main { flex: 1; }
.hero {
  position: relative;
  min-height: 219px;
  margin: 30px 0 22px;
  border: 2px solid #141814;
  box-shadow: 0 4px #101310;
  background-color: #2a3027;
  background-image: linear-gradient(90deg, #171c19 2%, #191e1be8 29%, #1b211972 61%, #171b190a 100%), url("/assets/hero.webp");
  background-position: center, center 48%;
  background-size: cover;
  display: flex;
  align-items: center;
}
.hero::after { content: ""; pointer-events: none; position: absolute; inset: 0; box-shadow: inset 0 2px #ffffff22, inset 0 -2px #0005; }
.hero-content { position: relative; padding: 25px 36px; }
.hero-label { color: #b5dd9f; font-size: 13px; font-weight: 800; letter-spacing: .11em; }
.hero-label span { display: inline-block; width: 8px; height: 8px; background: #98d875; box-shadow: 2px 2px #354e2d; margin-right: 7px; vertical-align: 1px; }
.hero h1 { margin: 7px 0 10px; font-size: clamp(34px, 5vw, 47px); letter-spacing: .055em; line-height: 1.18; text-shadow: 3px 3px #101410; }
.hero h1 + p { color: #dce3d8; font-size: 15px; }

.feedback-grid { display: grid; grid-template-columns: minmax(0, 1fr) 302px; align-items: start; gap: 18px; }
.panel { min-width: 0; background: var(--surface); color: var(--text); border: 2px solid var(--edge); box-shadow: 0 3px #151815, inset 0 1px #4c514a; }
.panel-head { padding: 18px 22px; display: flex; align-items: center; gap: 13px; background: var(--surface-raised); border-bottom: 2px solid var(--edge); box-shadow: inset 0 1px #555a51; }
.panel-head p { color: var(--muted); font-size: 12px; margin-top: 4px; }
.heading-icon { color: var(--green); display: grid; place-items: center; width: 39px; height: 39px; flex: 0 0 39px; background: #282f27; border: 1px solid #1b221a; box-shadow: inset 0 1px #465241; }
.panel-content { padding: 20px 22px; }
.section { margin: 0; min-width: 0; padding: 0 0 21px; border: 0; }
.section + .section { padding-top: 4px; }
.section legend { display: inline-flex; align-items: center; gap: 10px; width: 100%; font-size: 14px; font-weight: 800; margin: 0 0 12px; padding: 0; }
.section legend::after { content: ""; height: 2px; flex: 1; background: var(--edge); box-shadow: 0 1px var(--line); }
.category-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
.category { min-width: 0; cursor: pointer; position: relative; }
.category input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.category span { min-height: 65px; padding: 7px 3px 9px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 4px; border: 1px solid #1a1e19; box-shadow: inset 0 1px #666c61, inset 0 -4px #333832; background: #4a5047; color: #f1f4ed; font-size: 12px; font-weight: 750; }
.category span .icon { color: #d7e1d2; }
.category:hover span { background: #565e53; }
.category input:focus-visible + span { outline: 2px solid #c5f3aa; outline-offset: 2px; }
.category input:checked + span { background: #3a6c31; color: #fff; box-shadow: inset 0 3px #273f22, inset 0 -2px #558649; padding-top: 10px; padding-bottom: 6px; }
.category input:checked + span::after { position: absolute; content: ""; width: 18px; height: 2px; left: calc(50% - 9px); bottom: 4px; background: #c5efb2; }
.category input:checked + span .icon { color: #e4ffd8; }
.columns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: block; min-width: 0; font-weight: 700; }
.field :is(input, select, textarea) { display: block; margin-top: 5px; }
.fields > * + * { margin-top: 12px; }
input:not([type="radio"], [type="checkbox"]), textarea, select {
  width: 100%; min-height: 40px; padding: 8px 10px; color: var(--text); border: 1px solid #171b17; border-radius: 0;
  background: var(--inset); box-shadow: inset 0 2px #131713, 0 1px #454a43; font-weight: 400;
}
input::placeholder, textarea::placeholder { color: #a6b0a3; opacity: 1; }
textarea { resize: vertical; }
.log-input, #player-key { font-family: var(--mono), var(--font); font-size: 13px; }
.required { color: #f0ae9d; }
.optional { display: inline-block; color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 3px; }
.muted { color: var(--muted); }
.help-line { margin-top: 5px; font-size: 12px; }
.form-actions, .split-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.form-actions, .split-actions { justify-content: space-between; }
.form-actions { padding-top: 14px; border-top: 1px solid var(--line); }
.form-actions p, .text-link { font-size: 13px; }
.upload input { border-style: dashed; }
input::file-selector-button {
  padding: 4px 9px; margin-right: 8px; cursor: pointer; color: #212520; background: #d0d1d4; border: 1px solid #131713;
  box-shadow: inset 0 1px #f0f1f0, inset 0 -2px #888d85;
}
.button {
  --face: #d0d1d4; --light: #f0f1f1; --mid: #e0e3df; --shadow: #747a72; --ink: #202520;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 1px solid #151914;
  min-height: 41px; padding: 6px 13px 9px; background: var(--face); color: var(--ink); text-decoration: none;
  box-shadow: inset 0 2px var(--light), inset 0 -3px var(--shadow), inset 0 -4px var(--mid); font-weight: 800;
}
.button:hover:not(:disabled) { filter: brightness(1.1); }
.button:active:not(:disabled) { box-shadow: inset 0 2px var(--shadow), inset 0 -1px var(--mid); padding-top: 8px; padding-bottom: 7px; }
.button.primary { --face: #3d852c; --light: #80b16c; --mid: #609b4f; --shadow: #214718; --ink: #fff; min-width: 128px; }
.button.small { min-height: 32px; padding-inline: 10px; font-size: 12px; }
.notice { padding: 10px 12px; border: 1px solid #49573f; background: #2b3527; color: #dfefda; font-size: 13px; overflow-wrap: anywhere; }
.notice.error { background: #4a2b27; color: #ffded7; border-color: #87534a; margin: 0 0 12px; }
.notice.privacy { background: #3a3428; color: var(--amber); border-color: #5a5037; font-size: 12px; }
#page-error { margin: 22px 0; }

.rail { display: grid; gap: 16px; }
.rail-head { display: flex; align-items: center; gap: 9px; padding: 12px 14px; background: var(--surface-raised); border-bottom: 2px solid var(--edge); }
.rail-head .icon { color: var(--green); }
.rail-head h2 { font-size: 15px; }
.rail-body { padding: 13px; }
.steps { display: grid; gap: 12px; padding: 0; margin: 0 0 15px; list-style: none; }
.steps li { display: flex; align-items: flex-start; gap: 9px; }
.steps b { display: grid; place-items: center; flex: 0 0 22px; height: 22px; background: #282e27; border: 1px solid #485143; color: var(--green); font: 800 12px var(--mono); }
.steps strong { font-size: 13px; }
.steps p, .rail-text { color: var(--muted); font-size: 12px; }
.rail-button { margin-top: 10px; width: 100%; justify-content: space-between; }
.footer { margin-top: 23px; padding: 16px 0 21px; border-top: 1px solid #444a42; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 18px; font-size: 12px; color: var(--muted); }
dialog { width: min(456px, calc(100% - 28px)); padding: 0; }
dialog::backdrop { background: #111711d9; }
.workspace { padding-top: 24px; }
.hero:not([hidden]) ~ .workspace { padding-top: 0; }
.workspace .panel + .panel { margin-top: 14px; }
.workspace .panel-head { justify-content: space-between; flex-wrap: wrap; }
.workspace .panel-head > div:first-child { min-width: 0; }
.signin { width: min(460px, 100%); margin: 8px auto; }
.toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: 9px; padding: 13px 15px; border-bottom: 1px solid var(--line); }
.toolbar .field { min-width: 105px; }
.toolbar .search { flex: 1 1 200px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
.stat { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 5px; min-height: 66px; padding: 9px 12px; color: var(--text); text-align: left; font-weight: 700; }
.stat[aria-pressed="true"] { background: #3a5833; box-shadow: inset 0 2px #222b20; }
.stat b { font: 800 23px var(--mono); }
.ticket-card { display: grid; gap: 7px; padding: 13px 15px; color: inherit; text-decoration: none; border-bottom: 1px solid var(--line); }
.ticket-card:hover { background: #3e463c; }
.ticket-card:focus-visible { outline-offset: -3px; }
.ticket-line, .ticket-meta, .ticket-title-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
.ticket-id { color: #c9d5c6; font: 12px var(--mono); overflow-wrap: anywhere; }
.ticket-meta { color: var(--muted); justify-content: flex-start; font-size: 12px; overflow-wrap: anywhere; }
.status { display: inline-flex; align-items: center; gap: 6px; background: #5b512e; color: #fff1b9; border: 1px solid #77663a; padding: 2px 7px; font-size: 12px; white-space: nowrap; }
.status::before { content: ""; background: currentColor; width: 6px; height: 6px; }
.status-working { background: #2f4758; color: #d0eaff; border-color: #506d80; }
.status-waiting { background: #514257; color: #f1d8ff; border-color: #775d80; }
.status-resolved { background: #344b2e; color: #d4efc7; border-color: #547447; }
.empty { padding: 26px 15px; text-align: center; color: var(--muted); }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 15px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; align-items: start; gap: 14px; }
.detail-block { margin-top: 15px; }
.detail-block p, .event p { white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-block h3 { margin-bottom: 5px; }
.log-box { border: 1px solid #161a16; background: #222823; margin-top: 14px; }
.log-box summary { padding: 9px 11px; font-weight: 700; }
.log-box pre { max-height: 390px; padding: 0 10px; margin: 8px 0; overflow: auto; color: #d6e9d1; font: 12px/1.4 var(--mono), var(--font); }
.log-actions { margin-top: 8px; }
.photo-list { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.photo-list img { display: block; width: 120px; height: 84px; object-fit: cover; border: 1px solid #6e786a; }
.event { margin: 10px 0; padding: 9px 11px; background: #272e27; border-left: 3px solid #576852; }
.event.internal { background: #383227; border-left-color: #ad9149; }
.event time { font-size: 12px; color: var(--muted); }
.event p { margin-top: 5px; }
.secondary-banner { background: #363c33; color: var(--muted); padding: 8px 11px; margin: 12px 0; }

.icon { display: inline-block; flex: 0 0 auto; position: relative; width: 17px; height: 17px; color: inherit; }
.icon::before, .icon::after { content: ""; position: absolute; }
.icon-form::before { inset: 0 2px; border: 2px solid currentColor; }
.icon-form::after { left: 5px; top: 5px; width: 7px; height: 2px; background: currentColor; box-shadow: 0 4px currentColor, 0 8px currentColor; }
.icon-lock::before { width: 6px; height: 7px; border: 2px solid currentColor; left: 4px; top: 0; }
.icon-lock::after { width: 14px; height: 9px; top: 7px; left: 2px; background: currentColor; }
.icon-bug::before { inset: 3px 4px 0; background: currentColor; clip-path: polygon(22% 0, 78% 0, 78% 20%, 100% 20%, 100% 84%, 78% 84%, 78% 100%, 22% 100%, 22% 84%, 0 84%, 0 20%, 22% 20%); }
.icon-bug::after { width: 17px; height: 2px; top: 6px; background: currentColor; box-shadow: 0 4px currentColor, 0 8px currentColor; }
.icon-user::before { width: 7px; height: 7px; top: 1px; left: 5px; background: currentColor; }
.icon-user::after { inset: 10px 1px 1px; background: currentColor; clip-path: polygon(14% 0, 86% 0, 86% 25%, 100% 25%, 100% 100%, 0 100%, 0 25%, 14% 25%); }
.icon-coins::before { inset: 3px 2px 3px; border: 2px solid currentColor; box-shadow: 0 3px currentColor; }
.icon-coins::after { width: 5px; height: 2px; left: 6px; top: 7px; background: currentColor; }
.icon-flag::before { inset: 1px 13px 0 2px; background: currentColor; }
.icon-flag::after { inset: 1px 1px 6px 4px; background: currentColor; clip-path: polygon(0 0, 100% 0, 75% 50%, 100% 100%, 0 100%); }
.icon-bulb::before { inset: 1px 3px 4px; border: 2px solid currentColor; border-radius: 3px; }
.icon-bulb::after { inset: 15px 6px 0; background: currentColor; }
.icon-terminal::before, .icon-inbox::before { inset: 2px 0; border: 2px solid currentColor; }
.icon-terminal::after { top: 7px; left: 4px; width: 4px; height: 4px; border: solid currentColor; border-width: 2px 2px 0 0; transform: rotate(45deg); }
.icon-inbox::after { top: 7px; left: 4px; width: 9px; height: 2px; background: currentColor; box-shadow: 0 3px currentColor; }

@media (max-width: 940px) {
  .frame, .topbar-inner { width: calc(100% - 36px); }
  .feedback-grid { grid-template-columns: minmax(0, 1fr) 245px; gap: 12px; }
  .panel-head, .panel-content { padding-inline: 15px; }
}
@media (max-width: 710px) {
  .topbar-inner { flex-wrap: wrap; gap: 0 8px; min-height: 54px; }
  .brand { min-height: 52px; font-size: 20px; }
  .brand small { font-size: 13px; margin-left: 3px; }
  .brand-mark { width: 28px; height: 28px; }
  .topbar nav { order: 3; width: 100%; font-size: 13px; min-height: 37px; }
  .topbar nav a { padding-inline: 12px; }
  .hero { min-height: 164px; margin-top: 16px; margin-bottom: 14px; background-position: center, 59% center; }
  .hero-content { padding: 19px; }
  .hero h1 + p { font-size: 13px; }
  .feedback-grid, .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .panel-head { padding-block: 12px; }
  .workspace { padding-top: 15px; }
}
@media (max-width: 440px) {
  .frame, .topbar-inner { width: calc(100% - 22px); }
  .category-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .category span { min-height: 57px; }
  .columns, .stats { grid-template-columns: 1fr 1fr; gap: 7px; }
  .panel-content, .panel-head { padding-inline: 11px; }
  .admin-link { padding-inline: 3px; }
  .detail-grid .panel-head { align-items: flex-start; }
}
