:root {
    --bg: #f4f6f8;
    --surface: #ffffff;
    --border: #d8dee6;
    --text: #1f2933;
    --muted: #6b7280;
    --primary: #8b4513;
    --primary-hover: #6d3610;
    --danger: #c0392b;
    --warning-bg: #fff8e6;
    --success: #2e7d32;
    --header-bg: #2c1810;
    --sidebar-bg: #241610;
    --sidebar-active: rgba(255, 255, 255, 0.1);
    --accent-gold: #c9a227;
    --topbar-h: 56px;
    --sidebar-w: 220px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    color: var(--text);
    background: var(--bg);
    min-width: 1280px;
}

/* 输入框 placeholder 小于正文，全站统一 */
input::placeholder,
textarea::placeholder {
    font-size: 12px;
    line-height: 1.4;
    color: var(--muted);
    opacity: 1;
}

input::-webkit-input-placeholder,
textarea::-webkit-input-placeholder {
    font-size: 12px;
    color: var(--muted);
}

input::-moz-placeholder,
textarea::-moz-placeholder {
    font-size: 12px;
    color: var(--muted);
    opacity: 1;
}

/* 选择框（含 option）小于正文，全站统一 */
select,
.filter-select,
.page-size-select,
.candidate-select {
    font-size: 12px;
}

select option {
    font-size: 12px;
}

/* ========== 顶部通栏 ========== */
.admin-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 200;
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 0 20px;
    background: var(--header-bg);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.admin-topbar__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
    flex-shrink: 0;
}

.admin-topbar__brand:hover {
    opacity: 0.9;
}

.admin-topbar__logo {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-gold);
    color: var(--header-bg);
    border-radius: 6px;
    font-weight: 700;
    font-size: 16px;
}

.admin-topbar__name {
    font-size: 16px;
    font-weight: 600;
    white-space: nowrap;
}

.admin-topbar__stats {
    flex: 1;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.78);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.admin-topbar__hint {
    color: rgba(255, 255, 255, 0.72);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-topbar__actions {
    flex-shrink: 0;
}

.admin-topbar__status {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.72);
}

.admin-topbar__status.is-saving {
    color: #90caf9;
}

.admin-topbar__status.is-success {
    color: #a5d6a7;
}

.admin-topbar__status.is-error {
    color: #ef9a9a;
}

/* ========== 主体布局 ========== */
.admin-body {
    display: flex;
    margin-top: var(--topbar-h);
    min-height: calc(100vh - var(--topbar-h));
}

.admin-delegate-banner {
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    right: 0;
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 20px;
    background: #fff8e6;
    border-bottom: 1px solid #e8d9a8;
    font-size: 13px;
    color: #5c4b1f;
}

.admin-delegate-banner a {
    color: var(--primary);
    text-decoration: none;
    white-space: nowrap;
    font-weight: 600;
}

body.admin-app:has(.admin-delegate-banner) .admin-body {
    margin-top: calc(var(--topbar-h) + 36px);
    min-height: calc(100vh - var(--topbar-h) - 36px);
}

body.admin-app:has(.admin-delegate-banner) .admin-sidebar {
    top: calc(var(--topbar-h) + 36px);
    height: calc(100vh - var(--topbar-h) - 36px);
}

/* ========== 左侧菜单 ========== */
.admin-sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--sidebar-bg);
    color: rgba(255, 255, 255, 0.88);
    position: sticky;
    top: var(--topbar-h);
    height: calc(100vh - var(--topbar-h));
    overflow-y: auto;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-sidebar__nav {
    padding: 12px 0 24px;
}

.admin-sidebar__group {
    margin: 0 0 4px;
}

.admin-sidebar__group + .admin-sidebar__group {
    margin-top: 8px;
}

.admin-sidebar__group-label {
    padding: 12px 16px 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.4);
}

.admin-sidebar__group-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: calc(100% - 16px);
    margin: 0 8px;
    padding: 8px 10px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: rgba(255, 255, 255, 0.45);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s, color 0.15s;
}

.admin-sidebar__group-toggle:hover {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.72);
}

.admin-sidebar__group-label-text {
    flex: 1;
    min-width: 0;
}

.admin-sidebar__group-chevron {
    flex-shrink: 0;
    width: 0;
    height: 0;
    margin-left: 8px;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid rgba(255, 255, 255, 0.45);
    transition: transform 0.18s ease;
}

.admin-sidebar__group.is-open .admin-sidebar__group-chevron {
    transform: rotate(180deg);
}

.admin-sidebar__group:not(.is-open) > .admin-sidebar__list {
    display: none;
}

.admin-sidebar__group.is-open > .admin-sidebar__list {
    display: block;
}

.admin-sidebar__list {
    list-style: none;
    margin: 0;
    padding: 2px 8px 6px;
}

.admin-sidebar__link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 12px;
    margin-bottom: 2px;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.15s;
    border-left: 3px solid transparent;
}

.admin-sidebar__link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.admin-sidebar__link.is-active {
    background: var(--sidebar-active);
    color: #fff;
    border-left-color: var(--accent-gold);
}

.admin-sidebar__link-label {
    flex: 1;
    min-width: 0;
}

.admin-sidebar__badge {
    font-size: 11px;
    padding: 1px 7px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.9);
}

.admin-sidebar__link.is-active .admin-sidebar__badge {
    background: var(--accent-gold);
    color: var(--header-bg);
}

.admin-sidebar__phase {
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.5);
}

.admin-sidebar__external {
    font-size: 12px;
    opacity: 0.5;
}

/* ========== 右侧内容 ========== */
.admin-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.admin-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 24px 12px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.admin-page-header__aside {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.admin-page-header__extra {
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-page-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.admin-page-subtitle {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--muted);
}

.admin-page-subtitle--solo {
    margin-top: 0;
}

.phase-badge {
    display: inline-block;
    margin-top: 6px;
    padding: 2px 8px;
    font-size: 11px;
    border-radius: 4px;
    background: #fff3e0;
    color: #e65100;
}

.breadcrumb {
    font-size: 13px;
    color: var(--muted);
    white-space: nowrap;
    padding-top: 4px;
}

.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb__sep {
    margin: 0 6px;
    color: #ccc;
}

/* ========== 工具栏 ========== */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 16px;
    padding: 12px 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.toolbar__filters {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.toolbar label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    color: var(--muted);
}

.toolbar select,
.toolbar input[type="search"],
.inline-form select,
.inline-form input {
    min-width: 160px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
}

.toolbar input[type="search"],
.inline-form input {
    font-size: 14px;
}

.toolbar select,
.inline-form select {
    font-size: 12px;
}

/* 普通 dialog（画展编辑等）输入框最小宽度；排版相关 dialog 自行控制宽度 */
dialog:not(.layout-temp-dialog) input,
dialog:not(.layout-temp-dialog) select {
    min-width: 160px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
}

dialog:not(.layout-temp-dialog) input {
    font-size: 14px;
}

dialog:not(.layout-temp-dialog) select {
    font-size: 12px;
}

.toolbar__actions {
    display: flex;
    gap: 8px;
}

.admin-main {
    padding: 16px 24px 8px;
    flex: 1;
}

/* ========== 按钮 ========== */
.btn {
    border: none;
    border-radius: 6px;
    padding: 8px 14px;
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-primary:disabled,
.btn-secondary:disabled,
.btn.is-disabled,
a.btn.is-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-secondary {
    background: #eceff3;
    color: var(--text);
}

.btn-danger {
    background: #fdecea;
    color: var(--danger);
}

/* ========== 表格页脚 ========== */
.app-footer {
    display: flex;
    justify-content: space-between;
    padding: 10px 24px 16px;
    font-size: 13px;
    color: var(--muted);
}

#footer-status.is-saving { color: #1565c0; }
#footer-status.is-success { color: var(--success); }
#footer-status.is-error { color: var(--danger); }

#artworks-table {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.tabulator {
    font-size: 13px;
    border: none;
}

.tabulator .tabulator-header {
    background: #f0ebe6;
    border-bottom: 1px solid var(--border);
}

.tabulator .tabulator-col-title {
    font-weight: 600;
}

.tabulator-row:nth-child(even) .tabulator-cell {
    background: #fafafa;
}

.tabulator-cell.cell-empty {
    background: var(--warning-bg) !important;
}

.tabulator-cell.cell-saving {
    outline: 2px solid #90caf9;
}

.tabulator-cell.cell-error {
    outline: 2px solid var(--danger);
}

.cell-actions {
    display: flex;
    gap: 6px;
}

.cell-actions button {
    padding: 4px 8px;
    font-size: 12px;
}

.path-cell {
    font-size: 12px;
    color: #4b5563;
    word-break: break-all;
}

/* ========== 对话框 ========== */
dialog {
    border: none;
    border-radius: 10px;
    padding: 0;
    width: min(480px, 92vw);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
}

dialog form {
    padding: 20px 24px 16px;
}

dialog h2 {
    margin: 0 0 16px;
    font-size: 18px;
}

/* 仅作用于表单「直接子级」标签（上标签下输入）；嵌套标签由各自组件样式控制 */
dialog form > label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--muted);
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin: 8px 0 0;
    padding: 0;
}

/* ========== 概览仪表盘 ========== */
.dashboard {
    padding: 16px 24px 24px;
}

.dashboard-note {
    margin: 0 0 14px;
    font-size: 13px;
    color: var(--muted);
}

.stat-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.stat-cards--compact {
    grid-template-columns: repeat(4, 1fr);
    margin-bottom: 16px;
}

.stat-cards--5 {
    grid-template-columns: repeat(5, 1fr);
}

@media (max-width: 1200px) {
    .stat-cards--5 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .stat-cards--5 {
        grid-template-columns: repeat(2, 1fr);
    }
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px 20px;
}

.stat-card--primary {
    border-color: var(--primary);
    background: linear-gradient(135deg, #fff 0%, #faf6f2 100%);
}

.stat-card__label {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 8px;
}

.stat-card__value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
}

.stat-card__value--warn {
    color: #e65100;
}

.stat-card__value--sm {
    font-size: 20px;
}

.stat-card__meta {
    margin-top: 4px;
    font-size: 13px;
    color: var(--muted);
}

.dashboard-grid--breakdown {
    grid-template-columns: 2fr 1fr;
    align-items: start;
}

.panel--wide {
    margin-bottom: 0;
}

.stats-matrix-wrap {
    overflow-x: auto;
    margin: 0 -4px;
    padding: 0 4px;
}

.stats-matrix {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
    font-size: 13px;
}

.stats-matrix th,
.stats-matrix td {
    padding: 8px 10px;
    border: 1px solid var(--border);
    text-align: center;
    white-space: nowrap;
}

.stats-matrix thead th {
    background: #f3f4f6;
    font-weight: 600;
    font-size: 12px;
}

.stats-matrix__group {
    background: #faf6f2;
    font-weight: 600;
    vertical-align: middle;
    text-align: left;
}

.stats-matrix__cat {
    min-width: 56px;
}

.stats-matrix__num {
    font-variant-numeric: tabular-nums;
    color: #374151;
}

.stats-matrix tbody tr:nth-child(even):not(.stats-matrix__subtotal):not(.stats-matrix__total) {
    background: #fcfcfc;
}

.stats-matrix__subtotal {
    background: #f8f4ef;
}

.stats-matrix__subtotal td:first-child {
    font-weight: 600;
    text-align: right;
    color: var(--muted);
}

.stats-matrix__total {
    background: #ede8e1;
    font-weight: 600;
}

.stats-matrix__total td:first-child {
    text-align: left;
}

.category-bars {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.category-bar__head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
    font-size: 13px;
}

.category-bar__label {
    font-weight: 500;
}

.category-bar__count {
    font-variant-numeric: tabular-nums;
    color: var(--muted);
}

.category-bar__track {
    height: 8px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
}

.category-bar__fill {
    height: 100%;
    background: linear-gradient(90deg, #c4a882, var(--primary));
    border-radius: 4px;
    min-width: 2px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 16px;
}

.panel__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.panel__head .panel__title {
    margin-bottom: 4px;
}

.panel__head .panel__desc {
    margin: 0;
}

.panel__head .panel__desc--note {
    margin-top: 4px;
    font-size: 13px;
    color: var(--muted);
}

.panel__title {
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 600;
}

.panel__desc {
    margin: 0 0 12px;
    font-size: 14px;
    color: var(--muted);
}

.panel__hint {
    margin: 12px 0 0;
    font-size: 13px;
    color: var(--muted);
}

.settings-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 32px;
}

