:root{--bg:#f5f2ec;--panel:#fff;--ink:#29231f;--muted:#83786d;--line:#e8dfd2;--gold:#8b6a3e;--gold-dark:#73552f;--soft:#faf7f1;--danger:#a84535}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--ink);font:15px Arial,"Microsoft YaHei",sans-serif}
button,input,select,textarea{font:inherit}
button{background:var(--gold);color:#fff;border:0;border-radius:4px;padding:10px 16px;cursor:pointer}
button:hover{background:var(--gold-dark)}
button.secondary{background:#eee5d8;color:#5b4730}
button.danger{background:var(--danger)}
input,select,textarea{display:block;width:100%;padding:11px 12px;margin:8px 0 14px;border:1px solid #ddd3c5;border-radius:4px;background:#fff;color:var(--ink)}
textarea{min-height:110px;resize:vertical}
h1,h2,p{margin-top:0}
h1{font-family:Georgia,"Times New Roman",serif}
h2{font-size:22px;margin-bottom:6px}
#app{min-height:100vh}
.login-card{max-width:420px;margin:80px auto;background:var(--panel);padding:30px;border-radius:8px;box-shadow:0 18px 48px #00000012}
.admin-shell{display:grid;grid-template-columns:240px 1fr;min-height:100vh;background:transparent}
.sidebar{background:#2d2721;color:#fff;padding:26px 20px}
.brand h1{font-size:24px;margin-bottom:8px}
.brand p{color:#cbbca9;font-size:13px}
.side-nav{display:flex;flex-direction:column;gap:8px;margin-top:28px}
.side-nav button{width:100%;text-align:left;background:transparent;color:#e9dfd2;border:1px solid transparent}
.side-nav button:hover,.side-nav button.active{background:#3c332a;border-color:#6a5842}
.workspace{padding:24px;min-width:0}
.topbar{display:flex;justify-content:space-between;align-items:center;gap:16px;background:var(--panel);border:1px solid var(--line);border-radius:8px;padding:14px 18px;margin-bottom:20px}
.topbar strong,.topbar span{display:block}
.topbar span{color:var(--muted);font-size:13px;margin-top:3px}
.account-actions{display:flex;gap:8px;flex-wrap:wrap}
#content{background:var(--panel);border:1px solid var(--line);border-radius:8px;padding:22px;min-height:calc(100vh - 118px)}
.page-head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;margin-bottom:18px}
.page-head.compact{margin-bottom:14px}
.page-head p{color:var(--muted);font-size:13px;margin-bottom:0}
.count,.page-head span{color:var(--gold);font-size:13px}
.item{border:1px solid var(--line);padding:16px;margin:12px 0;border-radius:6px;background:#fff}
.item-head{display:flex;justify-content:space-between;gap:12px}
.item-head span,.muted{color:var(--muted);font-size:13px}
.empty{padding:24px;color:var(--muted);background:var(--soft);border:1px dashed #decfb9;border-radius:6px}
.cms-layout{display:grid;grid-template-columns:360px 1fr;gap:22px}
.cms-list{min-width:0;border-right:1px solid var(--line);padding-right:22px}
.cms-editor{min-width:0}
.cms-filters{display:grid;grid-template-columns:120px 1fr;gap:10px}
.article-list{display:flex;flex-direction:column;gap:10px;max-height:720px;overflow:auto;padding-right:4px}
.article-row{width:100%;text-align:left;background:#fff;color:var(--ink);border:1px solid var(--line);border-radius:6px;padding:14px;margin:0}
.article-row:hover,.article-row.selected{background:var(--soft);border-color:#cdb78f}
.row-title{display:block;font-weight:700;margin-bottom:8px;line-height:1.45}
.row-meta{display:block;color:var(--muted);font-size:13px}
.form-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px 14px}
label{font-size:13px;color:#6b625a}
.excerpt-input{min-height:74px}
.editor-card{border:1px solid #d9cdbd;border-radius:6px;overflow:hidden;margin:8px 0 16px;background:#fff;box-shadow:0 5px 18px #46351e0a}
.editor-toolbar{display:flex;align-items:center;gap:0;flex-wrap:wrap;padding:7px;background:#f6f1e9;border-bottom:1px solid var(--line);position:sticky;top:0;z-index:2}
.tool-group{display:flex;align-items:center;gap:4px;padding:3px 8px;border-right:1px solid #ded3c4}
.tool-group:first-child{padding-left:3px}
.tool-group-end{margin-left:auto;border-right:0}
.editor-toolbar button,.editor-toolbar select,.color-tool{height:32px;background:#fff;color:#4f4234;border:1px solid #d9cdbd;border-radius:4px;padding:0 9px;margin:0;font-size:12px;line-height:30px;white-space:nowrap}
.editor-toolbar button:hover,.editor-toolbar select:hover,.color-tool:hover{background:#fffaf2;border-color:#bca174;color:#6e4f28}
.editor-toolbar button:disabled,.editor-toolbar select:disabled,.color-tool:has(input:disabled){opacity:.42;cursor:not-allowed;background:#eee9e1}
.editor-toolbar select{display:block;width:auto;min-width:104px;cursor:pointer}
.editor-toolbar .tool-strong{font-weight:800;font-size:15px}
.editor-toolbar .tool-italic{font-family:Georgia,serif;font-size:15px;font-style:italic}
.editor-toolbar .tool-underline{text-decoration:underline;font-size:15px}
.editor-toolbar .tool-strike{text-decoration:line-through;font-size:15px}
.color-tool{display:inline-flex;align-items:center;gap:5px;cursor:pointer}
.color-tool input{display:block;width:17px;height:17px;padding:0;margin:0;border:0;border-radius:2px;background:none;cursor:pointer}
#imageUpload[hidden]{display:none}
.editor-surface{background:#ebe6de;padding:18px;max-height:610px;overflow:auto}
.rich-editor,.html-editor{width:min(820px,100%);min-height:520px;margin:0 auto;padding:54px 62px;border:1px solid #ded7cc;background:#fff;box-shadow:0 3px 15px #2e241713;outline:none;line-height:1.9;font:16px/1.9 Georgia,"Noto Serif SC","Microsoft YaHei",serif;color:#2c2925}
.html-editor{display:block;resize:none;border-radius:0;font:14px/1.7 Consolas,"SFMono-Regular",monospace;color:#243447;tab-size:2}
.html-editor[hidden],.rich-editor[hidden]{display:none}
.rich-editor:empty:before{content:attr(data-placeholder);color:#aaa}
.rich-editor h2{font-size:24px;margin:24px 0 12px}
.rich-editor h3{font-size:19px;margin:20px 0 10px}
.rich-editor h4{font-size:17px;margin:18px 0 8px}
.rich-editor p{margin:0 0 16px}
.rich-editor blockquote{margin:18px 0;padding:14px 18px;border-left:4px solid var(--gold);background:var(--soft);color:#5f564c}
.rich-editor ul,.rich-editor ol{padding-left:24px}
.rich-editor hr{border:0;border-top:1px solid #e7dccd;margin:24px 0}
.rich-editor a{color:#8a5d24;text-decoration:underline;text-underline-offset:3px}
.rich-editor figure{margin:24px 0;text-align:center}
.rich-editor figure img,.rich-editor>img{max-width:100%;height:auto;border-radius:3px}
.rich-editor figcaption{margin-top:8px;color:var(--muted);font-size:13px}
.rich-editor table{width:100%;border-collapse:collapse;margin:22px 0;font-family:Arial,"Microsoft YaHei",sans-serif;font-size:14px}
.rich-editor th,.rich-editor td{min-width:70px;border:1px solid #d9cdbd;padding:9px 10px;text-align:left}
.rich-editor th{background:#f6f1e9;font-weight:700}
.rich-editor pre{overflow:auto;padding:16px;background:#26231f;color:#f7f2ea;border-radius:4px;font:13px/1.7 Consolas,monospace;white-space:pre-wrap}
.editor-status{display:flex;align-items:center;gap:16px;min-height:34px;padding:7px 12px;border-top:1px solid var(--line);background:#faf8f4;color:var(--muted);font-size:12px}
.editor-status #uploadStatus{color:var(--gold-dark)}
.editor-status #wordCount{margin-left:auto}
.editor-fullscreen{position:fixed;inset:0;z-index:50;margin:0;border:0;border-radius:0;display:flex;flex-direction:column;background:#ebe6de}
.editor-fullscreen .editor-toolbar{flex:0 0 auto}
.editor-fullscreen .editor-surface{flex:1;max-height:none}
.editor-fullscreen .rich-editor,.editor-fullscreen .html-editor{min-height:calc(100vh - 125px)}
.editor-is-fullscreen{overflow:hidden}
.editor-dialog-overlay{position:fixed;inset:0;background:#0008;display:grid;place-items:center;padding:20px;z-index:70}
.editor-dialog-overlay[hidden]{display:none}
.editor-dialog{width:min(520px,100%);padding:22px;background:#fff;border-radius:8px;box-shadow:0 24px 70px #0005}
.dialog-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:16px}
.dialog-head h3{margin:0;font-size:19px}
.dialog-close{width:32px;height:32px;padding:0;border-radius:50%;background:#eee5d8;color:#5b4730;font-size:21px;line-height:30px}
.dialog-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.check-label{display:flex;align-items:center;gap:9px;margin:8px 0 18px}
.check-label input{display:inline-block;width:16px;height:16px;margin:0;padding:0}
.dialog-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:18px}
.actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.modal{position:fixed;inset:0;background:#0008;display:grid;place-items:center;padding:20px;z-index:20}
.modal[hidden]{display:none}
.modal-card{width:min(460px,100%);background:#fff;border-radius:8px;padding:24px;box-shadow:0 24px 70px #0005}
@media(max-width:980px){.admin-shell{grid-template-columns:1fr}.sidebar{padding:18px}.side-nav{flex-direction:row;margin-top:16px}.workspace{padding:14px}.cms-layout{grid-template-columns:1fr}.cms-list{border-right:0;border-bottom:1px solid var(--line);padding-right:0;padding-bottom:18px}.form-grid,.cms-filters{grid-template-columns:1fr}.topbar{align-items:flex-start;flex-direction:column}.article-list{max-height:none}.tool-group-end{margin-left:0}.editor-surface{padding:8px}.rich-editor,.html-editor{min-height:440px;padding:28px 22px}.editor-toolbar{align-items:flex-start;flex-wrap:nowrap;overflow-x:auto}.tool-group{flex:0 0 auto}.dialog-grid{grid-template-columns:1fr}}
