/* PopDaily Editor Beta — modern shell (2026-07-28 polish)
   Brand pink kept; glass + soft elevation for client projector walkthrough.
   Functional classes unchanged for app.js / module_ui.js. */

:root {
  --pd-bg: #f3f0f6;
  --pd-bg-deep: #e8e4ef;
  --pd-pink: #ff4d88;
  --pd-pink-deep: #e83674;
  --pd-pink-soft: #ffe8f1;
  --pd-pink-glow: rgba(255, 77, 136, 0.22);
  --pd-ink: #14181f;
  --pd-ink-2: #3a4150;
  --pd-muted: #8b93a7;
  --pd-line: rgba(20, 24, 40, 0.08);
  --pd-line-strong: rgba(20, 24, 40, 0.12);
  --ed-border: rgba(20, 24, 40, 0.1);
  --ed-muted: #6b7389;
  --surface: #ffffff;
  --surface-2: #f7f8fc;
  --surface-3: #eef1f8;
  --shadow-sm: 0 1px 2px rgba(16, 18, 30, 0.04), 0 4px 12px rgba(16, 18, 30, 0.04);
  --shadow-md: 0 8px 28px rgba(22, 18, 40, 0.08), 0 2px 8px rgba(22, 18, 40, 0.04);
  --shadow-lg: 0 20px 50px rgba(22, 18, 40, 0.12), 0 4px 16px rgba(22, 18, 40, 0.06);
  --radius: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --font: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", system-ui, sans-serif;
  --editor-pad-x: clamp(20px, 4vw, 40px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --top-h: 56px;
}

* { box-sizing: border-box; }
html {
  margin: 0;
  height: auto;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body {
  margin: 0;
  font-family: var(--font);
  color: var(--pd-ink);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  height: auto;
  background:
    radial-gradient(900px 480px at 12% -8%, rgba(255, 120, 170, 0.18), transparent 55%),
    radial-gradient(700px 420px at 92% 0%, rgba(120, 140, 255, 0.12), transparent 50%),
    radial-gradient(600px 360px at 50% 100%, rgba(255, 200, 220, 0.1), transparent 45%),
    linear-gradient(180deg, #f6f3f8 0%, var(--pd-bg) 40%, var(--pd-bg-deep) 100%);
  background-attachment: fixed;
}
body.modal-open { overflow: hidden; }

/* ── Top bar ── */
.top {
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: var(--top-h);
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--pd-line);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
}
.top-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.logo {
  font-weight: 800;
  color: var(--pd-pink);
  font-size: 17px;
  letter-spacing: -0.02em;
  display: flex;
  align-items: baseline;
  gap: 0;
}
.logo span {
  color: var(--pd-ink-2);
  font-weight: 600;
  font-size: 12px;
  margin-left: 6px;
  opacity: 0.85;
}
.badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #fff0f5, var(--pd-pink-soft));
  color: #b01a5a;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 90, 138, 0.22);
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}
.article-pick {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ed-muted);
}
.article-pick span {
  display: none;
}
@media (min-width: 900px) {
  .article-pick span { display: inline; }
}
.article-pick select {
  max-width: min(380px, 42vw);
  border: 1px solid var(--ed-border);
  border-radius: 12px;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--pd-ink);
  background: var(--surface);
  outline: none;
  box-shadow: var(--shadow-sm);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.article-pick select:focus {
  border-color: #ff9fbf;
  box-shadow: 0 0 0 3px var(--pd-pink-glow);
}
.showcase-btn {
  border: 0;
  background: linear-gradient(135deg, #ff7aa8 0%, var(--pd-pink) 45%, var(--pd-pink-deep) 100%);
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  font-family: inherit;
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  box-shadow: 0 6px 18px var(--pd-pink-glow), 0 1px 0 rgba(255, 255, 255, 0.25) inset;
  transition: transform .12s var(--ease), filter .12s var(--ease);
}
.showcase-btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
.showcase-btn:active { transform: translateY(0); }
.preview-btn {
  border: 1px solid rgba(255, 90, 138, 0.35);
  background: var(--surface);
  color: var(--pd-pink-deep);
  font-weight: 800;
  font-size: 12px;
  font-family: inherit;
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background .12s, border-color .12s, transform .12s var(--ease);
}
.preview-btn:hover {
  background: var(--pd-pink-soft);
  border-color: #ff8fb8;
  transform: translateY(-1px);
}
.top .meta {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  color: var(--pd-muted);
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 720px) {
  .top .meta { display: none; }
}

/* ── Banner ── */
.banner {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--pd-line);
  font-size: 12px;
}
.banner-bar {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  color: var(--pd-ink-2);
  transition: background .12s;
}
.banner-bar:hover { background: rgba(255, 255, 255, 0.65); }
.banner-bar-label {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #0b3d78;
  background: linear-gradient(135deg, #e8f0fe, #f0f4ff);
  border: 1px solid #c9daf5;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
}
.banner-bar-summary {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--ed-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.banner-bar-chevron {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--pd-muted);
  transition: transform .2s var(--ease);
}
.banner:not(.is-collapsed) .banner-bar-chevron {
  transform: rotate(180deg);
}
.banner-panel {
  padding: 0 16px 12px;
  border-top: 1px solid var(--pd-line);
}
.banner-panel[hidden] { display: none !important; }
.banner-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
}
.banner-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  font-weight: 700;
  font-size: 11px;
  background: var(--surface);
  border: 1px solid var(--pd-line-strong);
  color: var(--pd-ink-2);
  box-shadow: var(--shadow-sm);
}
.banner-chip.ok {
  background: #eefaf2;
  border-color: #b6e4c4;
  color: #176b3a;
}
.banner-chip.warn {
  background: #fff8eb;
  border-color: #f0d9a8;
  color: #8a5a00;
}
.banner-chip.muted { color: #667; }
.banner-detail {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 14px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed rgba(20, 24, 40, 0.1);
}
@media (max-width: 900px) {
  .banner-detail { grid-template-columns: 1fr; }
}
.banner-live,
.banner-out {
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--pd-line);
  box-shadow: var(--shadow-sm);
}
.banner-live strong {
  color: #0b3d78;
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
}
.banner-out strong {
  color: #8a4b00;
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
}
.banner-live ul {
  margin: 6px 0 8px;
  padding-left: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px 10px;
}
@media (max-width: 900px) {
  .banner-live ul { grid-template-columns: repeat(2, 1fr); }
}
.banner-live li {
  margin: 0;
  color: #1e4a7a;
  font-size: 11px;
  font-weight: 600;
}
.banner-live li::before {
  content: "✓ ";
  color: #2a9b5c;
  font-weight: 800;
}
.banner-out p,
.banner-live p {
  margin: 0;
  color: #6a4a20;
  line-height: 1.55;
  font-size: 12px;
}
.banner-live p { color: #3a5578; }

/* ── Workspace ── */
.workspace {
  flex: 1 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 0;
  padding: 0;
  overflow: visible;
  min-height: calc(100vh - 130px);
}

/* Left list */
.pane-list {
  flex: 0 0 280px;
  width: 280px;
  min-width: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-right: 1px solid var(--pd-line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  max-height: 100vh;
  overflow: hidden;
  transition: flex-basis .22s var(--ease), width .22s var(--ease);
  z-index: 5;
  box-shadow: 4px 0 24px rgba(20, 18, 40, 0.04);
}
body.list-collapsed .pane-list {
  flex: 0 0 44px;
  width: 44px;
  max-width: 44px;
  min-width: 44px;
}
.list-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 12px 10px 16px;
  border-bottom: 1px solid var(--pd-line);
  flex-shrink: 0;
}
.list-head h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.01em;
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.list-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--pd-muted);
  background: var(--surface-3);
  padding: 2px 7px;
  border-radius: var(--radius-pill);
}
.list-collapse-btn {
  border: 1px solid var(--ed-border);
  background: var(--surface);
  color: var(--pd-ink-2);
  width: 30px;
  height: 30px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
  transition: border-color .12s, background .12s, color .12s;
}
.list-collapse-btn:hover {
  border-color: #ffb3cb;
  color: var(--pd-pink-deep);
  background: var(--pd-pink-soft);
}
.list-filters {
  display: flex;
  gap: 5px;
  padding: 10px 12px 12px;
  border-bottom: 1px solid var(--pd-line);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.list-filters button {
  border: 1px solid transparent;
  background: var(--surface-2);
  color: var(--pd-ink-2);
  border-radius: var(--radius-pill);
  padding: 5px 11px;
  font-size: 11px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s, box-shadow .12s;
}
.list-filters button:hover {
  background: #fff;
  border-color: var(--pd-line-strong);
}
.list-filters button.on {
  background: var(--pd-pink-soft);
  border-color: rgba(255, 90, 138, 0.35);
  color: var(--pd-pink-deep);
  box-shadow: 0 0 0 1px rgba(255, 90, 138, 0.08);
}
.list-scroll {
  flex: 1;
  overflow: auto;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: #d0d4e0 transparent;
}
.feed-item {
  display: flex;
  gap: 11px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(20, 24, 40, 0.05);
  cursor: pointer;
  transition: background .12s var(--ease);
}
.feed-item:hover { background: rgba(255, 245, 250, 0.7); }
.feed-item.active {
  background: linear-gradient(90deg, #fff5f8, #fff);
  box-shadow: inset 3px 0 0 var(--pd-pink);
}
.feed-item.is-weak .t { color: #999; }
.feed-item img,
.thumb-ph {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 11px;
  background: #eee;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(16, 18, 30, 0.08);
}
.feed-item img.broken { opacity: 0.25; }
.thumb-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #ff9bb8, var(--pd-pink));
  font-size: 15px;
}
.feed-item .t {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--pd-ink);
}
.feed-item .s {
  font-size: 10px;
  color: var(--pd-muted);
  margin-top: 5px;
  font-weight: 600;
}
.feed-item .tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--surface-3);
  color: #5a6478;
  margin-right: 3px;
}

