:root {
  color-scheme: light;
  --ink: #10231d;
  --muted: #607069;
  --forest: #0b3b30;
  --forest-2: #155447;
  --cream: #f4f0e7;
  --paper: #fffdf8;
  --gold: #d8a765;
  --line: #dfe4df;
  --danger: #a83b35;
  --shadow: 0 20px 55px rgba(16, 35, 29, .1);
  font-family: Inter, "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--cream); color: var(--ink); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.eyebrow { margin: 0 0 12px; color: var(--gold); font-size: 12px; font-weight: 800; letter-spacing: .16em; }
.brand-mark { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--paper); color: var(--forest); font: 800 14px/1 Georgia, serif; border: 1px solid rgba(16,35,29,.12); }
.button { min-height: 44px; padding: 0 20px; border: 0; border-radius: 12px; cursor: pointer; font-weight: 750; }
.button--primary { background: var(--forest); color: white; box-shadow: 0 8px 20px rgba(11,59,48,.18); }
.button--primary:hover { background: var(--forest-2); }
.button--wide { width: 100%; }
.text-button { padding: 6px 0; border: 0; background: transparent; color: #dce8e3; cursor: pointer; text-align: left; }
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(420px, .9fr); background: var(--forest); }
.auth-brand { display: flex; flex-direction: column; justify-content: center; padding: clamp(48px, 8vw, 128px); color: white; background: radial-gradient(circle at 20% 15%, rgba(216,167,101,.2), transparent 28%), var(--forest); }
.auth-brand h1 { max-width: 720px; margin: 40px 0 24px; font: 500 clamp(48px, 6vw, 88px)/1.02 Georgia, "Times New Roman", serif; letter-spacing: -.045em; }
.auth-brand p:last-child { max-width: 580px; color: #d5e1dc; font-size: 18px; line-height: 1.8; }
.auth-card { align-self: center; margin: 48px clamp(32px, 8vw, 100px); padding: clamp(32px, 5vw, 58px); border-radius: 28px; background: var(--paper); box-shadow: var(--shadow); }
.auth-card h2 { margin: 0 0 10px; font: 600 34px/1.2 Georgia, serif; }
.auth-card > div > p:last-child, .auth-card > small { color: var(--muted); }
.auth-card form { display: grid; gap: 20px; margin: 34px 0 24px; }
.auth-card label { display: grid; gap: 9px; font-weight: 700; }
input, select { width: 100%; min-height: 44px; padding: 0 13px; border: 1px solid #cbd4ce; border-radius: 10px; background: white; color: var(--ink); outline: none; }
textarea { width: 100%; padding: 12px 13px; border: 1px solid #cbd4ce; border-radius: 10px; background: white; color: var(--ink); font: inherit; line-height: 1.55; resize: vertical; outline: none; }
input:focus, select:focus { border-color: var(--forest-2); box-shadow: 0 0 0 3px rgba(21,84,71,.12); }
textarea:focus { border-color: var(--forest-2); box-shadow: 0 0 0 3px rgba(21,84,71,.12); }
.form-error { min-height: 22px; margin: 0; color: var(--danger); font-size: 14px; }
.boot-screen { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 16px; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 260px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 28px 20px; background: var(--forest); color: white; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; color: white; text-decoration: none; }
.sidebar-brand strong, .sidebar-brand small { display: block; }
.sidebar-brand small { margin-top: 3px; color: #9fb7ae; font-size: 11px; letter-spacing: .05em; }
.sidebar nav { display: grid; gap: 8px; margin-top: 58px; }
.nav-item { padding: 13px 15px; border-radius: 10px; color: #bcd0c9; text-decoration: none; font-weight: 700; }
.nav-item:hover, .nav-item.is-active { color: white; background: rgba(255,255,255,.1); }
.sidebar-foot { display: grid; margin-top: auto; padding: 18px 14px 0; border-top: 1px solid rgba(255,255,255,.14); }
.sidebar-foot small { color: #9fb7ae; margin: 4px 0 10px; }
.workspace { min-width: 0; padding: clamp(28px, 4vw, 64px); }
.dashboard-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.dashboard-heading h1 { margin: 0 0 9px; font: 600 clamp(34px, 4vw, 50px)/1.1 Georgia, serif; }
.dashboard-heading p:last-child { margin: 0; color: var(--muted); }
.metric-grid { display: grid; grid-template-columns: repeat(5, minmax(120px, 1fr)); gap: 14px; margin: 34px 0; }
.metric-grid article { min-height: 116px; padding: 21px; border-radius: 16px; background: rgba(255,253,248,.7); border: 1px solid rgba(16,35,29,.08); }
.metric-grid span { display: block; color: var(--muted); font-size: 13px; }
.metric-grid strong { display: block; margin-top: 16px; font: 600 32px/1 Georgia, serif; }
.panel { border-radius: 18px; background: var(--paper); box-shadow: 0 8px 30px rgba(16,35,29,.06); border: 1px solid rgba(16,35,29,.08); overflow: hidden; }
.filter-bar { display: grid; grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(140px, .35fr)); gap: 10px; padding: 18px; border-bottom: 1px solid var(--line); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 900px; }
th, td { padding: 17px 18px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: 12px; letter-spacing: .04em; background: #faf8f2; }
td { font-size: 14px; }
td:first-child { min-width: 260px; }
td small { display: block; margin-top: 5px; color: var(--muted); }
.article-link { padding: 0; border: 0; background: transparent; color: var(--forest); cursor: pointer; font-weight: 800; text-align: left; }
.article-link:hover { text-decoration: underline; }
.status { display: inline-flex; padding: 5px 9px; border-radius: 99px; background: #ecefeb; color: #46564f; font-size: 12px; font-weight: 800; }
.status--in_review { background: #fff0d8; color: #85561e; }
.status--returned { background: #fbe2df; color: #8e332e; }
.status--approved, .status--published { background: #dceee7; color: #155447; }
.empty-state, .loading-state { padding: 50px; color: var(--muted); text-align: center; }
.error-panel { padding: 40px; color: var(--danger); }
.button--secondary { background: white; color: var(--forest); border: 1px solid #b9c8c1; }
.icon-button { width: 44px; height: 44px; border-radius: 50%; border: 1px solid #cbd4ce; background: var(--paper); color: var(--forest); cursor: pointer; font-size: 22px; }
.editor-page { min-width: 0; }
.editor-header { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 18px; margin-bottom: 24px; }
.editor-header h1 { margin: 0; overflow: hidden; font: 600 30px/1.2 Georgia, serif; text-overflow: ellipsis; white-space: nowrap; }
.editor-header .eyebrow { margin-bottom: 5px; }
.editor-actions { display: flex; align-items: center; gap: 9px; }
.save-state { min-width: 72px; color: var(--muted); font-size: 13px; text-align: right; }
.save-state[data-state="failed"] { color: var(--danger); font-weight: 750; }
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 22px; align-items: start; }
.editor-main, .editor-settings section { border: 1px solid rgba(16,35,29,.08); border-radius: 18px; background: var(--paper); box-shadow: 0 8px 30px rgba(16,35,29,.05); }
.title-field { display: grid; gap: 9px; padding: 26px 30px; font-size: 12px; font-weight: 800; letter-spacing: .05em; color: var(--muted); }
.title-field input { height: auto; padding: 6px 0 14px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; font: 600 clamp(30px, 4vw, 46px)/1.15 Georgia, serif; }
.title-field input:focus { box-shadow: none; border-bottom-color: var(--forest); }
.editor-toolbar { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 30px; border-block: 1px solid var(--line); background: rgba(255,253,248,.96); backdrop-filter: blur(12px); }
.editor-toolbar button, .preview-toolbar button { min-height: 34px; padding: 0 11px; border: 1px solid #ced7d1; border-radius: 8px; background: white; color: var(--forest); cursor: pointer; font-weight: 750; }
.visual-editor { min-height: 540px; padding: 34px clamp(24px, 6vw, 74px) 80px; }
.editor-block { position: relative; margin: 0 0 20px; padding: 6px 34px 6px 0; border-radius: 8px; }
.editor-block:hover { background: #f8f5ed; }
.editor-block h2 { margin: 12px 0; font: 600 30px/1.25 Georgia, serif; }
.editor-block h3 { margin: 10px 0; font-size: 21px; }
.editor-block p, .editor-block li, .editor-block blockquote { line-height: 1.75; }
.editor-block blockquote { margin: 12px 0; padding: 10px 20px; border-left: 3px solid var(--gold); color: #3f514a; font-family: Georgia, serif; font-style: italic; }
.editor-block table { min-width: 0; border: 1px solid var(--line); }
.editor-block td { min-width: 0; padding: 10px; }
.block-remove { position: absolute; top: 7px; right: 7px; display: none; width: 26px; height: 26px; border: 0; border-radius: 50%; background: #eee8de; color: var(--danger); cursor: pointer; }
.editor-block:hover .block-remove { display: block; }
.editor-image img { max-width: 100%; border-radius: 10px; }
.editor-settings { position: sticky; top: 20px; display: grid; gap: 14px; }
.editor-settings section { padding: 22px; }
.editor-settings h2 { margin: 0 0 20px; font: 600 20px/1.2 Georgia, serif; }
.editor-settings label { display: grid; gap: 7px; margin-top: 15px; color: #44564f; font-size: 13px; font-weight: 750; }
.cover-setting { margin-top: 18px; padding: 14px; border-radius: 10px; background: #f7f4ec; }
.cover-setting > span { font-size: 13px; font-weight: 750; }
.cover-setting p { margin: 7px 0 12px; color: var(--muted); font-size: 12px; }
.seo-checks { display: grid; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; font-size: 12px; line-height: 1.45; }
.seo-checks li { padding: 9px 10px; border-radius: 8px; }
.check-error { color: #8e332e; background: #fbe2df; }
.check-warning { color: #85561e; background: #fff0d8; }
.check-good { color: #155447; background: #dceee7; }
.text-button.dark { color: var(--forest); }
.editor-notice { min-height: 22px; margin: -12px 0 12px 62px; color: var(--forest-2); font-size: 13px; }
.recovery-banner { margin-bottom: 20px; padding: 12px 16px; border-radius: 10px; background: #fff0d8; color: #744b1c; }
.preview-panel { position: fixed; z-index: 20; inset: 18px; border: 1px solid #ccd5d0; border-radius: 20px; background: #e8e5dd; box-shadow: 0 30px 100px rgba(0,0,0,.28); overflow: hidden; }
.preview-toolbar { height: 58px; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; background: var(--paper); border-bottom: 1px solid var(--line); }
.preview-stage { height: calc(100% - 58px); padding: 18px; overflow: auto; text-align: center; }
.preview-stage iframe { width: 100%; height: 100%; border: 0; background: white; box-shadow: 0 5px 30px rgba(0,0,0,.12); transition: width .2s ease; }
.preview-stage iframe[data-width="mobile"] { width: 390px; max-width: 100%; }
.image-dialog { width: min(520px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 22px; background: var(--paper); box-shadow: 0 28px 100px rgba(0,0,0,.32); }
.image-dialog::backdrop { background: rgba(8,28,23,.68); backdrop-filter: blur(3px); }
.image-dialog form { display: grid; gap: 17px; padding: 30px; }
.image-dialog h2 { margin: 0 0 7px; font: 600 28px/1.2 Georgia, serif; }
.image-dialog form > div:first-child > p:last-child { color: var(--muted); }
.image-dialog label { display: grid; gap: 7px; font-size: 13px; font-weight: 750; }
.image-dialog .check-row { grid-template-columns: auto 1fr; align-items: center; }
.image-dialog .check-row input { width: 18px; min-height: 18px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; }
.button--danger { background: #9b3833; color: white; }
.button:disabled { cursor: not-allowed; opacity: .45; box-shadow: none; }
.review-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 22px; align-items: start; }
.review-grid main { display: grid; gap: 18px; }
.review-card { padding: 26px; }
.review-card h2 { margin: 0 0 18px; font: 600 24px/1.2 Georgia, serif; }
.review-card label { display: grid; gap: 8px; margin: 22px 0 16px; font-size: 13px; font-weight: 750; }
.review-meta { display: flex; flex-wrap: wrap; gap: 9px; }
.review-meta span { padding: 7px 10px; border-radius: 8px; background: #f1eee7; color: #51615a; font-size: 12px; }
.review-comment { margin-top: 20px; padding: 16px; border-left: 3px solid var(--gold); background: #faf6ed; }
.review-comment p { margin-bottom: 0; line-height: 1.6; }
.version-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.version-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.version-list strong, .version-list span, .version-list small { display: block; }
.version-list span, .version-list small { margin-top: 4px; color: var(--muted); font-size: 11px; }
.version-list button, .row-actions button { padding: 7px 9px; border: 1px solid #ccd5d0; border-radius: 7px; background: white; color: var(--forest); cursor: pointer; font-size: 12px; }
.user-guidance { margin: 28px 0 18px; padding: 18px 20px; border-radius: 14px; background: #e2eee9; color: var(--forest); }
.user-guidance p { margin: 6px 0 0; color: #496059; font-size: 13px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; min-width: 270px; }
@media (max-width: 980px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand { min-height: 46vh; padding: 48px 32px; }
  .auth-brand h1 { font-size: clamp(40px, 10vw, 70px); margin-top: 28px; }
  .auth-card { margin: -36px 20px 32px; position: relative; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; padding: 18px 22px; flex-direction: row; align-items: center; gap: 20px; }
  .sidebar nav { margin: 0 0 0 auto; display: flex; }
  .sidebar-foot { display: none; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .filter-bar { grid-template-columns: 1fr 1fr; }
  .editor-layout { grid-template-columns: 1fr; }
  .editor-settings { position: static; grid-template-columns: 1fr 1fr; }
  .review-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .sidebar nav .nav-item:not(.is-active), .sidebar-brand small { display: none; }
  .workspace { padding: 24px 14px; }
  .dashboard-heading { align-items: stretch; flex-direction: column; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .filter-bar { grid-template-columns: 1fr; }
  .editor-header { grid-template-columns: auto minmax(0, 1fr); align-items: start; }
  .editor-header > div { min-width: 0; }
  .editor-header h1 { overflow-wrap: anywhere; white-space: normal; font-size: clamp(24px, 8vw, 30px); }
  .editor-actions { grid-column: 1 / -1; flex-wrap: wrap; min-width: 0; }
  .editor-actions .button { flex: 1 1 120px; }
  .editor-actions .save-state { margin-right: auto; }
  .editor-main, .editor-settings { min-width: 0; width: 100%; }
  .title-field { padding: 22px 18px; }
  .title-field input { min-width: 0; font-size: 28px; }
  .editor-settings { grid-template-columns: 1fr; }
  .visual-editor { padding: 24px 18px 60px; }
  .editor-block { overflow-wrap: anywhere; }
  .preview-panel { inset: 4px; }
}
