:root {
  --workspace-sidebar: #111719;
  --workspace-sidebar-raised: #1d2629;
  --workspace-canvas: #f5f7f6;
  --workspace-panel: #ffffff;
  --workspace-line: #e3e8e5;
  --workspace-ink: #172022;
  --workspace-muted: #7f898b;
  --workspace-green: #10b981;
  --workspace-green-dark: #07845c;
  --workspace-soft-green: #ecfaf4;
  --workspace-shadow: 0 12px 32px rgba(17, 30, 27, .07);
}

body { background: var(--workspace-canvas); color: var(--workspace-ink); }
.app-shell { min-height: 100vh; grid-template-columns: 272px minmax(0, 1fr); }
.app-shell.auth-shell { display: block; min-height: 100vh; }
.workspace-sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; padding: 24px 14px 16px;
  background: radial-gradient(circle at 95% 100%, #19352c 0, transparent 25%), var(--workspace-sidebar);
  color: #eaf0ee;
}
.workspace-brand { display: flex; align-items: center; gap: 10px; padding: 0 10px 24px; color: #fff; text-decoration: none; font-size: 19px; font-weight: 760; letter-spacing: -.02em; }
.castle-mark { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 8px; color: #08281e; background: linear-gradient(145deg, #31d89e, #08a773); box-shadow: 0 5px 15px rgba(16,185,129,.2); }
.castle-mark svg { width: 19px; height: 19px; fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.9; }

.project-switcher { margin: 0 0 18px; border: 1px solid rgba(229, 242, 237, .14); border-radius: 11px; background: rgba(255,255,255,.045); }
.project-switcher summary { list-style: none; display: flex; align-items: center; gap: 10px; min-height: 58px; padding: 9px 10px; cursor: pointer; }
.project-switcher summary::-webkit-details-marker { display: none; }
.project-avatar { display: grid; flex: 0 0 auto; width: 35px; height: 35px; place-items: center; border-radius: 50%; background: linear-gradient(145deg, #d9d1cc, #6c7579); color: #182325; font-size: 15px; font-weight: 800; overflow: hidden; }
.project-switcher-title { display: grid; min-width: 0; gap: 1px; flex: 1; }
.project-switcher-title strong, .project-option strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; color: #fff; }
.project-switcher-title small, .project-option small { color: #8b9b98; font-size: 11px; }
.chevron { margin-left: auto; color: #a6b3b0; font-size: 17px; transition: transform .16s ease; }
.project-switcher:not([open]) .chevron { transform: rotate(180deg); }
.project-options { padding: 0 7px 8px; border-top: 1px solid rgba(229,242,237,.09); }
.project-option { display: flex; align-items: center; gap: 9px; padding: 8px; margin-top: 5px; border-radius: 8px; color: #eaf0ee; text-decoration: none; }
.project-option:hover, .project-option.is-current { background: rgba(255,255,255,.09); }
.project-option.is-current::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--workspace-green); box-shadow: 0 0 0 4px rgba(16,185,129,.12); }
.small-avatar { width: 28px; height: 28px; font-size: 12px; }
.project-option > span:last-child { display: grid; min-width: 0; }
.manage-projects-link { display: block; margin: 7px 4px 1px; padding: 7px 4px; color: #9aaba7; text-decoration: none; font-size: 12px; }
.manage-projects-link:hover { color: #fff; }
.sidebar-muted { padding: 6px 5px; color: #8b9b98; font-size: 12px; }

.nav-section-label { margin: 8px 10px 7px; color: #7f908c; font-size: 11px; letter-spacing: .06em; }
.workspace-nav { display: grid; gap: 3px; }
.nav-link { position: relative; display: flex; align-items: center; gap: 12px; min-height: 41px; padding: 0 11px; border-radius: 8px; color: #b9c5c2; text-decoration: none; transition: background .15s ease, color .15s ease; }
.nav-link > .nav-icon { display: grid; width: 18px; height: 18px; flex: 0 0 18px; place-items: center; color: #a8b7b4; }
.nav-icon svg { width: 18px; height: 18px; fill: none; stroke: currentcolor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.nav-link:hover { color: #f2f8f6; background: rgba(255,255,255,.06); }
.nav-link.is-active { color: #37d59d; background: linear-gradient(90deg, rgba(31,50,47,.94), rgba(25,39,38,.5)); font-weight: 700; }
.nav-link.is-active::after { content: ""; position: absolute; right: -14px; top: 8px; width: 3px; height: 25px; border-radius: 6px 0 0 6px; background: var(--workspace-green); }
.nav-link.is-active > .nav-icon { color: #37d59d; }
.nav-divider { height: 1px; margin: 14px 9px 10px; background: rgba(220,239,232,.13); }
.sidebar-account { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 14px 7px 2px; border-top: 1px solid rgba(220,239,232,.13); }
.account-avatar { display: grid; width: 36px; height: 36px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: linear-gradient(145deg, #c8d3d0, #62716d); color: #182321; font-weight: 750; }
.account-meta { display: grid; min-width: 0; flex: 1; gap: 1px; }
.account-meta strong { overflow: hidden; color: #f4f8f7; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.account-meta small { color: #90a19d; font-size: 11px; }
.account-meta i { display: inline-block; width: 7px; height: 7px; margin-right: 4px; border-radius: 50%; background: var(--workspace-green); }
.sidebar-account form { margin: 0; }
.logout-button { width: 27px; height: 27px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: #91a19d; cursor: pointer; font: 18px/1 sans-serif; }
.logout-button:hover { background: rgba(255,255,255,.08); color: #fff; }

.content { padding: 34px 42px 44px; min-width: 0; }
.page-heading { margin-bottom: 22px; }
.page-heading h1, .auth-card h1 { color: var(--workspace-ink); font-size: 30px; letter-spacing: -.035em; }
.eyebrow { color: #8b9597; }
.panel, .project-card, .metric, .auth-card { border-color: var(--workspace-line); border-radius: 12px; box-shadow: var(--workspace-shadow); }
.panel { background: var(--workspace-panel); }
.button { min-height: 38px; border-color: #d9e0dd; border-radius: 8px; box-shadow: none; font-weight: 650; }
.button:hover { border-color: #a9b9b4; background: #fbfdfc; }
.button.primary { background: linear-gradient(135deg, #10ba82, #079569); border-color: #079569; box-shadow: 0 8px 18px rgba(8,151,105,.16); }
.button.primary:hover { background: #07845c; }
.button.outline-button { border-color: #aeb8b5; background: #fff; }
.button.small { min-height: 30px; border-radius: 7px; }
.auth-card { background: #fff; }

/* 分享作品工作区 */
.library-page { max-width: 1380px; margin: 0 auto; }
.library-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.breadcrumb { color: #7a8586; font-size: 13px; }
.breadcrumb span { margin: 0 7px; color: #b4bcba; }
.library-title-row { display: flex; align-items: baseline; gap: 16px; margin-top: 13px; }
.library-title-row h1 { margin: 0; color: #121b1d; font-size: 31px; letter-spacing: -.04em; line-height: 1.2; }
.library-title-row p { margin: 0; color: #697376; font-size: 14px; }
.library-actions { display: flex; gap: 11px; padding-top: 12px; }
.library-actions form { margin: 0; }
.export-trigger { min-width: 116px; }
.library-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 17px; color: #748082; font-size: 13px; }
.health-dot { width: 9px; height: 9px; border-radius: 50%; background: #abb7b4; }
.health-dot.is-healthy { background: var(--workspace-green); box-shadow: 0 0 0 3px #dff7ed; }
.meta-separator { color: #c0c9c6; }
.notice { margin-bottom: 14px; padding: 10px 13px; border: 1px solid; border-radius: 8px; font-size: 13px; }
.notice.success { border-color: #bae8d5; background: #f0fbf6; color: #08764e; }
.notice.warning { border-color: #f0d8a6; background: #fff9eb; color: #8c6412; }
.library-filters { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 14px; }
.library-filters input, .library-filters select { height: 40px; border-color: #dce3e0; border-radius: 8px; box-shadow: none; }
.library-filters > input:not([type="hidden"]), .library-filters > select { width: auto; min-width: 146px; flex: 1 1 152px; }
.library-search { min-width: 270px !important; flex: 2 1 300px !important; padding-left: 38px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%2396a19e' stroke-width='2'%3E%3Ccircle cx='8' cy='8' r='5'/%3E%3Cpath d='m12 12 4 4'/%3E%3C/svg%3E") no-repeat 13px center; }
.date-filter { display: flex; width: auto; min-width: 195px; flex: 1 1 195px; align-items: center; gap: 7px; padding: 0 0 0 9px; border: 1px solid #dce3e0; border-radius: 8px; background: #fff; color: #717c7c; font-size: 12px; font-weight: 600; white-space: nowrap; }
.date-filter:focus-within { outline: 2px solid #a8e3cb; border-color: var(--workspace-green); }
.date-filter input { min-width: 0; height: 38px; padding: 5px 7px; border: 0; outline: 0 !important; }
.filter-submit { min-height: 40px; }
.clear-filter { min-height: 40px; color: #657171; }
.library-workspace { display: grid; grid-template-columns: minmax(0, 1fr) clamp(340px, 29vw, 420px); align-items: start; gap: 16px; }
.asset-list-pane { min-width: 0; overflow: hidden; border: 1px solid var(--workspace-line); border-radius: 13px; background: var(--workspace-panel); box-shadow: var(--workspace-shadow); }
.asset-list-head, .asset-row { display: grid; grid-template-columns: minmax(210px, 1.35fr) minmax(175px, 1fr) minmax(118px, .72fr) minmax(170px, 1.2fr); column-gap: 12px; align-items: center; }
.asset-list-head { min-height: 59px; padding: 0 22px; border-bottom: 1px solid var(--workspace-line); background: #fbfcfb; color: #6f797b; font-size: 12px; font-weight: 720; }
.asset-row { position: relative; min-height: 113px; padding: 12px 22px; border-bottom: 1px solid #eef1ef; color: var(--workspace-ink); text-decoration: none; transition: background .14s ease; }
.asset-row:hover { background: #fafdfb; }
.asset-row.is-selected { background: linear-gradient(105deg, #f4fcf8, #fbfefd); }
.asset-row.is-selected::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 3px; background: var(--workspace-green); }
.asset-visual { display: flex; align-items: center; gap: 13px; min-width: 0; }
.asset-visual img, .asset-placeholder { width: 105px; height: 78px; flex: 0 0 auto; border-radius: 7px; object-fit: cover; background: #edf1ef; }
.asset-placeholder { display: grid; place-items: center; color: #8e9998; font-size: 12px; }
.asset-author { display: flex; align-items: center; min-width: 0; gap: 9px; }
.asset-author > span:last-child { display: grid; min-width: 0; gap: 3px; }
.asset-author strong { overflow: hidden; color: #202a2c; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.asset-author small { overflow: hidden; color: #7d8889; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.asset-author .asset-inline-time { color: #4d8170; font-size: 11px; }
.author-avatar { display: grid; width: 31px; height: 31px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: linear-gradient(145deg, #e1ddd5, #92948e); color: #31413d; font-size: 12px; font-weight: 700; object-fit: cover; }
.source-tag { display: inline-flex; max-width: 100%; overflow: hidden; padding: 5px 8px; border-radius: 8px; background: #e8f5ff; color: #297298; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.source-tag.source-tone-0 { background: #e8f5ff; color: #297298; }
.source-tag.source-tone-1 { background: #ecf9ef; color: #177a58; }
.source-tag.source-tone-2 { background: #f5edff; color: #7855a4; }
.source-tag.source-tone-3 { background: #fff0e4; color: #ae6533; }
.source-tag.source-tone-4 { background: #fff6d9; color: #956f13; }
.asset-description { min-width: 0; overflow: hidden; color: #586463; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; line-height: 1.5; }
.asset-empty { padding: 90px 20px; color: #899392; text-align: center; }

.violator-list-head, .violator-row { display: grid; grid-template-columns: minmax(190px, 1.35fr) minmax(145px, 1fr) minmax(145px, 1fr) minmax(175px, 1.25fr) 88px 88px minmax(126px, .9fr) 78px; column-gap: 14px; align-items: center; }
.violator-list-head { min-height: 58px; padding: 0 22px; border-bottom: 1px solid var(--workspace-line); background: #fbfcfb; color: #6f797b; font-size: 12px; font-weight: 720; }
.violator-row { min-height: 76px; padding: 12px 22px; border-bottom: 1px solid #eef1ef; color: #53605f; font-size: 13px; }
.violator-row:hover { background: #fafdfb; }
.violator-person { display: flex; min-width: 0; align-items: center; gap: 10px; }
.violator-person img, .violator-person > span { display: grid; width: 38px; height: 38px; flex: 0 0 auto; place-items: center; border-radius: 50%; background: linear-gradient(145deg, #dfe6e3, #aab8b2); color: #38514b; object-fit: cover; font-size: 13px; font-weight: 700; }
.violator-person strong, .violator-row code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.violator-person strong { color: #202a2c; font-size: 13px; }
.violator-row code { color: #64716f; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.violator-row time { color: #657173; white-space: nowrap; font-size: 12px; }
.violator-count { color: #0a9166; font-size: 18px; }

.asset-detail-pane { position: sticky; top: 22px; min-width: 0; max-height: calc(100vh - 44px); overflow-y: auto; padding: 20px 21px; border: 1px solid var(--workspace-line); border-radius: 13px; background: var(--workspace-panel); box-shadow: var(--workspace-shadow); }
.detail-heading { display: flex; align-items: center; justify-content: space-between; min-height: 39px; margin-bottom: 17px; padding-bottom: 13px; border-bottom: 1px solid var(--workspace-line); }
.detail-heading h2 { margin: 2px 0 0; font-size: 19px; letter-spacing: -.025em; }
.detail-kicker { color: #899593; font-size: 11px; font-weight: 700; letter-spacing: .07em; }
.detail-image { position: relative; display: block; height: 174px; overflow: hidden; border-radius: 8px; background: #edf1ef; }
.detail-image img { width: 100%; height: 100%; object-fit: cover; }
.detail-image span { position: absolute; right: 8px; bottom: 8px; padding: 3px 6px; border-radius: 5px; background: rgba(10,16,16,.7); color: #fff; font-size: 11px; }
.detail-no-image { display: grid; height: 174px; place-items: center; border: 1px dashed #ccd6d2; border-radius: 8px; color: #84908e; }
.detail-fields { display: grid; gap: 17px; margin: 23px 0 0; }
.detail-fields > div { display: grid; grid-template-columns: 93px minmax(0, 1fr); align-items: start; gap: 7px; }
.detail-fields dt { color: #687577; font-size: 12px; }
.detail-fields dd { min-width: 0; margin: 0; color: #3c4748; font-size: 13px; word-break: break-word; }
.detail-fields dd a { color: #07946a; text-decoration: none; }
.detail-description { max-height: 58px; overflow: auto; line-height: 1.55; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--workspace-line); }
.detail-actions form { margin: 0; }
.detail-actions .button { min-height: 34px; padding: 7px 10px; font-size: 12px; }
.subtle-danger { background: #fff; }
.detail-empty { display: grid; min-height: 440px; place-content: center; text-align: center; color: #87918f; }
.detail-empty > span { color: #b6c3bf; font-size: 30px; }
.detail-empty h2 { margin: 13px 0 5px; color: #586362; font-size: 16px; }
.detail-empty p { max-width: 210px; margin: 0; font-size: 13px; }

/* 完整分页：永远保留，方便调整页面条数和跳转。 */
.pagination { display: flex; align-items: center; gap: 11px; min-height: 61px; margin: 0; padding: 10px 18px; border-top: 1px solid var(--workspace-line); background: #fff; }
.pagination form { margin: 0; }
.page-size-form label { display: flex; align-items: center; gap: 6px; color: #6c7777; font-size: 12px; font-weight: 500; }
.page-size-form select { width: auto; min-height: 31px; padding: 4px 25px 4px 8px; border-radius: 6px; font-size: 12px; }
.pagination-total { margin-right: auto; color: #8c9695; font-size: 12px; white-space: nowrap; }
.page-controls { display: flex; align-items: center; gap: 4px; }
.page-control { display: grid; min-width: 29px; height: 29px; padding: 0 6px; place-items: center; border: 1px solid transparent; border-radius: 6px; color: #4d5958; text-decoration: none; font-size: 12px; }
a.page-control:hover { border-color: #c9d4d0; background: #f5f8f6; }
.page-edge { min-width: 37px; }
.page-control.is-current { border-color: #10b981; background: #eafaf3; color: #048259; font-weight: 750; }
.page-control.is-disabled { color: #c1c9c6; }
.page-ellipsis { width: 18px; color: #8c9795; text-align: center; }
.page-jump-form { display: flex; align-items: center; gap: 5px; color: #778280; font-size: 12px; white-space: nowrap; }
.page-jump { width: 46px; min-height: 29px; padding: 3px 6px; border-radius: 6px; text-align: center; font-size: 12px; }
.page-jump-form .button { min-height: 29px; padding: 4px 8px; }

/* 导出列选择、排序和拖动。 */
.export-dialog { width: min(560px, calc(100vw - 32px)); max-height: min(780px, calc(100vh - 38px)); padding: 0; border: 1px solid #dce4e0; border-radius: 14px; background: #fff; color: var(--workspace-ink); box-shadow: 0 25px 80px rgba(9,21,18,.25); }
.export-dialog::backdrop { background: rgba(14,23,21,.48); backdrop-filter: blur(2px); }
.dialog-topbar { display: flex; align-items: center; justify-content: space-between; padding: 19px 22px 14px; border-bottom: 1px solid var(--workspace-line); }
.dialog-topbar h2 { margin: 0; font-size: 19px; }
.dialog-close { width: 30px; height: 30px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: #4c5957; cursor: pointer; font-size: 25px; font-weight: 300; }
.dialog-close:hover { background: #f0f4f2; }
.export-dialog > p { margin: 15px 22px; color: #6e7a78; font-size: 13px; }
.export-dialog > .export-mode-note { margin-top: -7px; color: #087d59; }
.export-dialog #export-form { padding: 0 22px 20px; }
.export-columns { display: grid; max-height: 420px; margin: 0; padding: 0; overflow: auto; border: 1px solid var(--workspace-line); border-radius: 9px; list-style: none; }
.export-columns li { display: grid; grid-template-columns: 25px minmax(0,1fr) 26px 26px 26px; align-items: center; gap: 5px; min-height: 42px; padding: 0 8px; border-bottom: 1px solid #edf1ef; background: #fff; cursor: grab; }
.export-columns li:last-child { border-bottom: 0; }
.export-columns li.is-dragging { opacity: .45; background: #e9faf2; }
.drag-handle { color: #a2aeab; font-size: 18px; text-align: center; }
.export-columns label { display: flex; align-items: center; gap: 8px; color: #384544; font-weight: 600; cursor: pointer; }
.export-columns label input { width: auto; }
.column-order { display: grid; width: 21px; height: 21px; place-items: center; border-radius: 50%; background: #eff4f1; color: #74807c; font-size: 11px; }
.move-column { width: 24px; height: 24px; padding: 0; border: 0; border-radius: 5px; background: transparent; color: #63706d; cursor: pointer; font-size: 16px; }
.move-column:hover { background: #eaf7f1; color: #08865e; }
.export-dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 17px; }

/* 让既有页面也落入同一个系统视觉中。 */
.project-grid { gap: 14px; }
.project-card { box-shadow: none; }
.project-card-unassigned { opacity: .75; cursor: default; }
.table-panel { box-shadow: var(--workspace-shadow); }
.metric-grid { gap: 14px; }
.metric { border-radius: 11px; box-shadow: none; }
.log-toolbar, .filters { border-radius: 9px; }
.tail-panel { border-radius: 11px; overflow: hidden; }
.settings-grid .panel, .project-grid + .panel { box-shadow: none; }

@media (max-width: 1250px) {
  .content { padding: 28px; }
  .library-workspace { grid-template-columns: minmax(590px, 1fr) minmax(320px, 370px); }
  .asset-list-head, .asset-row { grid-template-columns: minmax(190px, 1.25fr) minmax(145px, .9fr) 104px minmax(135px, 1.05fr); padding-left: 16px; padding-right: 16px; }
  .asset-visual img, .asset-placeholder { width: 90px; height: 68px; }
  .violator-list-head, .violator-row { grid-template-columns: minmax(150px, 1.15fr) minmax(128px, .9fr) minmax(128px, .9fr) minmax(150px, 1.1fr) 74px 74px 112px 68px; padding-left: 16px; padding-right: 16px; }
  .pagination { flex-wrap: wrap; }
}
@media (max-width: 1020px) {
  .app-shell { grid-template-columns: 220px minmax(0,1fr); }
  .workspace-sidebar { padding-left: 10px; padding-right: 10px; }
  .content { padding: 22px; }
  .library-workspace { grid-template-columns: minmax(0,1fr); }
  .asset-list-head, .asset-row { grid-template-columns: minmax(255px, 1.55fr) minmax(185px, 1fr) minmax(125px, .72fr) minmax(210px, 1.2fr); }
  .asset-detail-pane { position: static; max-height: none; overflow: visible; }
  .violator-list-head, .violator-row { grid-template-columns: minmax(185px, 1.2fr) minmax(150px, .95fr) minmax(150px, .95fr) minmax(180px, 1.2fr) 84px 84px 128px 78px; }
}
@media (max-width: 760px) {
  .app-shell { display: block; }
  .workspace-sidebar { position: relative; height: auto; min-height: 0; padding-bottom: 12px; }
  .workspace-brand { padding-bottom: 14px; }
  .project-switcher { margin-bottom: 10px; }
  .workspace-nav { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .nav-link.is-active::after { right: 5px; }
  .sidebar-account { display: none; }
  .content { padding: 19px 14px 28px; }
  .library-header { align-items: stretch; flex-direction: column; }
  .library-actions { padding-top: 0; }
  .library-filters > * { flex: 1 1 180px; }
  .library-search { flex-basis: 100% !important; }
  .asset-list-head { display: none; }
  .asset-list { overflow-x: auto; }
  .asset-row { min-width: 760px; }
  .violator-list { overflow-x: auto; }
  .violator-list-head, .violator-row { min-width: 1120px; }
  .pagination { justify-content: center; }
  .pagination-total { margin-right: 0; }
}
@media (max-width: 480px) {
  .workspace-nav { grid-template-columns: 1fr; }
  .library-title-row { display: block; }
  .library-title-row p { margin-top: 6px; }
  .library-actions { width: 100%; }
  .library-actions > *, .library-actions .button { flex: 1; }
  .library-filters > * { flex-basis: 100%; }
  .page-controls { order: 3; width: 100%; justify-content: center; }
  .page-jump-form { margin-left: auto; }
}