body.list-collapsed .list-head,
body.list-collapsed .list-filters,
body.list-collapsed .list-scroll {
  display: none;
}
.list-expand-tab {
  display: none;
  position: absolute;
  inset: 0;
  border: 0;
  background: linear-gradient(180deg, #fff, #faf8fc);
  cursor: pointer;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  color: var(--pd-ink-2);
  letter-spacing: 0.14em;
  padding: 14px 0;
  align-items: center;
  justify-content: center;
}
.list-expand-tab:hover {
  background: var(--pd-pink-soft);
  color: var(--pd-pink-deep);
}
body.list-collapsed .list-expand-tab {
  display: flex;
}
body.list-collapsed .list-expand-tab[hidden] {
  display: flex !important;
}

.list-toggle-top {
  border: 1px solid var(--ed-border);
  background: var(--surface);
  color: var(--pd-ink-2);
  font-weight: 700;
  font-size: 12px;
  font-family: inherit;
  padding: 8px 13px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color .12s, background .12s, color .12s;
}
.list-toggle-top:hover,
body.list-open .list-toggle-top {
  border-color: #ffb3cb;
  color: var(--pd-pink-deep);
  background: #fff8fa;
}
body.list-collapsed .list-toggle-top {
  background: var(--surface);
  color: var(--pd-ink-2);
  border-color: var(--ed-border);
}

/* Editor pane */
.pane-editor {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  padding: 14px 18px 32px;
  overflow: visible;
}
.pane-editor .ed-chrome {
  max-width: none;
  width: 100%;
  margin: 0;
}
@media (max-width: 800px) {
  body.list-open .pane-list {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    flex-basis: min(300px, 88vw);
    width: min(300px, 88vw);
    height: 100vh;
    max-height: 100vh;
    box-shadow: 12px 0 40px rgba(20, 22, 34, 0.16);
  }
  body.list-collapsed .pane-list {
    position: sticky;
  }
  .pane-editor { padding: 10px 10px 24px; }
}

.ed-chrome {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: visible;
  height: auto;
  min-height: 0;
}

/* Tools — sticky glass */
.ed-tools {
  flex-shrink: 0;
  border-bottom: 1px solid var(--pd-line);
  background: rgba(252, 252, 255, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 6;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset;
}
.ed-titlebar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--pd-line);
  background: linear-gradient(180deg, #fff, rgba(250, 250, 255, 0.9));
}
.ed-titlebar .dots { display: flex; gap: 6px; }
.ed-titlebar .dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: block;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06) inset;
}
.ed-titlebar .dots .r { background: #ff5f57; }
.ed-titlebar .dots .y { background: #febc2e; }
.ed-titlebar .dots .g { background: #28c840; }
.ed-titlebar .name {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.ed-titlebar .name small {
  font-weight: 600;
  color: var(--ed-muted);
  margin-left: 8px;
  font-size: 11px;
}
.view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  margin-left: 4px;
  background: var(--surface-2);
  border: 1px solid var(--pd-line);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-sm);
}
.view-toggle-btn {
  border: 0;
  background: transparent;
  color: var(--ed-muted);
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background .12s, color .12s, box-shadow .12s;
}
.view-toggle-btn:hover {
  color: var(--pd-ink-2);
  background: rgba(255, 255, 255, 0.7);
}
.view-toggle-btn.on {
  background: #fff;
  color: var(--pd-pink-deep);
  box-shadow: 0 1px 4px rgba(16, 18, 30, 0.08);
}
.ed-titlebar .pill {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  color: var(--pd-pink-deep);
  background: var(--pd-pink-soft);
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 90, 138, 0.18);
}

/* Source mode: dim palette / fmt */
body.source-mode .ed-palette-wrap,
body.source-mode .ed-fmt {
  opacity: 0.45;
  pointer-events: none;
  filter: grayscale(0.15);
}
body.source-mode .ed-palette-label span::after {
  content: " · 原始碼模式下停用";
  color: #b45309;
  font-weight: 700;
}

.source-wrap {
  margin-top: 4px;
  border: 1px solid var(--ed-border);
  border-radius: 14px;
  background: #0f1219;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.source-wrap[hidden] {
  display: none !important;
}
.source-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: linear-gradient(180deg, #1a1f2b, #151922);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.source-label {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  font-weight: 800;
  color: #e8ecf7;
  letter-spacing: 0.02em;
}
.source-label small {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 600;
  color: #8b93a7;
  letter-spacing: 0;
}
.source-copy {
  padding: 7px 12px !important;
  font-size: 12px !important;
  background: rgba(255, 255, 255, 0.06) !important;
  color: #e8ecf7 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}
.source-copy:hover {
  background: rgba(255, 90, 138, 0.18) !important;
  border-color: rgba(255, 140, 180, 0.45) !important;
  color: #fff !important;
}
.source-textarea {
  display: block;
  width: 100%;
  min-height: min(58vh, 560px);
  border: 0;
  outline: none;
  resize: vertical;
  padding: 16px 18px 24px;
  font-family: ui-monospace, "SF Mono", "Menlo", "Consolas", monospace;
  font-size: 12.5px;
  line-height: 1.55;
  color: #d7deee;
  background: #0f1219;
  tab-size: 2;
  white-space: pre;
  overflow: auto;
}
.source-textarea::selection {
  background: rgba(255, 90, 138, 0.35);
}
.pill-edit { background: #fff6d9 !important; color: #8a6d00 !important; border-color: #f0dca0 !important; }
.pill-info { background: #e8f0fe !important; color: #1a4a8a !important; border-color: #c5d8f5 !important; }
.pill-ok { background: #e6f7ed !important; color: #1a7f4b !important; border-color: #b6e4c4 !important; }

.ed-palette-wrap {
  padding: 10px 14px 12px;
  border-bottom: 1px solid var(--pd-line);
}
.ed-palette-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--pd-ink-2);
  margin: 0 2px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.02em;
}
.ed-palette-label span {
  font-weight: 600;
  color: var(--pd-muted);
  letter-spacing: 0;
}
.ed-palette {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 7px;
}
@media (max-width: 1100px) {
  .ed-palette { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .ed-palette { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.mod-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 56px;
  border: 1px solid var(--ed-border);
  background: var(--surface);
  color: var(--pd-ink);
  border-radius: 12px;
  padding: 7px 4px;
  font-size: 11px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .14s var(--ease), box-shadow .14s var(--ease), transform .12s var(--ease), background .12s;
  box-shadow: var(--shadow-sm);
}
.mod-btn .ico { font-size: 16px; line-height: 1.1; }
.mod-btn .lbl { font-size: 10px; font-weight: 700; letter-spacing: 0.01em; }
.mod-btn:hover {
  border-color: #ffb3cb;
  box-shadow: 0 6px 16px var(--pd-pink-glow);
  transform: translateY(-2px);
}
.mod-btn:active { transform: translateY(0); }
.mod-btn.tone-rose:hover { background: #fff5f8; }
.mod-btn.tone-blue:hover { background: #f3f8ff; }
.mod-btn.tone-amber:hover { background: #fff9ef; }
.mod-btn.tone-green:hover { background: #f3fbf5; }
.mod-btn.tone-indigo:hover { background: #f4f5ff; }
.mod-btn.tone-gold:hover { background: #fffaf0; }
.mod-btn.tone-violet:hover { background: #f8f4ff; }
.mod-btn.tone-pink:hover { background: #fff5f8; }
.mod-btn.tone-hot:hover { background: #fff0f4; }
.mod-btn.tone-slate:hover { background: #f6f7fa; }

.ed-fmt {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 8px 14px 10px;
  background: linear-gradient(180deg, #fafbff, #f6f7fc);
}
.ed-fmt button {
  border: 1px solid transparent;
  background: var(--surface);
  color: var(--pd-ink-2);
  border-radius: 9px;
  min-width: 34px;
  height: 32px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(16, 18, 30, 0.04);
  transition: border-color .12s, background .12s, color .12s, box-shadow .12s;
}
.ed-fmt button:hover {
  border-color: #ffb3cb;
  color: var(--pd-pink-deep);
}
.ed-fmt button.is-active {
  background: var(--pd-pink-soft);
  border-color: #ff9fbf;
  color: var(--pd-pink-deep);
  box-shadow: 0 0 0 1px rgba(255, 90, 138, 0.12);
}
.sep {
  width: 1px;
  height: 18px;
  background: var(--pd-line-strong);
  margin: 0 4px;
}

/* Document canvas */
.ed-scroll {
  flex: 0 0 auto;
  overflow: visible;
  height: auto;
  padding: 28px var(--editor-pad-x) 48px;
  background:
    radial-gradient(1000px 280px at 50% -8%, rgba(255, 77, 136, 0.06), transparent 55%),
    linear-gradient(180deg, #fffefd 0%, #fff 40%);
}
.ed-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.ed-chip {
  font-size: 11px;
  font-weight: 700;
  color: var(--ed-muted);
  background: var(--surface-2);
  border: 1px solid var(--pd-line);
  padding: 5px 11px;
  border-radius: var(--radius-pill);
}
.ed-chip strong { color: var(--pd-ink-2); }

.title-input {
  width: 100%;
  border: 0;
  outline: none;
  font-family: inherit;
  font-size: clamp(24px, 3.2vw, 32px);
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--pd-ink);
  padding: 4px 0 16px;
  background: transparent;
}
.title-input::placeholder { color: #c8ccd8; font-weight: 700; }

.cover-slot {
  margin: 4px 0 18px;
  border: 1.5px dashed #d5dae8;
  border-radius: 16px;
  background: linear-gradient(180deg, #fafbff, #f4f6fb);
  min-height: 110px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .15s;
}
.cover-slot:hover { border-color: #ffc0d4; }
.cover-slot.has-img { border-style: solid; min-height: 0; border-color: var(--pd-line); }
.cover-slot.has-img.broken { min-height: 72px; border-style: dashed; }
.cover-slot img {
  width: 100%;
  max-height: 280px;
  object-fit: cover;
  display: block;
}
.cover-slot .ph {
  text-align: center;
  color: var(--ed-muted);
  font-size: 13px;
  font-weight: 600;
  padding: 16px;
}

.ProseMirror {
  min-height: 280px;
  height: auto;
  outline: none;
  font-size: 16.5px;
  line-height: 1.88;
  color: #2a2f3a;
  overflow: visible;
}
.ProseMirror p { margin: 0 0 0.9em; }
.ProseMirror h2 {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 1.2em 0 0.5em;
  color: var(--pd-ink);
  letter-spacing: -0.02em;
}
.ProseMirror h3 {
  font-size: 1.14rem;
  font-weight: 800;
  margin: 1.05em 0 0.4em;
  letter-spacing: -0.01em;
}
.ProseMirror ul,
.ProseMirror ol {
  padding-left: 1.4em;
  margin: 0 0 1em;
}
.ProseMirror blockquote {
  margin: 0 0 1em;
  padding: 12px 16px;
  border-left: 3px solid var(--pd-pink);
  background: linear-gradient(90deg, #fff5f8, #fffafb);
  color: #555;
  border-radius: 0 12px 12px 0;
}
.ProseMirror hr {
  border: none;
  border-top: 1px solid var(--pd-line-strong);
  margin: 1.4em 0;
}
.ProseMirror p.is-editor-empty:first-child::before {
  content: attr(data-placeholder);
  float: left;
  color: #c5c8d4;
  pointer-events: none;
  height: 0;
}
.tiptap-wrap {
  border: 1px solid transparent;
  border-radius: 12px;
  min-height: 280px;
  height: auto;
  overflow: visible;
  transition: border-color .15s, box-shadow .15s;
}
.tiptap-wrap:focus-within {
  border-color: #ffd0e0;
  box-shadow: 0 0 0 4px rgba(255, 77, 136, 0.08);
}

/* Module host */
.pd-module-host {
  margin: 1em 0;
  border-radius: 16px;
  outline: 2px solid transparent;
  transition: outline-color .14s, box-shadow .14s;
  position: relative;
}
.pd-module-host.is-editable { cursor: pointer; }
.pd-module-host:hover {
  outline-color: #ffd0e0;
  box-shadow: 0 8px 24px rgba(255, 77, 136, 0.1);
}
.pd-module-host.is-selected,
.ProseMirror-selectednode.pd-module-host,
.pd-module-host.ProseMirror-selectednode {
  outline-color: var(--pd-pink);
  box-shadow: 0 0 0 3px rgba(255, 77, 136, 0.2);
}
.pd-module-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  background: linear-gradient(90deg, #fff0f5, #f8f9fd);
  border: 1px solid #ffd6e4;
  border-bottom: 0;
  border-radius: 16px 16px 0 0;
}
.pd-module-toolbar-label {
  font-size: 10px;
  font-weight: 800;
  color: #c2185b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: auto;
  padding-left: 4px;
}
.pd-edit-btn,
.pd-del-btn {
  border: 1px solid var(--ed-border);
  background: #fff;
  border-radius: var(--radius-pill);
  padding: 5px 11px;
  font-size: 11px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  color: #444;
  transition: border-color .12s, background .12s, color .12s;
}
.pd-edit-btn:hover {
  border-color: #ffb3cb;
  color: var(--pd-pink-deep);
  background: #fff5f8;
}
.pd-del-btn:hover {
  border-color: #f0c0bc;
  color: #b42318;
  background: #fff5f4;
}
.pd-module-body {
  border-radius: 0 0 16px 16px;
  overflow: hidden;
}
.pd-module-body .pd-mod {
  border-radius: 0 0 16px 16px;
  border-top: 0;
}
.pd-mod-edit-hint {
  margin-left: auto;
  font-size: 10px;
  font-weight: 800;
  color: #c2185b;
  background: #ffe4ee;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
}

/* Module cards */
.pd-mod {
  margin: 0;
  border: 1px solid #e6eaf5;
  border-radius: 16px;
  padding: 0 0 14px;
  background: linear-gradient(180deg, #fbfcff, #f7f8fc);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.pd-mod-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  background: linear-gradient(180deg, #fff, #f4f6fb);
  border-bottom: 1px solid #eef0f6;
  margin-bottom: 12px;
}
.pd-mod-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #fff;
  background: linear-gradient(135deg, #ff7aa3, var(--pd-pink-deep));
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  box-shadow: 0 2px 8px rgba(232, 67, 122, 0.25);
}
.pd-mod > :not(.pd-mod-head) {
  margin-left: 14px;
  margin-right: 14px;
}
.pd-mod-figure img {
  max-width: 100%;
  border-radius: 12px;
  display: block;
  background: #f0f0f0;
}
.pd-mod-figure figcaption {
  font-size: 13px;
  color: #777;
  margin-top: 8px;
  font-weight: 500;
}
.pd-mod-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.pd-mod-table th,
.pd-mod-table td {
  border: 1px solid #e2e5ef;
  padding: 9px 11px;
  text-align: left;
}
.pd-mod-table th {
  background: #f3f4f9;
  font-weight: 800;
}
.pd-faq-item {
  padding: 10px 0;
  border-bottom: 1px dashed #e8ebf5;
}
.pd-faq-item:last-child { border-bottom: 0; }
.pd-faq-q {
  display: block;
  margin-bottom: 4px;
  color: #222;
  font-weight: 700;
}
.pd-faq-a {
  margin: 0;
  color: #555;
  font-size: 14px;
  line-height: 1.55;
}
.pd-mod-steps ol {
  margin: 0;
  padding-left: 0;
  list-style: none;
  counter-reset: step;
}
.pd-mod-steps li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: start;
  margin: 0 0 12px;
  counter-increment: step;
}
.pd-mod-steps li::before {
  content: counter(step);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #fff3e0, #ffe8c8);
  color: #c46a00;
  font-weight: 800;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(196, 106, 0, 0.12);
}
.pd-mod-steps strong {
  display: block;
  font-size: 14px;
  margin-bottom: 2px;
}
.pd-mod-steps span {
  font-size: 13px;
  color: #666;
}
.pd-place-name {
  font-weight: 800;
  margin-bottom: 4px;
  font-size: 15px;
}
.pd-place-addr,
.pd-place-meta {
  font-size: 13px;
  color: #666;
  margin-bottom: 4px;
}
.pd-place-link {
  display: inline-block;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 800;
  color: #1a7f4b;
  text-decoration: none;
}
.pd-mod-linkcard a {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e4e8f5;
  transition: border-color .12s, box-shadow .12s;
}
.pd-mod-linkcard a:hover {
  border-color: #c5d0f0;
  box-shadow: var(--shadow-sm);
}
.pd-link-domain {
  display: block;
  font-size: 11px;
  color: #889;
  margin-bottom: 4px;
  font-weight: 700;
}
.pd-mod-linkcard strong {
  display: block;
  color: #3d4fcf;
  margin-bottom: 4px;
  font-size: 15px;
}
.pd-link-desc {
  font-size: 13px;
  color: #666;
}
.pd-rank-title {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 800;
}
.pd-mod-ranking ol {
  margin: 0;
  padding: 0;
  list-style: none;
}
.pd-mod-ranking li {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid #f0f2f8;
}
.pd-mod-ranking li:last-child { border-bottom: 0; }
.pd-rank-n {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: linear-gradient(135deg, #fff4e0, #ffe8c0);
  color: #c47a00;
  font-weight: 800;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pd-rank-name { font-weight: 700; }
.pd-mod-ranking em {
  color: var(--pd-pink);
  font-style: normal;
  font-weight: 800;
  font-size: 15px;
}
.pd-embed-frame {
  background: #1a1a22;
  color: #fff;
  border-radius: 14px;
  overflow: hidden;
}
.pd-embed-label {
  font-size: 11px;
  font-weight: 700;
  color: #bbb;
  padding: 8px 12px;
  background: #252530;
}
.pd-embed-fake {
  min-height: 128px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: radial-gradient(circle at 30% 30%, #3a2a45, #1a1a22 70%);
}
.pd-embed-play {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  backdrop-filter: blur(4px);
}
.pd-embed-caption {
  font-size: 12px;
  color: #ccc;
  padding: 0 16px;
  text-align: center;
}
.pd-mod-embed a {
  display: block;
  padding: 8px 12px;
  font-size: 12px;
  color: #9ab;
  word-break: break-all;
}
.pd-mod-quote {
  background: linear-gradient(135deg, #fff8fb, #fff);
  border-left: 4px solid var(--pd-pink) !important;
  border-radius: 0 16px 16px 0;
}
.pd-mod-quote p {
  margin: 0 14px 8px;
  font-size: 17px;
  line-height: 1.65;
  font-weight: 700;
  color: #333;
}
.pd-mod-quote cite {
  display: block;
  margin: 0 14px;
  font-size: 13px;
  color: #888;
  font-style: normal;
  font-weight: 600;
}
.pd-toc-title {
  font-weight: 800;
  margin: 0 14px 8px;
}
.pd-mod-toc ol {
  margin: 0 14px;
  padding-left: 1.2em;
}
.pd-mod-toc a {
  color: #3d4fcf;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
.pd-mod-toc a:hover { text-decoration: underline; }
.pd-gallery-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 14px !important;
}
.pd-gallery-row img {
  width: 100%;
  height: 92px;
  object-fit: contain;
  background: #f5f5f5;
  border-radius: 10px;
}
.pd-gallery-cap {
  font-size: 12px;
  color: #777;
  margin: 8px 14px 0 !important;
}
.pd-mod-cta {
  background: linear-gradient(135deg, #fff5f8, #fff);
  text-align: center;
  border-color: #ffd0e0 !important;
}
.pd-cta-text {
  margin: 4px 16px 4px !important;
  font-weight: 800;
  font-size: 16px;
}
.pd-cta-sub {
  margin: 0 16px 12px !important;
  font-size: 13px;
  color: #777;
}
.pd-cta-btn {
  display: inline-block;
  background: linear-gradient(180deg, #ff6e98, var(--pd-pink-deep));
  color: #fff !important;
  text-decoration: none !important;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  font-weight: 800;
  font-size: 14px;
  box-shadow: 0 8px 20px rgba(232, 67, 122, 0.3);
  transition: transform .12s var(--ease), filter .12s;
}
.pd-cta-btn:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}
.tone-blue .pd-mod-badge { background: linear-gradient(135deg, #5b9dff, #2f6fed); }
.tone-amber .pd-mod-badge { background: linear-gradient(135deg, #ffb347, #e08900); }
.tone-green .pd-mod-badge { background: linear-gradient(135deg, #5dcf8a, #1a9f55); }
.tone-indigo .pd-mod-badge { background: linear-gradient(135deg, #7b8cff, #4556e0); }
.tone-gold .pd-mod-badge { background: linear-gradient(135deg, #ffc857, #d4920a); }
.tone-violet .pd-mod-badge { background: linear-gradient(135deg, #b07cff, #7a3de0); }
.tone-slate .pd-mod-badge { background: linear-gradient(135deg, #8a93a8, #5a6478); }
.tone-hot .pd-mod-badge { background: linear-gradient(135deg, #ff6e98, #e8437a); }

/* Footer */
.ed-foot {
  display: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid var(--pd-line);
  background: linear-gradient(180deg, #fafbff, #f5f6fb);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  flex-shrink: 0;
}
.ed-foot.show { display: flex; }
.ed-foot .stats {
  font-size: 12px;
  color: var(--ed-muted);
  margin-right: auto;
  font-weight: 600;
}
.ed-foot .stats b { color: var(--pd-ink-2); }
button.primary {
  border: 0;
  border-radius: 12px;
  padding: 11px 18px;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  background: linear-gradient(180deg, #ff6e98, var(--pd-pink-deep));
  color: #fff;
  box-shadow: 0 8px 18px rgba(232, 67, 122, 0.28);
  transition: transform .12s var(--ease), filter .12s;
}
button.primary:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}
button.ghost {
  border-radius: 12px;
  padding: 11px 16px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  background: #fff;
  color: #444;
  border: 1px solid #d0d5e4;
  transition: background .12s, border-color .12s;
}
button.ghost:hover {
  border-color: #b8bfcf;
  background: #fafbff;
}
button.ghost.danger {
  color: #b42318;
  border-color: #f0c0bc;
  margin-right: auto;
}
button.ghost.danger:hover { background: #fff5f4; }
.status {
  width: 100%;
  font-size: 12px;
  color: var(--ed-muted);
  font-weight: 600;
}
.status.ok { color: #1a7f4b; }

/* Modal */
.modal-root {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-root[hidden] { display: none !important; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 14, 28, 0.52);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal-panel {
  position: relative;
  width: min(560px, 100%);
  max-height: min(86vh, 720px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 28px 72px rgba(16, 14, 30, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.7);
  overflow: hidden;
  animation: modalIn .18s var(--ease);
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid #f0e4ea;
  background: linear-gradient(180deg, #fff9fb, #fff);
}
.modal-head strong {
  display: block;
  font-size: 16px;
  font-weight: 800;
  color: #c2185b;
  letter-spacing: -0.01em;
}
.modal-sub {
  display: block;
  font-size: 12px;
  color: #8a6a78;
  font-weight: 600;
  margin-top: 4px;
}
.modal-x {
  border: 0;
  background: #f3f4f9;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: #666;
  flex-shrink: 0;
  transition: background .12s;
}
.modal-x:hover { background: #eceef4; }
.modal-body {
  overflow: auto;
  padding: 16px 20px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.mf-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #556;
}
.mf-field input,
.mf-field textarea {
  border: 1px solid #e2e5ef;
  border-radius: 12px;
  padding: 11px 13px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: #222;
  background: #fff;
  outline: none;
  width: 100%;
  resize: vertical;
  transition: border-color .12s, box-shadow .12s;
}
.mf-field input:focus,
.mf-field textarea:focus {
  border-color: #ff9fbf;
  box-shadow: 0 0 0 3px rgba(255, 90, 138, 0.12);
}
.mod-inspector-empty {
  margin: 8px 0;
  color: #888;
  font-size: 13px;
}

.faq-editor { display: flex; flex-direction: column; gap: 12px; }
.faq-editor-list { display: flex; flex-direction: column; gap: 12px; }
.faq-row {
  border: 1px solid #e8ebf5;
  border-radius: 14px;
  padding: 12px;
  background: #fafbff;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.faq-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 800;
  color: #2f6fed;
}
.faq-remove {
  border: 1px solid #f0c0bc;
  background: #fff;
  color: #b42318;
  border-radius: var(--radius-pill);
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}
.faq-remove:disabled { opacity: 0.4; cursor: not-allowed; }
.faq-remove:not(:disabled):hover { background: #fff5f4; }
.faq-add {
  border: 1.5px dashed #b7c9f0;
  background: #f3f8ff;
  color: #2f6fed;
  border-radius: 14px;
  padding: 12px;
  font-size: 13px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
}
.faq-add:hover:not(:disabled) {
  background: #e8f1ff;
  border-color: #7aa0e8;
}
.faq-add:disabled { opacity: 0.5; cursor: not-allowed; }

.dyn-editor {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}
.dyn-list { display: flex; flex-direction: column; gap: 10px; }
.dyn-row {
  border: 1px solid #e8ebf5;
  border-radius: 14px;
  padding: 12px;
  background: #fafbff;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dyn-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 800;
  color: #456;
}
.dyn-hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: #667;
  background: #f5f7fc;
  border-radius: 12px;
  padding: 10px 12px;
}
.dyn-hint code {
  font-size: 11px;
  background: #eef;
  padding: 1px 5px;
  border-radius: 4px;
}
.dyn-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.dyn-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 560px) {
  .dyn-grid-2 { grid-template-columns: 1fr; }
}
.mf-check {
  flex-direction: row !important;
  align-items: center;
  gap: 10px !important;
}
.mf-check input { width: auto; }
.mf-inline {
  flex-direction: row !important;
  align-items: center;
  gap: 6px !important;
  font-size: 11px;
}
.mf-inline input[type="number"],
.mf-inline select {
  width: 88px;
  padding: 6px 8px;
}
.mf-inline input[type="checkbox"] { width: auto; }

.table-edit-wrap {
  overflow-x: auto;
  border: 1px solid #e2e5ef;
  border-radius: 12px;
}
.table-edit {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table-edit th,
.table-edit td {
  border: 1px solid #e2e5ef;
  padding: 4px;
  min-width: 88px;
}
.table-edit th { background: #f3f4f9; }
.table-edit input {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 6px;
  font-family: inherit;
  font-size: 13px;
  outline: none;
}

.media-preview-row {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.media-preview-img {
  width: 140px;
  height: 100px;
  object-fit: cover;
  border-radius: 12px;
  background: #f0f0f0;
  border: 1px solid #e2e5ef;
}
.media-preview-actions {
  flex: 1;
  min-width: 180px;
}
.pd-fig-meta {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: #889;
  font-weight: 600;
}
.pd-toc-hint {
  font-size: 12px;
  color: #778;
  margin: 0 14px 8px !important;
}
.pd-toc-anchor {
  font-size: 10px;
  color: #99a;
  margin-left: 6px;
  font-weight: 500;
}
.pd-rank-name {
  color: inherit;
  text-decoration: none;
  font-weight: 700;
}
a.pd-rank-name {
  color: #3d4fcf;
  text-decoration: underline;
}

.gal-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.gal-item {
  border: 1px solid #e8ebf5;
  border-radius: 14px;
  padding: 8px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.gal-item img {
  width: 100%;
  height: 90px;
  object-fit: cover;
  border-radius: 10px;
  background: #f0f0f0;
}

.modal-panel-wide {
  width: min(720px, 100%);
  max-height: min(90vh, 860px);
}
.media-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.media-upload-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  padding: 12px;
  background: #f7f8fc;
  border-radius: 14px;
}
.media-file-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #ff6e98, var(--pd-pink-deep));
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(232, 67, 122, 0.25);
}
.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  min-height: 120px;
}
.media-card {
  border: 2px solid #e2e5ef;
  border-radius: 14px;
  padding: 0;
  overflow: hidden;
  background: #fff;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border-color .12s, box-shadow .12s;
}
.media-card.is-on {
  border-color: var(--pd-pink);
  box-shadow: 0 0 0 3px rgba(255, 90, 138, 0.18);
}
.media-card img {
  display: block;
  width: 100%;
  height: 88px;
  object-fit: cover;
  background: #f0f0f0;
}
.media-card-meta {
  display: block;
  padding: 6px 8px;
  font-size: 10px;
  color: #667;
  line-height: 1.35;
  font-weight: 600;
}
.media-hint {
  margin-right: auto;
  font-size: 12px;
  color: #778;
  font-weight: 600;
}

.modal-foot {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 14px 20px 18px;
  border-top: 1px solid #f0e4ea;
  background: #fafbff;
}

.empty-state {
  padding: 48px 20px;
  text-align: center;
  color: var(--pd-muted);
  font-size: 14px;
  font-weight: 600;
}
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: rgba(20, 22, 34, 0.92);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  transition: opacity .2s, transform .2s var(--ease);
  z-index: 300;
  pointer-events: none;
  box-shadow: 0 12px 32px rgba(16, 18, 30, 0.28);
  backdrop-filter: blur(8px);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.loading-ed {
  padding: 48px;
  text-align: center;
  color: var(--ed-muted);
  font-size: 14px;
  font-weight: 600;
}

/* Projector-friendly: slightly larger hit targets when wide */
@media (min-width: 1280px) {
  .mod-btn { min-height: 60px; }
  .ProseMirror { font-size: 17px; }
}

/* ═══════════════════════════════════════════════════════════
   波波版 theme-bobo — Ghost-like writing × PopDaily pink
   ═══════════════════════════════════════════════════════════ */

body.theme-bobo {
  --pd-bg: #faf4f7;
  --pd-bg-deep: #f3e8ee;
  --pd-pink: #ff4d8d;
  --pd-pink-deep: #e82d72;
  --pd-pink-soft: #ffe9f1;
  --pd-pink-glow: rgba(255, 77, 141, 0.2);
  --pd-ink: #1a1520;
  --pd-ink-2: #4a4050;
  --pd-muted: #9a8f9a;
  --surface: #ffffff;
  --surface-2: #fff8fb;
  --surface-3: #f7eef3;
  --write-max: 720px;
  --shadow-lg: 0 18px 50px rgba(80, 30, 55, 0.08), 0 4px 14px rgba(80, 30, 55, 0.04);
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(255, 140, 180, 0.22), transparent 55%),
    radial-gradient(700px 400px at 95% 5%, rgba(255, 200, 220, 0.2), transparent 50%),
    radial-gradient(600px 360px at 50% 110%, rgba(255, 180, 200, 0.12), transparent 45%),
    linear-gradient(180deg, #fff9fb 0%, #faf4f7 45%, #f5eaf0 100%);
}

/* Brand mark */
body.theme-bobo .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
}
body.theme-bobo .logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(145deg, #ff7aab, var(--pd-pink-deep));
  box-shadow: 0 6px 14px var(--pd-pink-glow);
  letter-spacing: 0;
}
body.theme-bobo .logo-text {
  font-weight: 800;
  font-size: 16px;
  color: var(--pd-pink);
  letter-spacing: -0.02em;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
body.theme-bobo .logo-zh {
  font-size: 12px;
  font-weight: 600;
  color: var(--pd-ink-2);
  opacity: 0.85;
}
body.theme-bobo .badge {
  background: linear-gradient(135deg, #fff0f5, #ffe4ee);
  color: #b01558;
  border-color: rgba(255, 90, 138, 0.28);
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 11px;
}

/* Softer top bar */
body.theme-bobo .top {
  background: rgba(255, 255, 255, 0.82);
  border-bottom-color: rgba(255, 120, 160, 0.12);
}

/* List: blush sidebar */
body.theme-bobo .pane-list {
  background: rgba(255, 255, 255, 0.94);
  border-right-color: rgba(255, 120, 160, 0.12);
}
body.theme-bobo .feed-item.active {
  background: linear-gradient(90deg, #fff0f5, #fff);
  box-shadow: inset 3px 0 0 var(--pd-pink);
}
body.theme-bobo .list-head h2 {
  color: var(--pd-ink);
}

/* Editor chrome: almost frameless paper */
body.theme-bobo .pane-editor {
  padding: 16px 20px 40px;
}
body.theme-bobo .ed-chrome {
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  background: #fff;
}
body.theme-bobo .ed-tools {
  background: rgba(255, 252, 253, 0.96);
  border-bottom-color: rgba(255, 120, 160, 0.1);
  border-radius: 24px 24px 0 0;
}
body.theme-bobo .ed-titlebar {
  background: transparent;
  border-bottom-color: rgba(255, 120, 160, 0.08);
  padding: 14px 18px 12px;
}
body.theme-bobo .ed-titlebar .name-main {
  font-size: 14px;
  font-weight: 800;
  color: var(--pd-ink);
  letter-spacing: -0.02em;
}
body.theme-bobo .ed-titlebar .name small {
  display: block;
  margin: 2px 0 0;
  margin-left: 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--pd-muted);
}
body.theme-bobo .ed-titlebar .dots {
  display: none;
}

/* Palette: quieter chip row */
body.theme-bobo .ed-palette-wrap {
  padding: 8px 16px 10px;
  border-bottom-color: rgba(255, 120, 160, 0.08);
}
body.theme-bobo .ed-palette-label {
  color: var(--pd-muted);
  font-weight: 700;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
body.theme-bobo .ed-palette-label span {
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}
body.theme-bobo .mod-btn {
  border-radius: 14px;
  border-color: rgba(255, 120, 160, 0.14);
  background: #fff;
  min-height: 54px;
}
body.theme-bobo .mod-btn:hover {
  border-color: #ff9fbf;
  background: #fff5f8;
}

body.theme-bobo .ed-fmt {
  background: linear-gradient(180deg, #fffafc, #fff5f8);
  padding: 8px 16px 12px;
}
body.theme-bobo .ed-fmt button {
  border-radius: 10px;
  color: var(--pd-ink-2);
  min-height: 32px;
}

/* Writing sheet — Ghost-like centered column */
body.theme-bobo .ed-scroll {
  padding: 28px 12px 56px;
  background:
    radial-gradient(800px 240px at 50% 0%, rgba(255, 100, 150, 0.05), transparent 60%),
    #fff;
}
body.theme-bobo .writing-sheet {
  max-width: var(--write-max);
  margin: 0 auto;
  padding: 0 8px;
}
body.theme-bobo .ed-meta {
  margin-bottom: 18px;
  gap: 6px;
}
body.theme-bobo .ed-chip.soft {
  background: #fff5f8;
  border-color: rgba(255, 120, 160, 0.16);
  color: #8a4a62;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
body.theme-bobo .ed-chip.soft.muted {
  background: #f7f4f6;
  border-color: rgba(20, 24, 40, 0.06);
  color: var(--pd-muted);
  text-transform: none;
  font-weight: 600;
}
body.theme-bobo .ed-chip.soft.id {
  font-variant-numeric: tabular-nums;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Ghost-scale title */
body.theme-bobo .title-input {
  font-size: clamp(28px, 4.2vw, 40px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.22;
  color: var(--pd-ink);
  padding: 0 0 6px;
}
body.theme-bobo .title-input::placeholder {
  color: #d4c4cc;
  font-weight: 700;
}
body.theme-bobo .title-hint {
  margin: 0 0 18px;
  font-size: 12px;
  font-weight: 600;
  color: var(--pd-muted);
  letter-spacing: 0.01em;
}

body.theme-bobo .cover-slot {
  border-radius: 18px;
  border-color: rgba(255, 120, 160, 0.22);
  background: linear-gradient(180deg, #fff8fb, #fff0f5);
  margin-bottom: 28px;
  min-height: 120px;
}
body.theme-bobo .cover-slot .ph {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #b08a9a;
  font-weight: 600;
}
body.theme-bobo .cover-slot .ph-ico {
  font-size: 22px;
  color: var(--pd-pink);
  opacity: 0.7;
}

/* Body prose — magazine / lifestyle */
body.theme-bobo .ProseMirror {
  font-size: 18px;
  line-height: 1.9;
  color: #2c2430;
  font-weight: 400;
}
body.theme-bobo .ProseMirror p {
  margin: 0 0 1.05em;
}
body.theme-bobo .ProseMirror h2 {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  margin: 1.5em 0 0.55em;
  color: var(--pd-ink);
}
body.theme-bobo .ProseMirror h3 {
  font-size: 1.18rem;
  font-weight: 800;
  margin: 1.25em 0 0.45em;
}
body.theme-bobo .ProseMirror blockquote {
  border-left-width: 3px;
  border-left-color: var(--pd-pink);
  background: linear-gradient(90deg, #fff5f8, transparent);
  border-radius: 0 14px 14px 0;
  padding: 14px 18px;
  color: #5a4a55;
  font-size: 1.05em;
}
body.theme-bobo .ProseMirror p.is-editor-empty:first-child::before {
  color: #d0c0c8;
  font-weight: 500;
}
body.theme-bobo .tiptap-wrap {
  border-radius: 0;
  min-height: 320px;
}
body.theme-bobo .tiptap-wrap:focus-within {
  border-color: transparent;
  box-shadow: none;
}

/* Module cards: softer lifestyle */
body.theme-bobo .pd-module-host {
  border-radius: 18px;
}
body.theme-bobo .pd-module-toolbar {
  background: linear-gradient(90deg, #fff0f5, #fffafc);
  border-color: #ffd6e6;
  border-radius: 18px 18px 0 0;
}
body.theme-bobo .pd-mod {
  border-radius: 18px;
  border-color: rgba(255, 120, 160, 0.14);
  background: linear-gradient(180deg, #fff, #fff9fb);
  box-shadow: 0 4px 16px rgba(80, 30, 55, 0.04);
}
body.theme-bobo .pd-mod-head {
  background: linear-gradient(180deg, #fff, #fff5f8);
  border-bottom-color: #ffe4ee;
}
body.theme-bobo .pd-mod-cta {
  background: linear-gradient(145deg, #fff5f8, #fff);
}

/* Footer soft */
body.theme-bobo .ed-foot {
  background: linear-gradient(180deg, #fffafc, #fff5f8);
  border-top-color: rgba(255, 120, 160, 0.12);
  border-radius: 0 0 24px 24px;
}
body.theme-bobo button.primary {
  border-radius: 999px;
  padding: 11px 20px;
}

/* Banner soft */
body.theme-bobo .banner {
  background: rgba(255, 248, 251, 0.75);
  border-bottom-color: rgba(255, 120, 160, 0.1);
}
body.theme-bobo .banner-bar-label {
  background: #ffe9f1;
  border-color: #ffc5d8;
  color: #b01558;
}

/* View toggle labels already 寫作/原始碼 */
body.theme-bobo .view-toggle {
  background: #fff5f8;
  border-color: rgba(255, 120, 160, 0.18);
}
body.theme-bobo .view-toggle-btn.on {
  color: var(--pd-pink-deep);
}

@media (min-width: 1280px) {
  body.theme-bobo .ProseMirror { font-size: 18.5px; }
  body.theme-bobo .writing-sheet { padding: 0 12px; }
}

/* Focus writing: slightly dim list when open editor feels active */
body.theme-bobo.list-open .pane-list {
  box-shadow: 4px 0 28px rgba(80, 30, 55, 0.04);
}
