/* Yi Tuo Hub · 公众号排版工坊 —— 电影感视觉（Vectrus 风）
 * 关键词：深海军蓝 #1D3045 / 大字距全大写小标签 / 细字重大标题 /
 *        圆形细线按钮 / 发丝线 / 错峰上浮入场 cubic-bezier(.16,1,.3,1)
 */
:root {
  --bg: #F7F8FA;
  --bg-mesh: radial-gradient(1200px 800px at 8% 8%, rgba(200, 225, 245, 0.38) 0%, transparent 60%),
             radial-gradient(1000px 700px at 92% 88%, rgba(228, 222, 248, 0.32) 0%, transparent 55%),
             radial-gradient(700px 500px at 50% 30%, rgba(254, 246, 228, 0.22) 0%, transparent 60%),
             #F7F8FA;
  --panel: rgba(255, 255, 255, 0.88);
  --panel-solid: #FFFFFF;
  --dark: #122131;
  --dark-2: #0B1622;
  --ink: #142232;
  --text: #2A3B4D;
  --sub: #4E6174;
  --sub2: #7E92A5;
  --line: rgba(20, 36, 54, 0.08);
  --line-strong: rgba(20, 36, 54, 0.14);
  --ok: #0D7A58;
  --bad: #BE382A;
  --warn: #B45309;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --spring: cubic-bezier(0.34, 1.4, 0.64, 1);

  /* 全局权威无衬线云端字体与等宽字体族 */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "HarmonyOS Sans SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  --font-mono: 'JetBrains Mono', "SF Mono", Menlo, Monaco, Consolas, "Liberation Mono", monospace;

  /* 字阶阶梯 (Fluid Typography Scale) */
  --text-2xs: 10px;
  --text-xs: 11px;
  --text-sm: 12.5px;
  --text-base: 13.5px;
  --text-md: 14.5px;
  --text-lg: 16px;
  --text-xl: 18px;
}
* { box-sizing: border-box; }
button, [role="button"], input, select, textarea, a { touch-action: manipulation; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  -webkit-tap-highlight-color: transparent;
  background: var(--bg-mesh);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
}

/* ---------- 入场动画 ---------- */
@keyframes riseIn {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}
.rise { animation: riseIn 0.7s var(--ease) both; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 28px;
  background: rgba(244, 246, 248, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand .logo { display: block; line-height: 0; flex-shrink: 0; }
.brand h1 {
  margin: 0;
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--dark);
  white-space: nowrap;
  line-height: 1.3;
}
.brand-badge-slot {
  display: flex;
  align-items: center;
  margin-left: 4px;
}
.btn-brand-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px 3px 8px;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.btn-brand-tag:hover {
  border-color: var(--dark);
  background: #FFFFFF;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transform: translateY(-0.5px);
}
.btn-brand-tag:active {
  transform: scale(0.98);
}
.brand-tag-dots {
  display: inline-flex;
  align-items: center;
}
.dot-ocean {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2B4764;
  box-shadow: 0 0 0 2px rgba(43, 71, 100, 0.18);
}
.brand-tag-name {
  font-family: 'Plus Jakarta Sans', -apple-system, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--dark);
  text-transform: uppercase;
}
.brand-tag-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--sub2);
  text-transform: uppercase;
  background: rgba(20, 36, 54, 0.06);
  padding: 1px 6px;
  border-radius: 4px;
}

/* 品牌自定义弹窗样式 */
.brand-config-box {
  width: 480px;
  max-width: min(480px, calc(100vw - 32px));
}
.brand-form-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0 20px;
  text-align: left;
}
.brand-input-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.brand-input-group span {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--sub);
}
.brand-input-group input {
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #FAFBFD;
  font-size: 13px;
  color: var(--dark);
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.brand-input-group input:focus {
  border-color: var(--dark);
  background: #FFFFFF;
}
.brand-preset-pills {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}
.preset-label {
  font-size: 11px;
  color: var(--sub2);
}
.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.btn-preset-pill {
  border: 1px solid var(--line);
  background: #FFFFFF;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--dark);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.btn-preset-pill:hover {
  border-color: var(--dark);
  background: rgba(20, 36, 54, 0.04);
}
.brand h1 em {
  font-style: normal;
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--sub);
  margin-left: 8px;
}
.brand p {
  margin: 2px 0 0;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--sub2);
  text-transform: uppercase;
}
.actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

