/* app.css — 應用介面樣式（溫暖書卷氣、留白充足）。
   卡片本身的樣式全部寫在 js/render.js 的內聯樣式裡，不在這裡。 */

:root {
  --bg: #EFEAE0;
  --panel: #FCFAF4;
  --panel-2: #F5F0E6;
  --ink: #2B2B2B;
  --ink-soft: #5C564B;
  --muted: #9A927F;
  --accent: #33465E;
  --accent-deep: #29384C;
  --cinnabar: #8D3A36;
  --line: #E6DFD1;
  --shadow: 0 1px 2px rgba(43, 43, 43, 0.04), 0 4px 16px rgba(43, 43, 43, 0.05);
  --serif: "Georgia", "Times New Roman", "宋体", "SimSun", serif;
  --sans: "Segoe UI", "微軟正黑體", "Microsoft JhengHei", "微軟雅黑", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  display: flex;
  flex-direction: column;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* ============ 頂部工具欄 ============ */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: rgba(251, 250, 246, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.brand {
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--accent);
  white-space: nowrap;
}
.brand .sub { font-size: 11px; font-weight: 400; letter-spacing: 2px; color: var(--muted); margin-left: 10px; }
.toolbar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.divider { width: 1px; height: 22px; background: var(--line); margin: 0 6px; }

button {
  font-family: var(--sans);
  font-size: 13px;
  padding: 8px 16px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.15s ease;
}
button:hover { border-color: var(--accent); color: var(--accent); }
button:active { transform: translateY(1px); }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover { background: var(--accent-deep); color: #fff; }
button.primary-accent { background: var(--cinnabar); border-color: var(--cinnabar); color: #fff; }
button.primary-accent:hover { opacity: 0.92; color: #fff; }
.toolbar-actions button { transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease; }
.toolbar-actions button:hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(43, 43, 43, 0.10); }
.toolbar-actions button:active { transform: translateY(0); }

/* ============ 主體左右佈局 ============ */
.layout { flex: 1 1 auto; display: flex; min-height: 0; }

.editor {
  width: 372px;
  flex: 0 0 auto;
  overflow-y: auto;
  padding: 20px 18px 40px;
  border-right: 1px solid var(--line);
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 18px 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.panel h2 {
  margin: 0 0 14px;
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--accent);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

/* ============ 表單字段 ============ */
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 12px; color: var(--ink-soft); margin-bottom: 5px; letter-spacing: 1px; }
.field input[type="text"],
.field textarea {
  width: 100%;
  font-family: var(--serif);
  font-size: 15px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field textarea { resize: vertical; line-height: 1.7; }
.field select {
  width: 100%; font-family: var(--sans); font-size: 14px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
}
.field input[type="date"] {
  width: 100%; font-family: var(--sans); font-size: 14px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
}
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(51, 70, 94, 0.10);
}
.field-row { display: flex; gap: 8px; }
.field-row .field { flex: 1; }
.check-line { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-soft); padding: 9px 0 0; }
.check-line input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--cinnabar); cursor: pointer; }

.hint { font-size: 12px; color: var(--muted); line-height: 1.7; margin: 4px 0 0; }

/* ============ 樣式控制 ============ */
.ctrl { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.ctrl > label { font-size: 12px; color: var(--ink-soft); letter-spacing: 1px; flex: 0 0 auto; }
.ctrl select {
  font-family: var(--sans); font-size: 13px; padding: 7px 10px;
  border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink);
}

