:root {
  --ink: #17211f;
  --muted: #6c7774;
  --line: #dfe5e2;
  --paper: #f3f6f4;
  --white: #fff;
  --teal: #0b6b60;
  --teal-dark: #084d46;
  --red: #b9362c;
  --gold: #d59b39;
  --shadow: 0 14px 40px rgba(18, 47, 42, .08);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
body.modal-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
input, select, textarea { width: 100%; border: 1px solid #cfd8d5; border-radius: 4px; padding: 9px 11px; background: #fff; color: var(--ink); }
textarea { resize: vertical; }

.sidebar { position: fixed; inset: 0 auto 0 0; width: 248px; background: #102c28; color: #e9f2ef; padding: 24px 16px; display: flex; flex-direction: column; }
.brand { display: flex; gap: 12px; align-items: center; padding: 0 8px 24px; border-bottom: 1px solid rgba(255, 255, 255, .12); }
.brand-logo { width: 46px; height: 46px; flex: none; border: 2px solid rgba(255, 255, 255, .88); border-radius: 50%; background: #fff; object-fit: contain; }
.brand strong, .brand small { display: block; }
.brand small { color: #9db3ae; margin-top: 2px; }
.sidebar nav { padding: 18px 0; overflow: auto; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .2) transparent; }
.nav-link { position: relative; display: block; min-height: 40px; padding: 9px 12px; border-radius: 5px; color: #bed0cc; }
.nav-link:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav-link.active { background: #f6fbf9; box-shadow: 0 6px 18px rgba(0, 0, 0, .16); color: #07594f; font-weight: 750; }
.nav-link.active::before { position: absolute; top: 9px; bottom: 9px; left: 0; width: 4px; border-radius: 0 3px 3px 0; background: var(--gold); content: ""; }
.nav-dashboard { margin-bottom: 10px; }
.nav-group { margin: 3px 0; }
.nav-group summary { display: flex; min-height: 40px; align-items: center; justify-content: space-between; padding: 9px 12px; border-radius: 5px; color: #8fa9a3; cursor: pointer; font-size: 12px; font-weight: 750; list-style: none; }
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary:hover, .nav-group[open] summary, .nav-group.active summary { background: rgba(255, 255, 255, .05); color: #fff; }
.nav-chevron { width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); transition: transform .18s ease; }
.nav-group[open] .nav-chevron { transform: rotate(225deg); }
.nav-submenu { display: grid; gap: 3px; margin: 4px 0 10px 13px; padding-left: 9px; border-left: 1px solid rgba(255, 255, 255, .12); }
.nav-submenu .nav-link { padding-left: 14px; }
.logout { margin-top: auto; width: 100%; background: transparent; border: 1px solid rgba(255, 255, 255, .2); color: #dce9e6; padding: 9px; border-radius: 5px; }

.admin-main { margin-left: 248px; padding: 36px; min-height: 100vh; }
.admin-main.narrow { max-width: 1220px; }
.page-header { display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; margin-bottom: 24px; }
.page-header h1 { font-size: 28px; line-height: 1.2; margin: 4px 0; }
.page-header p { margin: 0; color: var(--muted); }
.header-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; }
.eyebrow { color: var(--teal) !important; font-size: 11px; font-weight: 800; letter-spacing: 1.5px; }
.primary { display: inline-flex; align-items: center; justify-content: center; background: var(--teal); color: #fff; border: 0; border-radius: 5px; padding: 10px 18px; cursor: pointer; }
.primary:hover { background: var(--teal-dark); }
.wide { width: 100%; }
.panel { background: var(--white); border: 1px solid var(--line); box-shadow: var(--shadow); padding: 22px; border-radius: 7px; margin-bottom: 24px; }
.overview-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.overview-item { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 7px; background: var(--white); box-shadow: var(--shadow); }
.overview-item-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; min-height: 92px; }
.overview-item h2 { margin: 0 0 8px; font-size: 18px; }
.overview-item p { margin: 0; color: var(--muted); line-height: 1.6; }
.overview-count { width: max-content; flex: none; padding: 4px 8px; border-radius: 4px; background: #edf5f2; color: var(--teal-dark); font-size: 12px; font-weight: 700; white-space: nowrap; word-break: keep-all; }
.overview-details { display: grid; gap: 8px; margin: 18px 0 0; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.overview-details div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; }
.overview-details dt { color: var(--muted); font-weight: 650; }
.overview-details dd { min-width: 0; margin: 0; overflow-wrap: anywhere; }
.overview-item-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 16px; }
.overview-item-footer .secondary { flex: none; min-width: 82px; text-align: center; }
.panel-title, .toolbar, .pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.panel-title h2 { margin: 0 0 14px; }
.overview-item-heading > .secret-state, .panel-title > .secret-state { min-width: max-content; flex: 0 0 auto; writing-mode: horizontal-tb; }
.panel-title a, .back { color: var(--teal); }
.stat-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat-grid a { background: #fff; border-top: 3px solid var(--teal); padding: 18px; border-radius: 5px; box-shadow: var(--shadow); }
.stat-grid strong, .stat-grid span { display: block; }
.stat-grid strong { font-size: 28px; }
.stat-grid span { color: var(--muted); }
.toolbar { flex-wrap: wrap; justify-content: flex-start; margin-bottom: 16px; }
.toolbar input { width: min(360px, 100%); }
.toolbar select { width: auto; min-width: 170px; }
.toolbar button { border: 1px solid var(--line); background: #fff; padding: 9px 16px; border-radius: 4px; }
.toolbar .primary { border-color: transparent; background: var(--teal); color: #fff; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th, td { text-align: left; border-bottom: 1px solid #edf0ef; padding: 12px 10px; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
th { color: var(--muted); font-size: 12px; background: #f8faf9; }
.actions { vertical-align: middle; }
.actions-inner { display: flex; min-height: 42px; align-items: center; gap: 10px; }
.actions-inner form { display: inline-flex; margin: 0; }
.actions a, .actions button { color: var(--teal); background: none; border: 0; padding: 0; cursor: pointer; }
.actions .danger-text { color: var(--red); }
.status { display: inline-block; padding: 2px 8px; background: #edf5f2; color: var(--teal); border-radius: 3px; }
.status-badge { display: inline-flex; min-height: 24px; align-items: center; justify-content: center; padding: 2px 8px; border-radius: 3px; background: #edf2f0; color: #52625e; font-size: 12px; font-weight: 700; }
.status-active, .status-published, .status-approved, .status-completed, .status-resolved, .status-checked_in { background: #e2f2eb; color: #12604f; }
.status-pending, .status-pending_payment, .status-reviewing, .status-processing, .status-paid { background: #fff1d7; color: #855d16; }
.status-disabled, .status-rejected, .status-cancelled, .status-refunded, .status-archived, .status-unlisted, .status-expired { background: #f7e7e4; color: #96392f; }
.resource-actions { min-width: 280px; white-space: normal; }
.resource-actions .actions-inner { flex-wrap: wrap; }
.workflow-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.actions .action-button, .workflow-actions .action-button { display: inline-flex; min-height: 30px; align-items: center; justify-content: center; border: 1px solid #b9cec8; border-radius: 4px; padding: 4px 9px; background: #f7fbf9; color: var(--teal); line-height: 1.2; cursor: pointer; }
.actions .action-button.danger-action, .workflow-actions .action-button.danger-action { border-color: #e2b8b3; background: #fff8f7; color: var(--red); }
.resource-actions .shop-order-actions { display: grid; grid-template-columns: max-content max-content; align-items: center; justify-content: start; gap: 8px 10px; min-height: 68px; }
.shop-order-actions > .workflow-actions { display: contents; }
.shop-order-actions > .shop-order-view { grid-column: 1; grid-row: 1; }
.shop-order-actions .workflow-action:not(.workflow-action-manualStatus) { grid-row: 1; }
.shop-order-actions .workflow-action-manualStatus { grid-column: 1; grid-row: 2; }
.shop-order-actions > .shop-order-delete { grid-column: 2; grid-row: 2; }
.workflow-complete { color: var(--muted); font-size: 12px; }
.current-account { display: inline-flex; min-height: 22px; align-items: center; margin-left: 8px; padding: 1px 6px; border-radius: 3px; background: #edf2f0; color: var(--muted); font-size: 11px; font-weight: 700; vertical-align: middle; }
.workflow-panel { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 18px; margin-bottom: 18px; border: 1px solid var(--line); border-left: 4px solid var(--teal); border-radius: 6px; background: #fff; }
.workflow-panel > div:first-child { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.workflow-panel p { width: 100%; margin: 2px 0 0; color: var(--muted); }
.action-dialog { width: min(520px, calc(100% - 32px)); padding: 0; overflow: hidden; border: 0; border-radius: 7px; background: #fff; box-shadow: 0 24px 70px rgba(0, 0, 0, .24); }
.action-dialog::backdrop { background: rgba(8, 25, 22, .58); }
.action-dialog > form { display: block; width: 100%; margin: 0; }
.action-dialog header, .action-dialog footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; }
.action-dialog header { align-items: flex-start; border-bottom: 1px solid var(--line); }
.action-dialog footer { justify-content: flex-end; padding-block: 14px; border-top: 1px solid var(--line); background: #f8faf9; }
.action-dialog h3, .action-dialog p { margin: 0; }
.action-dialog p { color: var(--muted); }
.dialog-heading { min-width: 0; }
.dialog-heading h3 { font-size: 18px; line-height: 1.35; }
.dialog-context { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.dialog-context span { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border-radius: 4px; background: #edf4f1; color: var(--muted); font-size: 12px; }
.dialog-context strong { color: var(--ink); font-size: 13px; }
.dialog-close { display: inline-flex; width: 34px; height: 34px; flex: none; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: #eef2f0; color: var(--ink); font-size: 22px; line-height: 1; cursor: pointer; }
.dialog-close:hover { background: #e1e9e6; }
.dialog-fields { display: grid; gap: 16px; padding: 20px 22px 22px; }
.dialog-fields .field { min-width: 0; }
.confirm-dialog-body { min-height: 92px; align-content: center; }
.confirm-dialog-body p { color: var(--ink); font-size: 15px; line-height: 1.75; white-space: pre-line; }
.dialog-actions .secondary, .dialog-actions .primary { min-width: 96px; min-height: 40px; }
.danger-button { background: var(--red); }
.danger-button:hover { background: #8f2b23; }
.empty { text-align: center; color: var(--muted); padding: 36px; }
.pagination { justify-content: flex-end; margin-top: 18px; }
.pagination a { border: 1px solid var(--line); padding: 6px 10px; border-radius: 4px; }

.edit-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.edit-form [hidden] { display: none !important; }
.field-hint { display: block; margin-top: 7px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.location-field { display: grid; gap: 8px; }
.location-control-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.location-pick-button { white-space: nowrap; }
.location-field-meta { display: flex; min-height: 24px; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; }
.location-field-meta .text-button { padding: 2px 4px; }
.location-picker-dialog { width: min(1040px, calc(100% - 32px)); max-height: min(860px, calc(100vh - 32px)); overflow: hidden; }
.location-picker-body { display: grid; min-height: 0; gap: 12px; padding: 16px 20px; overflow: auto; }
.location-picker-toolbar { display: grid; grid-template-columns: minmax(0, 1fr) minmax(130px, 190px) auto; gap: 10px; }
.location-picker-toolbar label { min-width: 0; }
.location-picker-toolbar input { width: 100%; }
.location-picker-workspace { display: grid; min-height: 430px; grid-template-columns: minmax(0, 1.65fr) minmax(260px, .75fr); overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: #eef2f0; }
.location-picker-map { min-height: 430px; background: #e9efed; }
.location-picker-results { display: flex; min-width: 0; max-height: 430px; flex-direction: column; overflow: auto; border-left: 1px solid var(--line); background: #fff; }
.location-picker-result { display: grid; width: 100%; gap: 5px; padding: 13px 14px; border: 0; border-bottom: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; text-align: left; }
.location-picker-result:hover { background: #f4f8f7; }
.location-picker-result.active { box-shadow: inset 4px 0 0 var(--teal); background: #e8f4f0; }
.location-picker-result strong, .location-picker-result span, .location-picker-result small { overflow-wrap: anywhere; }
.location-picker-result strong { color: var(--teal-dark); font-size: 14px; }
.location-picker-result span { color: var(--ink); font-size: 13px; line-height: 1.5; }
.location-picker-result small { color: var(--muted); }
.location-picker-empty, .location-picker-loading, .location-picker-error, .location-picker-reverse { display: grid; min-height: 160px; padding: 24px; place-content: center; gap: 7px; color: var(--muted); line-height: 1.65; text-align: center; }
.location-picker-loading::before { content: ''; width: 24px; height: 24px; margin: 0 auto 4px; border: 3px solid #d5e3df; border-top-color: var(--teal); border-radius: 50%; animation: location-spin .75s linear infinite; }
.location-picker-error { color: var(--red); }
.location-picker-reverse strong { color: var(--teal-dark); }
.location-picker-reverse span { color: var(--ink); }
.location-picker-selection { min-height: 42px; padding: 10px 12px; border-radius: 5px; background: #f1f6f4; color: var(--teal-dark); line-height: 1.55; overflow-wrap: anywhere; }
.location-picker-help { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.55; }
@keyframes location-spin { to { transform: rotate(360deg); } }
.field > span:first-child { display: block; font-weight: 650; margin-bottom: 6px; }
.field small { color: var(--muted); font-weight: 400; }
.span-2 { grid-column: 1 / -1; }
.check-row { display: flex !important; align-items: center; gap: 8px; font-weight: 400 !important; height: 40px; }
.check-row input { width: auto; }
.form-actions { display: flex; align-items: center; gap: 16px; border-top: 1px solid var(--line); padding-top: 18px; }
.article-preview-button { margin-right: auto; }
.alert { display: none; }
.toast-stack { position: fixed; z-index: 1300; top: 20px; right: 22px; display: grid; width: min(360px, calc(100vw - 32px)); gap: 10px; pointer-events: none; }
.admin-toast { padding: 12px 14px; border: 1px solid transparent; border-radius: 6px; box-shadow: 0 16px 46px rgba(9, 31, 27, .18); background: #fff; color: var(--ink); font-weight: 650; animation: toast-in .18s ease-out; }
.admin-toast.success { border-color: #bfe0d4; background: #e8f6f0; color: #155f51; }
.admin-toast.error { border-color: #edc4be; background: #fbe9e7; color: #8c2d25; }
.admin-toast.warning { border-color: #efd28d; background: #fff3d1; color: #7b560d; }
.admin-toast.leaving { opacity: 0; transform: translateY(-8px); transition: opacity .28s ease, transform .28s ease; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

.image-uploader { display: grid; grid-template-columns: minmax(220px, 320px) 1fr; gap: 18px; padding: 14px; border: 1px solid var(--line); border-radius: 6px; background: #f8faf9; }
.user-avatar { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; object-fit: cover; background: #fff; }
.user-avatar.large { width: 64px; height: 64px; }
.password-panel { max-width: 560px; }
.account-summary { display: flex; align-items: center; gap: 14px; padding-bottom: 20px; margin-bottom: 20px; border-bottom: 1px solid var(--line); }
.account-summary strong, .account-summary span { display: block; }
.account-summary span { color: var(--muted); margin-top: 2px; }
.password-form { max-width: 420px; }
.image-preview { display: grid; place-items: center; min-height: 180px; overflow: hidden; border: 1px dashed #bdc9c5; border-radius: 5px; background: #eef2f0; color: var(--muted); }
.image-preview.has-image { border-style: solid; }
.image-preview img { display: block; width: 100%; height: 100%; max-height: 240px; object-fit: contain; background: #fff; }
.image-editor { display: flex; min-width: 0; flex-direction: column; justify-content: center; gap: 12px; }
.image-editor small { color: var(--muted); line-height: 1.6; }
.image-actions, .crop-tools, .crop-submit { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.secondary, .crop-tools button { border: 1px solid #b8c5c1; background: #fff; color: var(--teal-dark); border-radius: 5px; padding: 9px 14px; cursor: pointer; }
.text-button { border: 0; background: transparent; color: var(--red); padding: 8px 6px; cursor: pointer; }
.image-list-uploader { display: grid; gap: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 6px; background: #f8faf9; }
.image-list-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.image-list-empty { display: grid; min-height: 160px; place-items: center; border: 1px dashed #bdc9c5; border-radius: 5px; color: var(--muted); }
.image-list-item { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 5px; background: #fff; }
.image-list-item img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.image-list-order { position: absolute; top: 8px; left: 8px; display: grid; width: 26px; height: 26px; place-items: center; border-radius: 50%; background: rgba(9, 39, 34, .82); color: #fff; font-size: 12px; font-weight: 700; }
.image-list-item-actions { display: flex; justify-content: center; border-top: 1px solid var(--line); }
.image-list-item-actions button { flex: 1; border: 0; border-right: 1px solid var(--line); padding: 8px 4px; background: #fff; color: var(--teal); cursor: pointer; }
.image-list-item-actions button:last-child { border-right: 0; }
.image-list-item-actions button:disabled { color: #aab3b0; cursor: default; }
.image-list-item-actions .danger-text { color: var(--red); }
.image-list-editor { display: flex; flex-direction: column; gap: 12px; }
.image-list-editor small { color: var(--muted); }
.image-url-add { display: grid; grid-template-columns: 1fr auto; gap: 8px; }

.article-content-editor { display: grid; gap: 12px; }
.article-content-editor textarea { min-height: 280px; line-height: 1.7; white-space: pre-wrap; }
.article-content-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.article-content-toolbar > button { flex: none; }
.article-content-url-add { display: grid; min-width: min(420px, 100%); flex: 1; grid-template-columns: 1fr auto; gap: 8px; }
.article-content-editor .field-hint { display: block; color: var(--muted); font-weight: 400; line-height: 1.6; }
.article-preview-dialog { width: min(1120px, calc(100% - 32px)); max-width: none; max-height: calc(100vh - 32px); padding: 0; overflow: hidden; border: 0; border-radius: 10px; background: #fff; box-shadow: 0 28px 90px rgba(5, 25, 21, .3); }
.article-preview-dialog::backdrop { background: rgba(10, 25, 22, .72); }
.article-preview-dialog-header, .article-preview-dialog > footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 20px; }
.article-preview-dialog-header { border-bottom: 1px solid var(--line); }
.article-preview-dialog-header h2, .article-preview-dialog-header p { margin: 0; }
.article-preview-dialog-header h2 { font-size: 20px; }
.article-preview-dialog-header p { margin-top: 4px; color: var(--muted); font-size: 13px; }
.article-preview-dialog > footer { justify-content: flex-end; border-top: 1px solid var(--line); background: #f8faf9; }
.article-preview-stage { display: grid; max-height: calc(100vh - 164px); place-items: start center; overflow: auto; padding: 28px; background: #e6ecea; }
.article-preview-phone { width: min(430px, 100%); min-height: 720px; overflow: hidden; border: 1px solid #cad5d1; border-radius: 24px; background: #fff; box-shadow: 0 18px 50px rgba(16, 44, 40, .2); }
.article-preview-navigation { display: grid; grid-template-columns: 62px minmax(0, 1fr) 62px; align-items: center; height: 54px; padding: 0 14px; border-bottom: 1px solid #edf0ef; background: #fff; text-align: center; }
.article-preview-navigation strong { overflow: hidden; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.article-preview-capsule { display: inline-flex; height: 28px; align-items: center; justify-content: center; border: 1px solid #d8dfdc; border-radius: 16px; color: #17211f; letter-spacing: 1px; }
.article-preview-page { min-height: 666px; background: #fff; }
.article-preview-page[hidden], .article-preview-wechat[hidden] { display: none; }
.article-preview-cover { position: relative; display: grid; height: 236px; place-items: center; overflow: hidden; background: #e9efed; color: #8a9793; }
.article-preview-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.article-preview-cover img[hidden] { display: none; }
.article-preview-cover.has-image > span { display: none; }
.article-preview-inner { padding: 20px 18px 38px; }
.article-preview-tag { display: inline-flex; align-items: center; padding: 4px 9px; border-radius: 4px; background: #e5f3ef; color: var(--teal-dark); font-size: 12px; font-weight: 700; }
.article-preview-inner h1 { margin: 13px 0; color: #1f2a28; font-size: 24px; font-weight: 800; line-height: 1.45; overflow-wrap: anywhere; }
.article-preview-meta { display: flex; flex-wrap: wrap; gap: 14px; color: #87928f; font-size: 12px; }
.article-preview-divider { height: 1px; margin: 18px 0; background: #e6ecea; }
.article-preview-inner video { display: block; width: 100%; max-height: 360px; margin-bottom: 18px; background: #111; }
.article-preview-inner video[hidden] { display: none; }
.article-preview-content { display: flex; flex-direction: column; gap: 14px; }
.article-preview-content p { margin: 0; white-space: pre-wrap; color: #1f2a28; font-size: 16px; line-height: 1.95; overflow-wrap: anywhere; }
.article-preview-content img { display: block; width: 100%; height: auto; border-radius: 6px; background: #eef2f0; }
.article-preview-content .article-preview-empty { padding: 34px 12px; color: var(--muted); text-align: center; }
.article-preview-wechat { min-height: 666px; padding: 80px 34px 50px; text-align: center; }
.article-preview-wechat-icon { display: grid; width: 80px; height: 80px; margin: 0 auto 24px; place-items: center; border-radius: 20px; background: #08c160; color: #fff; font-size: 17px; font-weight: 800; }
.article-preview-wechat h3 { margin: 0 0 12px; color: #1f2a28; font-size: 21px; }
.article-preview-wechat p { margin: 0; color: #52625e; line-height: 1.75; }
.article-preview-wechat span { display: block; margin-top: 22px; color: #87928f; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.video-uploader { display: grid; grid-template-columns: minmax(260px, 1.2fr) minmax(220px, .8fr); gap: 18px; align-items: start; }
.video-preview { display: grid; min-height: 210px; place-items: center; overflow: hidden; border: 1px dashed #b9c8c4; border-radius: 6px; background: #f4f7f6; }
.video-preview.has-video { border-style: solid; background: #101817; }
.video-preview video { display: block; width: 100%; max-height: 420px; background: #000; }
.video-preview video[hidden] { display: none; }
.video-empty { color: var(--muted); }
.video-actions { display: flex; flex-direction: column; gap: 10px; }
.video-actions small, .field > small { color: var(--muted); font-weight: 400; line-height: 1.6; }
.settings-note { padding: 16px 18px; border-left: 3px solid var(--teal); background: #f2f7f5; }
.settings-note p { margin: 6px 0 0; color: var(--muted); line-height: 1.65; }
.secret-state { display: inline-flex; width: max-content; flex-shrink: 0; margin-left: 8px; padding: 2px 7px; border-radius: 4px; background: #f4e9e6; color: var(--red); font-size: 12px; font-style: normal; font-weight: 700; white-space: nowrap; word-break: keep-all; }
.secret-state.configured { background: #e5f3ef; color: var(--teal); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.page-resource-link { min-width: 120px; text-align: center; }
.page-settings-form { padding-bottom: 82px; }
.page-setting-section { padding: 0; overflow: hidden; }
.page-setting-section > .panel-title { padding: 20px 22px 16px; border-bottom: 1px solid var(--line); background: #f8faf9; }
.page-setting-section > .panel-title h2, .page-setting-section > .panel-title p { margin: 0; }
.page-setting-section > .panel-title p { color: var(--muted); }
.page-setting-section > .edit-form { padding: 22px; }
.settings-fieldset { min-width: 0; margin: 0; padding: 16px; border: 1px solid var(--line); border-radius: 6px; }
.settings-fieldset > legend { padding: 0 7px; font-weight: 700; }
.object-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ordered-list-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 14px; }
.ordered-list-heading strong, .ordered-list-heading small { display: block; }
.ordered-list-heading small { margin-top: 2px; color: var(--muted); font-weight: 400; }
.compact-button { min-width: 88px; min-height: 38px; flex: none; padding: 7px 12px; }
.ordered-list { display: grid; gap: 9px; }
.ordered-list-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 5px; background: #fff; }
.ordered-list-index { display: inline-grid; width: 30px; height: 30px; place-items: center; border-radius: 4px; background: #e8f1ee; color: var(--teal-dark); font-weight: 750; }
.ordered-list-actions { display: flex; align-items: center; gap: 6px; }
.ordered-list-actions button { min-width: 54px; min-height: 34px; border: 1px solid #c6d1ce; border-radius: 4px; background: #f8faf9; color: var(--teal-dark); cursor: pointer; }
.ordered-list-actions button:hover:not(:disabled) { border-color: var(--teal); background: #edf5f2; }
.ordered-list-actions button:disabled { color: #aab3b0; cursor: default; opacity: .68; }
.ordered-list-actions .danger-text { color: var(--red); }
.object-list-row { align-items: start; }
.object-list-row .ordered-list-actions { min-height: 42px; align-self: end; }
.member-level-row { grid-template-columns: 34px minmax(220px, 1fr) auto auto; align-items: end; }
.member-level-row > .ordered-list-index { align-self: center; }
.member-level-enabled { min-height: 42px; align-self: end; padding: 0 8px; white-space: nowrap; }
.object-list-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.compact-field { min-width: 0; }
.boolean-field { display: flex; min-height: 40px; align-items: center; gap: 8px; align-self: end; }
.boolean-field input[type="checkbox"] { width: 18px; height: 18px; flex: none; margin: 0; }
.settings-boolean-field { align-items: flex-start; gap: 12px; padding: 16px; border: 1px solid var(--border); border-radius: 6px; background: #f8fbfa; }
.settings-boolean-field input[type="checkbox"] { margin-top: 2px; }
.settings-boolean-field > span { display: grid; gap: 4px; }
.settings-boolean-field small { color: var(--muted); font-weight: 400; line-height: 1.6; }
.sticky-save-bar { position: sticky; z-index: 20; bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 13px 16px; border: 1px solid #b9cec8; border-radius: 6px; background: rgba(255, 255, 255, .96); box-shadow: 0 12px 34px rgba(18, 47, 42, .16); backdrop-filter: blur(8px); }
.sticky-save-bar span { color: var(--muted); }
.sticky-save-bar .primary { min-width: 150px; }
.secret-field { min-width: 0; }
.secret-field-label { display: flex; min-height: 29px; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.secret-field-label > span { font-weight: 650; }
.secret-field-label .secret-state { margin-left: 0; }
.secret-field-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; gap: 8px; }
.setting-field-form { min-width: 0; margin: 0; }
.setting-field-form > span { display: block; margin-bottom: 6px; font-weight: 650; }
.setting-field-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; gap: 8px; }
.setting-save-button { min-width: 72px; min-height: 40px; }
.secret-field-control textarea { grid-column: 1 / -1; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; overflow-wrap: anywhere; }
.secret-field-actions { display: flex; align-items: stretch; justify-content: flex-end; gap: 8px; }
.secret-field-control textarea + .secret-field-actions { grid-column: 1 / -1; }
.secret-reveal-button { min-width: 72px; min-height: 40px; }
.secret-dialog { width: min(620px, calc(100% - 32px)); }
.secret-dialog-error { padding: 9px 11px; border-radius: 4px; background: #fbe9e7; color: #8c2d25 !important; }
.secret-result textarea { min-height: 180px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; line-height: 1.55; overflow-wrap: anywhere; word-break: break-all; white-space: pre-wrap; }
.secret-result small { display: block; margin-top: 5px; }
.shipping-dialog { width: min(640px, calc(100% - 32px)); }
.shipping-info { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 10px 16px; padding: 20px 22px; }
.shipping-info dt { color: var(--muted); font-weight: 700; }
.shipping-info dd { margin: 0; min-width: 0; white-space: normal; overflow-wrap: anywhere; }

.crop-modal { position: fixed; z-index: 1000; inset: 0; display: grid; place-items: center; padding: 24px; background: rgba(10, 25, 22, .72); }
.crop-modal[hidden] { display: none; }
.crop-dialog { display: flex; width: min(1040px, 100%); max-height: calc(100vh - 48px); flex-direction: column; overflow: hidden; border-radius: 7px; background: #fff; box-shadow: 0 24px 80px rgba(0, 0, 0, .32); }
.crop-dialog > header, .crop-dialog > footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 20px; }
.crop-dialog > header { border-bottom: 1px solid var(--line); }
.crop-dialog > header h2, .crop-dialog > header p { margin: 0; }
.crop-dialog > header p { color: var(--muted); }
.modal-close { width: 38px; height: 38px; border: 0; background: #edf2f0; color: var(--ink); border-radius: 50%; font-size: 24px; cursor: pointer; }
.crop-stage { min-height: 360px; height: min(62vh, 680px); padding: 16px; background: #17211f; }
.crop-stage img { display: block; max-width: 100%; max-height: 100%; }
.crop-dialog > footer { border-top: 1px solid var(--line); }
.crop-submit { justify-content: flex-end; }
.crop-submit .primary:disabled { opacity: .65; cursor: wait; }

.login-page { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #102c28 0 45%, #f3f6f4 45%); }
.login-panel { width: min(430px, calc(100% - 32px)); background: #fff; padding: 36px; border-radius: 8px; box-shadow: 0 24px 70px rgba(0, 0, 0, .2); }
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.login-brand-logo { width: 58px; height: 58px; border-color: #dbe5e2; }
.login-brand h1 { font-size: 21px; margin: 0; }
.login-brand p { color: var(--muted); margin: 2px 0; }
.stack-form { display: grid; gap: 16px; }
.stack-form label { font-weight: 650; }
.stack-form input { margin-top: 6px; }
.captcha-row { display: grid; grid-template-columns: 1fr 150px auto; align-items: center; gap: 8px; margin-top: 6px; }
.captcha-row input { margin-top: 0; }
.captcha-row img { width: 150px; height: 56px; border: 1px solid var(--line); border-radius: 5px; }
.inline-details { position: relative; }
.inline-details summary, .create-box summary { color: var(--teal); cursor: pointer; }
.inline-form { position: absolute; z-index: 10; top: 30px; right: 0; display: grid; width: 280px; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: 6px; background: #fff; box-shadow: var(--shadow); }
.create-box { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.compact-form { margin-top: 16px; }
.admin-two-column { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.muted-copy { color: var(--muted); }
.points-up { color: var(--teal); font-weight: 700; }
.points-down { color: var(--red); font-weight: 700; }
.error-page { min-height: 100vh; display: grid; place-content: center; text-align: center; }
.error-page strong { font-size: 80px; color: var(--teal); }
.error-page .primary { margin: 20px auto; }

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

@media (max-width: 760px) {
  .sidebar { position: static; width: auto; padding: 18px 16px; }
  .brand { padding-bottom: 18px; }
  .sidebar nav { display: grid; width: 100%; overflow: visible; padding: 12px 0 6px; }
  .nav-dashboard { margin-bottom: 4px; }
  .nav-submenu { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav-link { min-width: 0; }
  .logout { margin-top: 10px; }
  .admin-main { margin-left: 0; padding: 20px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .page-header { align-items: flex-start; flex-direction: column; }
  .edit-form { grid-template-columns: 1fr; }
  .location-control-row { grid-template-columns: 1fr; }
  .location-picker-body { padding: 12px; }
  .location-picker-toolbar { grid-template-columns: minmax(0, 1fr) auto; }
  .location-picker-region-field { grid-column: 1 / -1; grid-row: 2; }
  .location-picker-workspace { min-height: 0; grid-template-columns: 1fr; }
  .location-picker-map { min-height: 330px; }
  .location-picker-results { max-height: 260px; border-top: 1px solid var(--line); border-left: 0; }
  .span-2 { grid-column: auto; }
  .image-uploader { grid-template-columns: 1fr; }
  .video-uploader { grid-template-columns: 1fr; }
  .image-preview { min-height: 150px; }
  .image-list-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .image-url-add { grid-template-columns: 1fr; }
  .article-content-url-add { grid-template-columns: 1fr; }
  .article-content-url-add { width: 100%; }
  .form-actions { align-items: stretch; flex-direction: column; }
  .article-preview-button { margin-right: 0; }
  .article-preview-dialog { width: calc(100% - 16px); max-height: calc(100vh - 16px); }
  .article-preview-dialog-header { align-items: flex-start; }
  .article-preview-dialog-header p { display: none; }
  .article-preview-stage { max-height: calc(100vh - 142px); padding: 10px; }
  .article-preview-phone { min-height: 640px; border-radius: 16px; }
  .article-preview-cover { height: 210px; }
  .article-preview-dialog > footer .primary { width: 100%; }
  .crop-dialog > footer { align-items: stretch; flex-direction: column; }
  .crop-submit .primary { flex: 1; }
  .crop-stage { min-height: 260px; height: 50vh; }
  .captcha-row { grid-template-columns: 1fr 130px; }
  .captcha-row img { width: 130px; }
  .captcha-row .secondary { grid-column: 1 / -1; }
  .admin-two-column { grid-template-columns: 1fr; }
  .overview-grid { grid-template-columns: 1fr; }
  .page-settings-form { padding-bottom: 64px; }
  .page-setting-section > .panel-title, .page-setting-section > .edit-form { padding: 17px; }
  .object-field-grid, .object-list-fields { grid-template-columns: 1fr; }
  .ordered-list-heading { align-items: flex-start; }
  .ordered-list-row { grid-template-columns: 34px minmax(0, 1fr); }
  .ordered-list-actions { grid-column: 2; justify-content: flex-end; flex-wrap: wrap; }
  .object-list-row .ordered-list-actions { grid-column: 1 / -1; }
  .member-level-row { grid-template-columns: 34px minmax(0, 1fr); }
  .member-level-enabled { grid-column: 2; justify-self: start; }
  .member-level-row .ordered-list-actions { grid-column: 2; }
  .sticky-save-bar { bottom: 8px; align-items: stretch; flex-direction: column; gap: 9px; }
  .sticky-save-bar .primary { width: 100%; }
  .secret-field-control { grid-template-columns: 1fr; }
  .setting-field-control { grid-template-columns: 1fr; }
  .setting-save-button { width: 100%; }
  .secret-field-actions { flex-direction: column; }
  .secret-reveal-button { width: 100%; }
}

.settings-test-form { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.settings-test-action { display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; gap: 8px; }
.settings-test-action > span { width: 100%; }
.sms-settings-panel { margin-top: 20px; }
