:root {
  color-scheme: light;
  font-family: "Segoe UI", "Microsoft YaHei UI", "PingFang SC", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  color: #15253b;
  background: #f3f6fb;
  --surface: #fff;
  --surface-muted: #f6f8fc;
  --ink: #15253b;
  --muted: #50617a;
  --line: #dce4ef;
  --brand: #235bd6;
  --brand-hover: #1849bc;
  --brand-soft: #edf3ff;
  --rail: #111e34;
  --radius: 14px;
  --shadow: 0 2px 6px #19294c07;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 280px; }
h1, h2, p, dl, dd { margin: 0; }
h1, h2 { line-height: 1.3; }
h1 { font-size: clamp(25px, 2.8vw, 34px); letter-spacing: -.025em; font-weight: 720; }
h2 { font-size: 17px; font-weight: 700; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid #4e84ff;
  outline-offset: 2px;
}
button { cursor: pointer; }
button:disabled { cursor: default; }
input:not([type="checkbox"]):not([type="hidden"]), select, textarea {
  min-width: 0;
  min-height: 40px;
  border: 1px solid #cbd6e7;
  border-radius: 8px;
  background: var(--surface);
  padding: 8px 11px;
}
input::placeholder { color: #677990; opacity: 1; }
input[type="file"] { width: 100%; padding: 4px 6px !important; }
input::file-selector-button {
  border: 0;
  border-radius: 5px;
  background: #eff3fa;
  color: #233650;
  padding: 5px 10px;
  margin-right: 9px;
  font: inherit;
  cursor: pointer;
}
input[type="checkbox"] { accent-color: var(--brand); }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  gap: 6px;
  padding: 7px 13px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 620;
  line-height: 1.4;
  white-space: nowrap;
  text-align: center;
}
.button-primary { color: #fff; background: var(--brand); box-shadow: 0 2px 3px #1848ad22; }
.button-primary:hover { background: var(--brand-hover); }
.button-secondary { color: #26364f; border-color: var(--line); background: #fff; }
.button-secondary:hover { border-color: #aabbd7; background: #f5f8fd; }
.button-quiet { color: var(--brand-hover); background: transparent; }
.button-quiet:hover, .button-soft { background: var(--brand-soft); color: var(--brand-hover); }
.button-soft:hover { background: #dce9ff; }
.button-danger { color: #a2293c; background: #fff2f4; }
.button-danger:hover { background: #ffe3e8; }
.button-small { min-height: 34px; padding: 5px 10px; font-size: 13px; }
.button:disabled { background: #eef2f8; border-color: transparent; color: #66758b; box-shadow: none; }

.layout { display: grid; grid-template-columns: 228px minmax(0, 1fr); min-height: 100vh; }
.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 36px;
  padding: 26px 16px 18px;
  background: var(--rail);
  color: #edf3ff;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px; color: inherit; width: fit-content; }
.brand-mark {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 11px;
  color: white;
  background: #3269e8;
  font-size: 25px;
  line-height: 1;
  font-weight: 750;
  box-shadow: inset 0 1px 0 #ffffff40, 0 4px 14px #235bd647;
}
.brand strong { display: block; font-size: 16px; white-space: nowrap; }
.brand small { display: block; color: #adbed7; font-size: 12px; margin-top: 2px; }
.navigation { display: grid; gap: 7px; }
.navigation a {
  display: flex;
  align-items: center;
  gap: 11px;
  border-radius: 9px;
  border: 1px solid transparent;
  min-height: 46px;
  padding: 10px 12px;
  color: #bfcee4;
  font-weight: 600;
}
.navigation a:hover { color: #fff; background: #20314e; }
.navigation a[aria-current] { background: #233a60; border-color: #375889; color: #f4f7ff; }
.nav-icon { flex: 0 0 17px; position: relative; width: 17px; height: 17px; }
.icon-account::before, .icon-account::after, .icon-card::before, .icon-kernel::after { content: ""; position: absolute; }
.icon-account::before { inset: 0 5px auto; height: 7px; border: 1.5px solid currentColor; border-radius: 100%; }
.icon-account::after { inset: auto 1px 0; height: 7px; border: 1.5px solid currentColor; border-radius: 7px 7px 3px 3px; }
.icon-card { height: 13px; border: 1.5px solid currentColor; border-radius: 3px; }
.icon-card::before { inset: 3px 0 auto; border-top: 1.5px solid currentColor; }
.icon-kernel { border: 1.5px solid currentColor; border-radius: 4px; }
.icon-kernel::after { inset: 3px; border: 1.5px solid currentColor; border-radius: 2px; }
.icon-release { border: 1.5px solid currentColor; border-radius: 3px; }
.icon-release::after { content: ""; position: absolute; inset: 4px 0 auto; border-top: 1.5px solid currentColor; }
.icon-log { border: 1.5px solid currentColor; border-radius: 3px; }
.icon-log::after { content: ""; position: absolute; inset: 3px 3px auto; height: 6px; border-block: 1.5px solid currentColor; }
.rail-profile {
  display: grid;
  gap: 10px;
  margin-top: auto;
  padding: 16px 5px 2px;
  border-top: 1px solid #2d3d59;
}
.profile-name { min-width: 0; }
.profile-name span { color: #adbed7; font-size: 12px; display: block; }
.profile-name strong { display: block; font-size: 13px; overflow-wrap: anywhere; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.sign-out {
  display: inline-flex;
  align-items: center;
  border: 1px solid #435471;
  background: transparent;
  color: #dfebff;
  border-radius: 7px;
  padding: 7px 9px;
  white-space: nowrap;
  font-size: 12px;
}
.sign-out:hover, .sign-out[aria-current] { background: #253959; color: #fff; }

.workspace { min-width: 0; width: 100%; max-width: 1540px; margin: 0 auto; padding: 34px clamp(18px, 3.2vw, 52px) 48px; }
.page-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px; margin-bottom: 24px; }
.time-zone {
  font-size: 12px;
  font-weight: 550;
  overflow-wrap: anywhere;
  color: var(--muted);
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 20px;
  padding: 4px 10px;
}
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.panel + .panel { margin-top: 20px; }
.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 18px;
  padding: 17px 20px;
}
.section-title { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.count { font-size: 12px; color: var(--muted); font-weight: 650; border-radius: 999px; padding: 2px 8px; background: #eff3f8; }
.search-form, .inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.search-form input { width: clamp(145px, 19vw, 250px); flex: 1 1 145px; }
.card-search select { flex: 0 0 auto; }
.panel-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 0 20px 14px; }
.tools-split { justify-content: space-between; }
.filters { display: flex; flex-wrap: wrap; gap: 5px; }
.filters a {
  display: inline-flex;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 7px;
  min-height: 33px;
  color: var(--muted);
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 610;
}
.filters a:hover { background: #f4f7fd; color: var(--brand-hover); }
.filters a[aria-current] { color: var(--brand-hover); border-color: #d5e3ff; background: var(--brand-soft); }
.compact-sort { display: none; }
.action-form { display: grid; gap: 12px 14px; align-items: end; padding: 0 20px 20px; }
.issue-form { grid-template-columns: minmax(262px, 1.8fr) minmax(105px, .7fr) minmax(180px, 1.5fr) auto; }
.issue-duration { display: flex; gap: 12px; align-items: end; }
.issue-duration .field { flex: 1 1 0; }
.publish-form { grid-template-columns: minmax(145px, 1fr) minmax(220px, 1.8fr) auto; }
.template-publish-form { grid-template-columns: minmax(135px, 1fr) minmax(105px, .65fr) minmax(190px, 1.8fr) auto; }
.lanzou-form { grid-template-columns: minmax(220px, 1.8fr) minmax(145px, 1fr) auto; }
.lanzou-connect-form { grid-template-columns: repeat(2, minmax(120px, 1fr)) minmax(128px, .7fr) auto; }
.lanzou-details > summary { margin: 0 20px 14px; color: var(--brand-hover); font-size: 13px; font-weight: 650; cursor: pointer; }
.netdisk-actions { display: contents; }
.field { display: grid; gap: 6px; color: #2c3b54; font-size: 13px; font-weight: 650; min-width: 0; }
.field input { width: 100%; font-size: 14px; font-weight: 450; }
.hint { color: var(--muted); font-size: 12px; font-weight: 450; }
.form-note { grid-column: 1 / -1; }

.table-wrap { min-width: 0; overflow-x: auto; border-top: 1px solid var(--line); }
.table-wrap:last-child { border-radius: 0 0 calc(var(--radius) - 1px) calc(var(--radius) - 1px); }
table { width: 100%; border-collapse: collapse; text-align: left; }
.accounts-table { min-width: 590px; }
.batches-table { min-width: 810px; }
.cards-table { min-width: 765px; }
.versions-table { min-width: 735px; }
th, td { padding: 11px 16px; vertical-align: middle; }
th:first-child, td:first-child { padding-left: 20px; }
th:last-child, td:last-child { padding-right: 20px; }
th { font-size: 12px; background: var(--surface-muted); color: #475a76; white-space: nowrap; font-weight: 680; }
td { border-top: 1px solid #e6edf5; }
tbody tr:hover { background: #fafcff; }
.sort-link { display: inline-flex; align-items: center; gap: 5px; color: inherit; }
.sort-link:hover, th[aria-sort="ascending"] .sort-link, th[aria-sort="descending"] .sort-link { color: var(--brand-hover); }
.sort-arrow { min-width: 12px; font-size: 14px; text-align: center; }
.primary-cell { font-weight: 650; overflow-wrap: anywhere; }
.batch-name { min-width: 145px; max-width: 280px; }
.numeric, .time-cell, .usage, .pager, .batch-totals dd, .website-visits dd { font-variant-numeric: tabular-nums; }
.numeric, .time-cell { white-space: nowrap; }
.time-cell { color: #40516b; font-size: 13px; }
.state {
  font-size: 12px;
  line-height: 1.5;
  font-weight: 650;
  color: #6b4210;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  border-radius: 999px;
  padding: 3px 9px;
  background: #fff1d8;
}
.state::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.state.active { color: #116044; background: #e5f6ee; }
.state.disabled { color: #58647a; background: #edf0f5; }
.state.used { color: #425984; background: #edf2fc; }
.usage { display: flex; gap: 8px; align-items: baseline; color: var(--muted); font-size: 12px; white-space: nowrap; }
.usage span:last-child { color: #185d48; }
meter { width: 100%; min-width: 70px; max-width: 140px; height: 8px; border: 0; background: transparent; }
meter::-webkit-meter-bar { height: 6px; border: 0; border-radius: 5px; background: #eaf0f8; }
meter::-webkit-meter-optimum-value, meter::-webkit-meter-suboptimum-value, meter::-webkit-meter-even-less-good-value {
  border-radius: 5px;
  background: #5f8cf2;
}
meter::-moz-meter-bar { background: #5f8cf2; border-radius: 5px; }
.table-actions, .button-set { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.table-actions { justify-content: flex-end; }
.align-right { text-align: right; }
.code-cell code, .hash code { font-family: "Cascadia Mono", Consolas, monospace; font-size: 12px; }
.code-cell { white-space: nowrap; }
.text-link { font-weight: 630; }
.text-link:hover { text-decoration: underline; }
.hash summary { color: var(--brand-hover); font-size: 12px; cursor: pointer; white-space: nowrap; }
.hash code { display: block; margin-top: 6px; width: 17ch; overflow-wrap: anywhere; color: var(--muted); }
.empty { text-align: center; padding: 35px 16px; color: var(--muted); }
.cell-note { display: block; color: var(--muted); font-size: 12px; font-weight: 450; margin-top: 2px; }
.muted, .context-line { color: var(--muted); }
.context-line { margin-top: 5px; font-size: 13px; }
.back-link { display: inline-flex; gap: 7px; align-items: center; margin: 0 0 14px; font-weight: 650; color: var(--brand-hover); }
.back-link:hover { text-decoration: underline; }
.break { overflow-wrap: anywhere; }
.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 9px;
  border-top: 1px solid var(--line);
  padding: 11px 20px;
  color: var(--muted);
  font-size: 13px;
}

.editor-panel { max-width: 630px; }
.editor-form { display: grid; gap: 20px; padding: 0 20px 20px; }
.editor-form .field { max-width: 360px; }
.changelog-form { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.changelog-form .field { max-width: none; }
.changelog-content, .changelog-form .editor-actions { grid-column: 1 / -1; }
.changelog-content textarea { resize: vertical; font-size: 14px; font-weight: 450; }
.check-setting {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--surface-muted);
  border-radius: 9px;
  cursor: pointer;
}
.check-setting input { width: 17px; height: 17px; margin: 3px 0 0; }
.check-setting strong, .check-setting small { display: block; }
.check-setting small { color: var(--muted); margin-top: 3px; }
.editor-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 2px; }
.batch-totals, .website-visits { display: grid; gap: 8px; margin: 0 20px 16px; }
.batch-totals { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.website-visits { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.batch-totals div, .website-visits div { background: var(--surface-muted); border-radius: 8px; padding: 10px 14px; }
.batch-totals dt, .website-visits dt { color: var(--muted); font-size: 12px; }
.batch-totals dd, .website-visits dd { font-size: 23px; font-weight: 690; line-height: 1.25; }
.panel-note { color: var(--muted); padding: 0 20px 14px; font-size: 13px; }
.message { margin: 0 0 16px; border: 1px solid transparent; border-radius: 9px; padding: 10px 14px; font-size: 13px; font-weight: 560; }
.message-error { color: #942639; background: #fff2f4; border-color: #f9d8df; }
.message-success { color: #115c3e; background: #ecf9f2; border-color: #d1eddd; }
.toast {
  position: fixed;
  z-index: 2;
  right: 20px;
  bottom: 20px;
  max-width: calc(100vw - 40px);
  background: #192b48;
  color: #fff;
  border-radius: 10px;
  padding: 11px 16px;
  box-shadow: 0 5px 24px #12204035;
}
.toast.error { background: #8d2940; }
.copy-dialog { width: min(490px, calc(100% - 24px)); border: 1px solid var(--line); border-radius: var(--radius); padding: 0; color: var(--ink); }
.copy-dialog::backdrop { background: #03112c65; }
.dialog-body { display: grid; gap: 10px; padding: 20px; }
.dialog-body p { font-size: 13px; color: var(--muted); }
.dialog-body textarea { width: 100%; font-family: "Cascadia Mono", Consolas, monospace; resize: vertical; }

.login-page { background: #edf2f9; }
.login-main { display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; padding: 24px; }
.login-frame {
  width: min(790px, 100%);
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  background: var(--surface);
  border: 1px solid #d9e4f3;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 18px 60px #18315d18;
}
.login-brand {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 56px;
  min-height: 420px;
  padding: clamp(24px, 4vw, 43px);
  color: #f3f7ff;
  background:
    radial-gradient(ellipse at 93% 8%, #2a4c8b 0%, transparent 70%),
    linear-gradient(to bottom right, #172946, #101c32);
}
.login-product span { font-size: clamp(24px, 4vw, 36px); line-height: 1.25; font-weight: 740; letter-spacing: -.03em; }
.login-product p { font-size: 15px; color: #c4d4ee; margin-top: 6px; }
.login-panel { align-self: center; padding: clamp(24px, 5vw, 52px); min-width: 0; }
.login-panel h1 { font-size: 26px; margin-bottom: 23px; }
.login-form { display: grid; gap: 17px; }
.login-form input { min-height: 44px !important; }
.password-field { position: relative; }
.password-field:has(button:not([hidden])) input { padding-right: 82px; }
.password-toggle { position: absolute; right: 7px; top: 7px; padding: 4px 6px; background: transparent; color: var(--brand-hover); border: 0; border-radius: 5px; font-size: 12px; min-height: 30px; }
.password-toggle:hover { background: var(--brand-soft); }
.login-submit { width: 100%; min-height: 44px; margin-top: 5px; }

@media (max-width: 1080px) {
  .layout { grid-template-columns: 192px minmax(0, 1fr); }
  .rail { padding-inline: 12px; }
  .action-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .issue-duration { grid-column: 1 / -1; }
  .action-form > .button { justify-self: start; }
  .publish-form > .button, .lanzou-form > .button, .lanzou-connect-form > .button { grid-column: 1 / -1; }
}

@media (max-width: 800px) {
  .layout { display: block; }
  .rail {
    height: auto;
    position: static;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "brand profile" "nav nav";
    gap: 10px;
    padding: 12px 14px;
  }
  .brand { grid-area: brand; padding: 0; gap: 8px; }
  .brand .brand-mark { width: 35px; height: 35px; font-size: 22px; border-radius: 8px; }
  .brand strong { font-size: 14px; }
  .navigation { grid-area: nav; display: flex; flex-wrap: wrap; gap: 4px; }
  .navigation a { padding: 7px 9px; min-height: 36px; gap: 6px; font-size: 13px; }
  .navigation .nav-icon { display: none; }
  .rail-profile { grid-area: profile; margin: 0; padding: 0; border: 0; }
  .profile-name { display: none; }
  .workspace { padding: 22px 14px 28px; }
  .page-header { margin-bottom: 16px; }
}

@media (max-width: 680px) {
  .compact-sort { display: block; color: var(--muted); font-size: 13px; }
  .compact-sort summary { cursor: pointer; padding: 4px 8px; }
  .sort-choices { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 0; }
  .table-wrap table, .table-wrap tbody { display: block; min-width: 0; }
  .table-wrap thead, .table-wrap .no-card-action { display: none; }
  .table-wrap tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
    border-bottom: 1px solid var(--line);
    padding: 12px 14px;
  }
  .table-wrap tr:last-child { border-bottom: 0; }
  .table-wrap td { min-width: 0; border: 0; overflow-wrap: anywhere; }
  .table-wrap td, .table-wrap td:first-child, .table-wrap td:last-child { padding: 0; }
  .table-wrap td[data-label]::before { display: block; content: attr(data-label); font-size: 12px; color: var(--muted); }
  .table-wrap .primary-cell, .table-wrap .action-cell, .table-wrap .usage-cell, .table-wrap .empty { grid-column: 1 / -1; }
  .table-wrap .batch-name { min-width: 0; max-width: none; }
  .table-wrap .time-cell, .table-wrap .numeric { white-space: normal; }
  .table-wrap .empty { padding-block: 15px; }
  .table-wrap .table-actions { justify-content: flex-start; padding-top: 8px; border-top: 1px solid var(--line); }
  .table-wrap .table-actions .button { min-height: 38px; }
}

@media (max-width: 540px) {
  .login-main { padding: 12px; }
  .login-frame { grid-template-columns: 1fr; border-radius: 15px; }
  .login-brand { min-height: auto; flex-direction: row; justify-content: flex-start; align-items: center; gap: 13px; padding: 18px; }
  .login-product span { font-size: 22px; }
  .login-product p { font-size: 12px; margin-top: 3px; }
  .login-panel { padding: 21px 18px 25px; }
  .login-panel h1 { font-size: 22px; margin-bottom: 17px; }
  .panel-head { padding: 14px; }
  .panel-tools { padding: 0 14px 12px; }
  .action-form, .editor-form { padding: 0 14px 14px; }
  .changelog-form { grid-template-columns: minmax(0, 1fr); }
  .publish-form > .field, .lanzou-form > .field, .lanzou-connect-form > .field { grid-column: 1 / -1; }
  .lanzou-details > summary { margin-inline: 14px; }
  .search-form { flex: 1 1 100%; }
  .search-form input { min-width: 115px; width: 100%; }
  .card-search select { max-width: 46%; }
  .card-search input { flex-basis: 114px; }
  .batch-totals { margin-inline: 14px; }
  .batch-totals div { padding: 8px; }
  .pager { padding-inline: 14px; }
}