.settings-categories__subtitle {
    margin: 20px 0 10px;
    padding-top: 16px;
    border-top: 1px solid var(--border, #e8e8e8);
    font-size: 14px;
    font-weight: 600;
    color: var(--ink, #262626);
}

.panel > .settings-categories__subtitle:first-of-type {
    margin-top: 12px;
    padding-top: 0;
    border-top: 0;
}

.settings-categories__empty {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
}

.settings-category-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 4px 12px;
    border-radius: 999px;
    background: #f5f5f5;
    border: 1px solid #e8e8e8;
    font-size: 14px;
    line-height: 22px;
    color: #262626;
}

.settings-category-chip--manual {
    background: #e6f4ff;
    border-color: #91caff;
}

.settings-category-chip__text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.settings-category-chip__remove {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 18px;
    height: 18px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #ff4d4f;
    color: #fff;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 1;
}

.settings-category-chip:hover .settings-category-chip__remove,
.settings-category-chip:focus-within .settings-category-chip__remove {
    opacity: 1;
}

.settings-category-chip__remove:hover {
    background: #cf1322;
}

.settings-categories__add {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.settings-secondary-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 12px;
}

.settings-secondary-toolbar__field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: var(--muted);
    min-width: 140px;
    align-self: flex-end;
}

.settings-secondary-toolbar__field--grow {
    flex: 1 1 180px;
    min-width: 180px;
    max-width: 320px;
}

.settings-secondary-toolbar .filter-select,
.settings-secondary-toolbar .settings-category-input {
    flex: 0 0 auto;
    align-self: stretch;
    width: 100%;
    min-width: 0;
    height: 36px;
    min-height: 36px;
    max-height: 36px;
    box-sizing: border-box;
}

.settings-secondary-toolbar__field--grow .settings-category-input {
    max-width: 100%;
}

.settings-category-input {
    flex: 1 1 220px;
    min-width: 180px;
    height: 32px;
    padding: 4px 11px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
}

.settings-category-input:focus {
    outline: none;
    border-color: #1677ff;
    box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.1);
}

/* AI 设置开关 */
.settings-switch {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.settings-switch__input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.settings-switch__track {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
    border-radius: 999px;
    background: #c5cdd6;
    transition: background 0.2s ease;
}

.settings-switch__track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
}

.settings-switch__input:checked + .settings-switch__track {
    background: var(--primary);
}

.settings-switch__input:checked + .settings-switch__track::after {
    transform: translateX(20px);
}

.settings-switch__input:focus-visible + .settings-switch__track {
    outline: 2px solid var(--accent-gold);
    outline-offset: 2px;
}

.settings-switch__input:disabled + .settings-switch__track {
    opacity: 0.55;
}

.settings-switch__label {
    font-size: 14px;
    color: var(--text);
    min-width: 4em;
}

.settings-switch.is-saving {
    opacity: 0.7;
    pointer-events: none;
}

.page-settings .settings-tabs {
    display: flex;
    gap: 0;
    margin: 0 0 16px;
    padding: 0;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    border-radius: 8px 8px 0 0;
}

.page-settings .settings-tabs__btn {
    appearance: none;
    border: 0;
    background: transparent;
    margin: 0;
    padding: 12px 20px;
    font-size: 14px;
    font-family: inherit;
    color: var(--muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.15s ease, border-color 0.15s ease;
}

.page-settings .settings-tabs__btn:hover {
    color: var(--text);
}

.page-settings .settings-tabs__btn.is-active {
    color: var(--primary);
    font-weight: 600;
    border-bottom-color: var(--primary);
}

.page-settings .settings-tabs__btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.page-settings .settings-pane[hidden] {
    display: none !important;
}

.page-settings .settings-pane:not(.is-active) {
    display: none;
}

.page-settings .settings-collection-sec-group {
    margin: 0 0 14px;
}

.page-settings .settings-collection-sec-group__head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 0 0 8px;
    font-size: 13px;
}

.page-settings .settings-category-chip--readonly {
    cursor: default;
    padding-right: 12px;
}

.page-settings .settings-category-chip--readonly .settings-category-chip__remove {
    display: none;
}

.page-settings .data-table--settings th {
    width: 140px;
    vertical-align: top;
    white-space: nowrap;
}

.page-settings .data-table--settings .field-hint {
    margin: 6px 0 0;
    max-width: 480px;
}

.page-settings .data-table--settings .settings-category-input {
    flex: none;
    width: 100%;
    max-width: 360px;
}

.mail-settings-mode {
    margin: 0 0 14px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.5;
    background: #f5f5f5;
    color: var(--muted);
}

.mail-settings-mode.is-mock {
    background: var(--warning-bg);
    color: #8a6d1d;
}

.mail-settings-mode.is-live {
    background: #e8f5e9;
    color: var(--success);
}

.page-settings .mail-settings-section {
    padding-top: 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    background: #fafbfc;
    border-bottom-color: var(--border);
}

.panel--hint {
    background: #f8f9fa;
    border-style: dashed;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th,
.data-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.data-table th {
    background: #f8f9fa;
    font-weight: 600;
    width: 160px;
}

.data-table a {
    color: var(--primary);
}

.check-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.check-list li {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.check-status--pending {
    color: var(--muted);
    font-weight: 500;
}

.check-status--pass {
    color: #389e0d;
    font-weight: 600;
}

.check-status--warn {
    color: #d46b08;
    font-weight: 600;
}

.stat-card__value--ok {
    color: #389e0d;
}

.validate-panel__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 8px;
}

.validate-run-meta {
    margin: 12px 0 0;
    font-size: 13px;
    color: var(--muted);
}

.validate-card-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.validate-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    overflow: hidden;
}

.validate-card__header {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 16px;
    border: none;
    background: #fafafa;
    cursor: pointer;
    text-align: left;
    font: inherit;
}

.validate-card__header:hover {
    background: #f5f5f5;
}

.validate-card__meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.validate-card__group {
    font-size: 12px;
    color: var(--muted);
}