/* ---------- 按钮语言：胶囊 + 圆形细线 ---------- */
.btn {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 16px;
  height: 36px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: opacity 0.25s, border-color 0.25s, color 0.25s, background 0.25s, transform 0.25s var(--ease);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
  flex-shrink: 0;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
}
.btn svg {
  flex-shrink: 0;
  display: block;
}
.btn.primary {
  background: linear-gradient(180deg, #FFFFFF 0%, #F5F7FA 100%);
  color: #14283E;
  border-color: #2B4764;
  box-shadow: 0 2px 8px rgba(20, 40, 62, 0.06), inset 0 1px 0 0 #FFFFFF;
}
.btn.primary:hover {
  background: #FFFFFF;
  border-color: #14283E;
  box-shadow: 0 4px 14px rgba(20, 40, 62, 0.10), inset 0 1px 0 0 #FFFFFF;
  transform: translateY(-1px);
}
.btn.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}
.btn.ghost:hover {
  border-color: var(--dark);
  background: rgba(255, 255, 255, 0.6);
}
.btn:disabled {
  cursor: wait;
  opacity: 0.62;
}
.btn.tiny {
  height: 28px;
  padding: 0 11px;
  font-size: 11.5px;
  gap: 5px;
}
.btn.active {
  background: #FFFFFF;
  color: #14283E;
  border-color: #2B4764;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}
.btn.icon-round {
  width: 36px;
  height: 36px;
  padding: 0;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--dark);
  flex-shrink: 0;
}
.btn.icon-round:hover {
  border-color: var(--dark);
  background: rgba(255, 255, 255, 0.6);
}

/* ---------- Hero ---------- */
.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 30px 32px 16px;
}
.hero-eyebrow {
  margin: 0;
  font-size: 10px;
  letter-spacing: 0.32em;
  color: var(--sub2);
  font-weight: 600;
  text-transform: uppercase;
}
.hero-title {
  margin: 12px 0 0;
  font-size: clamp(22px, 2.6vw, 32px);
  font-weight: 300;
  letter-spacing: 0.04em;
  line-height: 1.3;
  color: var(--dark);
}
.hero-title strong { font-weight: 600; }
.hero-meta {
  text-align: right;
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--sub2);
  line-height: 2.1;
  text-transform: uppercase;
  white-space: nowrap;
}