.segmented { display: flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: #fff; }
.segmented .seg-btn {
  padding: 7px 14px; font-size: 13px; border: none; border-radius: 0; background: transparent;
  border-right: 1px solid var(--line); color: var(--ink-soft);
  transition: background-color 0.2s ease, color 0.2s ease;
}
.segmented .seg-btn:last-child { border-right: none; }
.segmented .seg-btn.active { background: var(--accent); color: #fff; }

/* 滑桿 */
.slider { display: flex; align-items: center; gap: 10px; flex: 1 1 auto; justify-content: flex-end; }
.slider input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 120px; height: 4px; border-radius: 2px;
  background: var(--line); outline: none; cursor: pointer;
}
.slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--accent); border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--accent);
  transition: transform 0.15s ease, background-color 0.2s ease;
}
.slider input[type="range"]:hover::-webkit-slider-thumb { transform: scale(1.15); }
.slider-val { font-size: 12px; color: var(--ink-soft); min-width: 34px; text-align: right; font-variant-numeric: tabular-nums; }

/* 配色包 */
.theme-wrap { flex: 1 1 auto; min-width: 0; }
.theme-swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 100%; margin-bottom: 10px; }
.theme-swatch {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 6px 4px; border-radius: 9px;
  border: 1px solid var(--line); background: #fff; cursor: pointer;
  transition: transform 0.18s ease, border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.theme-swatch .dots { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; width: 100%; height: 18px; }
.theme-swatch .dots i { border-radius: 3px; display: block; }
.theme-swatch .t-label { font-size: 10px; color: var(--ink-soft); line-height: 1.2; }
.theme-swatch:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.theme-swatch.active { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(51, 70, 94, 0.25); }
.theme-custom { font-size: 12px; padding: 7px 10px; }

.custom-colors {
  width: 100%;
  max-height: 0; overflow: hidden; opacity: 0;
  margin-top: 0; padding: 0 10px;
  background: var(--panel-2); border-radius: 10px;
  transition: max-height 0.32s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.22s ease, margin-top 0.32s ease, padding 0.32s ease;
}
.custom-colors.open { max-height: 220px; opacity: 1; margin-top: 10px; padding: 10px; }
.color-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.color-grid .color-row { margin-bottom: 0; }
.color-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.color-row:last-child { margin-bottom: 0; }
.color-row span { font-size: 12px; color: var(--ink-soft); }
.color-row input[type="color"] {
  width: 32px; height: 26px; padding: 0; border: 1px solid var(--line);
  border-radius: 6px; background: #fff; cursor: pointer;
}
.theme-swatch-item { position: relative; }
.theme-swatch-item .theme-swatch { width: 100%; }
.theme-del {
  position: absolute; top: -4px; right: -4px;
  width: 18px; height: 18px; line-height: 16px; padding: 0;
  font-size: 13px; border: 1px solid var(--line); background: #fff; color: var(--cinnabar);
  border-radius: 50%; cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,0.12);
}
.theme-del:hover { background: var(--cinnabar); color: #fff; border-color: var(--cinnabar); }
.theme-save-row { display: flex; gap: 6px; margin-top: 8px; }
.theme-save-row input[type="text"] {
  flex: 1; min-width: 0; font-size: 13px; padding: 7px 10px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink);
}
.theme-save-row button { font-size: 12px; padding: 7px 12px; white-space: nowrap; }
.theme-gen { width: 100%; margin-top: 8px; font-size: 12px; padding: 7px 12px; color: var(--accent); border-color: var(--accent); background: transparent; }

/* ============ 圖片控制 ============ */
.img-strip { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.img-thumb {
  width: 56px; height: 56px; padding: 2px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; cursor: pointer; overflow: hidden;
}
.img-thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; display: block; }
.img-thumb.active { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(51, 70, 94, 0.25); }

.img-edit { border-top: 1px dashed var(--line); padding-top: 12px; }
.mini-label { display: block; font-size: 11px; color: var(--muted); letter-spacing: 1px; margin: 10px 0 6px; }
.mini-label:first-child { margin-top: 0; }