.validate-card__title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.validate-card__count {
    flex-shrink: 0;
    min-width: 28px;
    padding: 2px 10px;
    border-radius: 999px;
    background: #fff7e6;
    color: #d46b08;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}

.validate-card__chevron {
    flex-shrink: 0;
    width: 8px;
    height: 8px;
    border-right: 2px solid #999;
    border-bottom: 2px solid #999;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}

.validate-card.is-expanded .validate-card__chevron {
    transform: rotate(-135deg);
}

.validate-card__body {
    display: none;
    border-top: 1px solid var(--border);
    padding: 0 16px;
}

.validate-card.is-expanded .validate-card__body {
    display: block;
}

.validate-issue-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.validate-issue {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.validate-issue:last-child {
    border-bottom: none;
}

.validate-issue__link {
    color: var(--primary);
    text-decoration: none;
}

button.validate-issue__link {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.validate-issue__link:hover {
    text-decoration: underline;
}

.validate-issue__detail {
    color: var(--muted);
}

.validate-result-block + .validate-result-block {
    margin-top: 24px;
}

.validate-result-block__title {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 600;
}

.validate-issue-group + .validate-issue-group {
    margin-top: 16px;
}

.validate-issue-group h4 {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 600;
}

.validate-issue-count {
    color: #d46b08;
    font-weight: 600;
}

.validate-issue-more {
    margin: 8px 0 0;
    font-size: 12px;
    color: var(--muted);
}

.page-validate .stat-cards--compact {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 992px) {
    .page-validate .stat-cards--compact {
        grid-template-columns: repeat(2, 1fr);
    }
}

.quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.quick-link {
    padding: 8px 16px;
    background: #f0ebe6;
    border-radius: 6px;
    color: var(--primary);
    text-decoration: none;
    font-size: 14px;
}

.quick-link:hover {
    background: #e8dfd6;
}

/* ========== 功能页 ========== */
.feature-page {
    padding: 16px 24px 24px;
}

.inline-form {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 16px;
}

.inline-form label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    color: var(--muted);
}

.checkbox-group {
    border: none;
    padding: 0;
    margin: 0 0 12px;
}

.checkbox-group legend {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 8px;
}

.checkbox-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: 16px;
    font-size: 14px;
}

/* ========== 占位页 ========== */
.placeholder-page {
    padding: 24px;
    display: flex;
    justify-content: center;
}

.placeholder-page__card {
    max-width: 520px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px;
    text-align: center;
}

.placeholder-page__icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.placeholder-page__card h3 {
    margin: 0 0 8px;
    font-size: 20px;
}

.placeholder-page__card p {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 14px;
}

.placeholder-page__phase {
    font-size: 14px;
}

.placeholder-page__list {
    text-align: left;
    margin: 16px 0;
    padding-left: 20px;
    font-size: 14px;
    color: var(--text);
}

.placeholder-page__list li {
    margin-bottom: 6px;
}

.placeholder-page__actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

code {
    background: #f1f3f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

/* ========== 数据表格页（作品/作者/留言等，Ant Design 风格） ========== */
body.page-data-table .admin-body {
    width: 100%;
    min-width: 0;
}

body.page-data-table .admin-content {
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    flex: 1;
    width: 100%;
}

.page-data-table .admin-page-header {
    padding-bottom: 8px;
}

.page-works .admin-page-header {
    align-items: flex-end;
    padding-bottom: 12px;
}

.page-works .admin-page-header__aside {
    align-self: flex-end;
    margin-left: auto;
}

.page-works .works-page-header-actions {
    gap: 10px;
}

.page-works .admin-page-subtitle {
    margin: 4px 0 0;
}

.works-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 12px 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.works-toolbar__filters {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.filter-field {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-field__label {
    font-size: 13px;
    color: var(--muted);
    white-space: nowrap;
}

.filter-field--search {
    flex: 1;
    min-width: 180px;
}

/* 作品管理页 — 筛选控件宽度 */
.page-works .works-toolbar__filters {
    flex: 1;
    min-width: 0;
}

.page-works .filter-field--exhibition { width: 136px; }
.page-works .filter-field--artist { width: 120px; }
.page-works .filter-field--status { width: 108px; }
.page-works .filter-field--category { width: 120px; }
.page-works .filter-field--size { width: 108px; }
.page-works .filter-field--tag { width: 116px; }
.page-works .filter-field--search {
    flex: 1;
    min-width: 160px;
    max-width: 260px;
}

.page-works .filter-field--exhibition .filter-select,
.page-works .filter-field--artist .filter-select,
.page-works .filter-field--status .filter-select,
.page-works .filter-field--category .filter-select,
.page-works .filter-field--size .filter-select,
.page-works .filter-field--tag .filter-select,
.page-works .filter-field--search .filter-input {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.filter-select,
.filter-input {
    padding: 7px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fafbfc;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.filter-input {
    font-size: 14px;
}

.filter-select {
    font-size: 12px;
}

.filter-select:focus,
.filter-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.12);
    background: #fff;
}

.filter-select:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.works-toolbar__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    margin-left: auto;
}

.works-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.works-count {
    font-size: 13px;
    color: var(--muted);
    padding-right: 4px;
}

.works-batch-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    flex-shrink: 0;
}

.works-batch-bar__count {
    font-size: 13px;
    color: var(--muted);
    white-space: nowrap;
}

.tabulator .tabulator-col.cell-select .tabulator-col-title {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.tabulator .tabulator-col.cell-select .tabulator-col-title > * {
    margin: 0;
}

.tabulator .cell-select {
    text-align: center;
    padding: 0 !important;
}

.tabulator .cell-select.tabulator-cell .tabulator-cell-contents {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.tabulator .cell-select .works-row-select {
    width: 16px;
    height: 16px;
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
}

.tabulator .tabulator-col.cell-select .tabulator-col-title-holder {
    display: flex;
    align-items: center;
    justify-content: center;
}

.tabulator .tabulator-col.cell-select .tabulator-col-title {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0;
}

.tabulator .tabulator-col.cell-select .tabulator-header-popup-button,
.tabulator .tabulator-col.cell-select .tabulator-col-menu-button {
    display: none !important;
}

.tabulator .tabulator-col-title input#works-select-all {
    width: 16px;
    height: 16px;
    cursor: pointer;
    margin: 0;
}

.btn-ghost {
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    background: #f5f5f5;
    color: var(--text);
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

.works-table-wrap {
    padding: 16px 24px 0;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
}

.page-data-table .antd-table {
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
    flex: 1;
    min-height: 0;
}

/* 数据表格页 Tabulator — Ant Design 风格（覆盖全局 tabulator 样式） */
.page-data-table .tabulator {
    font-size: 14px;
    border: none !important;
    background: #fff;
    color: rgba(0, 0, 0, 0.88);
    width: 100% !important;
}

.page-data-table .tabulator .tabulator-header {
    background: #fafafa !important;
    border-bottom: 1px solid #f0f0f0 !important;
    color: rgba(0, 0, 0, 0.88);
    font-weight: 500;
}

.page-data-table .tabulator .tabulator-col {
    border-right: 1px solid #f0f0f0 !important;
    background: #fafafa !important;
}

.page-data-table .tabulator .tabulator-col:last-child {
    border-right: none !important;
}

.page-data-table .tabulator .tabulator-col-content {
    padding: 0 !important;
}

.page-data-table .tabulator .tabulator-col-title {
    padding: 12px 16px !important;
    font-weight: 500 !important;
    font-size: 14px !important;
    color: rgba(0, 0, 0, 0.88) !important;
    white-space: nowrap !important;
    writing-mode: horizontal-tb !important;
    line-height: 1.5715 !important;
}

.page-data-table .tabulator .tabulator-row {
    border-bottom: 1px solid #f0f0f0;
    background: #fff;
    min-height: 76px;
}

.page-data-table .tabulator .tabulator-row .tabulator-cell {
    border-right: 1px solid #f0f0f0;
    padding: 8px 12px !important;
    vertical-align: middle;
    line-height: 1.5715;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.page-data-table .tabulator .tabulator-row:hover {
    background: #fafafa !important;
}

.page-data-table .tabulator .tabulator-row .tabulator-cell:last-child {
    border-right: none;
}

.page-data-table .tabulator .tabulator-row:nth-child(even) .tabulator-cell {
    background: transparent !important;
}

.page-data-table .tabulator .tabulator-row:hover .tabulator-cell {
    background: transparent !important;
}

.page-data-table .tabulator .tabulator-cell.tabulator-frozen-left,
.page-data-table .tabulator .tabulator-col.tabulator-frozen-left {
    border-right: 1px solid #f0f0f0 !important;
    box-shadow: none !important;
}

.page-data-table .tabulator .tabulator-cell.cell-thumb {
    padding: 8px !important;
    vertical-align: middle;
    text-align: center;
    overflow: hidden !important;
    white-space: nowrap !important;
    line-height: normal;
    height: 76px;
    max-height: 76px;
    box-sizing: border-box;
}

.page-data-table .tabulator .tabulator-cell.cell-intro {
    white-space: nowrap !important;
    line-height: 1.5715;
    overflow: hidden;
    text-overflow: ellipsis;
}

.work-thumb-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 60px;
    max-height: 60px;
    overflow: hidden;
}

.work-thumb {
    display: block;
    max-height: 60px;
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
    margin: 0 auto;
    cursor: zoom-in;
    border-radius: 4px;
    background: #f5f5f5;
}

.work-thumb-preview {
    position: fixed;
    z-index: 10000;
    pointer-events: none;
    padding: 6px;
    background: #fff;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.work-thumb-preview img {
    display: block;
    max-width: min(800px, calc(100vw - 16px));
    max-height: min(800px, calc(100vh - 16px));
    width: auto;
    height: auto;
    object-fit: contain;
}

.artist-name-tip {
    cursor: help;
    border-bottom: 1px dashed #91caff;
}

.artist-bio-preview {
    position: fixed;
    z-index: 10000;
    pointer-events: none;
    padding: 14px 16px;
    width: min(520px, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
    overflow-y: auto;
    background: #fff;
    border: 1px solid #d9d9d9;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    font-size: 13px;
    line-height: 1.65;
    color: #333;
    box-sizing: border-box;
}

.artist-bio-preview__name {
    font-weight: 600;
    margin-bottom: 8px;
    color: #111;
    font-size: 14px;
}

.artist-bio-preview__body {
    white-space: pre-wrap;
    word-break: break-word;
    overflow: visible;
}

.page-data-table .tabulator .tabulator-cell.cell-empty {
    background: #fffbe6 !important;
}

/* 编辑/保存/错误态：提升层级，避免右侧描边被相邻单元格遮挡 */
.page-data-table .tabulator .tabulator-row .tabulator-cell.tabulator-editing,
.page-data-table .tabulator .tabulator-cell.cell-saving,
.page-data-table .tabulator .tabulator-cell.cell-error {
    position: relative;
    z-index: 2;
    overflow: visible !important;
}

.page-data-table .tabulator .tabulator-row .tabulator-cell.tabulator-editing,
.page-data-table .tabulator .tabulator-cell.cell-saving {
    outline: 2px solid #1677ff !important;
    outline-offset: -2px;
    box-shadow: none !important;
}

.page-data-table .tabulator .tabulator-cell.cell-error {
    outline: 2px solid #ff4d4f !important;
    outline-offset: -2px;
    box-shadow: none !important;
}

.page-data-table .tabulator .tabulator-cell.tabulator-editing input,
.page-data-table .tabulator .tabulator-cell.tabulator-editing textarea,
.page-data-table .tabulator .tabulator-cell.tabulator-editing select {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent;
    font: inherit;
    color: inherit;
    line-height: inherit;
}

.page-data-table .tabulator .tabulator-cell.tabulator-editing select {
    font-size: 12px;
}

.page-data-table .tabulator .tabulator-placeholder {
    padding: 48px;
    color: rgba(0, 0, 0, 0.45);
    font-size: 14px;
}

.page-data-table .tabulator-tableholder {
    overflow-x: auto !important;
    width: 100% !important;
}

.page-data-table .tabulator .tabulator-table {
    width: 100% !important;
}

.page-data-table .tabulator .tabulator-header .tabulator-col,
.page-data-table .tabulator .tabulator-row .tabulator-cell {
    box-sizing: border-box;
}

/* 分页栏 */
.works-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 12px 24px 16px;
    font-size: 13px;
    color: var(--muted);
    border-top: 1px solid #f0f0f0;
    background: #fff;
}

.works-footer__start {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 0;
}

.works-footer__start #footer-status {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.works-pagination-bar {
    display: flex;
    align-items: center;
    gap: 16px;
}

.page-size-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: rgba(0, 0, 0, 0.65);
}

.page-size-select {
    padding: 4px 8px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 12px;
    background: #fff;
}

.works-pagination {
    display: flex;
    align-items: center;
    gap: 8px;
}

.works-pagination__total {
    font-size: 14px;
    color: rgba(0, 0, 0, 0.45);
    margin-right: 4px;
}

.works-pagination__pages {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pg-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 6px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    background: #fff;
    color: rgba(0, 0, 0, 0.88);
    font-size: 14px;
    cursor: pointer;
    line-height: 30px;
    text-align: center;
}

.pg-btn:hover:not(:disabled):not(.is-active) {
    border-color: #1677ff;
    color: #1677ff;
}

.pg-btn.is-active {
    border-color: #1677ff;
    color: #1677ff;
    font-weight: 500;
}

.pg-btn:disabled {
    color: rgba(0, 0, 0, 0.25);
    cursor: not-allowed;
    background: rgba(0, 0, 0, 0.04);
}

.pg-ellipsis {
    padding: 0 4px;
    color: rgba(0, 0, 0, 0.25);
}

/* 单元格内容 */
.cell-id {
    font-family: ui-monospace, 'SF Mono', monospace;
    font-size: 13px;
    color: rgba(0, 0, 0, 0.65);
}

.cell-placeholder {
    color: rgba(0, 0, 0, 0.25);
}

.work-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.work-tag {
    display: inline-block;
    padding: 0 6px;
    border-radius: 4px;
    background: #f0f5ff;
    color: #2f54eb;
    font-size: 12px;
    line-height: 20px;
    white-space: nowrap;
}

.page-works .tabulator .tabulator-row.row-frozen .work-tag {
    background: #f5f5f5;
    color: rgba(0, 0, 0, 0.45);
}

.cell-ellipsis {
    color: rgba(0, 0, 0, 0.65);
}

.cell-path {
    font-size: 13px;
    color: rgba(0, 0, 0, 0.45);
    font-family: ui-monospace, monospace;
}

.table-action {
    color: #1677ff;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
}

.table-action:hover {
    color: #4096ff;
}

.table-action--danger {
    color: #ff4d4f;
}

.table-action--danger:hover {
    color: #ff7875;
}

.page-works .tabulator .tabulator-row.row-frozen .tabulator-cell {
    color: #bfbfbf;
}

.page-works .tabulator .tabulator-row.row-frozen .cell-id,
.page-works .tabulator .tabulator-row.row-frozen .artist-name-tip {
    color: #bfbfbf;
    border-bottom-color: #d9d9d9;
}

.page-works .tabulator .tabulator-row.row-frozen .work-thumb {
    filter: grayscale(1);
    opacity: 0.5;
}

.page-works .tabulator .tabulator-row.row-frozen .cell-placeholder {
    color: #d9d9d9;
}

.page-works .tabulator .tabulator-row.row-frozen .table-action {
    color: #91caff;
}

.page-works .tabulator .tabulator-row.row-frozen .table-action--danger {
    color: #ffa39e;
}

.page-data-table .tabulator .tabulator-cell.cell-actions {
    white-space: nowrap;
}

.page-data-table .tabulator .tabulator-cell.cell-actions .table-action + .table-action {
    margin-left: 8px;
}

/* 留言等纯文本表格：行高略低 */
.page-messages .tabulator .tabulator-row {
    min-height: 48px;
}

.page-data-table .tabulator .tabulator-row.row-hidden .tabulator-cell {
    color: #bfbfbf;
}

.page-data-table .tabulator .tabulator-row.row-hidden .work-status--active {
    color: #8c8c8c;
}

.page-data-table .tabulator .tabulator-row.row-hidden .table-action {
    color: #91caff;
}

.page-data-table .tabulator .tabulator-row.row-hidden .table-action--danger {
    color: #ffa39e;
}

.work-status {
    display: inline-block;
    font-size: 13px;
    line-height: 1.4;
}

.work-status--active {
    color: #389e0d;
}

.work-status--frozen {
    color: #8c8c8c;
}

.work-status--withdrawn {
    color: #8c4a4a;
}

.work-status--pending {
    color: #d48806;
}

/* ========== 网作管理 ========== */
/* 筛选与详情弹窗样式见 assets/css/ugc-works.css */

/* ========== 作品管理 — 展示形式切换与瀑布流 ========== */
.works-view-switch {
    padding: 4px 14px;
    font-size: 13px;
    line-height: 1.5715;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    background: #fff;
    color: #1677ff;
    cursor: pointer;
    transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.works-view-switch:hover {
    color: #1677ff;
    border-color: #1677ff;
    background: #e6f4ff;
}

.works-view-switch.is-active {
    color: #fff;
    border-color: #1677ff;
    background: #1677ff;
}

.works-view-switch.is-active:hover {
    color: #fff;
    border-color: #4096ff;
    background: #4096ff;
}

/* 列表 / 瀑布流切换：与虚拟排版 layout-tb-btn 同风格；data-view 控制只显示当前图标 */
.works-view-mode-btn {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    position: relative;
}

.works-view-mode-btn .works-view-icon {
    width: 16px;
    height: 16px;
    display: none;
    flex-shrink: 0;
}

.works-view-mode-btn[data-view="list"] .works-view-icon--list,
.works-view-mode-btn[data-view="grid"] .works-view-icon--masonry {
    display: block;
}

.works-view-mode-btn.is-active {
    background: rgba(139, 90, 43, 0.12);
    color: #8b5a2b;
}

.works-view-mode-btn.is-active:hover {
    background: rgba(139, 90, 43, 0.18);
    color: #8b5a2b;
}

.works-layout-mode-wrap {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.layout-presence-label {
    font-size: 13px;
    line-height: 1.4;
    color: #595959;
    white-space: nowrap;
    user-select: none;
}

.layout-presence-label.is-multi {
    color: #cf1322;
    font-weight: 600;
}

.works-masonry {
    flex: 1;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    height: calc(100vh - 56px - 72px - 56px - 52px - 32px);
    padding: 12px 16px 24px;
    --grid-cols: 5;
}

.works-masonry-cols {
    display: grid;
    grid-template-columns: repeat(var(--grid-cols, 5), minmax(0, 1fr));
    gap: 10px;
    align-items: start;
}

.works-masonry-col {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.works-masonry__empty {
    width: 100%;
    padding: 48px 16px;
    text-align: center;
    color: rgba(0, 0, 0, 0.45);
    font-size: 14px;
}

.works-grid-card {
    width: 100%;
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    transition: box-shadow 0.22s ease, transform 0.22s ease;
    transform-origin: center center;
}

.works-grid-card:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    z-index: 2;
}

.works-grid-card__img-wrap--clickable {
    cursor: zoom-in;
}

.works-grid-card--frozen {
    opacity: 0.72;
}

.works-grid-card--frozen .works-grid-card__img {
    filter: grayscale(1);
    opacity: 0.55;
}

.works-grid-card__img-wrap {
    position: relative;
    background: #fafafa;
    line-height: 0;
}

.works-grid-card__img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}

.works-grid-card__img--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 160px;
    background: #fafafa;
    font-size: 14px;
}

.works-grid-card__overlay {
    position: absolute;
    padding: 3px 8px;
    font-size: 11px;
    line-height: 1.35;
    color: #fff;
    background: rgba(0, 0, 0, 0.52);
    border-radius: 4px;
    max-width: calc(100% - 12px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
}

.works-grid-card__overlay--top-left {
    top: 6px;
    left: 6px;
    right: auto;
}

.works-grid-card__overlay--bottom-right {
    right: 6px;
    bottom: 6px;
    left: auto;
    text-align: right;
}

.works-grid-card--frozen .works-grid-card__overlay {
    background: rgba(0, 0, 0, 0.35);
}

.works-grid-card__body {
    padding: 8px 10px 10px;
}

.works-grid-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.works-grid-card__title {
    margin: 0;
    flex: 1;
    min-width: 0;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.35;
    color: rgba(0, 0, 0, 0.88);
    word-break: break-word;
}

.works-grid-card--frozen .works-grid-card__title {
    color: #bfbfbf;
}

.works-grid-card__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.works-grid-card__actions .table-action {
    font-size: 12px;
    white-space: nowrap;
}

.works-grid-card--frozen .works-grid-card__actions .table-action {
    color: #91caff;
}

.page-works--grid .works-table-wrap {
    padding-top: 8px;
}

/* ========== 虚拟排版 ========== */
.works-layout {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    /* 排版模式隐藏 footer，高度吃满主内容区 */
    height: calc(100vh - 56px - 72px - 56px);
    background: #f5f5f5;
}

/* display:flex 会盖掉原生 [hidden]，必须显式隐藏 */
.works-layout[hidden],
.works-masonry[hidden],
.page-works .antd-table[hidden] {
    display: none !important;
}

.page-works--layout .works-footer {
    display: none !important;
}

.page-works--layout .works-table-wrap {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    /* 抵消普通表格页 footer 占位，把空间还给展墙 */
    flex: 1;
    min-height: 0;
}

.page-works--layout .works-layout {
    display: flex;
    height: 100%;
}

.works-layout__body {
    flex: 1;
    min-height: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.works-layout__main {
    flex: 1;
    min-height: 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    order: 1;
}

.works-layout__strip-wrap {
    order: 2;
}

/* 专注全屏：隐藏侧栏/页眉，保留顶部筛选栏 */
body.page-works--layout-focus .admin-topbar,
body.page-works--layout-focus .admin-sidebar,
body.page-works--layout-focus .admin-page-header {
    display: none !important;
}

body.page-works--layout-focus .admin-body {
    width: 100%;
    margin-top: 0;
    min-height: 100vh;
}

body.page-works--layout-focus .admin-content {
    display: flex;
    flex-direction: column;
    padding: 0;
    margin: 0;
    min-height: 0;
    height: 100vh;
    overflow: hidden;
}

body.page-works--layout-focus .works-toolbar {
    flex-shrink: 0;
}

body.page-works--layout-focus .works-table-wrap {
    flex: 1;
    min-height: 0;
    height: auto;
    overflow: hidden;
}

body.page-works--layout-focus .works-layout {
    flex: 1;
    min-height: 0;
    height: auto;
}

/* 专注模式：左作品库 + 右（工具栏 + 展板网格） */
.works-layout--focus .works-layout__body {
    flex: 1;
    min-height: 0;
    flex-direction: row;
    align-items: stretch;
}

.works-layout--focus .works-layout__strip-wrap {
    order: 0;
    flex: 0 0 var(--layout-focus-strip-w, 132px);
    width: var(--layout-focus-strip-w, 132px);
    height: auto;
    max-height: none;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-self: stretch;
    border-top: none;
    border-right: 1px solid var(--border);
    padding: 8px 0 0;
    box-sizing: border-box;
}

.works-layout--focus .works-layout__strip {
    flex: 1 1 0;
    min-height: 0;
    flex-direction: column;
    align-items: stretch;
    overflow-x: hidden;
    overflow-y: auto;
    height: auto;
    padding: 0 8px 14px;
    gap: 10px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
}

.works-layout--focus .works-layout__strip-empty,
.works-layout--focus .works-layout__strip-more {
    white-space: normal;
    text-align: center;
    padding: 12px 8px;
    font-size: 12px;
}

.works-layout--focus .works-layout__main {
    order: 1;
    flex: 1;
    min-width: 0;
}

.works-layout--focus .works-layout__boards {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-content: flex-start;
    align-items: flex-start;
    overflow-x: hidden;
    overflow-y: auto;
    scroll-snap-type: none;
    overscroll-behavior-y: contain;
}

.works-layout--focus .layout-board,
.works-layout--focus .layout-board-placeholder {
    max-height: none;
    flex: 0 0 auto;
    touch-action: auto;
    scroll-snap-align: none;
}

.works-layout--focus .layout-strip-card {
    flex: 0 0 auto;
    width: 100%;
    max-width: none;
    touch-action: pan-y;
}

.works-layout__toolbar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0;
    min-height: 36px;
    padding: 3px 8px;
    background: #fff;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    /* 勿用 overflow:auto，会裁切历史下拉；窄屏允许整栏横向滚动由外层处理 */
    overflow: visible;
}

.works-layout__toolbar-main {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0;
    min-width: 0;
    flex-shrink: 0;
}

.works-layout__toolbar-spacer {
    flex: 1 1 12px;
    min-width: 8px;
}

.layout-tb-group {
    display: inline-flex;
    align-items: center;
    gap: 0;
    padding: 0 3px;
    flex-shrink: 0;
    overflow: visible;
    position: relative;
    z-index: 1;
}

.layout-tb-group + .layout-tb-group {
    border-left: 1px solid #e8e8e8;
    margin-left: 1px;
    padding-left: 3px;
}

.layout-tb-group__name {
    font-size: 11px;
    color: rgba(0, 0, 0, 0.45);
    margin-right: 3px;
    white-space: nowrap;
    user-select: none;
}

.layout-tb-sep {
    display: inline-block;
    width: 1px;
    height: 16px;
    margin: 0 3px;
    background: #e8e8e8;
    flex-shrink: 0;
}

.layout-tb-btn {
    width: 26px;
    height: 26px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #434343;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.layout-tb-btn:hover {
    background: #f0f0f0;
    color: #8b5a2b;
}

.layout-tb-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.layout-tb-btn:disabled:hover {
    background: transparent;
    color: #434343;
}

.layout-tb-btn svg {
    width: 16px;
    height: 16px;
}

.layout-tb-btn--export {
    width: 26px;
    height: 26px;
    position: relative;
    overflow: visible;
}

.layout-tb-export {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
}

.layout-tb-export__spin {
    display: none !important;
    position: absolute;
    top: calc(100% + 4px);
    left: 50%;
    width: 14px !important;
    height: 14px !important;
    margin: 0;
    color: #8b5a2b;
    pointer-events: none;
    z-index: 40;
    transform: translateX(-50%);
    filter: drop-shadow(0 1px 2px rgba(255, 255, 255, 0.9));
}

.layout-tb-btn--export.is-exporting {
    opacity: 1;
    cursor: wait;
    color: #8b5a2b;
    background: rgba(139, 90, 43, 0.08);
}

.layout-tb-btn--export.is-exporting:disabled {
    opacity: 1;
}

.layout-tb-btn--export.is-exporting .layout-tb-export__spin {
    display: block !important;
    animation: layout-export-spin 0.8s linear infinite;
}

@keyframes layout-export-spin {
    to { transform: translateX(-50%) rotate(360deg); }
}

.layout-export-dd {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.layout-export-dd__menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 50;
    min-width: 280px;
    padding: 4px;
    border: 1px solid #e8e0d4;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(40, 28, 16, 0.14);
}

/* JS 挂到 body 后使用 fixed，盖过展板作品与框选层 */
.layout-export-dd__menu.is-portal {
    position: fixed;
    z-index: 12000;
}

.layout-export-dd__opt {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 2px;
    padding: 8px 10px;
    border-radius: 6px;
    color: #5c5346;
    font-size: 12px;
    line-height: 1.35;
    cursor: pointer;
    user-select: none;
}

.layout-export-dd__opt:hover {
    background: rgba(139, 90, 43, 0.06);
}

.layout-export-dd__opt input {
    width: 14px;
    height: 14px;
    margin: 0;
    flex: 0 0 auto;
    accent-color: #8b5a2b;
}

.layout-export-dd__opt--sub {
    padding-left: 28px;
    color: #7a7165;
    font-size: 11px;
}

.layout-export-dd__opt--sub:has(input:disabled) {
    opacity: 0.45;
    cursor: default;
}

.layout-export-dd__opt--sub:has(input:disabled):hover {
    background: transparent;
}

.layout-export-dd__sep {
    height: 0;
    margin: 6px 8px;
    border: 0;
    border-top: 1px solid #e8e0d4;
}

.layout-export-dd__item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin: 0;
    padding: 8px 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #3d3429;
    font-size: 12px;
    line-height: 1.35;
    text-align: left;
    cursor: pointer;
}

.layout-export-dd__item-label {
    flex: 1 1 auto;
    min-width: 0;
}

.layout-export-dd__item::after {
    content: '';
    flex: 0 0 auto;
    width: 6px;
    height: 6px;
    margin-left: 4px;
    border-right: 1.5px solid currentColor;
    border-top: 1.5px solid currentColor;
    transform: rotate(45deg);
    opacity: 0.45;
}

.layout-export-dd__item:hover {
    background: rgba(139, 90, 43, 0.08);
    color: #8b5a2b;
}

.layout-export-dd__item:hover::after {
    opacity: 0.9;
}

.layout-tb-btn--toggle.is-on {
    background: rgba(139, 90, 43, 0.12);
    color: #8b5a2b;
}

.layout-tb-btn--toggle.is-on:hover {
    background: rgba(139, 90, 43, 0.18);
}

.layout-fast-tip {
    position: fixed;
    z-index: 10000;
    max-width: 280px;
    padding: 5px 8px;
    border-radius: 5px;
    background: rgba(32, 32, 32, 0.92);
    color: #fff;
    font-size: 12px;
    line-height: 1.4;
    pointer-events: none;
    opacity: 0;
    transform: translateY(2px);
    transition: opacity 60ms ease, transform 60ms ease;
    white-space: normal;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.layout-fast-tip.is-show {
    opacity: 1;
    transform: translateY(0);
}

.works-layout__hint {
    font-size: 12px;
    color: rgba(0, 0, 0, 0.45);
}

.works-layout__field {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: rgba(0, 0, 0, 0.65);
}

.layout-board-stats {
    margin: 0 8px 0 0;
    padding: 0;
    font-size: 12px;
    line-height: 26px;
    color: rgba(0, 0, 0, 0.45);
    white-space: nowrap;
    flex-shrink: 0;
    user-select: none;
}

.layout-board-stats__n {
    font-weight: 600;
    color: rgba(0, 0, 0, 0.88);
}

.works-layout__field--board-filter {
    display: inline-flex;
    align-items: center;
    margin-right: 2px;
}

.works-layout__field--board-filter .filter-select {
    width: auto;
    min-width: 88px;
    max-width: 140px;
    height: 26px;
    padding: 0 6px;
    font-size: 12px;
}

.works-layout__boards-empty {
    flex: 1 1 auto;
    align-self: center;
    padding: 24px 16px;
    font-size: 13px;
    color: rgba(0, 0, 0, 0.45);
    text-align: center;
    white-space: nowrap;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.works-layout__field .filter-select {
    width: 88px;
    min-width: 88px;
    height: 28px;
    padding: 0 8px;
    font-size: 12px;
}

/* 须写在通用 .works-layout__field .filter-select 之后，否则会被 88px 盖掉 */
.works-layout__field.works-layout__field--canvas #layout-canvas-select,
.works-layout__field.works-layout__field--canvas .filter-select {
    width: 110px;
    min-width: 110px;
    max-width: 140px;
    height: 26px;
    padding: 0 22px 0 6px;
    margin-right: 1px;
    font-size: 12px;
    box-sizing: border-box;
}

.works-layout__boards {
    position: relative;
    flex: 1 1 0;
    min-height: 0;
    max-height: 100%;
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 12px 16px;
    overflow-x: auto;
    overflow-y: hidden;
    /* proximity：拖滚动条时可轻吸附；滚轮滑动后临时关闭 snap（snap-wheel-idle） */
    scroll-snap-type: x proximity;
    /* 与水平 padding 一致，避免 snap 把首板贴齐视口左缘、吃掉左侧留白 */
    scroll-padding-inline: 16px;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
}

.works-layout__boards.is-wheel-panning,
.works-layout__boards.snap-wheel-idle,
.works-layout__boards.is-board-reordering {
    scroll-snap-type: none;
    scroll-behavior: auto;
    overscroll-behavior-x: contain;
}

.works-layout__boards.is-board-reordering .layout-board:not(.is-reordering),
.works-layout__boards.is-board-reordering .layout-board-placeholder {
    will-change: transform;
}

.works-layout__strip.is-wheel-panning {
    scroll-behavior: auto;
    overscroll-behavior-x: contain;
}

/* 虚拟排版 — 展板轨 / 作品条：极简滚动条（普通 + 全屏） */
.works-layout__boards,
.works-layout__strip {
    --layout-scrollbar-size: 4px;
    --layout-scrollbar-thumb: rgba(0, 0, 0, 0.14);
    --layout-scrollbar-thumb-hover: rgba(0, 0, 0, 0.26);
    scrollbar-width: thin;
    scrollbar-color: var(--layout-scrollbar-thumb) transparent;
}

.works-layout__boards::-webkit-scrollbar,
.works-layout__strip::-webkit-scrollbar {
    width: var(--layout-scrollbar-size);
    height: var(--layout-scrollbar-size);
}

.works-layout__boards::-webkit-scrollbar-track,
.works-layout__strip::-webkit-scrollbar-track {
    background: transparent;
}

.works-layout__boards::-webkit-scrollbar-thumb,
.works-layout__strip::-webkit-scrollbar-thumb {
    background-color: var(--layout-scrollbar-thumb);
    border-radius: 999px;
    border: 1px solid transparent;
    background-clip: padding-box;
}

.works-layout__boards::-webkit-scrollbar-thumb:hover,
.works-layout__strip::-webkit-scrollbar-thumb:hover {
    background-color: var(--layout-scrollbar-thumb-hover);
}

.works-layout__boards::-webkit-scrollbar-corner,
.works-layout__strip::-webkit-scrollbar-corner {
    background: transparent;
}

.layout-board {
    position: relative;
    flex: 0 0 auto;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    gap: 6px;
    touch-action: pan-x;
    max-height: 100%;
    box-sizing: border-box;
    transition: opacity 0.15s ease;
}

.layout-board.is-reordering {
    opacity: 0.95;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
    cursor: grabbing;
    touch-action: none;
}

.layout-board-placeholder {
    flex: 0 0 auto;
    flex-shrink: 0;
    box-sizing: border-box;
    border: 2px dashed #69b1ff;
    border-radius: 6px;
    background: rgba(22, 119, 255, 0.06);
    scroll-snap-align: start;
    pointer-events: none;
}

.layout-board.is-reorder-slot .layout-board__surface {
    border-color: #69b1ff;
    box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.18);
}

.layout-board__label {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 22px;
    padding: 0 4px;
    font-size: 12px;
    color: rgba(0, 0, 0, 0.65);
    user-select: none;
    cursor: grab;
    touch-action: none;
}

.layout-board__label:active {
    cursor: grabbing;
}

.layout-board__index {
    flex-shrink: 0;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    border-radius: 9px;
    background: rgba(0, 0, 0, 0.06);
    color: rgba(0, 0, 0, 0.55);
    font-size: 11px;
    font-weight: 600;
}

.layout-board.is-active .layout-board__index,
.layout-board.is-board-selected .layout-board__index {
    background: #1677ff;
    color: #fff;
}

.layout-board.is-board-selected .layout-board__surface,
.layout-board.is-active .layout-board__surface {
    border-color: #1677ff;
    box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.2);
}

.layout-board__name {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    font-weight: 500;
}

.layout-board__size {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 6px;
    z-index: 2;
    display: block;
    text-align: center;
    font-size: 11px;
    line-height: 1.2;
    color: rgba(0, 0, 0, 0.35);
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
    user-select: none;
    pointer-events: none;
}

.layout-board__surface {
    position: relative;
    flex: 0 0 auto; /* 勿被 max-height 压缩，否则作品按原 px/cm 定位会溢出底/右侧 */
    width: 100%;
    background:
        linear-gradient(180deg, #faf8f4 0%, #f0ebe3 100%);
    border: 2px solid #d9d9d9;
    border-radius: 4px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
    overflow: visible;
    touch-action: none;
}

.layout-board__surface.has-grid {
    background-color: #f6f1e8;
    background-image:
        linear-gradient(180deg, rgba(250, 248, 244, 0.65) 0%, rgba(240, 235, 227, 0.65) 100%),
        repeating-linear-gradient(
            to bottom,
            transparent 0,
            transparent calc(var(--layout-grid-gap, 40px) - 1px),
            rgba(0, 0, 0, 0.1) calc(var(--layout-grid-gap, 40px) - 1px),
            rgba(0, 0, 0, 0.1) var(--layout-grid-gap, 40px)
        ),
        repeating-linear-gradient(
            to right,
            transparent 0,
            transparent calc(var(--layout-grid-gap, 40px) - 1px),
            rgba(0, 0, 0, 0.1) calc(var(--layout-grid-gap, 40px) - 1px),
            rgba(0, 0, 0, 0.1) var(--layout-grid-gap, 40px)
        );
    background-position: 0 0, 0 0, 0 0;
}

.layout-safe-area {
    position: absolute;
    z-index: 3;
    border: 1.5px dashed rgba(255, 77, 79, 0.85);
    box-sizing: border-box;
    pointer-events: none;
}

.layout-sel-hud {
    position: absolute;
    z-index: 45;
    box-sizing: border-box;
    width: max-content;
    max-width: none;
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.78);
    color: #fff;
    font-size: 12px;
    line-height: 1.35;
    white-space: nowrap;
    overflow: visible;
    text-align: center;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
    transform: translateX(-50%);
}

.layout-sel-hud:not(.is-xy) {
    white-space: normal;
}

.layout-sel-hud__title {
    font-weight: 500;
    white-space: nowrap;
}

.layout-sel-hud__meta {
    margin-top: 1px;
    font-size: 11px;
    opacity: 0.92;
    white-space: nowrap;
}

.layout-sel-hud.is-xy {
    transform: none;
    text-align: left;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

.layout-marquee {
    position: absolute;
    z-index: 50;
    box-sizing: border-box;
    border: 1px solid rgba(22, 119, 255, 0.85);
    background: rgba(22, 119, 255, 0.12);
    pointer-events: none;
}

.layout-group-box {
    position: absolute;
    z-index: 47;
    box-sizing: border-box;
    border: 1.5px solid #1677ff;
    box-shadow: 0 0 0 1px rgba(22, 119, 255, 0.2);
    pointer-events: none;
}

.layout-item.is-grouped:not(.is-selected) {
    outline: 1px dashed rgba(22, 119, 255, 0.35);
    outline-offset: 1px;
}

.layout-item.is-selected.is-group-sel {
    outline: none;
    box-shadow: none;
}

.layout-item.is-selected.is-group-sel .layout-item__handles {
    display: none !important;
}

.layout-align-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 40;
    overflow: hidden;
}

.layout-align-guide--v {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 0;
    border-left: 1px solid #ff4d4f;
}

.layout-align-guide--h {
    position: absolute;
    left: 0;
    right: 0;
    height: 0;
    border-top: 1px solid #ff4d4f;
}

.layout-board.is-drop-target .layout-board__surface {
    border-color: #52c41a;
    box-shadow: 0 0 0 3px rgba(82, 196, 26, 0.25);
}

.layout-item {
    position: absolute;
    box-sizing: border-box;
    cursor: grab;
    touch-action: none;
    user-select: none;
    transform: translateZ(0);
}

.layout-item.is-dragging {
    cursor: grabbing;
    z-index: 9999 !important;
    opacity: 0.95;
}

.layout-item.is-selected {
    outline: 1px solid #1677ff;
    outline-offset: 0;
    z-index: 50 !important;
}

.layout-item__media {
    width: 100%;
    height: 100%;
    background: #fff;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.layout-item__media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    -webkit-user-drag: none;
}

.layout-item__placeholder {
    font-size: 11px;
    color: #999;
    padding: 4px;
    text-align: center;
}

.layout-item__handles {
    display: none;
}

.layout-item.is-selected .layout-item__handles {
    display: block;
}

.layout-item__handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #fff;
    border: 2px solid #1677ff;
    border-radius: 2px;
    z-index: 2;
}

.layout-item__handle[data-handle="nw"] { left: -5px; top: -5px; cursor: nwse-resize; }
.layout-item__handle[data-handle="ne"] { right: -5px; top: -5px; cursor: nesw-resize; }
.layout-item__handle[data-handle="sw"] { left: -5px; bottom: -5px; cursor: nesw-resize; }
.layout-item__handle[data-handle="se"] { right: -5px; bottom: -5px; cursor: nwse-resize; }

.layout-item--frame-thin .layout-item__media {
    border: 3px solid #c4a574;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.layout-item--frame-thick .layout-item__media {
    border: 6px solid #5c3d2e;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.layout-item--shadow-soft {
    filter: drop-shadow(2px 4px 6px rgba(0, 0, 0, 0.22));
}

.layout-item--shadow-strong {
    filter: drop-shadow(4px 8px 12px rgba(0, 0, 0, 0.38));
}

/* 外框：不占内容区，框加在外围 */
.layout-item--mount-frame .layout-item__mount-mat {
    position: relative;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
}

.layout-item--mount-frame .layout-item__media {
    position: absolute;
    box-sizing: border-box;
    background: #fff;
}

.layout-item--mount-frame .layout-item__media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* 外缘装饰（外包围 / 画框 outer）：多层 ring + 可选阴影由 JS 写入 --layout-media-outset-shadow */
.layout-item--has-outer-decor .layout-item__media {
    box-shadow: var(--layout-media-outset-shadow, none);
}

/* 内缘装饰（外包围 / 画框 inner）：inset ring 由 JS 写入 --layout-media-inset-shadow */
.layout-item--has-inner-decor .layout-item__media {
    position: relative;
}

.layout-item--has-inner-decor .layout-item__media::after {
    content: '';
    position: absolute;
    inset: 0;
    box-shadow: var(--layout-media-inset-shadow, none);
    pointer-events: none;
}

.layout-item--has-shadow:not(.layout-item--has-outer-decor) {
    box-shadow:
        var(--layout-shadow-x, 0px)
        var(--layout-shadow-y, 6px)
        var(--layout-shadow-blur, 8px)
        rgba(0, 0, 0, var(--layout-shadow-alpha, 0.25));
}

.layout-item--has-shadow.layout-item--has-outer-decor {
    box-shadow: none;
}

.layout-item.is-dragging {
    /* 拖移时保留画框/阴影（勿清 box-shadow） */
    will-change: left, top, width, height;
}

.works-layout__strip-wrap {
    flex-shrink: 0;
    height: 162px;
    background: #fff;
    border-top: 1px solid var(--border);
    padding: 6px 0 0;
    box-sizing: border-box;
}

.works-layout__strip {
    display: flex;
    align-items: stretch;
    gap: 10px;
    height: 100%;
    padding: 0 16px 14px;
    box-sizing: border-box;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
}

.works-layout__strip-empty,
.works-layout__strip-more {
    flex: 0 0 auto;
    align-self: center;
    padding: 12px 20px;
    font-size: 13px;
    color: rgba(0, 0, 0, 0.45);
    white-space: nowrap;
}

.layout-strip-card {
    flex: 0 0 110px;
    width: 110px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: grab;
    user-select: none;
    touch-action: pan-x;
}

.layout-strip-card:active {
    cursor: grabbing;
}

.layout-strip-card__img-wrap {
    position: relative;
    height: 104px;
    flex: 0 0 104px;
    border-radius: 6px;
    overflow: hidden;
    background: #fafafa;
    border: 1px solid #f0f0f0;
}

.layout-strip-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
    -webkit-user-drag: none;
}

.layout-strip-card__img--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bbb;
    font-size: 12px;
}