/* ---------- 主题选择器（工具栏下拉） ---------- */
.picker-slot { position: relative; display: inline-flex; gap: 6px; flex-shrink: 0; }
.picker-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  height: 30px;
  padding: 0 12px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: var(--dark);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  box-sizing: border-box;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.picker-btn:hover { border-color: var(--dark); background: #FAFBFD; }
.picker-btn:focus-visible { outline: 2px solid rgba(29, 48, 69, 0.22); outline-offset: 2px; }
.picker-btn.selected { background: var(--bg); border-color: #C8D2DC; }
.picker-btn.open { border-color: var(--dark); background: #fff; box-shadow: 0 0 0 2px rgba(18, 33, 49, 0.08); }
.picker-kind {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--sub2);
}
.picker-btn.selected .picker-kind { color: var(--sub); }
.picker-count { font-size: 10.5px; font-weight: 500; color: var(--sub2); }
.picker-btn .swatch {
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.picker-pop {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 80;
  width: 560px;
  max-width: min(560px, calc(100vw - 28px));
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(18, 33, 49, 0.14), 0 2px 8px rgba(0, 0, 0, 0.04);
  padding: 14px 16px;
  box-sizing: border-box;
  overflow: hidden;
}
.pop-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.pop-title { font-size: 10.5px; letter-spacing: 0.16em; font-weight: 700; color: var(--sub); text-transform: uppercase; }
.pop-note { font-size: 9.5px; letter-spacing: 0.12em; color: var(--sub2); }
.pop-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; width: 100%; box-sizing: border-box; }
.group-tab {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 999px;
  padding: 0 11px;
  height: 26px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--sub);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.group-tab:hover { color: var(--dark); border-color: var(--dark); }
.group-tab:focus-visible { outline: 2px solid rgba(29, 48, 69, 0.4); outline-offset: -2px; }
.group-tab.active {
  background: #FFFFFF;
  color: #14283E;
  border-color: #2B4764;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  font-weight: 700;
}
.group-tab .cnt { font-weight: 400; opacity: 0.65; margin-left: 2px; }
.pop-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  overflow-x: hidden !important;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  width: 100%;
  box-sizing: border-box;
}
.pop-grid::-webkit-scrollbar,
.level-list::-webkit-scrollbar,
.color-list::-webkit-scrollbar {
  width: 5px;
  height: 0px;
}
.pop-grid::-webkit-scrollbar-thumb,
.level-list::-webkit-scrollbar-thumb,
.color-list::-webkit-scrollbar-thumb {
  background: rgba(20, 36, 54, 0.15);
  border-radius: 999px;
}
.pop-card {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  text-align: left;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  transition: border-color 0.2s, background 0.2s;
}
.pop-card:hover { border-color: #B9C6D2; background: #FAFBFD; }
.pop-card.active { border-color: var(--dark); background: var(--bg); }
.pop-card .swatch {
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.pop-card-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1 1 0;
  overflow: hidden;
}
.pop-card .tname {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--dark);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pop-card .tdesc {
  font-size: 10px;
  color: var(--sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
  margin-top: 2px;
}

/* ---------- 蓝梦原创视觉等级（沿用现有胶囊与下拉语言） ---------- */
.level-picker-slot { position: relative; display: inline-flex; flex-shrink: 0; }
.level-picker-slot[hidden],
.motion-mode-btn[hidden] { display: none !important; }
.level-picker-btn { max-width: 220px; }
.level-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #E8EEF5;
  color: #1E3A5F;
  border: 1px solid rgba(30, 58, 95, 0.14);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.level-pop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 82;
  width: 420px;
  max-width: min(420px, calc(100vw - 28px));
  padding: 14px 16px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 24px 60px rgba(18, 33, 49, 0.14), 0 2px 8px rgba(0, 0, 0, 0.04);
  box-sizing: border-box;
  overflow: hidden;
}
.level-pop-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}
.level-list {
  display: grid;
  gap: 6px;
  max-height: 340px;
  overflow-y: auto;
  overflow-x: hidden !important;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  width: 100%;
  box-sizing: border-box;
}
.level-option {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--dark);
  text-align: left;
  cursor: pointer;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
  transition: border-color 0.2s, background 0.2s;
}
.level-option:hover { border-color: #B9C6D2; background: #FAFBFD; }
.level-option.active { border-color: var(--dark); background: var(--bg); }
.level-no {
  padding-top: 1px;
  color: var(--sub);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
}
.level-copy { display: flex; flex-direction: column; min-width: 0; }
.level-copy strong { font-size: 12.5px; font-weight: 650; line-height: 1.3; }
.level-copy small { margin-top: 3px; color: var(--sub); font-size: 10.5px; line-height: 1.45; text-wrap: pretty; }
.level-motion {
  min-width: 22px;
  padding: 3px 6px;
  border-radius: 999px;
  background: #E8EEF5;
  color: #1E3A5F;
  border: 1px solid rgba(30, 58, 95, 0.14);
  font-size: 9px;
  font-weight: 700;
  text-align: center;
  flex-shrink: 0;
}
.level-footnote {
  margin: 10px 2px 0;
  color: var(--sub2);
  font-size: 9.5px;
  line-height: 1.55;
  text-wrap: pretty;
}
.motion-mode-btn { min-width: 68px; flex-shrink: 0; }

/* ---------- 高级排版配色选择（每主题 5 套定制配色） ---------- */
.color-picker-slot { position: relative; display: inline-flex; flex-shrink: 0; }
.color-picker-slot[hidden] { display: none !important; }
.color-picker-btn { max-width: 220px; }
.color-chip-dots {
  display: inline-flex;
  align-items: center;
  flex: none;
}
.color-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1px solid rgba(29, 48, 69, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}
.color-dot + .color-dot { margin-left: -3px; }
.color-chip-dots.large .color-dot { width: 15px; height: 15px; }
.color-pop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 82;
  width: 420px;
  max-width: min(420px, calc(100vw - 28px));
  padding: 14px 16px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 24px 60px rgba(18, 33, 49, 0.14), 0 2px 8px rgba(0, 0, 0, 0.04);
  box-sizing: border-box;
  overflow: hidden;
}
.color-list {
  display: grid;
  gap: 6px;
  max-height: 340px;
  overflow-y: auto;
  overflow-x: hidden !important;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  width: 100%;
  box-sizing: border-box;
}
.color-option {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--dark);
  text-align: left;
  cursor: pointer;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
  transition: border-color 0.2s, background 0.2s;
}
.color-option:hover { border-color: #B9C6D2; background: #FAFBFD; }
.color-option.active { border-color: var(--dark); background: var(--bg); }
.color-copy { display: flex; flex-direction: column; min-width: 0; }
.color-copy strong { font-size: 12.5px; font-weight: 650; line-height: 1.3; }
.color-copy small { margin-top: 2px; color: var(--sub); font-size: 10.5px; line-height: 1.45; }

/* ---------- 动效组件库面板 ---------- */
.motion-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(29, 48, 69, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.motion-panel {
  background: #fff;
  border-radius: 18px;
  width: min(960px, 94vw);
  height: min(640px, 88vh);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 40px 90px rgba(22, 40, 58, 0.35);
}
.motion-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--line);
}
.motion-src { margin: 7px 0 0; font-size: 11px; color: var(--sub); }
.motion-body { flex: 1; display: flex; min-height: 0; }
.motion-nav {
  width: 168px;
  border-right: 1px solid var(--line);
  overflow: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
}
.motion-style {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12.5px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.motion-style:hover { background: var(--bg); }
.motion-style.active {
  background: #E8EEF5;
  color: #14283E;
  font-weight: 600;
}
.motion-style .swatch { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.motion-grid {
  flex: 1;
  overflow: auto;
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  align-content: start;
}
.motion-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.motion-preview {
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FAFBFC;
  border-radius: 8px;
  overflow: hidden;
}
.motion-preview img, .motion-preview svg { max-width: 100%; max-height: 100%; }
.motion-role { margin: 0; font-size: 12px; font-weight: 700; color: var(--ink); text-align: center; }
.motion-actions { display: flex; gap: 6px; justify-content: center; }
.motion-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 22px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--sub);
}
.motion-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 15px;
  height: 15px;
  border-radius: 999px;
  background: #E8EEF5;
  color: #1E3A5F;
  border: 1px solid rgba(30, 58, 95, 0.12);
  font-size: 9.5px;
  font-weight: 700;
  padding: 0 4px;
  margin-left: 5px;
}

