:root {
  color-scheme: light;
  --bg: #f2f5f3;
  --surface: #fff;
  --ink: #162b25;
  --muted: #51665e;
  --line: #d6e1dc;
  --accent: #1e634c;
  --accent-dark: #164b3a;
  --tint: #e8f3ed;
  --danger: #963d35;
  --radius: 14px;
  font: 100%/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
button, input, select { font: inherit; }
button, input, select { color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid #357e63; outline-offset: 3px; }
.skip { position: fixed; left: 1rem; top: -6rem; z-index: 10; background: white; padding: .65rem; color: var(--accent-dark); }
.skip:focus { top: 1rem; }
.wrap { width: min(1180px, calc(100% - 56px)); margin-inline: auto; }

.masthead {
  color: #f6faf8;
  background-color: #142d28;
  background-image: radial-gradient(ellipse at 78% 20%, #285344a0, transparent 68%), radial-gradient(#86b09a32 1px, transparent 1px);
  background-size: auto, 17px 17px;
  border-bottom: 1px solid #264a3f;
}
.masthead-content { display: flex; gap: 17px; align-items: center; padding-block: 25px 27px; }
.brand {
  width: 48px; height: 48px; flex: 0 0 48px; border: 1px solid #9ac9ac70; border-radius: 12px;
  display: flex; align-items: end; justify-content: center; gap: 4px; padding-bottom: 11px; background: #86bd9d1a;
}
.brand i { width: 5px; background: #b9efcc; border-radius: 2px 2px 0 0; height: 10px; }
.brand i:nth-child(2) { height: 16px; }
.brand i:nth-child(3) { height: 22px; }
.game { color: #bdd8c9; font-size: .88rem; font-weight: 650; line-height: 1.3; }
h1 { font-size: clamp(1.55rem, 4vw, 2rem); line-height: 1.32; letter-spacing: -.025em; }
.version {
  display: grid; justify-items: center; line-height: 1.35;
  margin-left: auto; border: 1px solid #9ac9ac70; border-radius: 6px; padding: .28rem .65rem;
  color: #e0f1e7; font-size: .84rem; font-weight: 600; white-space: nowrap;
}
.version small { font-size: .8em; color: #bdd8c9; }

.main { padding-block: 26px 44px; }
.file-panel {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px; box-shadow: 0 2px 5px #12362a08;
}
.file-panel.is-dragging { border-color: var(--accent); background: var(--tint); }
.file-icon { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px; border-radius: 10px; background: var(--tint); }
.file-icon::before { content: ""; width: 15px; height: 20px; border: 2px solid var(--accent); border-radius: 3px; }
.file-icon::after { content: ""; position: absolute; width: 7px; height: 4px; border-block: 1px solid var(--accent); transform: translateY(2px); }
.file-copy { min-width: 0; }
.file-copy h2 { font-size: 1.05rem; overflow-wrap: anywhere; }
.file-copy p { font-size: .88rem; color: var(--muted); margin-top: 2px; }
.file-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem; }
.file-details {
  grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .55rem 1rem; border-top: 1px solid var(--line); padding-top: .75rem; margin: 0;
}
.file-details dt { color: var(--muted); font-size: .83rem; }
.file-details dd { margin: .1rem 0 0; font-size: .9rem; font-weight: 620; overflow-wrap: anywhere; }
.button {
  display: inline-flex; gap: .4em; align-items: center; justify-content: center; min-height: 44px;
  border: 1px solid var(--line); padding: .55rem .85rem; border-radius: 8px;
  background: var(--surface); color: var(--ink); font-weight: 620; text-align: center; text-decoration: none; line-height: 1.3;
}
.button:hover { background: var(--tint); }
.button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.button.primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
body:not(.has-file) .file-button { background: var(--accent); border-color: var(--accent); color: #fff; }
body:not(.has-file) .file-button:hover { background: var(--accent-dark); }
.button.danger { color: var(--danger); }
.button:disabled { cursor: default; opacity: .48; }
.file-button { position: relative; cursor: pointer; white-space: nowrap; }
.file-button:focus-within { outline: 3px solid #357e63; outline-offset: 3px; }
.file-button input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.notice { padding: .65rem .85rem; margin-top: 12px; border: 1px solid #b8d8c7; border-radius: 8px; background: var(--tint); color: var(--accent-dark); overflow-wrap: anywhere; }
.notice.error { border-color: #e6c1bb; background: #fceeea; color: #772e27; }
.notice[role="status"] { scroll-margin-top: 1rem; }

.workspace { display: grid; grid-template-columns: 194px minmax(0, 1fr); gap: 22px; margin-top: 22px; align-items: start; }
.sidebar { position: sticky; top: 16px; }
.sidebar nav { display: grid; gap: 4px; padding: 9px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.nav-button {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 43px; padding: .42rem .65rem;
  border: 1px solid transparent; border-radius: 8px; background: transparent; text-align: start;
  color: var(--muted); font-weight: 580;
}
.nav-button::before { content: ""; width: 6px; height: 6px; border: 1px solid #647c71; border-radius: 50%; }
.nav-button:hover { background: #f2f6f4; }
.nav-button[aria-current="true"] { border-color: #cbe2d4; background: var(--tint); color: var(--accent-dark); font-weight: 700; }
.nav-button[aria-current="true"]::before { background: var(--accent); border-color: var(--accent); }
.mobile-nav { display: none; }
#workbench { min-width: 0; }
.module-heading { display: grid; gap: .23rem; margin-bottom: 14px; }
.module-heading h2 { font-size: 1.55rem; line-height: 1.35; }
.module-heading p, .subtext { color: var(--muted); font-size: .92rem; }
.panel {
  border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius);
  padding: 17px 19px; margin-bottom: 14px; min-width: 0;
}
.panel h3 { font-size: 1.05rem; line-height: 1.4; }
.panel > h3 { margin-bottom: .8rem; }
.panel > .subtext { margin-bottom: .65rem; }
.empty { padding-block: 35px; }
.empty h2 { font-size: 1.3rem; margin-bottom: .35rem; }
.empty p { color: var(--muted); }

.toolbar, .controls { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.toolbar { margin-bottom: 14px; }
.panel > .toolbar:last-child { margin-bottom: 0; }
.controls { margin-block: 9px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 142px), 1fr)); gap: 11px 14px; }
.grid.tight { grid-template-columns: repeat(auto-fit, minmax(min(100%, 105px), 1fr)); }
.control { display: grid; gap: 3px; align-content: start; min-width: 0; }
.control > span { font-size: .88rem; color: var(--muted); }
.control input, .control select, .mobile-nav select {
  width: 100%; min-width: 0; min-height: 44px; background: #fdfefd;
  border: 1px solid #bdcec5; border-radius: 8px; padding: .45rem .66rem; font-variant-numeric: tabular-nums;
}
.control input[type="file"] { border: 0; padding-inline: 0; }
.control input::file-selector-button {
  font: inherit; color: var(--ink); border-radius: 7px; padding: .45rem .7rem;
  border: 1px solid var(--line); background: var(--tint); margin-right: .45rem; cursor: pointer;
}
.control input[aria-invalid="true"] { border-color: var(--danger); background: #fff8f5; }
select {
  appearance: none; padding-right: 2.1rem !important;
  background-image: linear-gradient(45deg, transparent 50%, #47665a 50%), linear-gradient(135deg, #47665a 50%, transparent 50%) !important;
  background-position: right 17px center, right 12px center !important;
  background-size: 5px 5px, 5px 5px !important; background-repeat: no-repeat !important;
}
.toolbar .control, .controls .control { flex: 1 1 118px; max-width: 230px; }
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.status-line { color: var(--muted); font-size: .89rem; }
.feedback { color: var(--accent-dark); font-size: .9rem; margin-block: .25rem .8rem; }
.feedback.error { color: var(--danger); }
.details { border-bottom: 1px solid #e1e9e4; }
.details:last-child { border-bottom: 0; }
.details summary { cursor: pointer; list-style: none; min-height: 55px; padding: .65rem .25rem; }
.details summary::-webkit-details-marker { display: none; }
.details summary::after { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); margin: 0 6px 3px 12px; flex: 0 0 auto; }
.details[open] summary::after { transform: rotate(225deg); margin-bottom: -4px; }
.details-body { padding: 4px 2px 13px; }
.details-body .button { margin-top: 9px; }
.list-row, .details summary { display: flex; align-items: center; gap: 8px; min-width: 0; }
.list-row { min-height: 52px; border-bottom: 1px solid #e1e9e4; padding-block: .4rem; }
.list-row:last-child { border-bottom: 0; }
.row-copy { min-width: 0; flex: 1; overflow-wrap: anywhere; display: grid; }
.row-copy strong { font-weight: 650; }
.row-copy small, .row-meta { color: var(--muted); font-size: .83rem; }
.row-meta { text-align: right; font-variant-numeric: tabular-nums; }
.tick { cursor: pointer; display: flex; align-items: center; gap: 8px; min-height: 44px; }
.tick input { width: 19px; height: 19px; flex: 0 0 19px; accent-color: var(--accent); margin: 0; }
.select-row { align-items: stretch; }
.select-row .tick { flex: 1; }
.search-row { display: flex; align-items: end; gap: 10px; margin-bottom: 4px; }
.search-row .control { flex: 1; max-width: 360px; }
.search-row p { padding-bottom: .65rem; }
.pagination { display: flex; align-items: center; justify-content: center; gap: .65rem; padding-top: .85rem; }
.pagination .status-line { font-variant-numeric: tabular-nums; }
.list-empty { padding-block: .9rem .45rem; color: var(--muted); }
.export-content { display: flex; align-items: center; justify-content: space-between; gap: .55rem; }
.export-copy { order: 1; display: grid; min-width: 0; max-width: 132px; line-height: 1.3; }
.export-copy span { color: var(--accent-dark); font-weight: 650; font-size: .9rem; }
.export-copy span, .export-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.export-copy small { display: none; color: var(--muted); font-size: .85rem; }
.export-content .button { flex: 0 0 auto; min-width: 126px; }
a.visible-download { display: inline-block; color: var(--accent-dark); font-weight: 650; margin-left: .5rem; }

@media (max-width: 800px) {
  .wrap { width: calc(100% - 32px); }
  .workspace { grid-template-columns: 155px minmax(0, 1fr); gap: 14px; }
  .split { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .file-details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .main { padding-top: 14px; }
  body.has-file .main { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
  .masthead-content { padding-block: 15px; gap: 11px; }
  .brand { width: 40px; height: 40px; flex-basis: 40px; padding-bottom: 8px; }
  .game { font-size: .8rem; }
  .version { font-size: .75rem; padding: .18rem .36rem; }
  .file-panel { display: grid; grid-template-columns: auto minmax(0, 1fr); padding: 13px; gap: 11px; }
  .file-actions { grid-column: 1 / -1; }
  body:not(.has-file) .file-button { width: 100%; }
  .file-icon { width: 38px; height: 38px; }
  .export-bar {
    position: fixed; z-index: 3; left: 0; right: 0; bottom: 0;
    border-top: 1px solid var(--line); background: var(--surface); box-shadow: 0 -5px 24px #173d2f0d;
  }
  .export-content { width: calc(100% - 32px); margin-inline: auto; padding-block: .65rem calc(.65rem + env(safe-area-inset-bottom)); }
  .export-copy { order: 0; max-width: none; }
  .export-copy small { display: block; }
  .workspace { display: block; margin-top: 14px; }
  .sidebar { position: static; }
  .sidebar nav { display: none; }
  .mobile-nav {
    display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px;
    border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 8px 10px; margin-bottom: 15px;
  }
  .mobile-nav span { font-size: .86rem; color: var(--muted); }
  .panel { padding: 13px; margin-bottom: 11px; }
  .module-heading h2 { font-size: 1.36rem; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .toolbar .control { max-width: none; }
  .details summary { flex-wrap: wrap; column-gap: 5px; }
  .details .row-copy { flex-basis: 44%; }
  .list-row .button { padding-inline: .62rem; }
}
@media (max-width: 340px) {
  .wrap { width: calc(100% - 22px); }
  .masthead-content .brand { display: none; }
  .grid.tight { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
