:root {
  color-scheme: dark;
  --bg: #101413;
  --rail: #111614;
  --panel: #181d1b;
  --raised: #232a26;
  --border: #323c36;
  --ink: #f0f4ef;
  --muted: #aab8ae;
  --lime: #c2f84d;
  --warn: #ffbc9a;
  --radius: 18px;
  font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  background: var(--bg);
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 300px; min-height: 100vh; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--lime); outline-offset: 3px;
}
button, a { -webkit-tap-highlight-color: transparent; }
h1, h2, h3, p { margin: 0; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
.boot { min-height: 100vh; display: grid; place-items: center; color: var(--muted); }
.shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
.rail {
  border-right: 1px solid var(--border); background: var(--rail); min-height: 100vh;
  padding: 30px 16px 18px; display: flex; flex-direction: column; gap: 34px;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 11px; padding-inline: 7px; }
.brand strong { display: block; font-size: 1.12rem; letter-spacing: -.04em; line-height: 1.2; }
.brand small { display: block; margin-top: 5px; color: var(--muted); font-size: .82rem; }
.mark {
  width: 37px; height: 37px; border: 1px solid #8bba58; border-radius: 10px; flex: none;
  background: #c2f84d; position: relative; transform: rotate(-5deg);
}
.mark::before, .mark::after { content: ""; position: absolute; background: #243221; inset: 17px 6px auto; height: 2px; }
.mark::after { transform: rotate(90deg); }
.rail nav { display: grid; gap: 7px; }
.nav-item {
  display: flex; gap: 10px; align-items: center; padding: 12px 13px; min-height: 45px; width: 100%;
  border: 1px solid transparent; border-radius: 11px; text-align: left; font-weight: 550;
  background: transparent; color: var(--muted);
}
.nav-item img { width: 18px; height: 18px; opacity: .8; }
.nav-item:hover { background: #ffffff08; color: var(--ink); }
.nav-item[aria-current="page"] { background: #29342a; border-color: #485e40; color: var(--ink); }
.rail-foot { margin-top: auto; display: grid; gap: 10px; padding: 10px 7px 0; }
.rail-foot .technical { color: var(--muted); }
.workspace { min-width: 0; }
.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px clamp(18px, 3vw, 42px);
  min-height: 72px; border-bottom: 1px solid var(--border); background: #101413ed;
  position: sticky; top: 0; z-index: 3; backdrop-filter: blur(14px);
}
.topbar .actions { justify-content: flex-end; }
.topbar-status { color: var(--muted); font-size: .875rem; }
.mobile-logout { display: none; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.btn {
  min-height: 42px; border-radius: 10px; padding: 8px 15px; border: 1px solid var(--border);
  background: var(--raised); font-weight: 650; color: var(--ink); white-space: nowrap;
}
.btn:hover:not(:disabled) { border-color: #738575; }
.btn.primary { border-color: var(--lime); color: #191f10; background: var(--lime); }
.btn.primary:hover:not(:disabled) { background: #d6ff87; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--warn); }
.btn.compact { font-size: .875rem; min-height: 34px; padding: 5px 9px; }
.content { margin-inline: auto; max-width: 1500px; padding: 36px clamp(18px, 3vw, 42px) 64px; }
.hero {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 22px;
  padding: 34px 29px; margin-bottom: 26px; border: 1px solid #415049; border-radius: 22px;
  background: linear-gradient(100deg, #16201be8 5%, #141b1878), url("/admin/grid.jpg") center 46% / cover;
}
.hero h1 { font-size: clamp(2rem, 4vw, 3.1rem); line-height: 1.12; letter-spacing: -.065em; }
.hero p { margin-top: 12px; color: var(--muted); line-height: 1.6; }
.numbers { display: flex; gap: 18px; flex-wrap: wrap; }
.stat { display: grid; gap: 7px; min-width: 68px; border-left: 1px solid #4a594d; padding-left: 14px; }
.stat b { font-variant-numeric: tabular-nums; font-size: 1.55rem; color: var(--lime); line-height: 1.1; }
.stat span { font-size: .875rem; color: #c7d3c5; }
.heading { display: flex; gap: 13px; justify-content: space-between; align-items: center; margin: 0 0 20px; flex-wrap: wrap; }
.heading h1 { font-size: clamp(1.8rem, 3vw, 2.7rem); letter-spacing: -.055em; }
.heading h2, .panel h2 { font-size: 1.25rem; letter-spacing: -.03em; }
.heading p, .panel p { color: var(--muted); line-height: 1.6; margin-top: 7px; }
.filters { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 15px; margin-bottom: 18px; }
.chips { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.chip { border: 1px solid var(--border); border-radius: 30px; padding: 8px 13px; background: #141917; color: var(--muted); font-size: .9rem; }
.chip.active { border-color: #a0c966; color: var(--lime); background: #273120; }
.glass { background: linear-gradient(140deg, #242c27, #1a201d); border: 1px solid var(--border); border-radius: var(--radius); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.card { padding: 0; min-width: 0; overflow: hidden; text-align: left; color: var(--ink); }
.card:hover { border-color: #779472; }
.card-art {
  display: grid; place-items: center; min-height: 150px; aspect-ratio: 1.52;
  background: radial-gradient(ellipse at center, #3441395e, transparent 72%), #151b17;
  border-bottom: 1px solid var(--border); overflow: hidden;
}
.card-art img { width: 78%; height: 100%; max-height: 168px; object-fit: contain; padding: 10px 0; }
.card-art .technical { color: var(--muted); }
.card-copy { padding: 14px 14px 16px; }
.card-copy h3 { font-size: 1.12rem; letter-spacing: -.02em; margin: 8px 0 4px; }
.caption { color: var(--muted); font-size: .875rem; line-height: 1.5; }
.badge {
  display: inline-flex; align-items: center; min-height: 23px; border-radius: 6px; padding: 2px 7px;
  font-size: .8125rem; color: #b7c9bb; border: 1px solid #465349; background: #253029;
}
.badge.lime { color: var(--lime); background: #2d3c21; border-color: #57753d; }
.badge.dim { background: #282928; border-color: #424744; color: #c0c7c3; }
.badge.warn { color: var(--warn); }
.technical { font-family: "SF Mono", "Menlo", monospace; font-size: .8125rem; overflow-wrap: anywhere; }
.panel { padding: 20px; }
.panel + .panel { margin-top: 16px; }
.form-grid, .editor-layout, .paired { display: grid; gap: 16px; align-items: start; }
.form-grid, .paired { grid-template-columns: repeat(2, minmax(0,1fr)); }
.editor-layout { grid-template-columns: minmax(0,1.9fr) minmax(250px,1fr); }
.editor-aside { position: sticky; top: 90px; }
.field { display: grid; gap: 7px; min-width: 0; font-size: .875rem; }
.field > span { color: #c3cfc5; font-weight: 650; }
.full { grid-column: 1 / -1; }
input:not([type=checkbox]), select, textarea {
  width: 100%; min-height: 42px; border-radius: 9px; background: #101613;
  border: 1px solid #3c4a40; padding: 9px 11px;
}
input[type=checkbox] { accent-color: var(--lime); width: 18px; height: 18px; }
textarea { resize: vertical; line-height: 1.6; }
select {
  appearance: none; padding-right: 30px;
  background-image: linear-gradient(45deg,transparent 50%,#b2bfb4 50%),linear-gradient(135deg,#b2bfb4 50%,transparent 50%);
  background-position: calc(100% - 16px) calc(50% + 1px), calc(100% - 11px) calc(50% + 1px);
  background-size: 5px 5px; background-repeat: no-repeat;
}
.searchbox { flex: 1; max-width: 290px; min-width: 190px; }
.panel-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 9px; margin-bottom: 16px; }
.panel-row { margin-top: 14px; }
.aside-cover { border: 1px solid var(--border); border-radius: 12px; margin-block: 12px; min-height: 130px; }
.aside-cover img { max-height: 160px; }
.check { display: flex; align-items: center; gap: 8px; min-height: 42px; }
.parts { display: grid; gap: 8px; }
.part { border: 1px solid var(--border); border-radius: 10px; background: #141b16; min-width: 0; }
.part summary { font-weight: 650; padding: 11px 13px; cursor: pointer; color: #dbe8da; }
.part-body { padding: 0 12px 12px; display: grid; gap: 11px; }
.angles { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; }
.subparts { border-left: 1px solid #5a7254; padding-left: 8px; }
.part .actions { margin-top: 3px; }
.row-list { display: grid; gap: 8px; }
.row-item {
  min-width: 0; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px;
  padding: 12px; border-radius: 10px; background: #141b16; border: 1px solid var(--border);
}
.row-item .field { flex: 1; min-width: 115px; }
.row-item strong { display: block; margin-bottom: 4px; overflow-wrap: anywhere; }
.asset-image { width: 52px; height: 52px; object-fit: contain; border-radius: 7px; background: #232e22; flex: none; }
.empty { color: var(--muted); padding: 30px 15px; text-align: center; border: 1px dashed var(--border); border-radius: 12px; }
.modal { border: 1px solid #526453; border-radius: 17px; width: min(520px,calc(100% - 26px)); padding: 23px; background: #1f2922; color: var(--ink); }
.modal::backdrop { background: #050805a8; backdrop-filter: blur(4px); }
.modal form { display: grid; gap: 14px; }
.modal p { color: var(--muted); line-height: 1.55; }
.modal .actions { justify-content: flex-end; }
.error { color: var(--warn); min-height: 1em; font-size: .9rem; }
#notice {
  position: fixed; z-index: 8; right: 22px; bottom: 20px; padding: 12px 17px; max-width: min(490px,calc(100% - 44px));
  overflow-wrap: anywhere; border-radius: 11px; border: 1px solid #6d9358; background: #253420; pointer-events: none;
}
#notice:empty { display: none; }
#notice.error { border-color: #ad725a; background: #472b24; }
.login {
  display: grid; align-items: center; justify-items: center; min-height: 100vh; padding: 24px;
  background: linear-gradient(135deg,#131c16db,#101413b8), url("/admin/grid.jpg") center / cover;
}
.login form { width: min(430px,100%); padding: clamp(20px, 5vw, 33px); display: grid; gap: 17px; }
.login h1 { font-size: 2rem; letter-spacing: -.055em; }
.login .brand { margin-bottom: 6px; padding: 0; }
.login .btn { min-height: 46px; }
@media (prefers-reduced-motion: no-preference) {
  .content { animation: arrive .25s ease both; }
  @keyframes arrive { from { opacity: .55; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
}
@media (max-width: 1000px) {
  .shell { grid-template-columns: 168px minmax(0,1fr); }
  .rail { padding-inline: 10px; }
  .hero { align-items: flex-start; flex-direction: column; }
  .editor-layout { grid-template-columns: minmax(0,1fr); }
  .editor-aside { position: static; }
}
@media (max-width: 650px) {
  .shell { display: block; }
  .rail { position: static; min-height: 0; height: auto; padding: 15px; border-right: 0; border-bottom: 1px solid var(--border); gap: 14px; }
  .rail nav { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px; }
  .rail-foot { display: none; }
  .brand strong { font-size: 1rem; }
  .topbar { padding: 10px 14px; }
  .mobile-logout { display: inline-block; }
  .content { padding: 24px 14px 48px; }
  .hero { padding: 22px 16px; }
  .grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
  .card-art { min-height: 95px; }
  .card-copy { padding: 10px; }
  .form-grid, .paired { grid-template-columns: minmax(0,1fr); }
}