/* ---------- 工作区 ---------- */
.workspace {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 14px;
  padding: 18px 32px 8px;
  min-height: 66vh;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}
.pane {
  background: var(--panel);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.95), 0 20px 45px -15px rgba(18, 33, 49, 0.05);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}
.pane-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  min-height: 48px;
  box-sizing: border-box;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  position: relative;
  z-index: 5;
}
.toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}
.toolbar-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.pane-toolbar strong,
.pane-toolbar .pane-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sub);
  white-space: nowrap;
  flex-shrink: 0;
}
.spacer { flex: 1; min-width: 8px; }

/* 智能排版突出高光样式 */
.highlight-action {
  background: linear-gradient(180deg, #FFFFFF 0%, #F4F6F9 100%) !important;
  color: #14283E !important;
  border-color: #2B4764 !important;
  box-shadow: 0 1px 4px rgba(20, 40, 62, 0.06), inset 0 1px 0 0 #FFFFFF !important;
  font-weight: 700 !important;
}
.highlight-action:hover {
  background: #FFFFFF !important;
  border-color: #14283E !important;
  box-shadow: 0 2px 8px rgba(20, 40, 62, 0.12), inset 0 1px 0 0 #FFFFFF !important;
}

/* ---------- 编辑器底部元数据状态栏 ---------- */
.editor-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 14px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  min-height: 38px;
  box-sizing: border-box;
  flex-shrink: 0;
  min-width: 0;
  width: 100%;
}
.editor-foot-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-wrap: nowrap;
  overflow: hidden;
}
.editor-foot-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.save-status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--sub2);
  font-weight: 500;
  white-space: nowrap;
}
.save-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.18);
}

.article-stats-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  background: rgba(20, 36, 54, 0.04);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--sub);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
}

.author-field {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--sub);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}
.author-field input {
  border: 1px solid var(--line);
  border-radius: 999px;
  height: 24px;
  padding: 0 9px;
  font-family: inherit;
  font-size: 11.5px;
  width: 106px;
  outline: none;
  background: rgba(255, 255, 255, 0.9);
  transition: border-color 0.25s, box-shadow 0.25s, width 0.25s;
}
.author-field input:focus {
  border-color: var(--dark);
  width: 126px;
  box-shadow: 0 0 0 2px rgba(18, 33, 49, 0.08);
}

#editor {
  flex: 1;
  border: 0;
  outline: none;
  resize: none;
  padding: 18px 20px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--text);
  background: rgba(255, 255, 255, 0.72);
  letter-spacing: 0.01em;
  tab-size: 2;
  overflow-y: auto;
}
#editor::placeholder { color: #A0B0C0; }
#editor:focus-visible { box-shadow: inset 0 0 0 2px rgba(18, 33, 49, 0.18); }