.layout-strip-card .works-grid-card__overlay {
    font-size: 10px;
    line-height: 1.3;
    padding: 2px 4px;
}

.layout-strip-card__badge {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 2;
    font-size: 10px;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 3px;
    background: rgba(22, 119, 255, 0.9);
    color: #fff;
}

.layout-strip-card__badge--warn {
    background: rgba(250, 173, 20, 0.95);
    color: #000;
}

.layout-strip-card--placed {
    opacity: 0.55;
    cursor: not-allowed;
}

.layout-strip-card--placed:active {
    cursor: not-allowed;
}

.layout-strip-card__badge--placed {
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.layout-strip-card__title {
    flex-shrink: 0;
    height: 18px;
    font-size: 12px;
    line-height: 18px;
    color: rgba(0, 0, 0, 0.85);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.layout-drag-ghost {
    position: fixed;
    left: 0;
    top: 0;
    /* 宽高由 JS 按实际规格 × px/cm 设置，与落板后一致 */
    z-index: 10000;
    pointer-events: none;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    background: #fff;
    opacity: 0.92;
    will-change: transform;
    box-sizing: border-box;
}

.layout-drag-ghost img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    -webkit-user-drag: none;
}

.layout-temp-dialog {
    border: none;
    border-radius: 10px;
    padding: 0;
    max-width: 420px;
    width: calc(100% - 32px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

.layout-temp-dialog::backdrop {
    background: rgba(0, 0, 0, 0.35);
}

.layout-temp-dialog__form {
    padding: 20px 22px 16px;
}

.layout-temp-dialog__title {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 600;
}

.layout-temp-dialog__desc {
    margin: 0 0 16px;
    font-size: 13px;
    color: rgba(0, 0, 0, 0.55);
    line-height: 1.5;
}

.layout-temp-dialog__field {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    font-size: 13px;
}

.layout-temp-dialog__field .filter-input {
    flex: 1;
}

.layout-temp-dialog__actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.layout-delete-canvas-warn {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 700;
    color: var(--danger);
    line-height: 1.55;
}

.layout-delete-canvas-dialog .layout-temp-dialog__desc {
    margin-bottom: 14px;
}

.layout-delete-canvas-field {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 18px;
    font-size: 13px;
    color: rgba(0, 0, 0, 0.65);
    line-height: 1.45;
}

.layout-delete-canvas-field strong {
    color: rgba(0, 0, 0, 0.88);
    font-weight: 600;
}

.layout-delete-canvas-field .filter-input {
    width: 100%;
    box-sizing: border-box;
}

#layout-delete-canvas-confirm:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.layout-settings-dialog {
    max-width: 560px;
    width: calc(100% - 32px);
    box-sizing: border-box;
}

.layout-settings-dialog .layout-temp-dialog__form {
    padding: 16px 20px 14px;
    box-sizing: border-box;
    max-width: 100%;
}

.layout-settings-dialog .layout-temp-dialog__title {
    margin: 0 0 12px;
    font-size: 15px;
}

.layout-settings-dialog .layout-temp-dialog__actions {
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

.layout-shortcuts-dialog {
    max-width: 720px;
    width: calc(100% - 32px);
    box-sizing: border-box;
}

.layout-shortcuts-dialog__body {
    padding: 16px 18px 14px;
    box-sizing: border-box;
}

.layout-shortcuts-dialog__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.layout-shortcuts-dialog__head .layout-temp-dialog__title {
    margin: 0;
    flex: 1;
}

.layout-shortcuts-dialog__close {
    flex-shrink: 0;
}

.layout-shortcuts-dialog__lead {
    margin: 8px 0 12px;
}

.layout-shortcuts-dialog__scroll {
    max-height: min(58vh, 480px);
    overflow: auto;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    padding: 4px 0;
    margin-bottom: 12px;
}

.layout-shortcuts-dialog__section + .layout-shortcuts-dialog__section {
    border-top: 1px solid #f0f0f0;
    margin-top: 6px;
    padding-top: 6px;
}

.layout-shortcuts-dialog__section-title {
    margin: 0;
    padding: 8px 12px 6px;
    font-size: 12px;
    font-weight: 650;
    letter-spacing: 0.04em;
    color: #8b5a2b;
    background: rgba(139, 90, 43, 0.08);
}

.layout-shortcuts-dialog table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    table-layout: fixed;
}

.layout-shortcuts-dialog th,
.layout-shortcuts-dialog td {
    text-align: left;
    padding: 6px 12px;
    vertical-align: top;
    border-bottom: 1px solid #f5f5f5;
    word-break: break-word;
}

.layout-shortcuts-dialog th:nth-child(1),
.layout-shortcuts-dialog td:nth-child(1) {
    width: 38%;
}

.layout-shortcuts-dialog th:nth-child(2),
.layout-shortcuts-dialog td:nth-child(2) {
    width: 30%;
}

.layout-shortcuts-dialog th:nth-child(3),
.layout-shortcuts-dialog td:nth-child(3) {
    width: 32%;
}

.layout-shortcuts-dialog th {
    font-size: 11px;
    color: rgba(0, 0, 0, 0.45);
    font-weight: 600;
}

.layout-shortcuts-dialog tr:last-child td {
    border-bottom: none;
}

.layout-shortcuts-dialog__kbd {
    display: inline-block;
    font-family: ui-monospace, "SF Mono", Consolas, monospace;
    font-size: 12px;
    padding: 1px 6px;
    border: 1px solid #d9d9d9;
    border-bottom-width: 2px;
    border-radius: 4px;
    background: #fafafa;
    white-space: normal;
    line-height: 1.35;
    max-width: 100%;
    box-sizing: border-box;
}

.layout-shortcuts-dialog__note {
    font-size: 12px;
    color: rgba(0, 0, 0, 0.45);
}

.layout-settings-section {
    margin: 0 0 10px;
    padding: 8px 12px;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    min-width: 0;
    min-inline-size: 0;
    box-sizing: border-box;
}

.layout-settings-section legend {
    padding: 0 6px;
    font-size: 12px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.72);
}

.layout-settings-note {
    margin: 6px 0 0;
    font-size: 11px;
    color: rgba(0, 0, 0, 0.42);
    line-height: 1.4;
}

.layout-settings-check {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: 13px;
    color: rgba(0, 0, 0, 0.75);
    cursor: pointer;
    white-space: nowrap;
}

.layout-temp-dialog__form > .layout-settings-check {
    margin: 8px 0 12px;
}

.layout-settings-colors {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 8px 0 0;
    min-width: 0;
}

.layout-settings-colors::before {
    content: '颜色';
    flex: 0 0 auto;
    font-size: 13px;
    color: rgba(0, 0, 0, 0.75);
    margin-right: 2px;
}

.layout-color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 5px;
    border: 2px solid transparent;
    cursor: pointer;
    padding: 0;
    flex: 0 0 auto;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.layout-sync-list {
    margin: 0 0 12px;
    padding-left: 18px;
    font-size: 13px;
    line-height: 1.6;
    color: rgba(0, 0, 0, 0.85);
}

.layout-sync-badge {
    display: inline-block;
    margin-left: 4px;
    padding: 0 6px;
    font-size: 12px;
    line-height: 20px;
    color: #1677ff;
    background: rgba(22, 119, 255, 0.08);
    border-radius: 4px;
}

.layout-sync-actions {
    flex-wrap: wrap;
}

.layout-history-dd {
    position: relative;
    flex-shrink: 0;
}

.layout-zoom-dd {
    position: relative;
    flex-shrink: 0;
    display: none;
}

.works-layout--focus .layout-zoom-dd {
    display: inline-block;
}

.layout-zoom-dd__trigger.layout-tb-btn.is-on {
    background: rgba(139, 90, 43, 0.12);
    color: #8b5a2b;
}

.layout-zoom-dd__panel {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    z-index: 1200;
    width: 220px;
    padding: 10px 12px 8px;
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
    box-sizing: border-box;
}

.layout-zoom-dd__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.layout-zoom-dd__label {
    font-size: 12px;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.75);
}

