:root {
  --studio-ink: #1f2d49;
  --studio-deep: #14213a;
  --studio-gold: #b99235;
  --studio-paper: #f6f3ed;
  --studio-card: #fffefa;
  --studio-muted: #77756f;
  --studio-line: #e6e1d8;
  --studio-teal: #477f80;
  color-scheme: light;
  font-family: Poppins, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--studio-paper); }
body.editor-page {
  margin: 0;
  min-height: 100vh;
  color: var(--studio-ink);
  background:
    radial-gradient(ellipse at 85% 0%, rgba(185,146,53,.08), transparent 34rem),
    var(--studio-paper);
  font: 300 14px/1.65 Poppins, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
button, a, input, textarea { touch-action: manipulation; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 3px solid rgba(185,146,53,.55); outline-offset: 3px;
}
.editor-page button {
  min-height: 44px; border: 1px solid #d9d5cd; border-radius: 8px; padding: 10px 16px;
  color: var(--studio-ink); background: #fff; font-size: 12px; font-weight: 500;
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.editor-page button:hover { border-color: #b6ac99; background: #fbfaf7; }
.editor-page button:active { transform: translateY(1px); }
.editor-page .primary {
  border-color: var(--studio-ink); color: #fff; background: var(--studio-ink);
  box-shadow: 0 5px 14px rgba(31,45,73,.12);
}
.editor-page .primary:hover { border-color: var(--studio-deep); color: #fff; background: var(--studio-deep); box-shadow: 0 8px 20px rgba(31,45,73,.18); }
.editor-header {
  height: 74px; padding: 0 clamp(20px,5vw,76px); display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid rgba(31,45,73,.1); background: rgba(255,254,250,.86); backdrop-filter: blur(14px);
}
.editor-header a { color: var(--studio-ink); text-decoration: none; font-size: 12px; font-weight: 600; letter-spacing: .02em; }
.editor-header a:first-child { display: inline-flex; align-items: center; gap: 14px; }
.editor-header a:first-child::first-letter { font-weight: 700; }
.editor-header span { color: var(--studio-muted); font-weight: 300; }
.editor-header a:last-child { display: inline-flex; align-items: center; gap: 8px; color: var(--studio-teal); }
.editor-header a:last-child:hover { color: var(--studio-ink); }
.blog-kicker { margin: 0; color: var(--studio-gold); font-size: 10px; line-height: 1.5; letter-spacing: .19em; text-transform: uppercase; font-weight: 600; }
.editor-page h1 { margin: 12px 0; font-family: 'Instrument Serif', Georgia, serif; font-size: clamp(36px,4.1vw,54px); font-weight: 400; line-height: 1.08; letter-spacing: -.025em; }
.login-card {
  position: relative; width: min(100% - 40px, 560px); margin: clamp(72px,12vh,132px) auto 100px; padding: clamp(32px,6vw,60px);
  border: 1px solid rgba(31,45,73,.1); border-radius: 20px; background: var(--studio-card);
  box-shadow: 0 24px 70px rgba(31,45,73,.08), 0 3px 12px rgba(31,45,73,.04); overflow: hidden;
}
.login-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; background: linear-gradient(90deg,var(--studio-ink) 0 72%,var(--studio-gold) 72%); }
.login-card h1 { max-width: 440px; margin: 19px 0 16px; font-size: clamp(42px,7vw,64px); }
.login-card>p:not(.blog-kicker) { max-width: 390px; margin: 0 0 32px; color: #65645f; font-size: 13px; }
.editor-page label { display: block; margin: 18px 0 7px; color: #555a64; font-size: 11px; font-weight: 500; letter-spacing: .025em; }
.editor-page input:not([type=file]), .editor-page textarea, .editor-page select {
  width: 100%; min-height: 46px; padding: 11px 13px; border: 1px solid #dedbd4; border-radius: 8px;
  color: var(--studio-ink); background: #fff; font-size: 13px; font-weight: 300; transition: border-color .15s, box-shadow .15s;
}
.editor-page input:not([type=file]):focus, .editor-page textarea:focus, .editor-page select:focus { border-color: #a88b4b; box-shadow: 0 0 0 3px rgba(185,146,53,.1); outline: 0; }
.editor-page textarea { resize: vertical; min-height: 76px; }
#login-form { margin-top: 28px; }
#login-form label { color: var(--studio-ink); }
#login-form input { height: 52px; background: #fffefa; }
#login-form button { width: 100%; min-height: 50px; margin-top: 16px; border-radius: 8px; font-size: 13px; }
.studio-top { max-width: 1480px; margin: 0 auto; padding: 46px clamp(20px,5vw,76px) 30px; display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.studio-top h1 { margin: 8px 0 0; font-size: clamp(38px,4.3vw,56px); }
.studio-top>button { min-width: 106px; }
.studio-layout { max-width: 1480px; margin: 0 auto; padding: 0 clamp(20px,5vw,76px) 80px; display: grid; grid-template-columns: 252px minmax(0,1fr); align-items: start; gap: 26px; }
.post-sidebar { min-width: 0; padding: 20px 18px; border: 1px solid var(--studio-line); border-radius: 14px; background: rgba(255,254,250,.78); }
.post-sidebar>.primary { width: 100%; }
.post-sidebar>label { margin-top: 24px; }
#post-list { margin-top: 12px; color: var(--studio-muted); font-size: 12px; line-height: 1.7; }
.post-item { display: block; width: 100%; margin: 8px 0 0; padding: 12px !important; text-align: left; overflow-wrap: anywhere; }
.post-item strong, .post-item small { display: block; }
.post-item strong { font-size: 12px; }
.post-item small { margin-top: 5px; color: var(--studio-muted); font-size: 10px; }
.writing-panel { min-width: 0; padding: clamp(20px,3vw,36px); border: 1px solid var(--studio-line); border-radius: 16px; background: var(--studio-card); box-shadow: 0 10px 35px rgba(31,45,73,.045); }
.writing-actions, .writing-footer { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.writing-actions { position: sticky; z-index: 4; top: 0; margin: -8px -8px 22px; padding: 8px; border-bottom: 1px solid var(--studio-line); background: rgba(255,254,250,.94); backdrop-filter: blur(10px); }
.writing-actions>span { margin-right: auto; color: var(--studio-muted); font-size: 11px; }
.editor-page .title-input { min-height: 64px !important; padding: 8px 0 !important; border: 0 !important; border-bottom: 1px solid var(--studio-line) !important; border-radius: 0 !important; background: transparent !important; font-family: 'Instrument Serif', Georgia, serif !important; font-size: clamp(30px,4vw,44px) !important; font-weight: 400 !important; letter-spacing: -.02em; }
.editor-page .title-input::placeholder { color: #b2afa7; }
.metadata-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 20px; }
#author-note { display: block; margin-top: 7px; color: var(--studio-muted); font-size: 10px; }
.cover-control { display: flex; align-items: center; flex-wrap: wrap; gap: 20px; margin: 22px 0 28px; padding: 18px; border: 1px dashed #d8d2c5; border-radius: 10px; background: #fbfaf6; }
.cover-control>div { flex: 1 1 240px; min-width: 0; }
.cover-control label:first-child { margin-top: 0; }
.cover-control input[type=file] { max-width: 100%; color: var(--studio-muted); font-size: 11px; }
.cover-control img { width: 128px; height: 92px; border-radius: 7px; object-fit: cover; }
.cover-control #remove-cover { min-height: 36px; }
.editor-page #body-label { margin-bottom: 9px; color: var(--studio-ink); font-size: 12px; }
#toolbar { position: sticky; z-index: 3; top: 64px; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 8px 10px; border: 1px solid #dedbd4 !important; border-radius: 9px 9px 0 0; background: #f9f8f4 !important; }
.ql-toolbar.ql-snow { border-color: #dedbd4; }
.editor-page .ql-toolbar button { width: 30px; height: 30px; min-height: 30px; padding: 5px; border: 0; border-radius: 5px; }
.editor-page .ql-toolbar button:hover { background: #ebe8e0; }
.ql-snow .ql-stroke { stroke: #4a5260; }
.ql-snow .ql-fill { fill: #4a5260; }
.ql-snow .ql-picker { color: #4a5260; font-size: 11px; }
.ql-container.ql-snow { border: 1px solid #dedbd4 !important; border-top: 0 !important; border-radius: 0 0 9px 9px; }
.ql-container { min-height: 390px; font: 15px/1.9 Poppins, Arial, sans-serif; }
.ql-editor { min-height: 390px; padding: 24px 26px; overflow-wrap: anywhere; color: #343a45; }
.ql-editor.ql-blank::before { left: 26px; color: #aaa79f; font-style: normal; }
.ql-editor img, .article-body img { max-width: 100%; height: auto; border-radius: 7px; }
.writing-footer { margin-top: 16px; color: var(--studio-muted); font-size: 11px; }
.writing-footer>a { margin-left: auto; color: var(--studio-teal); text-decoration: none; font-weight: 500; }
.writing-footer>a:hover { text-decoration: underline; }
#notice { position: fixed; z-index: 10; bottom: 24px; left: 50%; width: max-content; max-width: calc(100vw - 32px); margin: 0; padding: 13px 18px; transform: translateX(-50%); border: 1px solid rgba(255,255,255,.16); border-radius: 9px; color: #fff; background: var(--studio-ink); box-shadow: 0 12px 32px rgba(20,33,58,.22); font-size: 12px; }
#notice:empty { display: none; }
dialog { width: min(920px,94vw); max-height: 90vh; padding: clamp(20px,5vw,44px); border: 1px solid var(--studio-line); border-radius: 16px; color: var(--studio-ink); background: var(--studio-card); box-shadow: 0 24px 80px rgba(20,33,58,.25); }
dialog::backdrop { background: rgba(20,33,58,.58); backdrop-filter: blur(3px); }
#close-preview { float: right; }
.blog-page { color: var(--studio-ink); background: var(--studio-paper); }
.blog-hero { padding: 150px 0 66px; color: #fff; background: var(--studio-ink); }
.blog-hero h1 { margin: 20px 0; font-family: 'Instrument Serif', Georgia, serif; font-size: clamp(52px,8vw,100px); font-weight: 400; line-height: 1.04; }
.blog-hero p:last-child { max-width: 560px; color: rgba(255,255,255,.74); }
.blog-content { min-height: 45vh; padding-top: 60px; padding-bottom: 90px; }
.blog-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 34px 28px; }
.blog-card { min-width: 0; padding-bottom: 24px; border-bottom: 1px solid var(--studio-line); }
.blog-card a { display: block; color: inherit; text-decoration: none; }
.blog-card img { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: 10px; }
.blog-card h2 { margin: 15px 0 8px; font-family: 'Instrument Serif', Georgia, serif; font-size: 30px; font-weight: 400; line-height: 1.18; }
.blog-card p { color: #66645e; line-height: 1.75; }
.article-body { max-width: 780px; margin: 0 auto; overflow-wrap: anywhere; font: 300 17px/1.9 Poppins,Arial,sans-serif; }
.article-body h1 { font-family: 'Instrument Serif',Georgia,serif; font-size: clamp(38px,5.5vw,68px); font-weight: 400; line-height: 1.08; letter-spacing: -.02em; }
.article-body .blog-kicker { margin-top: 40px; }
.article-body>.ql-editor { min-height: 0; padding: 25px 0; font: inherit; white-space: normal; }
.article-body .ql-editor h2 { font-family: 'Instrument Serif',Georgia,serif; font-size: 1.7em; font-weight: 400; }
.article-body .ql-editor h3 { font-family: 'Instrument Serif',Georgia,serif; font-size: 1.35em; font-weight: 400; }
.article-body .ql-editor p { margin: 0 0 1em; }
.article-body .ql-editor blockquote { padding-left: 24px; border-left: 3px solid var(--studio-gold); color: #64615b; }
.article-body pre { overflow: auto; padding: 20px; border-radius: 8px; background: #f0eee8; }
.article-excerpt { color: #686e76; font-size: 20px; }
.blog-empty { padding: 30px 0; }
.ql-align-center { text-align: center; }
.ql-align-right { text-align: right; }
.ql-align-justify { text-align: justify; }
@media (max-width: 980px) {
  .studio-layout { grid-template-columns: 210px minmax(0,1fr); gap: 16px; }
  .post-sidebar { padding: 16px 13px; }
  .writing-panel { padding: 20px; }
  .blog-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 700px) {
  .editor-header { height: 62px; padding: 0 18px; }
  .editor-header a { font-size: 11px; }
  .editor-header span { display: none; }
  .login-card { width: calc(100% - 32px); margin: 12vh auto 60px; padding: 30px 24px; border-radius: 15px; }
  .login-card h1 { font-size: clamp(42px,12vw,58px); }
  .studio-top { align-items: flex-start; padding: 32px 18px 22px; }
  .studio-top h1 { max-width: 280px; font-size: 39px; }
  .studio-top>button { min-width: 0; padding: 9px 12px; }
  .studio-layout { display: flex; flex-direction: column; gap: 14px; margin: 0; padding: 0 14px 52px; }
  .post-sidebar, .writing-panel { width: 100%; border-radius: 12px; }
  .post-sidebar { padding: 14px; }
  .post-sidebar>label { margin-top: 16px; }
  #post-list { max-height: 180px; overflow: auto; }
  .writing-panel { padding: 17px 14px; }
  .writing-actions { top: 0; gap: 6px; margin: -3px -4px 16px; padding: 6px 4px 10px; }
  .writing-actions>span { flex: 1 0 100%; }
  .writing-actions button { flex: 1; min-width: 0; padding: 9px 8px; font-size: 11px; }
  .editor-page .title-input { min-height: 56px !important; font-size: 34px !important; }
  .metadata-grid { grid-template-columns: 1fr; gap: 0; }
  .cover-control { align-items: flex-start; gap: 12px; padding: 13px; }
  .cover-control img { width: 88px; height: 70px; }
  #toolbar { top: 116px; gap: 0; padding: 5px; }
  .editor-page .ql-toolbar button { width: 28px; height: 28px; }
  .ql-container, .ql-editor { min-height: 330px; }
  .ql-editor { padding: 18px 15px; font-size: 14px; }
  .ql-editor.ql-blank::before { left: 15px; }
  .writing-footer { gap: 7px; }
  .writing-footer>a { width: 100%; margin-left: 0; }
  .blog-grid { grid-template-columns: 1fr; }
  .blog-content { padding-top: 36px; padding-bottom: 64px; }
  .blog-hero { padding-top: 112px; }
  .article-body { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