.badge {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 0 11px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
  flex-shrink: 0;
}
.badge.ok { background: #EDF7F3; color: var(--ok); border-color: #D2EAE1; }
.badge.bad { background: #FBF0EE; color: var(--bad); border-color: #F0D9D5; cursor: pointer; }
.badge.warn { background: #FBF5EB; color: var(--warn); border-color: #EFE2CC; cursor: pointer; }

.width-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  flex-wrap: nowrap;
}
.preview-wrap { flex: 1; min-height: 0; display: flex; align-items: flex-start; justify-content: center; background: #EDF0F3; overflow: auto; }
#preview { border: 0; background: #fff; width: 100%; min-height: 100%; flex: 0 0 100%; }
.preview-wrap.readable #preview {
  width: min(500px, 100%);
  flex-basis: min(500px, 100%);
  margin-inline: auto;
  margin-top: 16px;
  margin-bottom: 24px;
  border-radius: 12px;
  box-shadow: 0 0 0 1px var(--line), 0 20px 50px -10px rgba(29, 48, 69, 0.12);
}
.preview-wrap.device #preview {
  width: var(--preview-width);
  flex-basis: var(--preview-width);
  margin-inline: auto;
  margin-top: 16px;
  margin-bottom: 24px;
  border-radius: 16px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.9) inset, 0 24px 60px -12px rgba(15, 23, 42, 0.15), 0 4px 18px rgba(15, 23, 42, 0.05);
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1), flex-basis 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
}

@media (min-width: 901px) {
  html, body { height: 100%; }
  body { min-height: 0; overflow: hidden; }
  .workspace { min-height: 0; }
  .mobile-segmented,
  .mobile-dock,
  .mobile-sheet-backdrop { display: none !important; }
}

.valid-panel {
  border-top: 1px solid var(--line);
  background: #FBF5EB;
  padding: 10px 16px;
  font-size: 12.5px;
  line-height: 1.8;
  max-height: 130px;
  overflow: auto;
}
.valid-panel .err { color: var(--bad); }
.valid-panel .warn { color: var(--warn); }
.valid-panel a { color: inherit; font-weight: 700; text-underline-offset: 3px; }

