:root {
  color-scheme: light;
  --ink: #152638;
  --muted: #526577;
  --soft: #f2f6fa;
  --paper: #f8f9fb;
  --line: #e1e8ef;
  --blue: #235ea0;
  --blue-strong: #184c86;
  --focus: #2f79ca;
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--paper); }
button, input, select, textarea { font: inherit; }
button:not(:disabled) { cursor: pointer; }
button:disabled { opacity: .55; }
button, input, select, textarea, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
a { color: var(--blue-strong); }
.layout { width: min(1160px, calc(100% - 72px)); margin-inline: auto; }
.site-header { background: #fff; border-bottom: 1px solid var(--line); }
.header-inner { min-height: 72px; display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-size: 18px; font-weight: 720; white-space: nowrap; line-height: 1.05; }
.brand img { object-fit: contain; }
.brand small { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; letter-spacing: .2em; }
.header-context { border-left: 1px solid var(--line); padding-left: 24px; color: var(--muted); white-space: nowrap; }
.header-account { margin-left: auto; display: flex; align-items: center; gap: 18px; min-width: 0; }
.header-account a { text-decoration: none; white-space: nowrap; }
.header-account span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quiet-button { border: 0; background: transparent; color: var(--blue-strong); padding: 8px 0; white-space: nowrap; }
.quiet-button:hover, .header-account a:hover { text-decoration: underline; }
.boot-message { padding: 70px 0; color: var(--muted); }
.primary-button, .outline-button { min-height: 40px; border: 1px solid transparent; border-radius: 7px; padding: 0 16px; font-weight: 630; white-space: nowrap; }
.primary-button { background: var(--blue); color: #fff; }
.primary-button:not(:disabled):hover { background: var(--blue-strong); }
.outline-button { background: #fff; border-color: #d5e0eb; color: var(--blue-strong); }
.outline-button:not(:disabled):hover { background: #edf4fb; }

.sign-in { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(290px, .85fr); gap: clamp(32px, 8vw, 108px); max-width: 1030px; margin: clamp(60px, 12vh, 130px) auto; align-items: center; }
.sign-in-intro p { max-width: 460px; margin: 0; color: var(--muted); line-height: 1.8; }
.sign-in-notes { display: grid; gap: 9px; padding-top: 25px; margin-top: 30px; border-top: 1px solid var(--line); color: #294b69; }
.sign-in-notes span::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 10px; vertical-align: .16em; background: var(--blue); border-radius: 50%; }
.sign-in-panel { min-height: 272px; padding: 36px; text-align: center; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 12px 40px #243c5710; }
.sign-in-panel h1 { font-size: 23px; margin: 0 0 8px; }
.sign-in-panel p { margin: 0 0 25px; color: var(--muted); }
.sign-in-panel .primary-button { min-height: 45px; min-width: 160px; }
.sign-in-panel .sign-in-error, .drawer-message { color: #913343; background: #fceff1; border-radius: 6px; padding: 9px 12px; margin: 14px 0 0; }
.login-code-dialog { padding: 0; border-color: #dce5ed; border-radius: 20px; box-shadow: 0 16px 65px #0d273548; width: min(380px, calc(100% - 32px)); max-height: calc(100% - 32px); }
.login-code-dialog::backdrop { background: #142a415d; }
.login-code-panel { position: relative; padding: 29px 22px 23px; text-align: center; }
.login-code-panel h2 { font-size: 21px; margin: 0 30px 12px; }
.login-code-close { position: absolute; right: 11px; top: 11px; display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; font: 25px/1 system-ui; background: transparent; color: #4d606e; }
.login-code-close:hover { background: #edf4f9; }
.qr-frame img { display: block; width: min(224px, 100%); height: auto; margin: 0 auto; }
.login-code-panel p { margin: 10px 0; color: var(--muted); }
.login-code-panel #qr-status { font-size: 13px; }
.login-code-panel #qr-error { color: #913343; }
.login-code-panel .quiet-button { font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }

.workspace { padding: 42px 0 72px; }
.workspace-title { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 25px; }
.workspace-title h1 { margin: 0 0 7px; font-size: clamp(28px, 3vw, 38px); font-weight: 730; line-height: 1.22; letter-spacing: -.035em; }
.workspace-title p { margin: 0; color: var(--muted); }
.workspace-title .primary-button { min-height: 44px; }
.workspace-title .primary-button span { margin-right: 4px; }
.works-panel { border: 1px solid var(--line); border-radius: 13px; background: #fff; box-shadow: 0 3px 8px #162e4905; }
.work-tools { display: flex; gap: 12px; flex-wrap: wrap; justify-content: space-between; align-items: center; padding: 17px 20px; }
.filters, .search-form, .page-controls { display: flex; align-items: center; gap: 8px; }
.filters { flex-wrap: wrap; gap: 4px; }
.filter-button { display: inline-flex; gap: 6px; align-items: center; padding: 6px 9px; min-height: 36px; border: 1px solid transparent; border-radius: 6px; color: var(--muted); background: transparent; white-space: nowrap; }
.filter-button small { color: #53687d; font-variant-numeric: tabular-nums; }
.filter-button:not([aria-pressed="true"]):hover { background: var(--soft); }
.filter-button[aria-pressed="true"] { border-color: #c9def2; background: #e8f1fa; color: #174e88; font-weight: 680; }
.filter-button[aria-pressed="true"] small { color: #174e88; }
.search-form input, #work-form > input, #work-form select, #work-form textarea { background: #fff; color: var(--ink); min-height: 40px; border: 1px solid #d5e0eb; border-radius: 7px; padding: 8px 11px; }
.search-form input { width: 186px; min-width: 0; }
.search-form input::placeholder, #work-form input::placeholder, #work-form textarea::placeholder { color: #65768a; }
.list-message { padding: 42px 22px; color: var(--muted); border-block: 1px solid var(--line); }
.list-message .outline-button { margin-inline-start: 12px; }
.work-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; padding: 0 20px 20px; }
.work-card { min-width: 0; display: grid; align-content: start; gap: 10px; border: 1px solid #e1e8ef; border-radius: 10px; background: #fff; padding: 8px; color: var(--ink); text-align: left; }
.work-card:hover, .work-card:focus-visible { border-color: #93b5d9; box-shadow: 0 3px 12px #235ea018; }
.card-art, .detail-art { position: relative; display: grid; place-items: center; border: 1px solid #e4ebf2; border-radius: 6px; overflow: hidden; background: #f3f6fa; color: var(--muted); }
.card-art { aspect-ratio: 4 / 3; }
.card-art img, .detail-art img, .file-picker img { display: block; width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; }
.card-art img, .detail-art img { position: absolute; inset: 0; margin: auto; }
.card-art .image-fallback { font-size: 12px; }
.card-info { display: grid; gap: 7px; min-width: 0; padding: 0 5px 4px; }
.card-title, .card-meta > span:first-child, .card-date { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-title { font-size: 15px; }
.work-card:hover .card-title { color: var(--blue); }
.card-meta { display: flex; align-items: center; justify-content: space-between; gap: 7px; min-height: 26px; color: var(--muted); font-size: 13px; }
.card-date { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.status { display: inline-flex; width: fit-content; padding: 4px 9px; border-radius: 5px; font-size: 12px; font-weight: 680; white-space: nowrap; }
.status.pending { background: #fff0d6; color: #81540d; }
.status.ready { background: #e5effb; color: #205586; }
.status.published { background: #e6f5eb; color: #1d6443; }
.status.rejected { background: #fae9ec; color: #9a3348; }
.status.delisted { background: #ecf0f5; color: #47596e; }
.list-footer { min-height: 63px; display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 22px; border-top: 1px solid #edf1f5; color: var(--muted); font-size: 13px; }
.page-controls button { min-height: 34px; padding-inline: 10px; }

dialog { color: var(--ink); border: 1px solid var(--line); background: #fff; }
dialog::backdrop { background: #162b4260; }
body:has(dialog[open]) { overflow: hidden; }
.drawer { inset: 0 0 0 auto; margin: 0 0 0 auto; position: fixed; width: min(100%, 510px); max-width: 100%; max-height: 100%; height: 100dvh; padding: 0; border: 0; overflow: auto; box-shadow: -12px 0 40px #18294420; }
.drawer-header { position: sticky; top: 0; z-index: 1; background: #fff; padding: 16px 24px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.drawer-header h2, .confirm-dialog h2 { margin: 0; font-size: 20px; }
.close-button { width: 38px; height: 38px; border: 0; border-radius: 6px; background: var(--soft); color: #344d67; font-size: 24px; line-height: 1; }
.close-button:hover { background: #e9eff7; }
.drawer-body { padding: 22px 24px 32px; }
.drawer-message { margin: 0 0 16px; }
.detail-art { height: 216px; }
#detail-name { margin: 17px 0 7px; font-size: 22px; overflow-wrap: anywhere; }
.detail-fields { display: grid; grid-template-columns: 94px 1fr; gap: 11px 10px; margin: 20px 0; }
.detail-fields dt { color: var(--muted); }
.detail-fields dd { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.drawer-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 23px; padding-top: 16px; border-top: 1px solid var(--line); }
#work-form { display: grid; }
.field-label { font-weight: 640; margin: 14px 0 6px; }
.field-label:first-child { margin-top: 0; }
.field-label small { color: var(--muted); font-weight: 400; }
.file-picker { position: relative; cursor: pointer; display: grid; gap: 7px; justify-items: center; text-align: center; padding: 21px 12px; min-height: 118px; border: 1px dashed #adbed0; border-radius: 8px; background: #f7f9fc; color: var(--blue-strong); overflow-wrap: anywhere; }
.file-picker:focus-within { outline: 2px solid var(--focus); }
.file-picker img { max-height: 130px; }
.file-picker input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.file-picker small { color: var(--muted); }
#work-form textarea { resize: vertical; }
.confirm-dialog { margin: auto; width: min(400px, calc(100% - 32px)); border-radius: 13px; padding: 24px; }
.confirm-dialog p { margin: 10px 0 0; color: var(--muted); }
.toast { position: fixed; z-index: 2; bottom: 26px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 30px); background: #213d56; color: #fff; border-radius: 8px; padding: 9px 15px; }

@media (max-width: 840px) {
  .layout { width: calc(100% - 42px); }
  .work-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
}
@media (max-width: 640px) {
  .layout { width: calc(100% - 28px); }
  .header-inner { min-height: 60px; gap: 11px; }
  .header-context { padding-left: 11px; font-size: 12px; }
  .brand { gap: 5px; font-size: 15px; }
  .brand img { width: 23px; height: 25px; }
  .header-account { gap: 7px; font-size: 12px; }
  .header-account #account-name { max-width: 64px; }
  .sign-in { grid-template-columns: 1fr; margin: 36px auto; gap: 28px; }
  .sign-in-panel { min-height: 0; padding: 25px 17px; }
  .workspace { padding-top: 29px; }
  .workspace-title { align-items: flex-start; }
  .workspace-title p { font-size: 13px; }
  .workspace-title button { min-height: 39px; padding-inline: 10px; font-size: 13px; }
  .work-tools { padding: 12px; }
  .filters { gap: 3px; }
  .filter-button { font-size: 12px; padding-inline: 6px; }
  .search-form { width: 100%; }
  .search-form input { width: 100%; flex: 1; }
  .work-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; padding: 0 12px 12px; }
  .work-card { gap: 7px; padding: 5px; }
  .card-info { padding: 0 3px 3px; gap: 4px; }
  .card-title, .card-meta { font-size: 13px; }
  .status { font-size: 11px; padding-inline: 5px; }
  .list-footer { padding-inline: 12px; }
  .drawer-header, .drawer-body { padding-inline: 15px; }
}