.opt-buttons { display: flex; gap: 6px; flex-wrap: wrap; }
.opt-btn {
  font-size: 12px; padding: 6px 12px; border-radius: 8px;
  border: 1px solid var(--line); background: #fff; color: var(--ink-soft);
}
.opt-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.img-range { display: flex; align-items: center; gap: 10px; }
.img-range input[type="range"] {
  -webkit-appearance: none; appearance: none;
  flex: 1; height: 4px; border-radius: 2px; background: var(--line); outline: none; cursor: pointer;
}
.img-range input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--cinnabar); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--cinnabar);
}
.btn-del { margin-top: 12px; color: var(--cinnabar); border-color: #E4C8C4; background: #FBF1EF; }
.btn-del:hover { color: var(--cinnabar); border-color: var(--cinnabar); }

/* ============ 右側預覽 ============ */
.preview-pane { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; }
.preview-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 22px; border-bottom: 1px solid var(--line);
  background: var(--panel);
}
.scale-label { font-size: 12px; color: var(--ink-soft); display: flex; align-items: center; gap: 8px; }
.scale-label select {
  font-family: var(--sans); font-size: 13px; padding: 5px 8px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
.status { font-size: 12px; color: var(--muted); }

.card-stage {
  flex: 1 1 auto; overflow: auto;
  display: flex; align-items: flex-start; justify-content: flex-start;
  padding: 36px;
  background: radial-gradient(1200px 600px at 50% 0%, #EFEBE2 0%, #E4DFD3 100%);
}
#preview { margin: auto; line-height: 0; }

/* ============ 草稿側欄 ============ */
.sidebar {
  position: fixed; top: 0; right: 0; height: 100%; width: 330px;
  background: var(--panel); border-left: 1px solid var(--line);
  z-index: 30; display: flex; flex-direction: column;
  box-shadow: -8px 0 28px rgba(43, 43, 43, 0.10);
}
.sidebar-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid var(--line);
  font-family: var(--serif); font-size: 15px; color: var(--accent); font-weight: 700; letter-spacing: 2px;
}
.sidebar-head button { border: none; background: none; font-size: 22px; line-height: 1; color: var(--muted); }
.draft-list { overflow-y: auto; padding: 12px; flex: 1; }
.draft-item {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; margin-bottom: 10px; cursor: pointer; transition: all 0.15s ease;
}
.draft-item:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.draft-item .d-title { font-size: 14px; font-weight: 600; font-family: var(--serif); }
.draft-item .d-meta { font-size: 12px; color: var(--muted); margin-top: 6px; display: flex; justify-content: space-between; align-items: center; }
.draft-item .d-del { border: none; background: none; color: var(--cinnabar); font-size: 12px; padding: 2px 4px; }
.draft-empty { color: var(--muted); font-size: 13px; text-align: center; margin-top: 40px; line-height: 1.8; }

/* ============ 遮罩與提示 ============ */
.overlay { position: fixed; inset: 0; background: rgba(43, 43, 43, 0.28); z-index: 20; }
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  background: rgba(43, 43, 43, 0.95); color: #F5F1E8; padding: 11px 22px; border-radius: 24px;
  font-size: 13px; z-index: 40; box-shadow: 0 6px 20px rgba(0,0,0,0.2);
  animation: toast-in 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
.hidden { display: none !important; }

/* 細窄滾動條 */
.editor::-webkit-scrollbar, .draft-list::-webkit-scrollbar { width: 8px; }
.editor::-webkit-scrollbar-thumb, .draft-list::-webkit-scrollbar-thumb { background: #D4CDBE; border-radius: 4px; }

/* ============ 界面主题（皮膚） ============ */
/* 深色系通用覆蓋（墨黑 / 墨藍 / 玄青） */
body:is([data-theme="dark"], [data-theme="vellum"], [data-theme="grove"]) .toolbar { background: var(--panel); }
body:is([data-theme="dark"], [data-theme="vellum"], [data-theme="grove"]) button { background: var(--panel-2); color: var(--ink); }
body:is([data-theme="dark"], [data-theme="vellum"], [data-theme="grove"]) .panel { background: var(--panel); }
body:is([data-theme="dark"], [data-theme="vellum"], [data-theme="grove"]) .field input[type="text"],
body:is([data-theme="dark"], [data-theme="vellum"], [data-theme="grove"]) .field textarea,
body:is([data-theme="dark"], [data-theme="vellum"], [data-theme="grove"]) .field input[type="date"],
body:is([data-theme="dark"], [data-theme="vellum"], [data-theme="grove"]) .field select,
body:is([data-theme="dark"], [data-theme="vellum"], [data-theme="grove"]) .ctrl select,
body:is([data-theme="dark"], [data-theme="vellum"], [data-theme="grove"]) .scale-label select,
body:is([data-theme="dark"], [data-theme="vellum"], [data-theme="grove"]) .ui-theme-label select { background: var(--panel-2); color: var(--ink); }
body:is([data-theme="dark"], [data-theme="vellum"], [data-theme="grove"]) .segmented,
body:is([data-theme="dark"], [data-theme="vellum"], [data-theme="grove"]) .segmented .seg-btn { background: var(--panel-2); }
body:is([data-theme="dark"], [data-theme="vellum"], [data-theme="grove"]) .theme-swatch,
body:is([data-theme="dark"], [data-theme="vellum"], [data-theme="grove"]) .img-crop-stage,
body:is([data-theme="dark"], [data-theme="vellum"], [data-theme="grove"]) .opt-btn { background: var(--panel-2); }
body:is([data-theme="dark"], [data-theme="vellum"], [data-theme="grove"]) .theme-del { background: var(--panel-2); }
body:is([data-theme="dark"], [data-theme="vellum"], [data-theme="grove"]) .theme-save-row input[type="text"],
body:is([data-theme="dark"], [data-theme="vellum"], [data-theme="grove"]) .color-row input[type="color"] { background: var(--panel-2); color: var(--ink); }
body:is([data-theme="dark"], [data-theme="vellum"], [data-theme="grove"]) .card-stage { background: radial-gradient(1200px 600px at 50% 0%, var(--panel) 0%, var(--bg) 100%); }
body:is([data-theme="dark"], [data-theme="vellum"], [data-theme="grove"]) .draft-item { background: var(--panel-2); }
body:is([data-theme="dark"], [data-theme="vellum"], [data-theme="grove"]) .preview-toolbar { background: var(--panel); }

/* 深色系配色 */
body[data-theme="dark"] {
  --bg: #17191C; --panel: #202227; --panel-2: #282B31;
  --ink: #EAE5D8; --ink-soft: #B6B0A2; --muted: #857E70;
  --accent: #A9BFD0; --accent-deep: #8FA8BC; --cinnabar: #D08A72;
  --line: #34363C;
  --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 4px 16px rgba(0,0,0,0.35);
}
body[data-theme="vellum"] {
  --bg: #232B54; --panel: #2B3466; --panel-2: #343E78;
  --ink: #ECE8DA; --ink-soft: #C4C0A8; --muted: #9A96BC;
  --accent: #E8D85C; --accent-deep: #C8B94A; --cinnabar: #E0805F;
  --line: #3A4280;
  --shadow: 0 1px 2px rgba(0,0,0,0.35), 0 4px 16px rgba(0,0,0,0.4);
}
body[data-theme="grove"] {
  --bg: #18251B; --panel: #1F2F23; --panel-2: #28392C;
  --ink: #E6E0CE; --ink-soft: #B5AF9A; --muted: #8A8F7E;
  --accent: #C07030; --accent-deep: #A85E28; --cinnabar: #C8524A;
  --line: #33453A;
  --shadow: 0 1px 2px rgba(0,0,0,0.35), 0 4px 16px rgba(0,0,0,0.4);
}

/* 淺色系配色 */
body[data-theme="forest"] {
  --bg: #E2EAE0; --panel: #F2F6EE; --panel-2: #E9EFE3;
  --ink: #1F2A20; --ink-soft: #4C5748; --muted: #8A9484;
  --accent: #2E4A2A; --accent-deep: #243A21; --cinnabar: #B5463A;
  --line: #D2DCCE;
}
body[data-theme="cobalt"] {
  --bg: #E5E9F5; --panel: #F3F5FB; --panel-2: #EAEEF5;
  --ink: #1A1E33; --ink-soft: #4A4E63; --muted: #8A8EA3;
  --accent: #1F2BE0; --accent-deep: #1A24C0; --cinnabar: #C0392B;
  --line: #D6DBEC;
}
body[data-theme="burgundy"] {
  --bg: #F7E3DF; --panel: #FCF1EE; --panel-2: #F7E8E4;
  --ink: #3F1A22; --ink-soft: #6E4A52; --muted: #A0888E;
  --accent: #7A1F35; --accent-deep: #5E1829; --cinnabar: #B5463A;
  --line: #EBD2CC;
}

/* ============ 工具欄的界面主題選擇 ============ */
.ui-theme-label { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.ui-theme-label select {
  font-family: var(--sans); font-size: 13px; padding: 5px 8px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink);
}

/* ============ 豎排紅點開關 ============ */
.ctrl input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--cinnabar); cursor: pointer; }