/* ---------- 移动端 Markdown 快捷格式棒 ---------- */
.mobile-md-toolbar {
  display: none;
  background: rgba(240, 243, 246, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 6px 12px;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
  mask-image: linear-gradient(to right, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
}
.btn.copy-success, button.copy-success {
  background: #16a34a !important;
  color: #ffffff !important;
  border-color: #16a34a !important;
  transform: scale(1.03);
  transition: background 0.2s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.mobile-md-toolbar::-webkit-scrollbar { display: none; }
.md-tag-btn {
  border: 1px solid var(--line);
  background: #FFFFFF;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--dark);
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.md-tag-btn.highlight-tag {
  background: #142436;
  color: #FFFFFF;
  border-color: #142436;
}
.md-tag-btn:active {
  background: rgba(20, 36, 54, 0.08);
  transform: scale(0.96);
}
.md-tag-btn.highlight-tag:active {
  background: #253D56;
}

@media (max-width: 900px) {
  .mobile-md-toolbar {
    display: none !important; /* 彻底精简移动端顶栏，隐藏重复的格式标签棒以释放写作视野 */
  }
}

/* ---------- 移动端专属架构 (Native App Level) ---------- */
.mobile-segmented {
  display: flex;
  background: rgba(20, 36, 54, 0.06);
  padding: 4px;
  border-radius: 999px;
  margin: 10px 16px 0;
  gap: 4px;
  position: relative;
  z-index: 10;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}
.mobile-seg-btn {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--sub);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.25s var(--ease), color 0.25s var(--ease), box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
  position: relative;
}
.mobile-seg-btn.active {
  background: #FFFFFF;
  color: var(--dark);
  box-shadow: 0 2px 8px rgba(18, 33, 49, 0.12);
}
.mobile-seg-btn:active {
  transform: scale(0.97);
}
.mobile-valid-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  display: inline-block;
  transition: background-color 0.2s;
}
.mobile-valid-dot.warn { background: var(--warn); }
.mobile-valid-dot.bad { background: var(--bad); }

.mobile-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 85;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 30px rgba(18, 33, 49, 0.08);
  padding: 8px 14px max(8px, env(safe-area-inset-bottom)) 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
  width: 100%;
}
.mobile-dock-btn {
  border: 1px solid var(--line);
  background: #FFFFFF;
  border-radius: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
  color: var(--dark);
  height: 46px;
  box-sizing: border-box;
  font-family: inherit;
  user-select: none;
  -webkit-user-select: none;
}
.mobile-dock-btn:active {
  transform: scale(0.96);
}
.mobile-dock-btn.theme-btn {
  flex: 1 1 0;
  min-width: 0;
  padding: 0 11px;
  gap: 8px;
  justify-content: flex-start;
  height: 46px;
}
.mobile-theme-swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1);
}
.mobile-theme-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  text-align: left;
  flex: 1;
  overflow: hidden;
}
.mobile-dock-sub {
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: var(--sub2);
  text-transform: uppercase;
  line-height: 1.1;
  white-space: nowrap;
}
.mobile-dock-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}
.mobile-dock-btn.cta-btn {
  flex: 1.3 1 0;
  min-width: 125px;
  background: linear-gradient(180deg, #FFFFFF 0%, #F5F7FA 100%);
  color: #14283E;
  border: 1.5px solid #2B4764;
  font-size: 13px;
  font-weight: 700;
  padding: 0 14px;
  height: 46px;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(20, 40, 62, 0.06), inset 0 1px 0 0 #FFFFFF;
}
.mobile-dock-btn.cta-btn span {
  white-space: nowrap;
}
.mobile-dock-btn.cta-btn:active {
  background: #E8EDF4;
  transform: scale(0.97);
}
.mobile-dock-btn.icon-btn {
  width: 46px;
  height: 46px;
  padding: 0;
  justify-content: center;
  flex: 0 0 46px;
  color: var(--dark);
  border-radius: 14px;
}

/* 移动端抽屉弹层 (Bottom Sheet) */
.mobile-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(18, 33, 49, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s var(--ease);
}
.mobile-sheet-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}
.mobile-sheet {
  background: #FFFFFF;
  border-radius: 20px 20px 0 0;
  padding: 12px 16px max(24px, env(safe-area-inset-bottom));
  max-height: 82dvh;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.35s var(--spring);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.16);
}
.mobile-sheet-backdrop.open .mobile-sheet {
  transform: translateY(0);
}
.sheet-handle {
  width: 38px;
  height: 4px;
  border-radius: 2px;
  background: #D8DFE6;
  margin: 0 auto 12px;
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.sheet-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--dark);
}
.sheet-close-btn {
  border: 0;
  background: rgba(20, 36, 54, 0.06);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--sub);
}
.sheet-content {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
}
.sheet-level-list,
.sheet-color-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0 16px;
  width: 100%;
  box-sizing: border-box;
}
.sheet-level-option,
.sheet-color-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #FFFFFF;
  cursor: pointer;
  text-align: left;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  transition: background 0.15s, border-color 0.15s;
}
.sheet-level-option.active,
.sheet-color-option.active {
  border-color: var(--dark);
  background: rgba(18, 33, 49, 0.05);
}
.sheet-level-no {
  font-size: 11px;
  font-weight: 800;
  color: var(--sub);
  letter-spacing: 0.04em;
  width: 24px;
  flex-shrink: 0;
}
.sheet-copy {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.sheet-copy strong {
  font-size: 13px;
  font-weight: 650;
  color: var(--dark);
  line-height: 1.35;
}
.sheet-copy small {
  font-size: 11px;
  color: var(--sub);
  line-height: 1.45;
  margin-top: 2px;
}
.sheet-motion-badge {
  padding: 2px 7px;
  border-radius: 999px;
  background: #E8EEF5;
  color: #1E3A5F;
  border: 1px solid rgba(30, 58, 95, 0.14);
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}

/* 确认对话框 Modal */
.confirm-modal {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(18, 33, 49, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease);
}
.confirm-modal.open {
  opacity: 1;
  pointer-events: auto;
}
.confirm-box {
  background: #FFFFFF;
  border-radius: 18px;
  width: min(380px, 92vw);
  padding: 22px 24px 20px;
  box-shadow: 0 20px 50px rgba(18, 33, 49, 0.25);
  transform: scale(0.94);
  transition: transform 0.25s var(--spring);
}
.confirm-modal.open .confirm-box {
  transform: scale(1);
}
.confirm-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--dark);
  margin: 0 0 8px;
}
.confirm-desc {
  font-size: 13px;
  color: var(--sub);
  line-height: 1.6;
  margin: 0 0 18px;
}
.confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* 统一导出菜单 Modal 样式 */
.export-modal-box {
  width: 520px;
  max-width: min(520px, calc(100vw - 28px));
  padding: 24px 26px 22px;
}
.export-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.export-modal-head .confirm-title {
  margin: 0;
  font-size: 17px;
}
.export-options-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 18px 0 20px;
}
.export-card {
  background: rgba(247, 248, 250, 0.85);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color 0.2s, background 0.2s;
}
.export-card:hover {
  border-color: rgba(20, 36, 54, 0.2);
  background: #FFFFFF;
}
.export-card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.export-card-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(18, 33, 49, 0.05);
  color: var(--dark);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.export-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}
