:root {
  color-scheme: light;
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --navy: #16253b;
  --navy-light: #243750;
  --ink: #1d2b40;
  --muted: #59687b;
  --paper: #f4f6f9;
  --line: #dce3eb;
  --yellow: #f6c84a;
  --white: #fff;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button, input[type=checkbox], input[type=file], select { cursor: pointer; }
button { border: 0; }
button:disabled { opacity: .65; cursor: wait; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid #416bb6; outline-offset: 3px; }
img { display: block; max-width: 100%; }
svg { width: 20px; height: 20px; flex: 0 0 auto; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); line-height: 1.15; letter-spacing: -.045em; overflow-wrap: anywhere; }
h2 { font-size: 1.1rem; }
small, .hint { font-size: .875rem; }
.muted { color: var(--muted); }
.button, .chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-weight: 650; border-radius: 8px; border: 1px solid transparent;
  white-space: nowrap; font-size: .875rem;
}
.button { min-height: 42px; padding: 0 14px; }
.primary { background: var(--yellow); color: #263041; }
.primary:hover { background: #efb92d; }
.quiet { background: var(--white); border-color: var(--line); }
.quiet:hover, .chip:hover { background: #f2f5fa; border-color: #aab9ca; }
.icon-button { display: grid; place-items: center; width: 34px; height: 34px; background: transparent; color: inherit; border-radius: 7px; }
.icon-button:hover { background: #787f8e24; }
.mark { display: inline-grid; place-items: center; width: 35px; height: 35px; border-radius: 10px; background: var(--yellow); flex-shrink: 0; position: relative; }
.mark i { position: absolute; border: 1.5px solid var(--navy); width: 14px; height: 10px; border-radius: 2px; transform: rotate(-23deg) skew(15deg); background: var(--yellow); }
.mark i:nth-child(1) { margin-top: 8px; }
.mark i:nth-child(2) { margin-top: 1px; }
.mark i:nth-child(3) { margin-top: -6px; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 750; line-height: 1.15; letter-spacing: -.02em; }
.brand small { display: block; color: #a9b9cf; font-family: ui-monospace, monospace; font-weight: 550; font-size: .63rem; letter-spacing: .115em; margin-top: 5px; }
.auth { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.06fr) minmax(360px, 1fr); background: var(--white); }
.auth-art {
  display: flex; flex-direction: column; justify-content: space-between; min-height: 580px;
  padding: clamp(28px, 5vw, 72px); color: #fff; background-color: var(--navy);
  background-image: linear-gradient(#a3bddd13 1px, transparent 1px), linear-gradient(90deg, #a3bddd13 1px, transparent 1px);
  background-size: 30px 30px;
}
.auth-art > p { font-size: clamp(1.6rem, 3.6vw, 3.5rem); line-height: 1.2; font-weight: 700; letter-spacing: -.035em; }
.artwork { display: grid; place-items: center; padding: 35px 15px; }
.art-frame { width: min(100%, 340px); aspect-ratio: 1.22; border: 1px solid #8ca5c7; position: relative; display: grid; place-items: center; transform: rotate(-8deg); }
.art-frame > span { position: absolute; width: 8px; height: 8px; background: #dce7f6; border: 1px solid #324c75; }
.art-frame > span:nth-child(1) { top: -4px; left: -4px; }
.art-frame > span:nth-child(2) { top: -4px; right: -4px; }
.art-frame > span:nth-child(3) { bottom: -4px; left: -4px; }
.art-frame > span:nth-child(4) { bottom: -4px; right: -4px; }
.art-sheet { width: 80%; height: 77%; border: 1px solid #a3b9d644; background: #293d59; overflow: hidden; position: relative; }
.art-circle { position: absolute; width: 53%; aspect-ratio: 1; border-radius: 50%; background: var(--yellow); top: 13%; left: 12%; }
.art-square { position: absolute; width: 40%; aspect-ratio: 1; border: 1px solid #c1d4ef; background: #9eb9ef; transform: rotate(25deg); top: 38%; left: 45%; }
.art-lines { position: absolute; width: 32%; height: 14%; top: 74%; left: 10%; background: repeating-linear-gradient(0deg, transparent 0 5px, #e6edf7 5px 6px); }
.auth-side { display: grid; align-items: center; justify-items: center; padding: 32px; }
.auth-box { width: min(100%, 430px); }
.auth-box > p { margin: 14px 0 28px; line-height: 1.65; }
.auth-box form > button { width: 100%; min-height: 48px; }
.mobile-brand { display: none; }
.mobile-brand small { color: var(--muted); }
form { display: grid; gap: 16px; }
form label, dialog > label { display: grid; gap: 8px; font-size: .9375rem; font-weight: 620; }
input:not([type=checkbox]), select {
  width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; padding: 9px 12px; font-size: .9375rem;
}
input::placeholder { color: #64748b; }
input[readonly] { background: #f4f6f9; }
.form-error { color: #9d2d2e; font-size: .9rem; line-height: 1.4; }
.form-error:empty { display: none; }
.shell { display: grid; min-height: 100dvh; grid-template-columns: 226px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; background: var(--navy); color: #fff; padding: 24px 14px 14px; }
.sidebar > .brand { margin: 0 9px 35px; }
.sidebar nav { display: grid; gap: 6px; }
.sidebar nav a { display: flex; align-items: center; gap: 11px; min-height: 46px; color: #c9d5e5; padding: 0 11px; border-radius: 8px; font-size: .9375rem; }
.sidebar nav a.active, .sidebar nav a:hover { color: #fff; background: var(--navy-light); }
.sidebar nav a.active svg { color: var(--yellow); }
.sidebar-footer { display: flex; align-items: center; gap: 9px; margin-top: auto; border-top: 1px solid #ffffff26; padding: 13px 2px 0; }
.avatar { display: grid; place-items: center; width: 35px; height: 35px; flex: 0 0 auto; border-radius: 50%; background: #dce6f7; color: #29476b; font-weight: 700; }
.identity { display: grid; flex: 1 1 auto; gap: 2px; overflow: hidden; font-size: .875rem; }
.identity strong, .member-info > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.identity small { color: #a9b9cf; font-size: .77rem; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 70px; padding: 10px clamp(16px, 3vw, 44px); background: var(--white); border-bottom: 1px solid var(--line); font-size: .9rem; color: var(--muted); }
.topbar > span { overflow-wrap: anywhere; }
.topbar a:hover, .back:hover { text-decoration: underline; }
.content { max-width: 1540px; margin: 0 auto; padding: 38px clamp(16px, 3vw, 44px) 60px; }
.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 28px; }
.page-heading p { color: var(--muted); margin-top: 10px; line-height: 1.5; }
.toolbar { display: flex; justify-content: space-between; align-items: center; min-height: 44px; gap: 10px; margin-bottom: 16px; }
.toolbar > span { font-size: .875rem; }
.search { display: flex; align-items: center; position: relative; width: min(255px, 65%); }
.search svg { position: absolute; left: 10px; color: var(--muted); pointer-events: none; }
.search input { padding-left: 36px; }
.empty { display: grid; justify-items: center; text-align: center; align-content: center; gap: 13px; min-height: 340px; border: 1px dashed #c0ccda; border-radius: 13px; padding: 25px; background: #ffffffa0; }
.empty p { color: var(--muted); line-height: 1.55; }
.empty-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 12px; color: #36567c; background: #e5edf8; }
.empty-icon svg { width: 26px; height: 26px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 245px), 1fr)); gap: 17px; }
.card { min-width: 0; display: block; border: 1px solid var(--line); background: #fff; border-radius: 12px; overflow: hidden; }
a.card:hover { border-color: #8aa3c1; box-shadow: 0 6px 18px #263d5914; }
.thumb { display: grid; place-items: center; aspect-ratio: 1.55; width: 100%; color: var(--muted); padding: 15px; overflow: hidden; background-color: #eaf0f7; background-image: radial-gradient(#a5b5c9 0.8px, transparent 0.8px); background-size: 12px 12px; }
.thumb img { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
button.thumb:hover { background-color: #dfe8f3; }
.file-mark { display: grid; place-items: center; width: 70px; height: 82px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.card-body { padding: 15px; min-width: 0; display: grid; gap: 7px; }
.card-body h2 { overflow-wrap: anywhere; line-height: 1.3; }
.card-body p, .card-body small { font-size: .875rem; color: var(--muted); overflow-wrap: anywhere; }
.back { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 17px; font-size: .875rem; color: var(--muted); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tabbar { border-bottom: 1px solid var(--line); margin-bottom: 15px; }
.tabs { display: flex; gap: 14px; flex-wrap: wrap; }
.tabs button { padding: 0 8px; min-height: 47px; border-bottom: 3px solid transparent; background: none; font-weight: 650; color: var(--muted); }
.tabs button.current { border-color: #ce971c; color: var(--ink); }
.tabs small, .panel-head small { margin-left: 4px; color: var(--muted); font-weight: 500; }
.detail-tools select { width: auto; max-width: 48%; padding-right: 28px; }
.variants, .tags { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 6px 8px; background: var(--paper); border-color: var(--line); }
.chip svg { width: 14px; height: 14px; }
.big-preview { padding: 12px; background: #e4eaf2; border-radius: 10px; width: 100%; display: grid; place-items: center; }
.big-preview img { max-height: 70vh; object-fit: contain; }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(270px, 1fr); gap: 17px; }
.panel { border: 1px solid var(--line); background: #fff; border-radius: 12px; min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; min-height: 62px; border-bottom: 1px solid var(--line); padding: 10px 16px; gap: 8px; }
.member, .group-list > div { display: flex; gap: 10px; align-items: center; padding: 13px 16px; }
.member + .member, .group-list > div + div { border-top: 1px solid var(--line); }
.member-info { display: grid; flex: 1; gap: 3px; min-width: 0; }
.member-info > span { color: var(--muted); font-size: .875rem; }
.member-info small, .tags span { display: inline-block; color: #34537b; background: #e8eff8; padding: 2px 6px; border-radius: 4px; font-size: .78rem; }
.group-list > div { justify-content: space-between; overflow-wrap: anywhere; }
.group-list > div > span { white-space: nowrap; }
.panel-empty { padding: 20px 16px; line-height: 1.5; }
dialog { width: min(480px, calc(100% - 24px)); max-height: calc(100% - 30px); overflow: auto; border: 1px solid var(--line); border-radius: 14px; padding: 22px; color: var(--ink); box-shadow: 0 18px 70px #0e162d40; }
dialog::backdrop { background: #101b31a8; }
.dialog-head, .dialog-actions { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.dialog-head { margin-bottom: 14px; }
.dialog-head h2 { font-size: 1.25rem; overflow-wrap: anywhere; }
.dialog-actions { justify-content: flex-end; }
dialog > p, dialog > label { margin-bottom: 12px; }
.drop { padding: 13px; border: 1px dashed #aab9ca; background: #f5f8fc; border-radius: 8px; }
input::file-selector-button { border: 0; padding: 5px 9px; background: #e9eff8; border-radius: 4px; color: var(--ink); margin-right: 8px; cursor: pointer; }
fieldset { padding: 10px; margin: 0; border: 1px solid var(--line); border-radius: 8px; }
legend { padding: 0 5px; font-size: .9375rem; font-weight: 620; }
.group-options { display: flex; flex-wrap: wrap; gap: 6px; }
.group-options .check { display: flex; align-items: center; gap: 4px; background: #edf2fa; padding: 6px 8px; border-radius: 6px; }
.check input { accent-color: #34537b; }
dialog.lightbox { width: min(1100px, calc(100% - 24px)); }
.lightbox-canvas { display: grid; justify-items: center; overflow: auto; max-height: 76vh; background: #e7edf5; padding: 12px; }
.lightbox-canvas img { width: auto; max-height: 73vh; }
.lightbox-canvas.enlarged { display: block; }
.lightbox-canvas.enlarged img { max-width: none; max-height: none; }
.lightbox .dialog-head .actions { flex-wrap: nowrap; }
#toast { position: fixed; inset: auto 18px 18px auto; z-index: 20; padding: 12px 16px; background: var(--navy); color: #fff; border-radius: 8px; box-shadow: 0 2px 12px #1b2b5740; max-width: calc(100% - 36px); }
#toast.negative { background: #852c34; }
@media (max-width: 880px) {
  .shell { grid-template-columns: 190px minmax(0, 1fr); }
  .admin-grid { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-side { align-items: start; padding: 42px 20px; }
  .mobile-brand { display: flex; margin-bottom: 35px; }
  .shell { display: block; }
  .sidebar { position: static; height: auto; flex-direction: row; flex-wrap: wrap; padding: 12px; gap: 10px; align-items: center; }
  .sidebar > .brand { margin: 0; }
  .sidebar nav { display: flex; order: 3; width: 100%; }
  .sidebar nav a { min-height: 38px; }
  .sidebar-footer { border: 0; margin: 0 0 0 auto; padding: 0; }
  .sidebar-footer .identity { display: none; }
  .topbar { min-height: 57px; }
  .content { padding-top: 25px; }
  .document-heading { align-items: start; flex-direction: column; gap: 12px; }
}