.layout-zoom-dd__value {
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    color: #1677ff;
    font-weight: 600;
}

.layout-zoom-dd__slider {
    display: block;
    width: 100%;
    margin: 0;
    cursor: pointer;
}

.layout-zoom-dd__ticks {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
    font-size: 10px;
    color: rgba(0, 0, 0, 0.38);
}

.layout-history-dd__trigger.layout-tb-btn {
    min-width: 0;
}

/* 只读：保留滚动 / 跳转 / 点选浏览，禁止写操作由 JS 拦截（勿用 pointer-events:none，否则滚轮与滚动条失效） */
.works-layout--readonly .works-layout__boards,
.works-layout--readonly .works-layout__strip {
    opacity: 0.96;
}

.works-layout--readonly .works-layout__boards::after {
    content: '只读浏览';
    position: absolute;
    top: 10px;
    left: 12px;
    z-index: 5;
    padding: 2px 8px;
    font-size: 12px;
    color: #ad6800;
    background: #fffbe6;
    border: 1px solid #ffe58f;
    border-radius: 4px;
    pointer-events: none;
}

.works-layout--readonly .layout-item__handle,
.works-layout--readonly .layout-board [data-board-drag] {
    cursor: default;
}

.layout-history-dd__tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #f0f0f0;
    margin: -4px -4px 4px;
    padding: 0 4px;
}