.export-card-info strong {
  font-size: 14px;
  color: var(--dark);
  font-weight: 700;
}
.export-card-info small {
  font-size: 11.5px;
  color: var(--sub);
  line-height: 1.45;
}
/* 实时分辨率与品牌预览 Card */
.export-preview-card {
  background: #FAFBFD;
  border: 1px solid rgba(43, 71, 100, 0.16);
}
.export-live-preview-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
}
.export-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.preview-badge-group {
  display: flex;
  align-items: center;
  gap: 6px;
}
.preview-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10B981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}
.export-preview-header strong {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--dark);
}
.preview-dim-tag {
  font-size: 11px;
  color: var(--sub);
  font-weight: 500;
}
.export-preview-thumbnail-wrap {
  position: relative;
  height: 120px;
  border-radius: 8px;
  border: 1px solid var(--line);
  overflow: hidden;
  background: #EDF0F3;
}
.export-preview-thumbnail-wrap iframe {
  width: 200%;
  height: 200%;
  border: 0;
  transform: scale(0.5);
  transform-origin: 0 0;
  pointer-events: none;
  background: #FFFFFF;
}
.export-preview-overlay {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}
.brand-overlay-tag,
.scale-overlay-tag {
  background: rgba(20, 36, 54, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #FFFFFF;
  font-size: 10.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 70%;
}
.scale-overlay-tag {
  background: #2563EB;
}
.btn-export-action {
  width: 100%;
  height: 38px;
  font-size: 13px;
}
.res-selection-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
.res-selection-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--sub);
}
.res-pill-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.res-pill {
  border: 1px solid var(--line);
  background: #FFFFFF;
  border-radius: 8px;
  padding: 6px 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}
.res-pill:hover {
  border-color: var(--dark);
}
.res-pill.active {
  border-color: #2B4764;
  background: rgba(43, 71, 100, 0.08);
  box-shadow: 0 0 0 1px #2B4764;
}
.res-pill-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--dark);
}
.res-pill-sub {
  font-size: 10px;
  color: var(--sub2);
}
.res-pill.active .res-pill-title {
  color: #14283E;
}
.res-pill.active .res-pill-sub {
  color: #2B4764;
  font-weight: 600;
}

/* ---------- 底部 / toast ---------- */
.foot {
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--sub2);
  padding: 16px 0 18px;
}
.foot a { color: var(--sub); text-decoration: none; border-bottom: 1px solid var(--line); }
.foot a:hover { color: var(--dark); border-color: var(--dark); }
.toast {
  position: fixed;
  left: 50%;
  bottom: max(78px, calc(68px + env(safe-area-inset-bottom)));
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #1E293B;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 9px 18px;
  border-radius: 999px;
  z-index: 199;
  border: 1px solid rgba(20, 36, 54, 0.12);
  box-shadow: 0 16px 36px rgba(18, 33, 49, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04), inset 0 1px 0 0 #FFFFFF;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
  white-space: nowrap;
  max-width: calc(100vw - 32px);
  box-sizing: border-box;
}
.toast span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toast[hidden] {
  display: none !important;
}
.toast .toast-action {
  color: #2563EB;
  background: transparent;
  border: 0;
  padding: 0 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .rise { animation: none; }
  * { transition: none !important; }
}
@media (max-width: 900px) {
  body {
    padding-bottom: 74px; /* 为底部 Dock 留出安全空间 */
  }
  .workspace {
    grid-template-columns: 1fr;
    padding: 8px 12px 14px;
    gap: 10px;
  }
  .hero { padding: 12px 16px 4px; }
  .topbar { padding: 10px 16px; }
  .hero-meta { display: none; }
  .actions #btnCopy { display: none; } /* 移动端已在底部 Dock 提供快捷操作，避免顶栏拥挤 */

  /* 移动端视图单切模式 */
  .workspace[data-mobile-view="edit"] .preview-pane {
    display: none !important;
  }
  .workspace[data-mobile-view="preview"] .editor-pane {
    display: none !important;
  }
  .workspace .pane {
    min-height: calc(100dvh - 128px);
    height: calc(100dvh - 128px);
    max-height: calc(100dvh - 128px);
  }
}
@media (max-width: 600px) {
  .hero { display: none !important; } /* 移动端极其微小的顶栏极简布局 */
  .workspace {
    padding: 4px 8px 8px;
  }
  .workspace .pane {
    min-height: calc(100dvh - 110px);
    height: calc(100dvh - 110px);
    max-height: calc(100dvh - 110px);
  }
  .topbar {
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
  }
  .brand { min-width: 0; flex: 1; }
  .brand h1 { font-size: 14px; }
  .brand h1 em { display: inline; font-size: 10.5px; }
  .actions {
    display: flex;
    gap: 6px;
  }
  .actions .btn.ghost,
  .actions #btnDownload,
  .actions #btnExportImage,
  .actions #btnCopy {
    display: none; /* 移动端转移至底部 Dock 与抽屉中 */
  }
  .actions #btnSponsor.sponsor-nav-btn {
    display: inline-flex !important;
    height: 30px;
    padding: 0 9px;
    font-size: 11px;
    border-radius: 999px;
    background: rgba(20, 36, 54, 0.05);
    border: 1px solid var(--line);
    color: var(--dark);
  }
  .actions .btn.icon-round {
    width: 32px;
    height: 32px;
  }
  .editor-pane .pane-toolbar,
  .preview-pane .pane-toolbar {
    position: relative;
    gap: 6px 8px;
    padding: 6px 10px;
    min-height: 40px;
    flex-wrap: wrap;
    justify-content: space-between;
  }
  .toolbar-left {
    gap: 6px;
  }
  .toolbar-right {
    gap: 4px;
  }
  .picker-slot,
  .level-picker-slot,
  .color-picker-slot {
    position: static;
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    flex-shrink: 0;
  }
  .editor-foot {
    padding: 6px 10px;
    gap: 8px;
    min-height: 34px;
  }
  .save-status-indicator {
    display: none;
  }
  .author-field {
    width: auto;
    margin-top: 0;
    flex-shrink: 0;
  }
  .author-field input {
    width: 88px;
    height: 22px;
    font-size: 11px;
    padding: 0 7px;
  }
  .author-field input:focus {
    width: 104px;
  }
  .picker-pop, .level-pop, .color-pop {
    left: 8px;
    right: 8px;
    top: calc(100% + 6px);
    bottom: auto;
    width: auto;
    max-width: none;
    max-height: calc(100dvh - 140px);
    padding: 12px 14px;
  }
}
@media (max-width: 440px) {
  .pop-grid {
    grid-template-columns: 1fr;
    gap: 6px;
    max-height: 320px;
  }
  .pop-card {
    padding: 8px 12px;
  }
  .pop-tabs {
    gap: 5px;
  }
  .group-tab {
    padding: 0 9px;
    height: 24px;
    font-size: 10.5px;
  }
}
@media (max-width: 380px) {
  .mobile-dock {
    padding: 6px 8px max(6px, env(safe-area-inset-bottom)) 8px;
    gap: 6px;
  }
  .mobile-dock-btn.cta-btn {
    min-width: 110px;
    padding: 0 8px;
    font-size: 12px;
  }
  .mobile-dock-btn.theme-btn {
    padding: 0 8px;
  }
  .mobile-dock-title {
    font-size: 11.5px;
  }
  .mobile-seg-btn {
    font-size: 12px;
    padding: 7px 8px;
  }
}