/* ============ 圖片自由裁切（拖拽平移 + 縮放） ============ */
.img-crop-editor { margin-top: 6px; }
.img-crop-stage {
  position: relative; width: 180px; max-width: 100%;
  border-radius: 8px; overflow: hidden; cursor: grab;
  border: 1px solid var(--line); background: #E6DFD1;
  touch-action: none; user-select: none;
}
.img-crop-stage:active { cursor: grabbing; }
.img-crop-img { position: absolute; left: 0; top: 0; max-width: none; max-height: none; }
.img-crop-editor .img-range { margin-top: 8px; }
.img-crop-editor .opt-btn { margin-top: 8px; }

/* ============ 作者头像 ============ */
.avatar-current { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.avatar-current-info { flex: 1; }
.avatar-thumb { position: relative; border-radius: 50%; overflow: hidden; background: #E6DFD1; border: 1px solid var(--line); flex-shrink: 0; }
.avatar-thumb img { position: absolute; left: 0; top: 0; max-width: none; max-height: none; display: block; }
.avatar-thumb.avatar-empty { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 11px; }
.avatar-btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.avatar-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.avatar-lib-item { position: relative; padding: 0; border: 1px solid transparent; border-radius: 50%; background: none; cursor: pointer; }
.avatar-lib-item.active { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.avatar-del { position: absolute; top: -6px; right: -6px; width: 18px; height: 18px; line-height: 16px; text-align: center; background: var(--cinnabar); color: #fff; border-radius: 50%; font-size: 12px; }
.avatar-crop-stage { position: relative; width: 160px; height: 160px; border-radius: 50%; overflow: hidden; cursor: grab; border: 1px solid var(--line); background: #E6DFD1; touch-action: none; user-select: none; margin-bottom: 10px; }
.avatar-crop-stage:active { cursor: grabbing; }
.avatar-crop-stage img { position: absolute; left: 0; top: 0; max-width: none; max-height: none; }

/* 合集「未歸檔」卡片：白色底（用更高优先级盖过 .collection-card .cc-cover 的渐变） */
.collection-card .cc-cover.is-unfiled { background: #FFFFFF; }
.collection-card .cc-cover.is-unfiled .cc-scrim { display: none; }
.collection-card .cc-cover.is-unfiled .cc-name { color: #5C564B; text-shadow: none; }
.collection-card .cc-cover.is-unfiled .cc-count { color: #5C564B; background: rgba(0,0,0,0.06); }
.collection-card .cc-cover.is-unfiled .cc-blossom { opacity: 0.35; }

/* ============ 頁腳 ============ */
.footer {
  flex: 0 0 auto;
  text-align: center;
  padding: 10px 16px;
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  background: var(--panel);
}
.footer-tagline { display: block; margin-top: 3px; font-size: 10px; letter-spacing: 2px; color: var(--accent); }

/* 詩句卡片（左側編輯區底部） */
.verse-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 8px;
  box-shadow: var(--shadow);
}
.verse-head { display: flex; align-items: center; justify-content: space-between; font-size: 11px; letter-spacing: 2px; color: var(--muted); margin-bottom: 10px; }
.verse-refresh { border: none; background: none; font-size: 16px; line-height: 1; color: var(--muted); cursor: pointer; padding: 2px 4px; transition: transform 0.3s ease, color 0.2s ease; }
.verse-refresh:hover { color: var(--accent); transform: rotate(90deg); }
.verse-text { font-family: var(--serif); font-size: 15px; line-height: 1.8; color: var(--ink); margin: 0 0 6px; }
.verse-source { font-size: 11px; color: var(--muted); margin: 0; letter-spacing: 1px; }

/* ============ 合集全屏视图 ============ */
.collections-view {
  position: fixed; inset: 0; z-index: 35;
  background: var(--bg);
  overflow-y: auto;
  padding: 26px 32px 64px;
}
.col-page { max-width: 1080px; margin: 0 auto; }
.col-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.col-head h1 { font-family: var(--serif); font-size: 22px; letter-spacing: 3px; color: var(--accent); margin: 0; }
.col-head-actions { display: flex; gap: 8px; }
.col-back { border: none; background: none; color: var(--muted); font-size: 14px; cursor: pointer; padding: 6px 8px; letter-spacing: 1px; }
.col-back:hover { color: var(--accent); }

.collection-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
.collection-card { cursor: pointer; }
.collection-card .cc-cover {
  position: relative; width: 100%; aspect-ratio: 1 / 1;
  border-radius: 12px; overflow: hidden;
  background: linear-gradient(155deg, var(--accent), #1b2233);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.2s ease;
}
.collection-card:hover .cc-cover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(43,43,43,0.14); }
.cc-img { position: absolute; left: 0; top: 0; max-width: none; max-height: none; }
.cc-blossom { position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%); opacity: 0.5; pointer-events: none; }
.cc-scrim { position: absolute; left: 0; right: 0; bottom: 0; height: 58%; background: linear-gradient(to top, rgba(18,18,20,0.74), rgba(18,18,20,0)); }
.cc-name {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 14px 13px 11px;
  font-family: var(--serif); font-size: 15px; line-height: 1.4;
  color: #F7F3EA; letter-spacing: 1px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.35);
  overflow-wrap: break-word;
}
.cc-count {
  position: absolute; top: 8px; right: 8px;
  font-size: 11px; color: #fff; background: rgba(20,20,22,0.52);
  padding: 2px 9px; border-radius: 20px; letter-spacing: 1px;
}

/* 合集内容页文档列表 */
.col-doc-list { display: flex; flex-direction: column; gap: 10px; }

/* 合集编辑 */
.col-editor-body { max-width: 500px; }
.col-cover-area { margin-bottom: 18px; }
.col-cover-stage {
  position: relative; width: 260px; height: 260px;
  border-radius: 12px; overflow: hidden; cursor: grab;
  background: linear-gradient(155deg, var(--accent), #1b2233);
  border: 1px solid var(--line);
  touch-action: none; user-select: none;
}
.col-cover-stage:active { cursor: grabbing; }
.col-cover-img { position: absolute; left: 0; top: 0; max-width: none; max-height: none; }
.col-crop-controls { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 12px; color: var(--ink-soft); }
.col-crop-controls input[type=range] { flex: 1; }
.col-cover-btns { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.col-editor-actions { display: flex; gap: 8px; margin-top: 20px; }
.col-hint { margin: 2px 2px 18px; color: var(--muted); font-size: 13px; line-height: 1.7; max-width: 760px; }
.col-doc-list .d-move { font-size: 12px; padding: 3px 6px; border-radius: 6px; border: 1px solid var(--line); background: #fff; color: var(--ink); max-width: 150px; }