.layout-history-dd__tab {
    flex: 1;
    border: 0;
    background: transparent;
    padding: 8px 6px;
    font-size: 12px;
    color: rgba(0, 0, 0, 0.55);
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.layout-history-dd__tab.is-active {
    color: #1677ff;
    font-weight: 600;
    border-bottom-color: #1677ff;
}

.layout-history-dd__tab:hover {
    color: #1677ff;
}

.layout-history-dd__list {
    max-height: 280px;
    overflow: auto;
}

.layout-history-dd__item:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.layout-history-dd__menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    z-index: 1200;
    min-width: 340px;
    max-width: min(420px, calc(100vw - 24px));
    max-width: min(92vw, 420px);
    max-height: min(50vh, 280px);
    overflow: auto;
    padding: 4px;
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

/* JS 挂到 body 后使用 fixed，避开排版区 overflow:hidden */
.layout-history-dd__menu.is-portal {
    position: fixed;
}

.layout-history-dd__item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 8px 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    font-size: 12px;
    line-height: 1.4;
    color: rgba(0, 0, 0, 0.85);
    white-space: nowrap;
    cursor: pointer;
}

.layout-history-dd__item.layout-history-dd__item--summary {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    white-space: normal;
}

.layout-history-dd__item--summary .layout-history-dd__meta {
    display: block;
    font-size: 12px;
    color: rgba(0, 0, 0, 0.85);
    line-height: 1.35;
    white-space: nowrap;
}

.layout-history-dd__item--summary .layout-history-dd__summary {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: rgba(0, 0, 0, 0.45);
    line-height: 1.3;
    white-space: normal;
}

.layout-history-dd__item:hover {
    background: #f5f5f5;
}

.layout-history-dd__empty {
    padding: 10px 12px;
    font-size: 12px;
    color: rgba(0, 0, 0, 0.45);
    white-space: nowrap;
}

.layout-color-swatch.is-active {
    border-color: #1677ff;
    box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.25);
}

.layout-color-swatch:hover {
    transform: scale(1.06);
}

.layout-ctx-menu {
    position: fixed;
    z-index: 11000;
    min-width: 160px;
    padding: 4px;
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
}

.layout-ctx-menu__item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 7px 10px;
    border: none;
    background: transparent;
    text-align: left;
    font-size: 13px;
    color: rgba(0, 0, 0, 0.85);
    border-radius: 6px;
    cursor: pointer;
}

.layout-ctx-menu__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: rgba(0, 0, 0, 0.55);
}

.layout-ctx-menu__icon svg {
    width: 15px;
    height: 15px;
}

.layout-ctx-menu__label {
    flex: 1 1 auto;
    min-width: 0;
}

.layout-ctx-menu__item:hover:not(:disabled) {
    background: #f5f5f5;
}

.layout-ctx-menu__item:hover:not(:disabled) .layout-ctx-menu__icon {
    color: #8b5a2b;
}

.layout-ctx-menu__item:disabled {
    color: rgba(0, 0, 0, 0.25);
    cursor: not-allowed;
}

.layout-ctx-menu__item:disabled .layout-ctx-menu__icon {
    color: rgba(0, 0, 0, 0.2);
}

.layout-ctx-menu__item.is-danger {
    color: #cf1322;
}

.layout-ctx-menu__item.is-danger .layout-ctx-menu__icon {
    color: #cf1322;
}

.layout-ctx-menu__sep {
    height: 1px;
    margin: 4px 6px;
    background: #f0f0f0;
}

.layout-ctx-menu__chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    margin-left: 8px;
    color: rgba(0, 0, 0, 0.35);
}

.layout-ctx-menu__chevron svg {
    width: 14px;
    height: 14px;
}

.layout-ctx-menu__item.has-submenu .layout-ctx-menu__label {
    flex: 1 1 auto;
}

.layout-ctx-menu__item.has-submenu.is-open,
.layout-ctx-menu__item.has-submenu:hover:not(:disabled) {
    background: #f5f5f5;
}

.layout-ctx-submenu {
    min-width: 180px;
    max-height: min(320px, calc(100vh - 16px));
    overflow-y: auto;
    z-index: 11001;
}

@media (max-width: 768px) {
    .works-layout__strip-wrap {
        height: 154px;
    }

    .layout-strip-card {
        flex-basis: 88px;
        width: 88px;
    }
}

/* ========== 画展管理页 ========== */
.exhibitions-page {
    padding: 20px 24px 32px;
}

.exhibitions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.exhibition-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: box-shadow 0.15s;
}

.exhibition-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.exhibition-card__head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}

.exhibition-card__name {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.exhibition-card__slug {
    font-size: 11px;
    color: var(--muted);
    font-family: ui-monospace, monospace;
    padding: 2px 6px;
    background: #f5f5f5;
    border-radius: 4px;
}

.exhibition-card__title {
    margin: 0;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.5;
}

.exhibition-card__stats {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text);
}

.exhibition-card__stats strong {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary);
    margin-right: 2px;
}

.exhibition-card__meta {
    margin: 0;
    font-size: 12px;
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 4px 8px;
}

.exhibition-card__meta dt {
    color: var(--muted);
}

.exhibition-card__meta dd {
    margin: 0;
    font-family: ui-monospace, monospace;
    font-size: 11px;
}

.exhibition-card__actions {
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
}

.loading-hint {
    color: var(--muted);
    font-size: 14px;
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px;
}

/* ===== 作者管理 · 编辑对话框 ===== */
.artist-photo-field {
    margin-bottom: 12px;
}

.artist-photo-field__label {
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 8px;
}

.artist-photo-field__actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.field-hint {
    margin: 8px 0 0;
    font-size: 11px;
    color: var(--muted);
    line-height: 1.5;
}

.field-error {
    margin: 6px 0 0;
    font-size: 12px;
    color: #ff4d4f;
    line-height: 1.5;
}

dialog input.is-invalid,
.auth-field input.is-invalid {
    border-color: #ff4d4f;
}

