:root {
  color-scheme: light;
  --ink: #17273c;
  --text: #1c2a40;
  --muted: #52637a;
  --paper: #fff;
  --workspace: #f2f5fa;
  --heading: #e4ebf5;
  --line: #d7e0ed;
  --line-strong: #bdcadc;
  --primary: #245dca;
  --primary-hover: #1c4eaf;
  --active: #edf3ff;
  --nav-height: 50px;
  font: 14px/1.45 "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--text);
  background: var(--workspace);
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
a { color: var(--primary); text-decoration: none; }
button, input, textarea, select { color: inherit; font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: default; opacity: .45; }
:focus-visible { outline: 2px solid #3977e2; outline-offset: 2px; }
h1, h2, p { margin: 0; }
h1 { font-size: 25px; line-height: 1.3; }
h2 { font-size: 17px; line-height: 1.4; }
p { color: var(--muted); }

.navigation {
  position: relative; z-index: 4; display: flex; align-items: center;
  min-height: var(--nav-height); padding: 0 20px; gap: 22px;
  background: var(--ink); color: #f1f5fc;
}
.brand { display: flex; align-items: center; gap: 11px; padding-right: 20px; border-right: 1px solid #ffffff32; white-space: nowrap; }
.brand strong { color: #f7faff; font-size: 16px; font-weight: 700; }
.brand-mark { position: relative; isolation: isolate; display: block; width: 24px; height: 22px; }
.brand-mark::before, .brand-mark::after {
  content: ""; position: absolute; width: 16px; height: 12px;
  border: 1.5px solid #edf3ff; border-radius: 3px; background: var(--ink);
}
.brand-mark::before { left: 5px; top: 2px; }
.brand-mark::after { left: 1px; top: 7px; }
.navigation nav { display: flex; align-self: stretch; gap: 16px; }
.navigation nav a {
  display: grid; place-items: center; padding: 0 10px; border-bottom: 3px solid transparent;
  color: #cdd8e9; font-weight: 600; white-space: nowrap;
}
.navigation nav a:hover { color: white; background: #ffffff12; }
.navigation nav a[aria-current] { color: white; border-color: #7ba8ff; }
.navigation :focus-visible { outline-color: #9fc0ff; outline-offset: -2px; }
.identity { display: flex; align-items: center; gap: 11px; margin-left: auto; color: #d2ddee; font-size: 12px; white-space: nowrap; }
#identity-role:empty { display: none; }
#identity-role:not(:empty) { padding-left: 10px; border-left: 1px solid #ffffff36; }
.save-state { display: inline-flex; align-items: center; gap: 6px; }
.save-state::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #94a6c1; }
.save-state[data-state="ready"]::before { background: #98beff; }
.save-state[data-state="pending"]::before { background: #f5ca75; }
.save-state[data-state="error"] { color: #ffb4a6; }
.save-state[data-state="error"]::before { background: currentColor; }
#account-action { min-height: 28px; background: #2a4363; color: #f8faff; border-color: #547092; font-size: 12px; }
#account-action:hover { background: #395681; }

.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 32px; padding: 4px 10px; border: 1px solid var(--line-strong); border-radius: 5px;
  background: var(--paper); color: var(--text); font-size: 13px; font-weight: 600; white-space: nowrap;
}
.button:hover:not(:disabled):not([aria-disabled="true"]) { background: #f2f6fe; border-color: #8da7cb; }
.button.primary { border-color: var(--primary); background: var(--primary); color: #fff; }
.button.primary:hover:not(:disabled):not([aria-disabled="true"]) { border-color: var(--primary-hover); background: var(--primary-hover); }
.button[aria-disabled="true"] { background: #edf1f7; color: #64758b; border-color: var(--line); cursor: default; }
.text-button { padding: 0; border: 0; background: none; color: var(--primary); font-weight: 550; }
.text-button:hover { text-decoration: underline; }

#sheet { display: flex; flex-direction: column; height: calc(100dvh - var(--nav-height)); min-height: 325px; }
.table-tools {
  display: flex; align-items: center; justify-content: space-between; flex: none; gap: 10px;
  min-height: 53px; padding: 9px 16px;
}
.viewbar, .sheet-filters, .sheet-footer, .sheet-date-filters { display: flex; align-items: center; }
.viewbar { gap: 5px; }
.viewbar button {
  display: inline-flex; align-items: baseline; gap: 6px; min-height: 32px; padding: 5px 9px;
  border: 1px solid var(--line); border-radius: 5px; background: #fafcff; font-size: 13px; font-weight: 650;
  white-space: nowrap;
}
.viewbar button:hover { border-color: #a6b8d2; }
.viewbar button[aria-pressed="true"] { border-color: var(--primary); background: var(--primary); color: white; }
.viewbar button span { color: var(--muted); font-size: 11px; font-weight: 500; font-variant-numeric: tabular-nums; }
.viewbar button[aria-pressed="true"] span { color: #e7efff; }
.sheet-filters { gap: 7px; min-width: 0; }
.search-box {
  display: flex; align-items: center; gap: 9px; width: clamp(158px, 19vw, 315px); min-width: 0;
  padding: 0 9px; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--paper);
}
.search-box:focus-within { border-color: #5a8ae1; box-shadow: 0 0 0 2px #d8e6ff; }
.search-icon { position: relative; flex: 0 0 12px; height: 12px; border: 1.5px solid #657a99; border-radius: 50%; }
.search-icon::after { content: ""; position: absolute; right: -4px; bottom: -2px; width: 5px; height: 1.5px; background: #657a99; transform: rotate(45deg); }
#search { width: 100%; height: 30px; min-width: 0; padding: 0; border: 0; outline: 0; background: none; font-size: 13px; }
#search::placeholder { color: #62758e; }
#platform, #record-kind, .sheet-date-filters select, .sheet-date-filters input { min-height: 32px; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--paper); padding: 3px 7px; font-size: 13px; }

.sheet-scroll {
  --title-width: clamp(205px, 19vw, 306px);
  flex: 1 1 auto; min-height: 0; overflow: auto;
  border-block: 1px solid var(--line); background: #f7f9fd;
  scrollbar-width: thin; scrollbar-color: #aabbcf #edf2fa;
  scroll-padding: 38px 5px 5px calc(var(--title-width) + 6px);
}
#collection-table {
  --extra-width: 0px;
  width: calc(100% + var(--extra-width)); min-width: calc(1396px + var(--extra-width));
  table-layout: fixed; border-collapse: separate; border-spacing: 0; background: var(--paper); text-align: left; font-size: 13px;
}
.number-col { width: var(--number-width, 56px); }
.title-col { width: var(--title-width); }
.platform-col { width: 70px; }
.author-col { width: 125px; }
.collected-col, .published-col { width: 145px; }
.likes-col { width: 86px; }
.column-published, .column-likes { font-variant-numeric: tabular-nums; }
.decision-col { width: 88px; }
#collection-table th {
  position: sticky; top: 0; z-index: 2; height: 38px;
  padding: 6px 9px; background: var(--heading); font-weight: 650; white-space: nowrap;
}
#collection-table th, #collection-table td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
#collection-table td { height: 34px; padding: 3px 7px; vertical-align: middle; }
#collection-table th:first-child, #collection-table .row-number { position: sticky; left: 0; text-align: center; background: var(--heading); font-variant-numeric: tabular-nums; }
#collection-table th:first-child { z-index: 4; }
#collection-table .row-number { z-index: 1; }
#collection-table th:nth-child(2) { left: var(--number-width, 56px); z-index: 3; padding-left: 31px; border-right-color: var(--line-strong); }
#collection-table .column-title { position: sticky; left: var(--number-width, 56px); z-index: 1; padding-left: 28px; background: var(--paper); border-right-color: var(--line-strong); }
#collection-table tr:hover td { background: #f6f9ff; }
#collection-table tr:focus-within td { background: #f3f7ff; }
#collection-table tr.is-expanded td { vertical-align: top; padding-top: 7px; padding-bottom: 7px; background: var(--active); }
#collection-table th:has(.column-filter) { padding-inline: 4px; }
#collection-table th label { display: flex; align-items: center; justify-content: center; gap: 4px; }
.column-filter { max-width: 50px; border: 1px solid #c5d2e5; border-radius: 4px; background: #f8faff; color: var(--muted); padding: 1px; font-size: 11px; }
.column-filter.active { border-color: #a9c2f3; background: #eff5ff; color: #174daf; }
.column-decision, .column-second { text-align: center; font-variant-numeric: tabular-nums; }
.expand-work {
  position: absolute; left: 4px; top: 4px; display: grid; place-items: center; width: 22px; height: 25px;
  padding: 0; border: 0; border-radius: 4px; background: transparent; color: #546681;
}
.expand-work::before { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-top: 1.5px solid currentColor; transform: rotate(45deg); }
.expand-work[aria-expanded="true"]::before { transform: translateY(-2px) rotate(135deg); }
.expand-work:hover, .rename-column:hover { color: var(--primary); background: #dce8fe; }
.is-expanded .expand-work { top: 8px; }
.custom-name { display: inline-block; max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.rename-column { width: 22px; height: 23px; border-radius: 4px; font-size: 14px; vertical-align: middle; }

.grid-value { position: relative; }
.cell-display, .owner-cell {
  display: block; width: 100%; min-width: 0; min-height: 26px; margin: 0; padding: 3px;
  border: 1px solid transparent; border-radius: 4px; background: none; color: inherit; text-align: left;
  line-height: 18px;
}
.cell-display { text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }
.cell-display.field-title, .cell-title { font-weight: 650; }
.cell-display.field-collected, [data-field="collected"] { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.field-platform, .field-author, .field-original { color: #3c4e67; }
.field-decision, .field-second, .stage-cell { text-align: center; font-weight: 650; }
.field-decision[data-value="0"], .field-second[data-value="0"] { color: #5a6c84; }
.field-draft[data-value=""] { color: #637590; }
.cell-read { cursor: pointer; }
.grid-value:hover .cell-display, .cell-read:hover { border-color: #b9ccef; background: #f0f5ff; }
.grid-value .owner-cell:not(:focus):not(.cell-invalid) { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; }
.grid-value:has(.owner-cell:focus) .cell-display, .grid-value:has(.cell-invalid) .cell-display { display: none; }
.owner-cell:not(select) { cursor: text; }
.owner-cell:focus { border-color: var(--primary); outline: 1px solid #a6c2f8; outline-offset: 0; background: var(--paper); }
.owner-cell::placeholder { color: #637590; }
.cell-script, .cell-title { resize: none; }
.cell-title { height: 26px; }
.is-expanded .long-text .cell-display {
  min-height: 132px; max-height: 245px; white-space: pre-wrap; overflow: auto; overflow-wrap: anywhere; text-overflow: clip;
}
.cell-script:focus, .cell-script.cell-invalid { height: 132px; min-height: 54px; resize: vertical; }
.cell-feedback:empty { display: none; }
.cell-feedback { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px; margin: 4px 0; font-size: 12px; color: #a13225; overflow-wrap: anywhere; }
.owner-cell.cell-invalid { border-color: #bd4e43; }
.sheet-footer {
  justify-content: space-between; flex: none; gap: 8px; min-height: 43px; padding: 6px 14px;
  color: var(--muted); font-size: 12px;
}
.col-grip { position: absolute; inset: 0 -1px 0 auto; width: 9px; cursor: col-resize; touch-action: none; user-select: none; }
.col-grip::after { content: ''; position: absolute; right: 2px; top: 25%; bottom: 25%; width: 2px; background: #a4b6ce; }
.col-grip:hover::after, .col-grip:focus-visible::after { background: var(--primary); }
.release-layout {
  display: grid; grid-template-columns: clamp(172px, 17vw, 224px) minmax(0, 1fr);
  align-items: start; gap: 16px; padding: 14px 15px;
}
.account-card { overflow: hidden; min-width: 0; border: 1px solid var(--line); border-radius: 5px; background: #edf2fa; }
.account-card h2 { padding: 12px 12px 9px; font-size: 15px; }
.account-option {
  display: flex; align-items: center; justify-content: space-between; gap: 7px; width: 100%; min-height: 53px;
  padding: 7px 10px; border: 0; border-top: 1px solid var(--line); border-left: 3px solid transparent;
  background: transparent; text-align: left; font-size: 13px;
}
.account-option:hover { background: #e5edfc; }
.account-option[aria-pressed="true"] { border-left-color: var(--primary); background: #dfeaff; }
.account-info { display: block; min-width: 0; overflow-wrap: anywhere; }
.account-info strong { font-weight: 650; }
.account-count { flex: none; color: var(--muted); font-size: 11px; }
.detail { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.release-card { min-width: 0; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; min-height: 46px; }
.card-head .button { margin-left: auto; font-size: 12px; }
.platform-label { padding: 2px 7px; border: 1px solid var(--line-strong); border-radius: 4px; color: var(--muted); font-size: 12px; }
.release-controls, .release-tabs, .release-toolbar { display: flex; align-items: center; }
.release-controls { justify-content: space-between; flex-wrap: wrap; gap: 7px 12px; margin: 3px 0 12px; border-bottom: 1px solid var(--line); }
.release-tabs { gap: 11px; min-height: 42px; align-items: stretch; }
.release-tabs button { padding: 5px 6px 4px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-weight: 650; }
.release-tabs button[aria-pressed="true"] { border-color: var(--primary); color: var(--primary); }
.release-toolbar { gap: 8px; padding: 4px 0; }
.release-scroll { overflow: auto; border: 1px solid var(--line); border-radius: 5px; background: var(--paper); }
.release-table { width: 100%; min-width: 625px; border-spacing: 0; text-align: left; }
.release-table th { height: 36px; padding: 6px 10px; background: var(--heading); font-size: 13px; }
.release-table td { padding: 7px 10px; border-top: 1px solid var(--line); }
.release-table :is(th, td) + :is(th, td) { border-left: 1px solid var(--line); }
.release-table #select-column, .release-table .release-select { width: 35px; padding-inline: 8px; text-align: center; }
.release-table .release-meta { width: 142px; color: #3c4e67; font-size: 12px; }
.release-table th:last-child { width: 225px; }
.release-table:has(#select-column[hidden]) th:last-child { width: 90px; }
#release-link-column { width: clamp(155px, 20vw, 306px); }
.release-link { max-width: 155px; }
.release-link a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.release-row:hover { background: #f6f9ff; }
input[type="checkbox"] { width: 16px; height: 16px; margin: 0; vertical-align: middle; accent-color: var(--primary); cursor: pointer; }
.release-work { display: flex; align-items: center; gap: 10px; }
.thumb-button { position: relative; flex: none; padding: 0; border: 0; border-radius: 4px; background: #e0e8f4; overflow: hidden; }
.thumb { display: block; width: 89px; height: 50px; object-fit: cover; }
.thumb-play { position: absolute; left: 50%; top: 50%; padding: 2px 6px; border-radius: 4px; transform: translate(-50%, -50%); background: #17273cb5; color: white; font-size: 11px; }
.task-title { font-size: 14px; font-weight: 650; overflow-wrap: anywhere; }
.row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 13px; }
.row-actions > * { white-space: nowrap; }
.row-actions > * + * { padding-left: 9px; border-left: 1px solid var(--line-strong); }
#collection-table .empty, .release-table .empty { padding: 22px 15px; color: var(--muted); }

.notice { padding: 10px 12px; border: 1px solid #b3c9ef; border-radius: 5px; background: #eef4ff; color: #20458d; }
#notice { position: fixed; right: 16px; bottom: 52px; z-index: 5; max-width: calc(100vw - 32px); }
#load-error { position: fixed; left: 12px; bottom: 52px; z-index: 5; border-color: #e0b8af; background: #fff1ec; color: #902c20; }
dialog { width: min(460px, calc(100% - 26px)); max-height: calc(100dvh - 28px); padding: 0; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--paper); color: var(--text); box-shadow: 0 14px 54px #15264238; }
dialog::backdrop { background: #17273c61; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.close-button { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font-size: 23px; line-height: 1; }
.close-button:hover { color: var(--text); background: var(--workspace); }
.dialog-fields { display: grid; gap: 6px; padding: 12px 16px 15px; }
.dialog-fields label { display: block; margin-top: 6px; font-size: 13px; font-weight: 650; }
.dialog-fields :is(input, select) { width: 100%; min-height: 35px; padding: 5px 8px; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--paper); }
#column-kind-field select { margin-top: 6px; }
.optional, #login-help { color: var(--muted); font-size: 12px; font-weight: 400; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.form-error { color: #a13225; font-size: 13px; }
.form-error:empty { display: none; }
#preview-dialog { width: min(560px, calc(100% - 26px)); }
#preview-video { display: block; width: calc(100% - 24px); max-height: min(69dvh, 610px); margin: 12px; border-radius: 4px; background: #111923; }
#preview-error:not(:empty) { padding: 0 12px 12px; }
#publish-task strong { display: block; margin-top: 3px; color: var(--text); }

@media (max-width: 1000px) {
  .table-tools { flex-wrap: wrap; padding: 8px 10px; }
  .sheet-filters { justify-content: flex-end; flex: 1; }
  .release-layout { gap: 10px; padding: 10px; }
  .release-table th:last-child { width: 180px; }
}
@media (max-width: 720px) {
  .navigation { gap: 7px; padding: 0 8px; }
  .brand { gap: 0; padding-right: 6px; }
  .brand strong { display: none; }
  .navigation nav { gap: 0; }
  .navigation nav a { padding: 0 6px; font-size: 13px; }
  #identity-role:not(:empty) { padding-left: 0; border: 0; }
  .identity { gap: 5px; }
  .save-state { display: none; }
  .save-state[data-state="error"] { display: inline-flex; max-width: 7em; white-space: normal; font-size: 10px; }
  .sheet-filters { justify-content: flex-start; flex-basis: 100%; }
  .search-box { flex: 1; }
  .sheet-scroll { --title-width: clamp(132px, 28vw, 185px); }
  .sheet-footer { flex-wrap: wrap; gap: 4px; padding: 5px 8px; }
  .release-layout { grid-template-columns: minmax(0, 1fr); }
  .account-card h2 { padding: 8px; }
  #account-list { display: flex; overflow-x: auto; }
  .account-option { flex: 0 0 126px; min-height: 50px; border-left: 0; border-right: 1px solid var(--line); border-bottom: 2px solid transparent; }
  .account-option[aria-pressed="true"] { border-bottom-color: var(--primary); }
  .account-option .detail, .account-count { font-size: 10px; }
  .card-head h1 { font-size: 21px; }
}
@media (max-width: 390px) {
  #identity-role { display: none; }
  .table-tools { padding-inline: 6px; }
  .sheet-filters { gap: 4px; }
  .sheet-filters .button, #platform, #record-kind { padding-inline: 4px; font-size: 12px; }
}


.work-source { display: none; }
.is-expanded .work-source {
    display: block;
    width: fit-content;
    margin: 4px 0 1px 24px;
    font-size: 12px;
    color: #27588e;
}

.work-production { display: none; }
.is-expanded .work-production {
    display: block;
    margin: 4px 0 1px 24px;
    color: #425b72;
    font-size: 12px;
}

#pipeline-health { padding: 8px 16px; color: #334863; background: #f4f7fb; font-size: 14px; }
#pipeline-health summary { cursor: pointer; }
#pipeline-details p { margin: 8px 0; }

.sheet-date-filters { flex: none; flex-wrap: wrap; gap: 6px 14px; padding: 2px 16px 8px; font-size: 13px; }
.sheet-date-filters label { display: inline-flex; align-items: center; gap: 5px; }
#source-author { max-width: 16em; }
.sort-collected { border: 0; background: transparent; color: inherit; padding: 0; font-weight: inherit; cursor: pointer; }
