
.write-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #ffffff 0%, #fbfaff 55%, #f3edff 100%);
}
.write-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  height: 72px;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.write-topbar-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.write-actions { display:flex; gap:9px; align-items:center; }
.write-layout {
  max-width: 1180px;
  margin: 0 auto;
  padding: 46px 22px 80px;
}
.write-heading { max-width: 780px; margin-bottom: 28px; }
.write-heading h1 {
  font-family: var(--serif);
  font-size: clamp(40px, 5vw, 62px);
  letter-spacing: -2px;
  line-height: 1.05;
}
.write-heading p { margin-top: 10px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.editor-shell {
  display:grid;
  grid-template-columns: 1fr 290px;
  gap: 22px;
  align-items:start;
}
.editor-card, .settings-card {
  background:#fff;
  border:1px solid #e8e4f0;
  border-radius:20px;
  box-shadow: 0 20px 55px rgba(47,21,96,.07);
}
.editor-card { overflow:hidden; }
.editor-toolbar {
  display:flex;
  align-items:center;
  gap:8px;
  padding:13px 15px;
  border-bottom:1px solid #ece8f2;
  background:#fcfbfe;
  flex-wrap:wrap;
}
.toolbar-btn {
  border:1px solid #e3dfeb;
  background:#fff;
  color:#4d4758;
  min-width:36px;
  height:34px;
  border-radius:8px;
  cursor:pointer;
  font-weight:700;
  font-size:13px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0 8px;
}
.toolbar-btn:hover { border-color:#bca5e8; color:var(--violet-700); }
.toolbar-btn:active { background:var(--violet-50); }

.toolbar-group { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.toolbar-divider { width:1px; height:22px; background:#e3dfeb; flex:0 0 auto; }
.toolbar-select {
  height:34px;
  border:1px solid #e3dfeb;
  border-radius:8px;
  background:#fff;
  color:#4d4758;
  font-size:12px;
  font-weight:600;
  padding:0 8px;
  cursor:pointer;
  outline:0;
}
.toolbar-select:hover { border-color:#bca5e8; color:var(--violet-700); }
.toolbar-select:focus { border-color:var(--violet-600); box-shadow:0 0 0 3px rgba(107,50,201,.08); }

.toolbar-color-group { gap:8px; }
.toolbar-color-btn {
  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:36px;
  height:34px;
  border:1px solid #e3dfeb;
  border-radius:8px;
  cursor:pointer;
  font-weight:700;
  color:#4d4758;
  background:#fff;
  overflow:hidden;
}
.toolbar-color-btn:hover { border-color:#bca5e8; color:var(--violet-700); }
.toolbar-color-btn input[type="color"] {
  position:absolute;
  inset:auto 4px 4px 4px;
  width:20px;
  height:5px;
  padding:0;
  border:0;
  cursor:pointer;
  background:none;
}
.highlight-swatch { background:#fdf1a8; padding:0 3px; border-radius:3px; font-size:11px; }
.editor-title {
  width:100%;
  border:0;
  outline:0;
  padding:28px 34px 10px;
  font-family:var(--serif);
  font-size:34px;
  color:var(--ink);
}
.editor-title::placeholder { color:#c6c0ce; }
.editor-content {
  min-height:520px;
  padding:10px 34px 40px;
  outline:0;
  font-family:var(--serif);
  font-size:17px;
  line-height:1.9;
  color:#302d39;
}
.editor-content:empty::before {
  content:"Begin your story here...";
  color:#b5afbd;
  pointer-events:none;
}
.editor-content h2, .editor-content h3 { font-family:var(--serif); color:#171325; line-height:1.2; margin:30px 0 14px; }
.editor-content h2 { font-size:29px; }
.editor-content h3 { font-size:23px; }
.editor-content blockquote { border-left:3px solid #6b32c9; margin:22px 0; padding:5px 0 5px 20px; color:#5f586d; font-style:italic; }
.editor-content pre { background:#f8f6fc; border:1px solid #e8e4f0; border-radius:12px; padding:16px 18px; margin:18px 0; font-family:var(--sans); font-size:15px; line-height:1.7; white-space:pre-wrap; color:#3a3646; }
.editor-content hr { border:0; border-top:1px solid #e3ddec; margin:30px auto; width:120px; }
.editor-content a { color:var(--violet-700); text-decoration:underline; text-underline-offset:2px; }
.editor-content ul, .editor-content ol { margin:0 0 18px 25px; }
.settings-card { padding:22px; }
.settings-card h3 { font-family:var(--serif); font-size:22px; margin-bottom:20px; }
.setting { display:grid; gap:8px; margin-bottom:18px; }
.setting label { font-size:11px; font-weight:700; color:#484351; }
.setting input, .setting select, .setting textarea {
  width:100%;
  border:1px solid #ded9e8;
  border-radius:10px;
  min-height:43px;
  padding:0 12px;
  font:inherit;
  color:var(--ink);
  background:#fff;
  outline:0;
}
.setting textarea { padding:11px 12px; min-height:95px; resize:vertical; }
.setting input:focus, .setting select:focus, .setting textarea:focus { border-color:var(--violet-600); box-shadow:0 0 0 4px rgba(107,50,201,.08); }
.write-status { font-size:11px; color:#777080; margin-top:12px; min-height:16px; }

.setting-help { color:#8a8492; font-size:10px; line-height:1.55; margin-top:-2px; }
.cover-upload-preview { display:grid; gap:9px; margin-top:3px; }
.cover-upload-preview img { width:100%; aspect-ratio:3/4; object-fit:cover; border-radius:12px; border:1px solid #e3ddec; background:#f8f6fc; }
.cover-setting input[type="file"] { min-height:44px; padding:9px 10px; font-size:11px; }
.cover-ratio-badge { display:inline-block; margin-left:7px; padding:3px 8px; border-radius:999px; background:#f1e9ff; color:#5b2bb5; font-size:11px; font-weight:700; letter-spacing:.2px; vertical-align:middle; }

.danger-link { color:#9b2840; border:0; background:transparent; cursor:pointer; font-size:11px; padding:0; }
@media (max-width: 850px) {
  .editor-shell { grid-template-columns:1fr; }
  .settings-card { order:-1; }
  .write-actions .btn { min-height:40px; padding:0 13px; }
}
@media (max-width: 560px) {
  .write-layout { padding:30px 14px 55px; }
  .editor-title { padding:24px 20px 8px; font-size:29px; }
  .editor-content { padding:10px 20px 30px; min-height:450px; }
}