.artist-edit-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    margin-bottom: 12px;
    border: 1px dashed var(--border);
    border-radius: 12px;
    background: #fafbfc;
    overflow: hidden;
}

.artist-edit-preview img {
    max-width: 100%;
    max-height: 160px;
    object-fit: contain;
}

.artist-edit-preview__empty {
    color: var(--muted);
    font-size: 13px;
}

#edit-artist-dialog textarea {
    width: 100%;
    min-height: 96px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
}

#edit-artist-dialog input[readonly] {
    background: #f5f5f5;
    color: var(--muted);
}

.edit-work-dialog {
    width: min(720px, 94vw);
    max-height: calc(100vh - 32px);
    overflow: hidden;
}

.edit-work-dialog.is-create-mode .edit-work-form__edit-only {
    display: none;
}

.edit-work-dialog form {
    max-height: calc(100vh - 32px);
    overflow-y: auto;
}

.edit-work-photo-field {
    margin-bottom: 16px;
}

.edit-work-media-mount {
    min-height: 120px;
}

.page-works .edit-work-media-mount,
.page-validate .edit-work-media-mount {
    --fdm-accent: var(--accent, #8b1a1a);
    --fdm-border: var(--border, #e8e0d4);
    --fdm-surface: var(--surface, #fff);
    --fdm-muted: var(--muted, #8a7f72);
}

.edit-work-photo-field__actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    min-height: 32px;
}

.edit-work-upload-inline {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    margin-top: 8px;
}

.edit-work-upload-status__text {
    flex-shrink: 0;
    font-size: 13px;
    color: var(--muted);
    white-space: nowrap;
}

.edit-work-upload-status__text.is-saving {
    color: #1677ff;
}

.edit-work-upload-status__text.is-success {
    color: #389e0d;
}

.edit-work-upload-status__text.is-error {
    color: #ff4d4f;
}

.edit-work-upload-progress {
    flex: 1;
    min-width: 72px;
    max-width: 180px;
    height: 6px;
    border-radius: 999px;
    background: #f0f0f0;
    overflow: hidden;
}

.edit-work-upload-progress__bar {
    height: 100%;
    width: 0;
    background: #1677ff;
    border-radius: 999px;
}

.edit-work-size-field.is-ratio-warn input {
    border-color: #ff4d4f;
    background: #fff2f0;
}

.edit-work-size-warn {
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.4;
    color: #ff4d4f;
}

.edit-work-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    margin-bottom: 16px;
    border: 1px dashed var(--border);
    border-radius: 12px;
    background: #fafbfc;
    overflow: hidden;
}

.edit-work-preview img {
    max-width: 100%;
    max-height: 200px;
    object-fit: contain;
}

.edit-work-preview__empty {
    color: var(--muted);
    font-size: 13px;
}

.edit-work-form__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
}

.edit-work-form__grid label {
    margin-bottom: 12px;
}

.edit-work-form__full {
    grid-column: 1 / -1;
}

.edit-work-tags-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.edit-work-tags-field__label {
    font-size: 14px;
    color: rgba(0, 0, 0, 0.88);
}

.edit-work-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 32px;
    align-items: center;
}

.edit-work-tags__empty {
    font-size: 13px;
    color: rgba(0, 0, 0, 0.25);
}

.edit-work-tag-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 2px 10px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    background: #fff;
    font-size: 13px;
    line-height: 22px;
    color: rgba(0, 0, 0, 0.88);
}

.edit-work-tag-chip__text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.edit-work-tag-chip__remove {
    position: absolute;
    top: -7px;
    left: -7px;
    width: 16px;
    height: 16px;
    padding: 0;
    border: 1px solid #fff;
    border-radius: 50%;
    background: #ff4d4f;
    color: #fff;
    font-size: 12px;
    line-height: 14px;
    text-align: center;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.edit-work-tag-chip:hover .edit-work-tag-chip__remove,
.edit-work-tag-chip:focus-within .edit-work-tag-chip__remove {
    opacity: 1;
    pointer-events: auto;
}

.edit-work-tag-chip__remove:hover {
    background: #cf1322;
}

.edit-work-tag-input {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 11px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.5;
    color: rgba(0, 0, 0, 0.88);
    background: #fff;
}

.edit-work-tag-input:focus {
    outline: none;
    border-color: #4096ff;
    box-shadow: 0 0 0 2px rgba(5, 145, 255, 0.1);
}

.edit-work-form__readonly input[readonly] {
    background: #f5f5f5;
    color: var(--muted);
}

.edit-work-form__paths {
    margin-bottom: 12px;
}

.edit-work-form__paths-title {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 8px;
}

.edit-work-form__paths-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
}

.edit-work-form__paths-grid label {
    margin-bottom: 8px;
}

#work-form-dialog textarea {
    width: 100%;
    min-height: 88px;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    line-height: 1.75;
    resize: vertical;
}

#work-form-dialog textarea[name="ai_intro"] {
    min-height: 120px;
    line-height: 1.85;
    white-space: pre-wrap;
}

#work-form-dialog input:not([readonly]),
#work-form-dialog select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
}

#work-form-dialog input:not([readonly]) {
    font-size: 14px;
}

#work-form-dialog select {
    font-size: 12px;
}

.edit-work-ai-intro-field__head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-bottom: 8px;
}

.edit-work-ai-intro-field__label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.edit-work-ai-review-status {
    font-size: 13px;
    color: var(--muted);
}

.edit-work-ai-review-status.is-saving {
    color: #1677ff;
}

.edit-work-ai-review-status.is-success {
    color: #389e0d;
}

.edit-work-ai-review-status.is-error {
    color: #ff4d4f;
}

.artist-bio-preview__section + .artist-bio-preview__section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #f0f0f0;
}

.artist-bio-preview__section-label {
    font-size: 12px;
    font-weight: 600;
    color: #1677ff;
    margin-bottom: 6px;
}

.artist-bio-preview__section-body {
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.75;
}

.artist-bio-preview__section-body--ai {
    white-space: pre-line;
    line-height: 1.85;
}

@media (max-width: 640px) {
    .edit-work-form__grid,
    .edit-work-form__paths-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== 批量导入向导 ===== */
.page-import-wizard .admin-page-header {
    margin-bottom: 16px;
}

.import-page {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 24px;
}

.import-page .import-card.panel {
    margin: 0 24px;
}

.import-file-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
}

.import-file-row--folder {
    margin-top: 12px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: start;
}

.import-folder-status {
    font-size: 13px;
    color: var(--muted);
    line-height: 1.5;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.import-file-picker {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.import-file-name {
    font-size: 13px;
    color: var(--muted);
    max-width: 420px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.import-match-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.import-options--inline {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 16px;
    margin: 0;
}

.import-commit-row {
    margin-top: 16px;
}

.import-wizard {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.import-steps {
    display: flex;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0 24px;
    flex-wrap: wrap;
}

.import-step {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 999px;
    background: #f5f5f5;
    color: rgba(0, 0, 0, 0.45);
    font-size: 13px;
}

.import-step span {
    display: inline-flex;
    width: 22px;
    height: 22px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #d9d9d9;
    color: #fff;
    font-size: 12px;
}

.import-step.is-active {
    background: #fff7e6;
    color: #d46b08;
}

.import-step.is-active span {
    background: #fa8c16;
}

.import-step.is-done {
    color: rgba(0, 0, 0, 0.65);
}

.import-step.is-done span {
    background: #52c41a;
}

.import-panel .panel,
.import-preview-section .panel {
    margin: 0 24px;
}

.import-message {
    margin: 0 24px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
}

.import-message.is-error {
    background: #fff2f0;
    color: #cf1322;
    border: 1px solid #ffccc7;
}

.import-message.is-success {
    background: #f6ffed;
    color: #389e0d;
    border: 1px solid #b7eb8f;
}

.import-error-detail {
    margin: 0 24px 16px;
    padding: 16px 18px;
    border-radius: 8px;
    background: #fff2f0;
    border: 1px solid #ffccc7;
    color: #434343;
    font-size: 14px;
}

.import-error-detail__title {
    margin: 0 0 10px;
    font-size: 15px;
    color: #cf1322;
}

.import-error-detail__list {
    margin: 0 0 12px;
    padding-left: 20px;
    max-height: 280px;
    overflow: auto;
}

.import-error-detail__list li {
    margin: 4px 0;
    line-height: 1.5;
    color: #595959;
}

.import-error-detail__list li:first-child,
.import-error-detail__list li:nth-child(2) {
    color: #262626;
    font-weight: 500;
}

.import-error-detail__hint {
    margin: 0;
    font-size: 13px;
    color: #8c8c8c;
}

.import-file-label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 16px;
    font-size: 14px;
}

.import-actions-row {
    margin-top: 12px;
}

.import-template-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    line-height: 1.6;
}

.import-match-note {
    margin-top: -4px;
    margin-bottom: 16px;
    line-height: 1.7;
}

.import-template-file {
    color: #1677ff;
    font-size: 14px;
    text-decoration: none;
    white-space: nowrap;
}

.import-template-file:hover {
    text-decoration: underline;
    color: #4096ff;
}

.import-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 16px 0;
    font-size: 14px;
}

.import-option-overwrite.is-disabled {
    color: var(--muted, #8c8c8c);
    cursor: not-allowed;
}

.import-option-overwrite.is-disabled input {
    cursor: not-allowed;
}

.import-option-hint {
    margin-left: 6px;
    font-size: 12px;
    color: var(--muted, #8c8c8c);
}

.import-fieldset {
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    padding: 12px 16px;
    margin: 16px 0;
    font-size: 14px;
}

.import-fieldset label {
    display: block;
    margin: 6px 0;
}

.import-filter-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 8px;
}

.import-filter-bar__label {
    font-size: 13px;
    color: #8c8c8c;
}

.import-filter-btn {
    border: 1px solid #d9d9d9;
    background: #fff;
    border-radius: 6px;
    padding: 4px 12px;
    font-size: 13px;
    cursor: pointer;
    color: #595959;
}

.import-filter-btn:hover {
    color: #1677ff;
    border-color: #1677ff;
}

.import-filter-btn.is-active {
    color: #1677ff;
    border-color: #1677ff;
    background: #e6f4ff;
}

.import-check-all-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-weight: 500;
    user-select: none;
}

.import-table .col-check {
    width: 72px;
    text-align: center;
}

.import-table-wrap {
    overflow: auto;
    max-height: 480px;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
}

.import-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.import-table th,
.import-table td {
    border-bottom: 1px solid #f0f0f0;
    border-right: 1px solid #f0f0f0;
    padding: 8px 10px;
    vertical-align: middle;
    white-space: nowrap;
}

.import-table th {
    background: #fafafa;
    position: sticky;
    top: 0;
    z-index: 1;
}

.import-table .cell-intro {
    white-space: normal;
    max-width: 200px;
}

.import-row--unique {
    background: #f6ffed;
}

.import-row--multiple {
    background: #fffbe6;
}

.import-row--unmatched {
    background: #fff2f0;
}

.import-row--manual {
    background: #e6f4ff;
}

.match-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.match-badge--unique { background: #d9f7be; color: #389e0d; }
.match-badge--multiple { background: #ffe58f; color: #d48806; }
.match-badge--unmatched { background: #ffccc7; color: #cf1322; }
.match-badge--manual { background: #bae0ff; color: #0958d9; }
.match-badge--pending { background: #f0f0f0; color: #666; }

.import-thumb-cell {
    display: flex;
    align-items: center;
    gap: 6px;
}

.import-thumb-wrap {
    flex-shrink: 0;
}

.import-thumb {
    display: block;
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #f0f0f0;
}

.import-thumb-placeholder {
    color: var(--muted);
}

/* ===== 图片裁切对话框 ===== */
.image-cropper-dialog {
    width: min(920px, calc(100vw - 32px));
    max-width: none;
    padding: 0;
    border: none;
    border-radius: 12px;
}

.image-cropper-dialog::backdrop {
    background: rgba(0, 0, 0, 0.45);
}

.image-cropper-dialog__form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px 24px 24px;
}

.image-cropper-dialog__title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.image-cropper-dialog__toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.image-cropper-dialog__toolbar-label {
    font-size: 13px;
    color: var(--muted);
}

.image-cropper-ratio-btn.is-active {
    border-color: var(--primary);
    color: var(--primary);
    background: #fff7e6;
}

.image-cropper-dialog__stage {
    width: 100%;
    max-height: min(60vh, 520px);
    overflow: hidden;
    background: #f5f5f5;
    border-radius: 8px;
}

.image-cropper-dialog__stage img {
    display: block;
    max-width: 100%;
}

.image-cropper-dialog__hint {
    margin: 0;
    font-size: 12px;
    color: var(--muted);
}

.image-cropper-dialog__actions {
    margin: 0;
}

.import-stats {
    margin: 0 0 12px;
    font-size: 13px;
    color: var(--muted);
}

.import-wizard-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 24px 24px;
    border-top: 1px solid #f0f0f0;
}

.import-report {
    margin-top: 16px;
    padding: 16px;
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    border-radius: 8px;
}

.import-report-errors {
    margin-top: 12px;
    color: #cf1322;
    font-size: 13px;
}

.import-report-actions {
    margin-top: 16px;
}

.candidate-select {
    max-width: 220px;
    font-size: 12px;
}

.import-progress {
    margin-top: 16px;
    padding: 16px;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    background: #fafafa;
}

.import-progress__bar-wrap {
    height: 8px;
    background: #e8e8e8;
    border-radius: 4px;
    overflow: hidden;
}

.import-progress__bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #1677ff, #4096ff);
    border-radius: 4px;
}

.import-progress__text {
    margin: 10px 0 12px;
    font-size: 14px;
    color: #262626;
}

.import-progress.is-cancelled .import-progress__bar {
    background: #faad14;
}

.import-report.is-partial h3 {
    color: #d46b08;
}

.page-work-detail .work-detail__header {
    margin-bottom: 20px;
}

.page-work-detail .work-detail__meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.page-work-detail .work-detail__id {
    font-size: 13px;
    color: #8c8c8c;
}

.page-work-detail .work-detail__title {
    margin: 0 0 6px;
    font-size: 24px;
}

.page-work-detail .work-detail__subtitle {
    margin: 0;
    color: #595959;
}

.page-work-detail .work-detail__grid {
    display: grid;
    grid-template-columns: minmax(280px, 420px) 1fr;
    gap: 20px;
    align-items: start;
}

.page-work-detail .work-detail__image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.page-work-detail .work-detail__info {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.page-work-detail .work-detail__like-card {
    max-width: 200px;
}

.page-work-detail .work-detail__dl {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 8px 16px;
    margin: 0;
}

.page-work-detail .work-detail__dl dt {
    margin: 0;
    color: #8c8c8c;
}

.page-work-detail .work-detail__dl dd {
    margin: 0;
}

.page-work-detail .work-detail__intro {
    margin: 0;
    line-height: 1.7;
    white-space: pre-wrap;
}

.page-work-detail .work-detail__actions {
    margin-top: 24px;
}

.like-count-link {
    color: #1677ff;
    font-weight: 600;
    text-decoration: none;
}

.like-count-link:hover {
    text-decoration: underline;
}

@media (max-width: 960px) {
    .page-work-detail .work-detail__grid {
        grid-template-columns: 1fr;
    }
}


/* duoyonghu: 策展机构/主题展/策展账号 */
.toolbar-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.toolbar-hint {
    margin: 0 0 16px;
    font-size: 13px;
    color: #667788;
    line-height: 1.5;
}

.org-page .exhibitions-grid,
.theme-page .exhibitions-grid,
.curators-page #curators-list {
    width: 100%;
}

.exhibition-card__theme {
    font-size: 13px;
    color: #546e7a;
    margin: 0 0 8px;
}

#org-dialog input[readonly],
#org-dialog input.is-readonly,
#theme-dialog input.is-readonly,
#exhibition-dialog input.is-readonly,
#curator-dialog input.is-readonly,
.page-organization-settings .settings-category-input.is-readonly,
.page-organization-settings .settings-category-input[readonly] {
    background: #f5f5f5;
    color: var(--muted);
    cursor: not-allowed;
}

.page-organization-settings .data-table--settings .field-hint {
    margin: 6px 0 0;
    max-width: 480px;
}

.curator-card {
    background: #fff;
    border: 1px solid #e0e6ed;
    border-radius: 10px;
    padding: 16px;
}

/* === SaaS 策展机构运营页样式（stash 迁回） === */
.page-exhibition-assign #assign-user-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 280px;
    overflow: auto;
}

.page-exhibition-assign #assign-user-list .checkbox-inline {
    margin-right: 0;
}

/* ========== 主题展 · 展示模板选择 ========== */
.theme-template-dialog {
    width: min(720px, 94vw);
}

.theme-template-dialog__form {
    padding: 20px 24px 16px;
}

.theme-template-dialog__hint {
    margin: -4px 0 16px;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.5;
}

.theme-template-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
    margin-bottom: 8px;
}

