:root {
  color-scheme: light;
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: #19243b;
  background: #f5f7fb;
  font-size: 14px;
  --line: #e4e9f2;
  --muted: #52617b;
  --blue: #285ad4;
  --dark: #14213a;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 300px; }
h1, h2, p { margin: 0; }
h1 { font-size: 32px; font-weight: 720; letter-spacing: -.04em; margin-bottom: 8px; }
h2 { font-size: 16px; font-weight: 680; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button, .button, input, select, textarea { font: inherit; }
button, .button {
  display: inline-flex; gap: 7px; align-items: center; justify-content: center;
  min-height: 37px; background: #fff; color: #263956; border: 1px solid #dce4ef;
  border-radius: 8px; padding: 8px 13px; cursor: pointer; font-weight: 600; white-space: nowrap;
}
button:hover, .button:hover { background: #f3f7ff; text-decoration: none; border-color: #b9c9e2; }
button:disabled { cursor: wait; opacity: .56; }
button.primary { color: #fff; background: var(--blue); border-color: var(--blue); }
button.primary:hover { background: #204bb5; }
input, select, textarea {
  width: 100%; min-width: 0; border: 1px solid #dce4ef; background: #fff; color: #19243b;
  border-radius: 8px; padding: 9px 11px; min-height: 40px;
}
textarea { resize: vertical; min-height: 105px; }
:focus-visible { outline: 2px solid #5280e9; outline-offset: 2px; }
label { display: block; font-weight: 600; }
label > input, label > select { display: block; margin-top: 6px; }
.muted, .page-head p { color: var(--muted); line-height: 1.6; }
code { font-family: "IBM Plex Mono", ui-monospace, monospace; overflow-wrap: anywhere; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; font-size: 17px; font-weight: 720; }
.brand:hover { text-decoration: none; }
.brand small { display: block; color: #aebedc; font-size: 11px; font-weight: 500; margin-top: 3px; }
.brand-mark {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 10px;
  background: #406feb; position: relative; display: inline-block;
}
.brand-mark::before, .brand-mark::after {
  content: ""; position: absolute; inset: 8px 14px; border-radius: 5px; background: #edf4ff; transform: rotate(45deg);
}
.brand-mark::after { transform: rotate(-45deg); opacity: .75; }
.layout { display: grid; grid-template-columns: 194px minmax(0,1fr); min-height: 100vh; }
.sidebar { background: var(--dark); color: #fff; padding: 25px 15px 16px; display: flex; flex-direction: column; gap: 34px; }
.sidebar .brand { margin-left: 6px; }
.sidebar nav { display: grid; gap: 5px; }
.sidebar nav a { display: flex; align-items: center; gap: 11px; padding: 11px 13px; border-radius: 8px; color: #bfcee8; }
.sidebar nav a:hover, .sidebar nav a[aria-current] { background: #263a60; color: #fff; text-decoration: none; }
.nav-icon { width: 16px; flex-shrink: 0; text-align: center; font-size: 17px; }
.side-logout { margin-top: auto; align-self: stretch; background: transparent; color: #c8d5eb; border-color: #394a68; }
.side-logout:hover { background: #263a60; color: #fff; }
.topbar { min-height: 62px; padding: 12px 32px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.topbar-root, .topbar-slash { color: var(--muted); margin-right: 10px; }
.service { display: inline-flex; align-items: center; gap: 8px; color: #344663; font-size: 12px; }
.service > span:first-child { width: 8px; height: 8px; border-radius: 50%; background: #14936e; }
.service.offline > span:first-child { background: #ce642c; }
.content { max-width: 1360px; margin: 0 auto; padding: 30px 32px 48px; }
.page-head { display: flex; justify-content: space-between; gap: 16px; align-items: center; margin-bottom: 23px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 2px 9px #22345608; min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.panel-foot { padding: 10px 20px; }
.panel-foot:has([hidden]) { display: none; }
.studio-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(230px, 315px); gap: 20px; }
.studio-side { display: grid; gap: 18px; align-content: start; }
.form-panel { padding: 0 20px 20px; display: grid; align-content: start; gap: 12px; }
.form-panel .panel-head { margin: 0 -20px 7px; }
.fields { display: grid; gap: 14px 16px; }
.fields.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; align-items: center; }
.metrics { margin: 0; padding: 20px; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.metrics dt { font-size: 12px; color: var(--muted); }
.metrics dd { margin: 7px 0 0; color: #244fb2; font-size: 27px; font-weight: 680; }
.recent-list, .file-list { margin: 0; padding: 0; list-style: none; }
.recent-list li { padding: 13px 18px; border-bottom: 1px solid var(--line); }
.recent-list li:last-child { border: 0; }
.recent-link { width: 100%; justify-content: space-between; border: 0; padding: 0; text-align: left; white-space: normal; }
.upload { padding: 12px; border: 1px dashed #bac9e3; background: #f7faff; border-radius: 8px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.upload input { width: 1px; height: 1px; min-height: 0; padding: 0; position: absolute; opacity: 0; }
.upload:focus-within { outline: 2px solid #5280e9; }
.file-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 7px 0; }
.file-name { min-width: 120px; flex: 1; overflow-wrap: anywhere; }
.file-list button { min-height: 28px; padding: 4px 8px; }
.inline-form { justify-content: flex-start; flex-wrap: wrap; }
.inline-form label { display: flex; gap: 10px; align-items: center; }
.inline-form label > input, .inline-form label > select { margin-top: 0; }
.inline-form input { max-width: 330px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 12px 18px; vertical-align: middle; border-bottom: 1px solid var(--line); }
th { background: #f5f8fd; font-size: 12px; white-space: nowrap; color: #435675; }
tbody tr:last-child td { border-bottom: 0; }
td small { color: var(--muted); display: block; margin-top: 5px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.row-actions button { min-height: 31px; padding: 5px 9px; }
.badge { display: inline-block; white-space: nowrap; font-size: 12px; background: #e9effa; color: #2d4775; border-radius: 6px; padding: 4px 7px; }
.badge.good { background: #e4f5ee; color: #087052; }
.badge.bad { background: #ffefec; color: #a93526; }
.badge.pending { background: #fff2d9; color: #805000; }
.notice, .quote-result { background: #eef4ff; color: #204479; border-radius: 8px; padding: 11px 14px; line-height: 1.5; overflow-wrap: anywhere; }
#notice { margin-bottom: 16px; }
.notice.error { background: #fff0eb; color: #922e22; }
dialog { width: min(530px, calc(100vw - 26px)); max-height: calc(100dvh - 24px); padding: 0; border: 1px solid #dce4ef; border-radius: 13px; color: inherit; box-shadow: 0 22px 90px #101d3a45; }
dialog::backdrop { background: #15284f6b; }
.dialog-body { padding: 20px; display: grid; gap: 15px; }
.dialog-body .panel-head { padding: 0 0 14px; }
.task-dialog { width: min(730px, calc(100vw - 26px)); }
.task-filters select { max-width: min(290px, 65vw); }
.task-action-form { display: grid; gap: 9px; padding: 13px; background: #f5f8fd; border-radius: 8px; }
.media-result { display: grid; gap: 9px; margin-top: 9px; }
.media-result video, .media-result img { display: block; width: 100%; max-height: 53dvh; object-fit: contain; border-radius: 8px; background: #111b2e; }
.media-result .actions { justify-content: flex-start; }
.details { display: grid; gap: 7px; margin-top: 9px; overflow-wrap: anywhere; }
#task-request summary { cursor: pointer; font-weight: 650; }
#task-request pre { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; padding: 10px 12px; background: #f5f8fd; border-radius: 8px; }
#task-request ol { margin: 0; padding-inline-start: 23px; }
#request-failure-form input { flex: 1 1 210px; }
#request-failure-result { margin: 12px 18px; white-space: pre-wrap; }
.steps { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; list-style: none; margin: 13px 0; }
.steps li { border-radius: 7px; padding: 6px 9px; background: #f0f3f9; color: var(--muted); }
.steps li.done { background: #e4f5ee; color: #086a4f; }
.steps li.current { background: #e7efff; color: #214fae; font-weight: 650; }
.login { min-height: 100dvh; display: grid; place-items: center; padding: 18px; background: radial-gradient(ellipse at 45% 30%, #e4edff, #f3f6fb 62%); }
.login-card { width: min(450px,100%); background: #fff; border: 1px solid #dce5f3; border-radius: 15px; padding: 28px; display: grid; gap: 15px; box-shadow: 0 15px 50px #1b30621b; }
.login-card h1 { font-size: 25px; margin: 9px 0 0; }
.copy-command { padding: 10px; border-radius: 7px; background: #edf2fa; color: #233e65; }
@media (max-width: 940px) {
  .layout { grid-template-columns: 155px minmax(0,1fr); }
  .content { padding: 23px 18px 38px; }
  .topbar { padding-inline: 18px; }
  .studio-grid { grid-template-columns: 1fr; }
  .studio-side { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 610px) {
  .layout { display: block; }
  .sidebar { padding: 12px; gap: 10px; }
  .sidebar nav { display: flex; overflow-x: auto; }
  .sidebar nav a { white-space: nowrap; padding: 7px 9px; }
  .side-logout { align-self: flex-start; }
  .topbar { min-height: 44px; }
  .content { padding: 20px 12px 30px; }
  .studio-side, .fields.two { grid-template-columns: 1fr; }
  .page-head h1 { font-size: 27px; }
  th, td { padding-inline: 12px; }
}
