:root {
  color-scheme: light;
  --paper: #f2f3f3;
  --white: #ffffff;
  --ink: #202326;
  --muted: #707579;
  --wine: #742638;
  --wine-dark: #4d1723;
  --forest: #18372f;
  --blue: #9eb2bb;
  --rose: #d9a5ad;
  --gold: #c8a36b;
  --line: #dadddd;
  --soft: #e9eded;
  --shadow-sm: 0 4px 16px rgba(26, 31, 32, .06);
  --shadow: 0 20px 56px rgba(26, 31, 32, .14);
  --serif: "Iowan Old Style", "Baskerville", "Noto Serif CJK SC", "Source Han Serif SC", "Songti SC", serif;
  --sans: "Avenir Next", "Noto Sans CJK SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
html.admin-active { scrollbar-gutter: stable; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--paper); font: 13px/1.5 var(--sans); }
body.preview-open { overflow: hidden; }
body, button, input, textarea, select, a { letter-spacing: 0; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
label > span { display: block; margin-bottom: 7px; color: var(--muted); font-size: 11px; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: var(--white);
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
input, select { height: 40px; padding: 0 12px; }
select { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg,transparent 50%,#7b8083 50%),linear-gradient(135deg,#7b8083 50%,transparent 50%); background-position: calc(100% - 16px) 17px,calc(100% - 11px) 17px; background-repeat: no-repeat; background-size: 5px 5px,5px 5px; }
textarea { padding: 16px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--wine); background-color: var(--white); box-shadow: 0 0 0 3px rgba(116,38,56,.1); }
input:-webkit-autofill,
input:-webkit-autofill:hover {
  -webkit-text-fill-color: var(--ink);
  caret-color: var(--ink);
  box-shadow: 0 0 0 1000px var(--white) inset;
}
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  caret-color: var(--ink);
  box-shadow: 0 0 0 1000px var(--white) inset, 0 0 0 3px rgba(116,38,56,.1);
}
.password-control > label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 11px; }
.password-field { position: relative; }
.password-field input { padding-right: 46px; }
.password-toggle {
  width: 36px;
  height: 36px;
  position: absolute;
  top: 2px;
  right: 3px;
  display: grid;
  place-items: center;
  padding: 0;
  color: #777d7f;
  border: 0;
  border-radius: 5px;
  background: transparent;
  transition: color .18s ease, background .18s ease;
}
.password-toggle:hover { color: var(--wine); background: rgba(116,38,56,.07); }
.password-toggle:focus-visible { outline: 2px solid var(--rose); outline-offset: 1px; }
.password-toggle svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.password-eye-off, .password-toggle[aria-pressed="true"] .password-eye { display: none; }
.password-toggle[aria-pressed="true"] .password-eye-off { display: block; }
::selection { color: #fff; background: var(--wine); }
button:focus-visible, a:focus-visible, .upload-command:focus-within { outline: 2px solid var(--rose); outline-offset: 3px; }
button:disabled, input:disabled { cursor: wait; }
button:disabled { opacity: .58; transform: none !important; box-shadow: none !important; }
.visually-hidden { width: 1px; height: 1px; position: absolute; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

.login-screen { height: 100svh; min-height: 100svh; display: grid; grid-template-columns: minmax(390px, 42%) 1fr; overflow: hidden; background: #fff; }
.login-panel { min-height: 0; position: relative; display: flex; flex-direction: column; justify-content: center; overflow-y: auto; padding: 64px max(48px, 9vw); background: var(--white); }
.login-brand { display: inline-flex; align-items: center; gap: 11px; align-self: flex-start; }
.login-brand > span, .admin-brand > span {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font: italic 12px/1 var(--serif);
}
.login-brand strong { font: 600 19px var(--serif); }
.login-brand small { color: var(--muted); font-size: 10px; }
.login-kicker { margin-top: 84px; color: var(--wine); font: italic 12px var(--serif); }
.login-panel h1 { margin-top: 16px; font: 500 44px/1.2 var(--serif); }
.login-copy { max-width: 420px; margin-top: 18px; color: var(--muted); font-size: 14px; line-height: 1.9; }
.login-panel form { display: grid; gap: 18px; max-width: 420px; margin-top: 40px; }
.login-panel form .primary-command { margin-top: 4px; justify-content: space-between; }
.login-foot { position: absolute; left: max(48px, 9vw); bottom: 32px; color: #a1a5a7; font: italic 11px var(--serif); }
.login-visual { min-width: 0; min-height: 0; position: relative; height: 100%; overflow: hidden; background: var(--forest); }
.login-visual picture { position: absolute; inset: 0; display: block; }
.login-visual img { width: 100%; height: 100%; position: absolute; inset: 0; display: block; object-fit: cover; }
.login-visual::after { content: ""; position: absolute; inset: 0; background: rgba(20,14,17,.46); }
.login-visual-copy { position: absolute; left: 8%; right: 8%; bottom: 8%; z-index: 1; color: #fff; }
.login-visual-copy > span { color: var(--rose); font: italic 13px var(--serif); }
.login-visual blockquote { max-width: 720px; margin: 20px 0 0; font: 30px/1.6 var(--serif); }
.login-visual-copy p { margin-top: 26px; color: rgba(255,255,255,.66); font: italic 14px var(--serif); }

.primary-command, .quiet-button, .upload-command, .new-button, .icon-button, .mobile-jump-button {
  border: 0;
  border-radius: 6px;
  font-weight: 700;
  transition: color .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.primary-command { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 14px; padding: 0 16px; color: #fff; background: var(--wine); box-shadow: 0 5px 16px rgba(116,38,56,.22); }
.primary-command:hover { background: var(--wine-dark); box-shadow: 0 8px 20px rgba(116,38,56,.25); transform: translateY(-1px); }
.primary-command.compact { min-height: 34px; }
.primary-command #save-label, .primary-command #video-save-label { margin: 0; color: inherit; font-size: 11px; }
.shortcut { padding: 2px 5px; border: 1px solid rgba(255,255,255,.25); border-radius: 3px; font-size: 8px; font-weight: 500; }
.form-error { min-height: 20px; color: #a12d21; font-size: 12px; }

.admin-shell { min-height: 100svh; }
.admin-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 62px;
  display: flex;
  align-items: center;
  padding: 0 18px;
  color: #fff;
  background: var(--wine-dark);
  border-bottom: 1px solid rgba(255,255,255,.13);
  box-shadow: 0 4px 18px rgba(40,18,23,.15);
}
.admin-header:focus-visible { outline: 2px solid rgba(255,255,255,.72); outline-offset: -3px; }
.admin-brand { min-width: 0; display: flex; align-items: center; gap: 10px; }
.admin-brand > span { width: 32px; height: 32px; font-size: 10px; }
.admin-brand strong { font: 600 16px var(--serif); white-space: nowrap; }
.admin-brand small { margin-left: 4px; color: rgba(255,255,255,.5); font-size: 10px; }
.admin-context { display: flex; align-items: center; gap: 8px; margin-left: 42px; color: rgba(255,255,255,.72); font-size: 10px; }
.admin-context i { width: 6px; height: 6px; border-radius: 50%; background: #8dd0ad; box-shadow: 0 0 0 4px rgba(141,208,173,.12); }
.admin-context small { color: rgba(255,255,255,.38); }
.admin-actions { margin-left: auto; display: flex; align-items: center; gap: 7px; }
.admin-action-divider { width: 1px; height: 20px; margin: 0 2px; background: rgba(255,255,255,.2); }
.workspace-notice { width: min(520px,calc(100% - 32px)); position: fixed; left: 50%; top: 74px; z-index: 29; display: flex; align-items: center; gap: 16px; padding: 12px 14px; color: #54212b; border: 1px solid rgba(116,38,56,.24); border-left: 3px solid var(--wine); border-radius: 6px; background: #fff9fa; box-shadow: var(--shadow); transform: translateX(-50%); }
.workspace-notice span { font-size: 11px; line-height: 1.6; }
.workspace-notice button { min-height: 32px; margin-left: auto; flex: 0 0 auto; padding: 0 11px; color: #fff; border: 0; border-radius: 5px; background: var(--wine); font-size: 10px; }
.workspace-notice button:disabled { cursor: wait; opacity: .62; }
.quiet-button { min-height: 32px; padding: 0 11px; color: inherit; border: 1px solid var(--line); background: var(--white); font-size: 11px; }
.admin-header .quiet-button { color: #fff; border-color: rgba(255,255,255,.22); background: rgba(255,255,255,.04); }
.quiet-button:hover { color: var(--wine); border-color: var(--rose); background: rgba(116,38,56,.05); }
.admin-header .quiet-button:hover { color: #fff; border-color: rgba(255,255,255,.48); background: rgba(255,255,255,.1); }
.quiet-button.danger:hover { color: #a22d34; border-color: rgba(162,45,52,.3); background: rgba(162,45,52,.06); }
.admin-header .public-page-link { min-height: 34px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 12px; color: var(--wine-dark); border-color: rgba(255,255,255,.92); background: #fff; box-shadow: 0 3px 10px rgba(27,8,13,.12); white-space: nowrap; line-height: 1; }
.admin-header .public-page-link:hover { color: var(--wine-dark); border-color: #fff; background: #f8f1f3; box-shadow: 0 5px 14px rgba(27,8,13,.17); transform: translateY(-1px); }
.public-page-link span { line-height: 1; }
.public-page-link i { width: 16px; height: 16px; display: grid; place-items: center; color: var(--wine); border-radius: 50%; background: #f2e4e7; font: normal 12px/1 var(--sans); }
.admin-header .logout-button { min-width: 48px; color: rgba(255,255,255,.72); border-color: transparent; background: transparent; }
.admin-header .logout-button:hover { color: #fff; border-color: rgba(255,255,255,.3); background: rgba(255,255,255,.08); }
.icon-button { width: 34px; height: 34px; display: grid; place-items: center; color: #fff; border: 1px solid rgba(255,255,255,.24); background: rgba(255,255,255,.04); font-size: 17px; }
.icon-button:hover { border-color: rgba(255,255,255,.52); background: rgba(255,255,255,.12); }
.icon-button.dark { color: var(--ink); border-color: var(--line); background: var(--white); }
.mobile-only, .mobile-jump-button { display: none; }
.mobile-jump-button { width: 34px; height: 34px; place-items: center; padding: 0; color: var(--wine); border: 1px solid var(--line); background: var(--white); font-size: 10px; }
.mobile-jump-button:hover { border-color: var(--rose); background: rgba(116,38,56,.05); }

.workspace { min-height: calc(100svh - 62px); display: grid; grid-template-columns: 304px minmax(0, 1fr); }
.post-sidebar { position: sticky; top: 62px; height: calc(100svh - 62px); border-right: 1px solid var(--line); background: #edf0f0; }
.content-kind-switch { height: 50px; display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.42); }
.content-kind-switch button { border: 0; border-radius: 5px; color: var(--muted); background: transparent; font-size: 10px; font-weight: 700; }
.content-kind-switch button:hover { color: var(--ink); background: rgba(255,255,255,.7); }
.content-kind-switch button.is-active { color: #fff; background: var(--wine); box-shadow: 0 3px 10px rgba(116,38,56,.16); }
.sidebar-head { height: 84px; display: flex; align-items: center; padding: 0 18px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.6); }
.sidebar-head span, .editor-toolbar p, .publish-head span, .section-heading span, .editor-section-label { color: var(--wine); font: italic 10px var(--serif); }
.sidebar-head h2 { margin-top: 4px; font: 500 23px var(--serif); }
.new-button { width: 38px; height: 38px; margin-left: auto; color: #fff; background: var(--wine); font-size: 19px; box-shadow: 0 5px 14px rgba(116,38,56,.2); }
.new-button:hover { background: var(--wine-dark); transform: translateY(-2px); }
.post-search { position: relative; display: block; padding: 12px 12px 6px; }
.post-search > span { position: absolute; left: 24px; top: 22px; z-index: 1; color: var(--muted); font-size: 17px; }
.post-search input { height: 36px; padding-left: 35px; border-color: transparent; background: rgba(255,255,255,.72); font-size: 11px; }
.status-tabs { height: 48px; display: flex; align-items: center; gap: 3px; padding: 6px 10px; border-bottom: 1px solid var(--line); }
.status-tabs button { height: 32px; flex: 1; padding: 0 7px; color: var(--muted); border: 0; border-radius: 5px; background: transparent; font-size: 10px; transition: color .18s ease, background .18s ease, box-shadow .18s ease; }
.status-tabs button span { margin-left: 3px; color: #9ca1a3; font: 9px var(--serif); }
.status-tabs button:hover { color: var(--ink); background: rgba(255,255,255,.55); }
.status-tabs button.is-active { color: var(--wine); background: var(--white); box-shadow: var(--shadow-sm); }
.admin-post-list { max-height: calc(100svh - 300px); overflow-y: auto; padding-bottom: 10px; }
.admin-post-item { width: calc(100% - 18px); min-height: 92px; display: grid; grid-template-columns: 1fr auto; align-content: center; gap: 5px 10px; margin: 8px 9px 0; padding: 14px; text-align: left; border: 1px solid transparent; border-radius: 7px; background: transparent; transition: background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.admin-post-item:hover { background: rgba(255,255,255,.68); border-color: rgba(116,38,56,.1); transform: translateX(2px); }
.admin-post-item.is-active { border-color: rgba(116,38,56,.18); background: var(--white); box-shadow: var(--shadow-sm); }
.admin-post-item strong { grid-column: 1 / -1; display: block; overflow: hidden; font: 600 15px/1.4 var(--serif); text-overflow: ellipsis; white-space: nowrap; }
.admin-post-item p { color: var(--muted); font-size: 9px; }
.admin-post-item span { justify-self: end; color: var(--wine); font-size: 9px; font-weight: 700; }
.sidebar-empty { margin: 24px 18px; padding: 28px 16px; border-top: 1px solid var(--line); text-align: center; }
.sidebar-empty b { display: block; font: italic 20px var(--serif); }
.sidebar-empty span { display: block; margin-top: 8px; color: var(--muted); font-size: 11px; }

.editor { position: relative; min-width: 0; }
.editor-toolbar { position: sticky; top: 62px; z-index: 12; height: 60px; display: flex; align-items: center; padding: 0 20px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.94); box-shadow: 0 2px 14px rgba(24,30,31,.04); backdrop-filter: blur(12px); }
.editor-state { display: flex; align-items: center; gap: 10px; }
.dirty-dot { width: 8px; height: 8px; border-radius: 50%; background: #b7babc; transition: background .2s ease, box-shadow .2s ease; }
.dirty-dot.is-dirty { background: var(--gold); box-shadow: 0 0 0 4px rgba(200,163,107,.14); }
.editor-toolbar span { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
.editor-commands { margin-left: auto; display: flex; gap: 8px; }
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 252px; align-items: start; }
.editor-fields { width: min(calc(100% - 40px), 1060px); margin: 20px auto 42px; padding: 32px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); box-shadow: var(--shadow-sm); }
.editor-section-label { margin-bottom: 26px; }
.title-field input { height: 52px; padding: 0 14px; font: 600 24px var(--serif); }
.field-row { display: grid; grid-template-columns: 160px 1fr; gap: 16px; margin-top: 22px; }
.body-field { display: block; margin-top: 24px; }
.body-field > label { display: block; margin-bottom: 7px; color: var(--muted); font-size: 11px; }
.format-toolbar { min-height: 38px; display: flex; align-items: center; gap: 4px; padding: 4px 7px; border: 1px solid var(--line); border-bottom: 0; border-radius: 6px 6px 0 0; background: #f7f8f8; }
.format-toolbar button { height: 28px; min-width: 34px; padding: 0 8px; color: #555b5e; border: 0; border-radius: 4px; background: transparent; font: 600 10px var(--sans); }
.format-toolbar button:hover { color: var(--wine); background: #fff; box-shadow: var(--shadow-sm); }
.body-field textarea { min-height: 430px; border-radius: 0 0 6px 6px; font: 14px/1.9 var(--sans); }
.body-field textarea:focus { position: relative; }
.content-meta { display: flex; justify-content: space-between; margin: 8px 2px 0; color: var(--muted); }
.content-meta b { font-size: 10px; font-weight: 600; }
.content-meta em { font: italic 10px var(--serif); }
.publish-panel { position: sticky; top: 142px; max-height: calc(100svh - 162px); overflow-y: auto; margin: 20px 18px 0 0; padding: 22px 17px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); box-shadow: var(--shadow-sm); }
.publish-head h3, .section-heading h3 { margin-top: 4px; font: 500 18px var(--serif); }
.publish-summary { display: flex; align-items: center; gap: 11px; margin-top: 18px; padding: 12px; border-radius: 6px; background: #f2f4f4; }
.publish-summary > i { width: 9px; height: 9px; border-radius: 50%; background: var(--blue); }
.publish-summary > i.is-public { background: #4a9f76; }
.publish-summary strong { display: block; font-size: 11px; }
.publish-summary span { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
.switch-row { position: relative; display: grid; grid-template-columns: 1fr 38px; gap: 10px; align-items: center; padding: 17px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.switch-row > span { margin: 0; color: var(--ink); }
.switch-row strong { display: block; font-size: 11px; }
.switch-row small { display: block; margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch-row > i { width: 36px; height: 20px; position: relative; border: 1px solid #c9cdcf; border-radius: 20px; background: #dfe2e3; transition: border-color .18s ease, background .18s ease; }
.switch-row > i::after { content: ""; position: absolute; width: 14px; height: 14px; top: 2px; left: 3px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(18,24,25,.24); transition: left .2s ease; }
.switch-row input:checked + i { border-color: var(--wine); background: var(--wine); }
.switch-row input:checked + i::after { left: 17px; }
.switch-row input:focus-visible + i { outline: 2px solid var(--rose); outline-offset: 3px; }
.switch-row.is-disabled { cursor: not-allowed; opacity: .5; }
.publish-note { margin-top: 16px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.media-grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 22px; margin-top: 36px; padding-top: 26px; border-top: 1px solid var(--line); }
.media-section { min-width: 0; }
.media-section + .media-section { padding-left: 22px; border-left: 1px solid var(--line); }
.section-heading { display: flex; align-items: center; }
.section-heading h3 small { margin-left: 5px; color: var(--muted); font: 9px var(--sans); }
.upload-command { min-height: 32px; display: inline-flex; align-items: center; margin-left: auto; padding: 0 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--white); font-size: 10px; font-weight: 700; cursor: pointer; }
.upload-command > span { display: inline; margin: 0; color: inherit; font-size: inherit; }
.upload-command:hover { color: var(--wine); border-color: var(--rose); box-shadow: var(--shadow-sm); }
.upload-command.is-busy { color: var(--muted); background: var(--soft); cursor: wait; pointer-events: none; }
.cover-preview { min-height: 150px; display: grid; place-items: center; margin-top: 13px; color: var(--muted); border: 1px dashed #c5cacc; border-radius: 6px; background: #f5f6f6; font-size: 10px; }
.cover-preview img { width: 100%; max-height: 380px; object-fit: cover; border-radius: 5px; }
.cover-preview .image-wrap { width: 100%; position: relative; }
.remove-image { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; color: #fff; border: 0; border-radius: 50%; background: rgba(77,23,35,.86); font-size: 19px; }
.gallery-preview { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin-top: 13px; }
.gallery-preview.is-empty { min-height: 150px; place-items: center; border: 1px dashed #c5cacc; border-radius: 6px; background: #f5f6f6; }
.gallery-empty-copy { grid-column: 1 / -1; justify-self: center; padding: 0 16px; color: var(--muted); font-size: 10px; text-align: center; }
.gallery-preview .image-wrap { position: relative; aspect-ratio: 4 / 3; }
.gallery-preview img { width: 100%; height: 100%; object-fit: cover; border-radius: 5px; }

.admin-video-item { width: calc(100% - 18px); min-height: 94px; display: grid; grid-template-columns: minmax(0,1fr) 30px; align-items: stretch; gap: 5px; margin: 8px 9px 0; border: 1px solid transparent; border-radius: 7px; overflow: hidden; transition: background .18s ease, border-color .18s ease, box-shadow .18s ease; }
.admin-video-item:hover { border-color: rgba(116,38,56,.1); background: rgba(255,255,255,.68); }
.admin-video-item.is-active { border-color: rgba(116,38,56,.18); background: var(--white); box-shadow: var(--shadow-sm); }
.admin-video-select { min-width: 0; display: grid; grid-template-columns: 1fr auto; align-content: center; gap: 5px 10px; padding: 13px 5px 13px 13px; text-align: left; border: 0; background: transparent; }
.admin-video-select strong { grid-column: 1 / -1; overflow: hidden; font: 600 15px/1.4 var(--serif); text-overflow: ellipsis; white-space: nowrap; }
.admin-video-select p { color: var(--muted); font-size: 9px; }
.admin-video-select > span { justify-self: end; color: var(--wine); font-size: 9px; font-weight: 700; }
.video-order-controls { display: grid; align-content: center; gap: 4px; padding-right: 6px; }
.video-order-button { width: 26px; height: 26px; display: grid; place-items: center; padding: 0; color: var(--muted); border: 1px solid transparent; border-radius: 4px; background: transparent; }
.video-order-button:hover { color: var(--wine); border-color: var(--line); background: #fff; }
.video-public-link { display: inline-flex; align-items: center; white-space: nowrap; }
.video-description-field textarea { min-height: 142px; border-radius: 6px; font: 13px/1.8 var(--sans); }
.video-source-section, .video-cover-section, .video-asset-section, .post-video-section { margin-top: 34px; padding-top: 26px; border-top: 1px solid var(--line); }
.video-cover-section { padding-left: 0 !important; border-left: 0 !important; }
.video-upload-panel { min-height: 112px; display: grid; grid-template-columns: 44px minmax(0,1fr) auto; align-items: center; gap: 14px; margin-top: 13px; padding: 16px; border: 1px solid var(--line); border-left: 3px solid var(--blue); border-radius: 6px; background: #f7f8f8; }
.video-upload-panel.is-processing { border-left-color: var(--gold); }
.video-upload-panel.is-failed { border-left-color: #a94b52; }
.video-upload-icon { width: 42px; height: 42px; display: grid; place-items: center; color: #fff; border-radius: 50%; background: var(--forest); font-size: 11px; }
.video-upload-copy { min-width: 0; }
.video-upload-copy strong { display: block; overflow: hidden; font: 600 13px/1.4 var(--serif); text-overflow: ellipsis; white-space: nowrap; }
.video-upload-copy span { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.video-upload-progress { grid-column: 2 / -1; display: grid; grid-template-columns: minmax(0,1fr) 42px; align-items: center; gap: 10px; }
.video-upload-progress > i { height: 5px; display: block; overflow: hidden; border-radius: 5px; background: #dde1e1; }
.video-upload-progress b { width: 0; height: 100%; display: block; border-radius: inherit; background: var(--wine); transition: width .18s linear; }
.video-upload-panel.is-processing .video-upload-progress b { background: var(--gold); }
.video-upload-panel.is-indeterminate .video-upload-progress b { animation: upload-wait 1.2s ease-in-out infinite alternate; }
.video-upload-progress > span { color: var(--muted); font-size: 9px; text-align: right; }
.video-upload-actions { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 7px; }
.video-upload-actions .quiet-button { min-height: 30px; font-size: 9px; }
.video-cover-preview { min-height: 220px; }
.video-asset-list { display: grid; gap: 7px; margin-top: 13px; }
.video-asset-row { min-height: 58px; display: flex; align-items: center; gap: 16px; padding: 10px 12px; border: 1px solid var(--line); border-left: 3px solid var(--blue); border-radius: 5px; background: #f8f9f9; }
.video-asset-row.is-ready { border-left-color: #4a9f76; }
.video-asset-row.is-processing { border-left-color: var(--gold); }
.video-asset-row.is-failed { border-left-color: #a94b52; }
.video-asset-row.is-cancelled { border-left-color: var(--muted); }
.video-asset-row.is-cancelled .video-asset-status { color: var(--muted); }
.video-asset-row > div { min-width: 0; }
.video-asset-row strong { display: block; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.video-asset-row div span { display: block; margin-top: 3px; color: var(--muted); font-size: 8px; }
.video-asset-status { margin-left: auto; color: var(--wine); font-size: 9px; white-space: nowrap; }
.video-assets-empty { padding: 24px 0; color: var(--muted); border-top: 1px dashed var(--line); font-size: 10px; text-align: center; }
.video-facts { margin: 14px 0 0; }
.video-facts > div { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.video-facts dt { color: var(--muted); font-size: 9px; }
.video-facts dd { margin: 0; font-size: 10px; font-weight: 700; }
.post-video-controls { display: grid; grid-template-columns: minmax(180px,1.2fr) minmax(150px,.8fr) minmax(180px,1fr) auto; align-items: end; gap: 10px; margin-top: 14px; }
.post-video-controls .quiet-button { height: 40px; }
.post-video-list { display: grid; gap: 8px; margin-top: 14px; }
.post-video-row { min-width: 0; display: grid; grid-template-columns: 88px minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: #f8f9f9; }
.post-video-thumb { aspect-ratio: 16 / 9; display: grid; place-items: center; overflow: hidden; color: var(--wine); border-radius: 4px; background: #e8ebea; font: italic 13px var(--serif); }
.post-video-thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-video-row-fields { min-width: 0; display: grid; grid-template-columns: minmax(120px,.8fr) minmax(130px,.7fr) minmax(160px,1fr); align-items: center; gap: 8px; }
.post-video-row-fields strong { overflow: hidden; font: 600 11px var(--serif); text-overflow: ellipsis; white-space: nowrap; }
.post-video-row-fields input, .post-video-row-fields select { height: 34px; font-size: 9px; }
.post-video-row-actions { display: flex; gap: 3px; }
.post-video-row-actions button { width: 30px; height: 30px; display: grid; place-items: center; padding: 0; color: var(--muted); border: 1px solid transparent; border-radius: 4px; background: transparent; }
.post-video-row-actions button:hover { color: var(--wine); border-color: var(--line); background: #fff; }
.post-video-empty { margin-top: 14px; padding: 20px 0; color: var(--muted); border-top: 1px dashed var(--line); font-size: 10px; text-align: center; }
.preview-video-block { margin: 42px 0; }
.preview-video-block > div { position: relative; aspect-ratio: 16 / 9; display: grid; place-items: center; overflow: hidden; color: #fff; background: #1c201e; }
.preview-video-block img { width: 100%; height: 100%; object-fit: cover; opacity: .86; }
.preview-video-block > div span { width: 52px; height: 52px; position: absolute; display: grid; place-items: center; padding-left: 3px; border: 1px solid rgba(255,255,255,.72); border-radius: 50%; background: rgba(21,24,22,.48); font-size: 14px; }
.preview-video-block figcaption { display: flex; justify-content: space-between; gap: 18px; margin-top: 10px; color: var(--muted); font: italic 10px var(--serif); }
.preview-video-block figcaption strong { color: var(--ink); font-weight: 500; }

@keyframes upload-wait { from { width: 24%; transform: translateX(-20%); } to { width: 58%; transform: translateX(135%); } }

.preview-pane { position: fixed; top: 62px; right: 0; bottom: 0; left: 304px; z-index: 15; overflow-y: auto; overscroll-behavior: contain; padding: 118px 8% 110px; background: #fff; }
.preview-bar { position: fixed; left: 304px; right: 0; top: 62px; z-index: 2; height: 60px; display: flex; align-items: center; padding: 0 22px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.95); backdrop-filter: blur(12px); }
.preview-bar span { display: block; color: var(--wine); font: italic 9px var(--serif); }
.preview-bar strong { display: block; margin-top: 2px; font-size: 11px; }
.preview-close { width: 34px; height: 34px; margin-left: auto; border: 1px solid var(--line); border-radius: 50%; background: var(--white); font-size: 22px; }
.preview-pane article { width: min(760px,100%); margin: 0 auto; }
.preview-meta { color: var(--wine); font: italic 12px var(--serif); }
.preview-pane h1 { margin-top: 20px; font: 500 44px/1.35 var(--serif); }
.preview-excerpt { margin-top: 20px; color: var(--muted); font: 16px/1.85 var(--serif); }
.preview-cover { width: 100%; max-height: 540px; margin-top: 40px; object-fit: cover; }
.preview-body { margin-top: 52px; }
.preview-body p, .preview-body li { font: 16px/2 var(--serif); white-space: pre-line; }
.preview-body p + p { margin-top: 24px; }
.preview-body h2 { margin: 48px 0 18px; font: 500 30px var(--serif); }
.preview-body h3 { margin: 36px 0 16px; color: var(--wine); font: 500 23px var(--serif); }
.preview-body blockquote { margin: 36px 0; padding: 24px 0; color: var(--wine-dark); border-top: 1px solid var(--rose); border-bottom: 1px solid var(--rose); font: italic 21px/1.8 var(--serif); text-align: center; }
.preview-gallery { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; margin-top: 48px; }
.preview-gallery:empty { display: none; }
.preview-gallery img { width: 100%; height: 100%; max-height: 520px; object-fit: cover; border-radius: 4px; background: var(--soft); }
.preview-gallery img:nth-child(3n) { grid-column: 1 / -1; }

dialog { width: min(460px,calc(100% - 32px)); padding: 0; overflow: hidden; border: 0; border-radius: 8px; color: var(--ink); background: var(--white); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(24,12,15,.74); }
dialog form { display: grid; gap: 18px; padding: 28px; }
.dialog-head { display: flex; align-items: center; }
.dialog-head > div > span { color: var(--wine); font: italic 10px var(--serif); }
.dialog-head h2 { margin-top: 4px; font: 500 23px var(--serif); }
.dialog-head button { margin-left: auto; }
dialog form > p { color: var(--muted); font-size: 11px; line-height: 1.7; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 30; max-width: 360px; padding: 12px 16px; color: #fff; border-radius: 6px; background: var(--wine-dark); box-shadow: var(--shadow); font-size: 11px; opacity: 0; pointer-events: none; transform: translateY(12px); transition: opacity .2s ease, transform .2s ease; }
.toast.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 980px) {
  .login-screen { grid-template-columns: 1fr; }
  .login-panel { min-height: 100svh; padding: 52px 28px; }
  .login-visual { display: none; }
  .workspace { grid-template-columns: 1fr; }
  .post-sidebar { position: static; height: auto; border-right: 0; }
  .admin-post-list { max-height: 280px; }
  .editor-grid { grid-template-columns: 1fr; }
  .editor-fields { width: calc(100% - 32px); margin: 16px auto 20px; }
  .publish-panel { position: static; max-height: none; overflow: visible; margin: 0 16px 26px; }
  .preview-pane, .preview-bar { left: 0; }
  .editor, .post-sidebar, .publish-panel { scroll-margin-top: 70px; }
  .post-video-controls { grid-template-columns: 1fr 1fr; }
  .post-video-row-fields { grid-template-columns: 1fr 1fr; }
  .post-video-row-fields strong { grid-column: 1 / -1; }
}
@media (min-width: 981px) and (max-width: 1120px) {
  .editor-grid { grid-template-columns: 1fr; }
  .editor-fields { width: calc(100% - 32px); margin: 16px auto 20px; }
  .publish-panel {
    position: static;
    max-height: none;
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    column-gap: 24px;
    align-items: start;
    margin: 0 16px 26px;
    padding: 20px;
    overflow: visible;
  }
  .publish-head,
  .publish-summary { grid-column: 1 / -1; }
  .video-facts { grid-column: 1 / -1; }
  .publish-note { margin-top: 0; padding-top: 16px; }
}
@media (min-width: 981px) and (max-height: 760px) {
  .login-panel { justify-content: flex-start; overflow-y: auto; padding-top: 32px; padding-bottom: 32px; }
  .login-kicker { margin-top: 36px; }
  .login-panel h1 { margin-top: 10px; font-size: 38px; }
  .login-copy { margin-top: 12px; line-height: 1.7; }
  .login-panel form { gap: 12px; margin-top: 22px; }
  .login-foot { position: static; margin-top: 20px; }
}
@media (max-width: 640px) {
  .admin-header { height: auto; min-height: 58px; padding: 7px 12px; }
  .workspace-notice { top: 70px; align-items: flex-start; }
  .admin-brand small, .admin-context, #password-button { display: none; }
  .mobile-only, .mobile-jump-button { display: grid; }
  .admin-actions { gap: 5px; }
  .admin-actions .quiet-button { padding: 0 8px; font-size: 9px; }
  .workspace { min-height: calc(100svh - 58px); }
  .sidebar-head { height: 70px; }
  .post-search > span { top: 26px; }
  .status-tabs { height: 56px; }
  .editor-toolbar { top: 58px; height: auto; min-height: 64px; padding: 10px 12px; }
  .editor-commands { gap: 5px; }
  .editor-commands .quiet-button { padding: 0 8px; }
  .shortcut { display: none !important; }
  .editor-fields { width: calc(100% - 20px); margin: 10px auto 14px; padding: 18px 14px; }
  .title-field input { font-size: 20px; }
  .field-row { grid-template-columns: 1fr; }
  .body-field textarea { min-height: 360px; }
  .content-meta em { display: none; }
  .media-grid { grid-template-columns: 1fr; gap: 22px; }
  .media-section + .media-section { padding: 22px 0 0; border-top: 1px solid var(--line); border-left: 0; }
  .publish-panel { margin: 0 10px 20px; }
  .gallery-preview { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .preview-pane { top: 58px; padding: 108px 20px 90px; }
  .preview-bar { top: 58px; }
  .preview-pane h1 { font-size: 36px; }
  .preview-gallery { grid-template-columns: 1fr; }
  .preview-gallery img:nth-child(3n) { grid-column: auto; }
  .content-kind-switch { height: 52px; }
  .video-public-link { display: none; }
  .video-description-field textarea { min-height: 128px; }
  .video-upload-panel { grid-template-columns: 40px minmax(0,1fr); padding: 13px; }
  .video-upload-actions,
  .video-upload-progress { grid-column: 1 / -1; }
  .post-video-controls { grid-template-columns: 1fr; }
  .post-video-row { grid-template-columns: 72px minmax(0,1fr); align-items: start; }
  .post-video-row-fields { grid-template-columns: 1fr; }
  .post-video-row-fields strong { grid-column: auto; }
  .post-video-row-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .preview-video-block figcaption { display: block; }
  .preview-video-block figcaption span { display: block; margin-top: 4px; }
}

@media (max-width: 640px) and (max-height: 640px) {
  .login-panel { justify-content: flex-start; overflow-y: auto; padding: 20px 28px; }
  .login-kicker { margin-top: 20px; }
  .login-panel h1 { margin-top: 8px; font-size: 34px; }
  .login-copy { margin-top: 10px; font-size: 13px; line-height: 1.7; }
  .login-panel form { gap: 12px; margin-top: 20px; }
  .login-foot { position: static; margin-top: 20px; }
}

@media (max-width: 360px) {
  .admin-brand { gap: 7px; }
  .admin-brand strong { font-size: 14px; }
  .admin-header .public-page-link {
    width: 44px;
    padding: 0;
    font-size: 0;
  }
  .admin-header .public-page-link span,
  .admin-header .public-page-link i { display: none; }
  .admin-header .public-page-link::after { content: "↗"; display: block; font-size: 16px; line-height: 1; }
  .editor-state { gap: 6px; }
  .editor-state > div > span { display: none; }
  .editor-commands { gap: 3px; }
  #preview-button {
    width: 44px;
    min-width: 44px;
    padding: 0;
    font-size: 9px;
  }
  #preview-button::after { content: none; }
  #save-button { min-width: 52px; padding: 0 8px; }
}

@media (max-width: 640px), (pointer: coarse) {
  .login-brand { min-height: 44px; }
  .login-panel input { height: 44px; }
  .login-panel .primary-command { min-height: 44px; }
  .login-panel .password-field input { padding-right: 52px; }
  .login-panel .password-toggle {
    width: 44px;
    height: 44px;
    top: 0;
    right: 0;
  }
  .admin-brand,
  .admin-header .quiet-button,
  .workspace-notice button,
  .status-tabs button,
  .editor-toolbar .quiet-button,
  .editor-toolbar .primary-command,
  .upload-command { min-height: 44px; }
  .editor-toolbar .quiet-button { min-width: 44px; }
  .admin-header .icon-button,
  .new-button,
  .mobile-jump-button,
  .format-toolbar button,
  .remove-image,
  .preview-close {
    min-width: 44px;
    width: 44px;
    min-height: 44px;
    height: 44px;
  }
  .post-search input,
  .editor-fields input,
  .editor-fields select,
  dialog input { height: 44px; }
  .content-kind-switch button,
  .video-order-button,
  .post-video-row-actions button { min-width: 44px; min-height: 44px; }
  .admin-video-item { grid-template-columns: minmax(0,1fr) 48px; }
  .video-order-controls { padding-right: 2px; }
  dialog .password-field input { padding-right: 52px; }
  dialog .password-toggle {
    width: 44px;
    height: 44px;
    top: 0;
    right: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; }
}