.theme-template-empty {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.theme-template-card {
    position: relative;
    display: block;
    margin: 0;
    cursor: pointer;
}

.theme-template-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.theme-template-card__body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 100%;
    padding: 10px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.theme-template-card input:checked + .theme-template-card__body {
    border-color: #1a365d;
    box-shadow: 0 0 0 2px rgba(26, 54, 93, 0.18);
}

.theme-template-card__preview {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-radius: 6px;
    background: #f3f4f6;
}

.theme-template-card__preview--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 12px;
}

.theme-template-card__meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.theme-template-card__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

.theme-template-card__badge {
    display: inline-flex;
    align-items: center;
    padding: 1px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 500;
    color: #92400e;
    background: #fef3c7;
}

.theme-template-card__desc {
    font-size: 12px;
    line-height: 1.45;
    color: #6b7280;
}

/* ========== 展览模板页 ========== */
.exhibition-templates-page {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 24px;
}

.ex-tpl-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.ex-tpl-panel-head .panel__title {
    margin-bottom: 4px;
}

.ex-tpl-panel-head .panel__desc {
    margin: 0;
}

.ex-tpl-panel-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

@media (max-width: 720px) {
    .ex-tpl-panel-head {
        flex-direction: column;
    }
}

.ex-tpl-catalog {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}

.ex-tpl-catalog-card {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ex-tpl-catalog-card__id {
    margin: 0;
    font-size: 11px;
    color: #9ca3af;
}

.ex-tpl-loading {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.tpl-edit-dialog {
    width: min(640px, 94vw);
}

.tpl-edit-dialog__form {
    padding: 20px 24px 16px;
}

.tpl-edit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 16px;
    margin-bottom: 8px;
}

.tpl-edit-grid > label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    color: var(--muted);
    margin: 0;
}

.tpl-edit-grid > label input[type="text"],
.tpl-edit-grid > label input[type="color"] {
    min-width: 0;
    width: 100%;
}

.tpl-edit-check {
    flex-direction: row !important;
    align-items: center;
    gap: 8px !important;
    color: #374151 !important;
}

.tpl-edit-template-line {
    margin: -8px 0 14px;
    font-size: 13px;
    color: #1a365d;
    font-weight: 600;
}

.tpl-edit-source {
    font-size: 11px;
    color: #9ca3af;
    line-height: 1.3;
}

.tpl-edit-source[data-source="config"] {
    color: #b45309;
}

.tpl-edit-source[data-source="theme"] {
    color: #1d4ed8;
}

/* —— 外观独立页 —— */
.tpl-appearance-page {
    max-width: none;
}

.tpl-appearance-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 400px);
    gap: 20px;
    align-items: start;
}

.tpl-appearance-main {
    min-width: 0;
    max-width: 720px;
}

.tpl-appearance-preview {
    position: sticky;
    top: 72px;
    margin-bottom: 16px;
}

.tpl-appearance-preview__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.tpl-appearance-preview__head .panel__title {
    margin: 0;
}

.tpl-appearance-preview__actions {
    display: flex;
    gap: 4px;
}

.tpl-appearance-preview__frame-wrap {
    /* 主流手机视口：iPhone 14/15 逻辑尺寸 390×844 */
    --tpl-preview-w: 390;
    --tpl-preview-h: 844;
    width: min(100%, calc(var(--tpl-preview-w) * 1px));
    margin: 10px auto 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: #111;
    aspect-ratio: var(--tpl-preview-w) / var(--tpl-preview-h);
    max-height: min(88vh, calc(var(--tpl-preview-h) * 1px));
}

.tpl-appearance-preview__frame {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: #fff;
}

.tpl-logo-box {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    margin-top: 8px;
}

.tpl-logo-preview-wrap {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 10px;
    overflow: hidden;
    background: #f3f4f6;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.tpl-logo-preview {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
}

.tpl-logo-preview.is-hidden,
.tpl-logo-empty.is-hidden {
    display: none !important;
}

.tpl-logo-empty {
    font-size: 12px;
    color: #9ca3af;
    text-align: center;
    padding: 8px;
}

.tpl-appearance-intro .panel__title {
    margin-bottom: 6px;
}

.tpl-appearance-intro .panel__desc {
    margin-bottom: 4px;
}

.tpl-appearance-intro .panel__desc--note {
    margin-top: 8px;
    margin-bottom: 0;
    font-size: 13px;
    color: var(--muted);
}

.tpl-template-id {
    margin-left: 6px;
    font-size: 12px;
    color: var(--muted);
    background: #f3f4f6;
    padding: 1px 6px;
    border-radius: 4px;
}

.tpl-appearance-form {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.tpl-appearance-form .panel {
    margin-bottom: 16px;
}

.tpl-appearance-actions {
    display: flex;
    gap: 10px;
    padding: 4px 0 8px;
}

.tpl-field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 20px;
    margin-top: 4px;
}

.tpl-field--full {
    grid-column: 1 / -1;
}

.tpl-field--cover-credit {
    margin-top: 18px;
}

.tpl-field__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.tpl-field__head--flush {
    margin-bottom: 4px;
    width: 100%;
}

.tpl-field__head label {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.tpl-field .settings-category-input {
    width: 100%;
    max-width: none;
}

.tpl-cover-box {
    display: grid;
    grid-template-columns: minmax(240px, 380px) minmax(0, 1fr);
    gap: 20px;
    align-items: stretch;
    margin-top: 8px;
}

.tpl-cover-preview-wrap {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    overflow: hidden;
    background: #e5e7eb;
    border: 1px solid var(--border);
}

.tpl-cover-preview-wrap.is-empty {
    --wash-cinnabar: rgba(176, 64, 48, 0.34);
    --wash-ultramarine: rgba(45, 74, 130, 0.38);
    --wash-ochre: rgba(196, 146, 62, 0.26);
    --wash-jade: rgba(62, 110, 88, 0.2);
    background-color: #1a1512;
    background-image:
        radial-gradient(ellipse 70% 55% at 12% 18%, var(--wash-cinnabar), transparent 62%),
        radial-gradient(ellipse 65% 60% at 88% 22%, var(--wash-ultramarine), transparent 58%),
        radial-gradient(ellipse 55% 50% at 72% 82%, var(--wash-ochre), transparent 60%),
        radial-gradient(ellipse 50% 45% at 18% 78%, var(--wash-jade), transparent 55%),
        radial-gradient(ellipse 90% 70% at 50% 48%, rgba(255, 248, 240, 0.06), transparent 70%),
        linear-gradient(152deg, #241c18 0%, #161210 42%, #1c222c 78%, #141816 100%);
    border-color: rgba(255, 255, 255, 0.08);
}

.tpl-cover-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tpl-cover-preview.is-hidden,
.tpl-cover-empty.is-hidden,
.tpl-check.is-hidden,
.is-hidden {
    display: none !important;
}

.tpl-cover-empty {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    color: rgba(245, 240, 232, 0.72);
    font-size: 13px;
    text-align: center;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

.tpl-cover-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 12px;
    min-width: 0;
}

.tpl-cover-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tpl-cover-upload-btn {
    display: inline-flex;
    cursor: pointer;
    margin: 0;
}

.tpl-color-rows {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 8px;
}

.tpl-color-row__label {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 10px;
}

.tpl-color-row__label code {
    font-size: 12px;
    font-weight: 500;
    color: #6b7280;
}

.tpl-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.tpl-swatch {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 2px solid transparent;
    background: var(--swatch, #ccc);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    padding: 0;
}

.tpl-swatch.is-selected {
    border-color: #5a4e44;
    box-shadow: 0 0 0 2px rgba(90, 78, 68, 0.22), inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.tpl-swatch--custom {
    width: auto;
    min-width: 64px;
    padding: 0 10px;
    background:
        linear-gradient(135deg, rgba(61, 74, 92, 0.92), rgba(154, 123, 79, 0.88)),
        linear-gradient(180deg, #f3efe8, #e8e2d8);
    color: #f7f3ec;
    font-size: 11px;
    font-weight: 600;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.28);
    box-shadow: inset 0 0 0 1px rgba(90, 78, 68, 0.28);
}

.tpl-swatch--custom span {
    position: relative;
    z-index: 1;
}

.tpl-color-picker-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.tpl-check-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 8px;
}

.tpl-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 14px;
    color: #374151;
    cursor: pointer;
}

@media (max-width: 1100px) {
    .tpl-appearance-layout {
        grid-template-columns: 1fr;
    }

    .tpl-appearance-preview {
        position: static;
    }

    .tpl-appearance-preview__frame-wrap {
        max-height: min(72vh, calc(var(--tpl-preview-h) * 1px));
    }

    .tpl-appearance-main {
        max-width: none;
    }
}

@media (max-width: 720px) {
    .tpl-field-grid,
    .tpl-cover-box,
    .tpl-logo-box {
        grid-template-columns: 1fr;
    }

    .tpl-field__head {
        flex-wrap: wrap;
    }
}
