:root { --bg: #f5f6f3; --ink: #24342c; --ink-soft: #67736b; --line: #dce2db; --seal: #a93629; --card: #fff; }
* { box-sizing: border-box; letter-spacing: 0; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.6 'PingFang SC', 'Microsoft YaHei', sans-serif; }
button, input, textarea, select { font: inherit; }
button, .ghost-link { border: 1px solid var(--line); border-radius: 4px; background: white; color: var(--ink); padding: 9px 14px; cursor: pointer; text-decoration: none; text-align: center; }
button:hover, .ghost-link:hover { background: #eaf0e8; border-color: #9cac9b; }
button:disabled { opacity: .45; cursor: not-allowed; }
button.primary { background: var(--seal); border-color: var(--seal); color: white; }
input, textarea, select { width: 100%; border: 1px solid #cbd4c8; border-radius: 4px; padding: 10px 12px; color: var(--ink); background: white; min-width: 0; }
input[type='checkbox'] { width: 18px; height: 18px; accent-color: #264d42; }
input[type='color'] { width: 60px; height: 40px; padding: 4px; }
input[type='file'] { font-size: 12px; }
textarea { min-height: 110px; resize: vertical; }
:focus-visible { outline: 2px solid #47775b; outline-offset: 3px; }
[hidden] { display: none !important; }
.admin-shell { display: grid; grid-template-columns: 268px minmax(0, 1fr); min-height: 100vh; }
.admin-sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 28px 22px; border-right: 1px solid var(--line); background: #eef1e9; display: grid; gap: 26px; align-content: start; }
.admin-sidebar h1 { font-size: 23px; margin: 0; font-weight: 600; }
.admin-sidebar h2 { font-size: 14px; margin: 0; }
.eyebrow { margin: 0 0 8px; text-transform: uppercase; color: var(--seal); font-size: 11px; }
.sidebar-panel { display: grid; gap: 12px; padding-top: 20px; border-top: 1px solid var(--line); }
label { display: grid; gap: 6px; }
.small-panel { position: sticky; bottom: -28px; background: #eef1e9; padding-bottom: 24px; }
.admin-main { padding: 36px 5%; min-width: 0; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding-bottom: 28px; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.toolbar h2 { margin: 0; font-size: 28px; }
.save-state { color: var(--seal); font-size: 13px; max-width: 420px; }
.editor-card { margin-bottom: 24px; }
.card-head { padding: 14px 0; font-weight: 600; cursor: pointer; }
.card-head h3 { margin: 0; font-size: 15px; }
.page-meta-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; padding-block: 22px; border-bottom: 1px solid var(--line); }
.module-list { display: grid; gap: 12px; }
.module-card { background: white; border: 1px solid var(--line); border-radius: 6px; padding: 0 22px; scroll-margin-top: 20px; }
.module-head { cursor: pointer; padding: 22px 0; display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.module-head::after { content: '+'; margin-left: auto; font-size: 22px; }
.module-card[open] > .module-head::after { content: '\2212'; }
.module-head span { color: var(--ink-soft); font-size: 12px; max-width: 55%; overflow-wrap: anywhere; }
.module-controls, .mini-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding-block: 12px; }
.module-controls { border-block: 1px solid var(--line); margin-bottom: 22px; }
.toggle { display: flex; gap: 6px; align-items: center; margin-right: auto; }
.field { display: grid; gap: 8px; margin-bottom: 20px; min-width: 0; }
.field > label, .field > span { font-size: 12px; font-weight: 600; color: #4e5b51; }
.list-field { border-top: 1px solid var(--line); padding-top: 20px; }
.list-stack { display: grid; gap: 16px; }
.list-object, .list-item { border-left: 2px solid #bdcbbb; padding: 12px 0 12px 18px; }
.list-item { display: grid; gap: 8px; }
.asset-preview { width: 100%; max-width: 360px; height: 210px; object-fit: contain; background: #edf0e9; border: 1px solid var(--line); }
.media-field > button { justify-self: start; }
.media-field > span[role='status'] { font-weight: 400; color: var(--seal); }
.upload-result { overflow-wrap: anywhere; font-size: 12px; color: var(--ink-soft); }
#upload-form { display: grid; gap: 10px; }
.admin-login-shell { display: grid; grid-template-columns: 1fr; place-items: center; padding: 24px; }
.login-card { width: min(440px, 100%); padding: 36px; background: white; border: 1px solid var(--line); border-radius: 6px; }
.login-card h1 { font-size: 28px; margin: 0 0 28px; }
.login-form { display: grid; gap: 20px; }
.notice { margin-block: 16px; padding: 12px; border-left: 3px solid var(--seal); color: #842d24; background: #f7eae5; }
@media (max-width: 900px) { .admin-shell { grid-template-columns: 220px minmax(0, 1fr); } .admin-sidebar { padding-inline: 16px; } .page-meta-grid { grid-template-columns: 1fr; } .toolbar { align-items: start; flex-direction: column; } }
@media (max-width: 620px) { .admin-shell { display: block; } .admin-login-shell { display: grid; } .admin-sidebar { position: static; height: auto; padding: 22px; } .sidebar-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; } .sidebar-panel h2, #upload-form, #upload-result { grid-column: 1 / -1; } .small-panel { position: static; } .admin-main { padding: 26px 18px; } .module-card { padding-inline: 16px; } .module-head span { max-width: 100%; } .module-controls button { padding-inline: 9px; } }.list-object>summary{cursor:pointer;font-weight:600;padding:12px 0;overflow-wrap:anywhere}.list-object[open]>summary{margin-bottom:16px;border-bottom:1px solid #ddd}.list-object .list-object{background:rgba(130,110,80,.035)}

/* Maintenance tasks stay visible; publishing is separate from editing. */
.editor-fields { padding: 0; margin: 0; min-width: 0; border: 0; }
.toolbar { position: sticky; top: 0; z-index: 10; background: var(--bg); padding: 18px 0; margin-top: -18px; gap: 16px; }
.toolbar h2 { font-size: 24px; }
.publish-actions, .page-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.page-actions { justify-content: space-between; margin-bottom: 18px; }
.page-actions a { color: var(--ink); text-underline-offset: 4px; }
.editing-context { font-size: 14px; color: var(--ink-soft); }
.field-help { font-size: 13px; line-height: 1.8; color: var(--ink-soft); margin: 4px 0 12px; font-weight: 400; }
.module-card > .field-help { margin-bottom: 20px; }
.task-links button { text-align: left; }
.sidebar-panel > summary { cursor: pointer; }
.advanced-fields { font-size: 13px; padding: 12px 0; border-top: 1px solid var(--line); }
.advanced-fields > summary { cursor: pointer; color: var(--ink-soft); margin-bottom: 10px; }
.advanced-fields > input { margin-top: 8px; }
.field > label { font-size: 14px; }
.field input[readonly] { color: var(--ink-soft); background: var(--bg); }
.module-head { gap: 10px; }
.module-head strong { font-size: 15px; }
.book-choices { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.book-choices label { overflow-wrap: anywhere; align-items: start; }
.book-choices input { flex-shrink: 0; }
.asset-document { height: auto; padding: 14px; font-size: 14px; }
.asset-preview { max-width: 460px; }
.media-status { overflow-wrap: anywhere; }
#editor-status { position: sticky; top: 100px; z-index: 11; background: #e8f0e5; color: #264d42; border-color: #47775b; }
#editor-status.error { background: #f9e9e6; color: #842d24; border-color: #a93629; }
#article-management { background: white; padding: 22px; border: 1px solid var(--line); border-radius: 6px; }
@media (max-width: 900px) { .toolbar { flex-direction: column; align-items: stretch; } #editor-status { top: 154px; } }
@media (max-width: 620px) {
 .sidebar-panel { display: block; } .sidebar-panel > * { margin-bottom: 10px; }
 .task-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
 .task-links h2 { grid-column: 1/-1; }
 .task-links button { padding: 10px; font-size: 13px; margin: 0; }
 .book-choices { grid-template-columns: 1fr; }
 .publish-actions button { flex: 1; padding-inline: 8px; }
 .toolbar h2 { font-size: 21px; } .page-actions { align-items: start; flex-direction: column; }
 .module-controls { gap: 8px; } .module-head strong, .module-head span { max-width: 100%; }
}

.module-card, .list-object, #article-management { scroll-margin-top: 180px; }
.small-panel { position: static; padding-bottom: 0; }
.asset-upload-button { justify-self: start; border-color: #53755e; color: #264d42; min-width: 140px; }
.quick-help { color: #264d42; font-size: 13px; text-underline-offset: 4px; }
.admin-learning { display: grid; gap: 4px; }
.admin-learning > a, .learning-downloads a { display: inline-flex; align-items: center; min-height: 36px; }
.learning-downloads { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.learning-downloads a { font-size: 13px; color: #264d42; text-underline-offset: 4px; }
@media (pointer: coarse) { .admin-learning > a, .learning-downloads a { min-height: 44px; } }
.contact-sync { margin-bottom: 20px; }
.mobile-editor-link { display: none; }
#editor { scroll-margin-top: 12px; }
.field { scroll-margin-top: 180px; }
@media (max-width: 620px) {
 .mobile-editor-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); text-underline-offset: 4px; }
 input, textarea, select { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