/* 赞赏开发者 Modal 样式 */
.sponsor-modal-box {
  width: 480px;
  max-width: min(480px, calc(100vw - 24px));
  padding: 24px 26px 20px;
}
.sponsor-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.sponsor-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sponsor-title-wrap .confirm-title {
  margin: 0;
  font-size: 17px;
}
.sponsor-badge-icon {
  font-size: 18px;
}
.sponsor-display-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 14px 0 16px;
  text-align: left;
}
.sponsor-message-box {
  background: rgba(244, 245, 247, 0.85);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
}
.sponsor-display-text {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--dark);
  font-weight: 500;
}
.sponsor-amount-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tiers-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--sub);
}
.sponsor-amount-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.amount-pill {
  border: 1px solid var(--line);
  background: #FFFFFF;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--dark);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}
.amount-pill:hover {
  border-color: var(--dark);
  background: rgba(20, 36, 54, 0.04);
}
.amount-pill.active {
  border-color: var(--dark);
  background: var(--dark);
  color: #FFFFFF;
}
.sponsor-pay-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #FAFBFD;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  align-items: center;
}
.sponsor-pay-tabs {
  display: flex;
  justify-content: center;
  width: 100%;
}
.pay-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border-radius: 999px;
  background: #FFFFFF;
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 600;
  color: #0F172A;
  box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}
.sponsor-qr-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.sponsor-qr-frame {
  width: 190px;
  height: 190px;
  border-radius: 14px;
  background: #FFFFFF;
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(18, 33, 49, 0.06);
}
.sponsor-qr-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.sponsor-qr-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}
.pay-amount-label {
  font-size: 13px;
  color: var(--dark);
  font-weight: 500;
}
.pay-amount-label strong {
  font-size: 15px;
  color: #059669;
  font-weight: 700;
}
.pay-sub-tip {
  font-size: 11px;
  color: var(--sub2);
}
.btn-done-pay {
  background: #059669 !important;
  color: #FFFFFF !important;
}
.btn-done-pay:hover {
  background: #047857 !important;
}

