:root {
  color-scheme: light;
  --ink: #17202f;
  --muted: #6f7785;
  --line: #dce2ea;
  --paper: #ffffff;
  --canvas: #ffffff;
  --soft: #f8fafc;
  --accent: #17202f;
  --brush-color: #2563eb;
  --text-bg-brush-color: #fff3a3;
  --control-bg: #fbfcfe;
  --control-text: #263140;
  --popover-bg: #ffffff;
  --preview-bg: #ffffff;
  --preview-mask: #ffffff;
  --active-bg: #17202f;
  --active-text: #ffffff;
  --active-border: #17202f;
  --primary-bg: #17202f;
  --primary-text: #ffffff;
  --guide-bg: #f8fafc;
  --guide-text: #4b5565;
  --avatar-bg: #eef6e6;
  --thumb-bg: #eef1f5;
  --crop-stage-bg: #111827;
  --crop-canvas-bg: #0b1020;
  --modal-overlay: rgba(15, 23, 42, 0.44);
  --shadow-soft: 0 10px 18px rgba(23, 32, 47, 0.05);
  --shadow-popover: 0 18px 50px rgba(23, 32, 47, 0.18);
  --shadow-card: 0 18px 46px rgba(23, 32, 47, 0.16);
  --focus-ring: rgba(23, 32, 47, 0.14);
  --green: #1f8a63;
  --coral: #e55d42;
  --shadow: 0 18px 50px rgba(23, 32, 47, 0.12);
}

:root[data-ui-theme="dark"] {
  color-scheme: dark;
  --ink: #f8fafc;
  --muted: #b6becb;
  --line: #3a3a3a;
  --paper: #151515;
  --canvas: #0b0b0b;
  --soft: #1d1d1d;
  --accent: #ffffff;
  --control-bg: #171717;
  --control-text: #f8fafc;
  --popover-bg: #121212;
  --preview-bg: #0b0b0b;
  --preview-mask: #0b0b0b;
  --active-bg: #ffffff;
  --active-text: #050505;
  --active-border: #ffffff;
  --primary-bg: #ffffff;
  --primary-text: #050505;
  --guide-bg: #1b1b1b;
  --guide-text: #d8dee8;
  --avatar-bg: #202020;
  --thumb-bg: #262626;
  --crop-stage-bg: #020617;
  --crop-canvas-bg: #020617;
  --modal-overlay: rgba(0, 0, 0, 0.72);
  --shadow-soft: 0 10px 18px rgba(0, 0, 0, 0.38);
  --shadow-popover: 0 18px 50px rgba(0, 0, 0, 0.55);
  --shadow-card: 0 18px 46px rgba(0, 0, 0, 0.46);
  --focus-ring: rgba(255, 255, 255, 0.18);
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.workspace {
  display: grid;
  grid-template-columns: var(--history-width-collapsed, 48px) 6px minmax(360px, var(--editor-width, 500px)) 6px minmax(360px, 1fr);
  height: 100vh;
}

.workspace.history-open {
  grid-template-columns: var(--history-width, 260px) 6px minmax(360px, var(--editor-width, 500px)) 6px minmax(360px, 1fr);
}

.site-footer {
  position: fixed;
  right: 18px;
  bottom: 14px;
  z-index: 220;
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-credit,
.account-dock-button {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  box-shadow: var(--shadow-soft);
  font-size: 12px;
  font-weight: 750;
  line-height: 1;
  letter-spacing: 0;
  backdrop-filter: blur(12px);
}

.site-credit {
  pointer-events: none;
}

.account-dock {
  position: relative;
}

.account-dock-button {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  gap: 6px;
  transition: border-color 120ms ease, color 120ms ease, background 120ms ease;
}

.account-dock-button:hover,
.account-dock-button[aria-expanded="true"] {
  border-color: var(--active-border);
  color: var(--control-text);
  background: var(--popover-bg);
}

.account-dock-button > svg {
  width: 14px;
  height: 14px;
}

.feature-anchor {
  position: relative;
}

.feature-new-badge {
  position: absolute;
  top: -7px;
  right: -8px;
  display: inline-grid;
  min-width: 22px;
  height: 18px;
  place-items: center;
  padding: 0 5px;
  border: 2px solid var(--paper);
  border-radius: 999px;
  color: #fff;
  background: #0071e3;
  box-shadow: 0 4px 12px rgba(0, 113, 227, 0.24);
  font-size: 9px;
  font-weight: 850;
  line-height: 1;
  pointer-events: none;
}

.feature-new-badge.compact {
  position: static;
  min-width: 18px;
  height: 16px;
  padding: 0 4px;
  border: 0;
  font-size: 8px;
}

.feature-new-badge[hidden],
.account-menu-new-dot[hidden] {
  display: none;
}

.account-dock-chevron {
  width: 12px !important;
  height: 12px !important;
  transition: transform 140ms ease;
}

.account-dock-button[aria-expanded="true"] .account-dock-chevron {
  transform: rotate(180deg);
}

.account-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #f59e0b;
  box-shadow: 0 0 0 2px color-mix(in srgb, #f59e0b 18%, transparent);
}

.account-dock-button.is-online .account-status-dot {
  background: #16a34a;
  box-shadow: 0 0 0 2px color-mix(in srgb, #16a34a 18%, transparent);
}

.account-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  width: min(292px, calc(100vw - 28px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--popover-bg);
  box-shadow: var(--shadow-popover);
}

.account-menu.hidden {
  display: none;
}

.account-menu-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding: 15px;
  border-bottom: 1px solid var(--line);
}

.account-menu-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 999px;
  color: var(--control-text);
  background: var(--soft);
}

.account-menu-avatar svg {
  width: 20px;
  height: 20px;
}

.account-menu-summary > div {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.account-menu-summary strong,
.account-menu-summary span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu-summary strong {
  color: var(--ink);
  font-size: 13px;
}

.account-menu-summary div > span {
  color: var(--muted);
  font-size: 11px;
}

.account-menu-actions {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.account-menu-actions .primary-button,
.account-menu-actions .secondary-button {
  width: 100%;
  min-height: 40px;
  justify-content: center;
}

.account-menu-text-button {
  display: flex;
  min-height: 36px;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 750;
  text-align: left;
}

.account-menu-new-dot {
  width: 7px;
  height: 7px;
  margin-left: auto;
  border-radius: 999px;
  background: #0071e3;
  box-shadow: 0 0 0 3px color-mix(in srgb, #0071e3 13%, transparent);
}

.account-menu-text-button:hover {
  color: var(--control-text);
  background: var(--soft);
}

.account-menu-text-button.danger:hover {
  color: #b91c1c;
  background: #fef2f2;
}

.account-menu-text-button svg {
  width: 15px;
  height: 15px;
}

.account-menu-hint {
  margin: 0;
  padding: 10px 14px 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: var(--soft);
  font-size: 10px;
  line-height: 1.5;
}

.history-sidebar,
.editor-panel,
.preview-panel {
  min-height: 0;
  overflow: auto;
}

.history-sidebar {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: var(--paper);
  border-right: 1px solid var(--line);
}

.history-sidebar.open {
  width: 100%;
}

.history-tab {
  position: absolute;
  top: 18px;
  left: 8px;
  z-index: 2;
  width: 32px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--control-text);
  background: var(--control-bg);
}

.history-sidebar.open .history-tab {
  display: none;
}

.history-tab svg {
  width: 18px;
  height: 18px;
}

.history-drawer {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 10px;
  width: var(--history-width, 260px);
  height: 100%;
  padding: 18px 12px;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-8px);
  transition: opacity 120ms ease, transform 160ms ease;
}

.history-sidebar.open .history-drawer {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.panel-resizer {
  position: relative;
  z-index: 4;
  width: 6px;
  min-width: 6px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  cursor: col-resize;
  align-self: stretch;
  touch-action: none;
}

.panel-resizer::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 2px;
  width: 1px;
  background: var(--line);
  transition: background 120ms ease, width 120ms ease, left 120ms ease;
}

.panel-resizer:hover::after,
.panel-resizer.active::after {
  left: 1px;
  width: 3px;
  background: var(--active-bg);
}

body.resizing-panels {
  cursor: col-resize;
  user-select: none;
}

body.resizing-panels iframe,
body.resizing-panels canvas,
body.resizing-panels textarea {
  pointer-events: none;
}

body.cloud-session-checking .workspace,
body.cloud-session-checking .site-footer,
body.entry-choice-pending .workspace,
body.entry-choice-pending .site-footer {
  visibility: hidden;
}

body.cloud-session-checking::before {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: var(--paper);
  content: "正在打开你的工作区…";
  font-size: 14px;
  font-weight: 800;
}

.editor-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: visible;
  background: var(--paper);
  border-right: 1px solid var(--line);
  padding: 18px;
}

body[data-guide-readonly="true"] .mode-switch,
body[data-guide-readonly="true"] .brand-actions button:not(#newProjectBtn),
body[data-guide-readonly="true"] .editor-controls {
  pointer-events: none;
  opacity: 0.52;
}

body[data-guide-readonly="true"] .editor-textarea {
  border-style: dashed;
  color: var(--guide-text);
  background: var(--guide-bg);
  cursor: default;
}

body[data-guide-readonly="true"] .editor-textarea:focus {
  box-shadow: none;
}

.brand-row,
.brand-actions,
.preview-topbar,
.toolbar,
.topbar-actions {
  display: flex;
  align-items: center;
}

.brand-row {
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 0;
}

.brand-title {
  flex: 1 1 170px;
  min-width: 170px;
}

.brand-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.mode-switch {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--control-bg);
}

.mode-switch button {
  height: 34px;
  border-radius: 6px;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.mode-switch button.active {
  color: var(--active-text);
  background: var(--active-bg);
}

.header-mode-button,
.convert-mode-button {
  height: 42px;
  padding-inline: 11px;
}

.brand-row h1,
.preview-topbar h2 {
  margin: 0;
  line-height: 1.05;
  letter-spacing: 0;
}

.brand-row h1 {
  font-size: 22px;
  white-space: nowrap;
}

.brand-english {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.15;
  white-space: nowrap;
}

.brand-row p,
#statusText {
  display: block;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--control-text);
  font-size: 13px;
  font-weight: 800;
}

.history-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.history-filter {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.history-filter button {
  min-height: 28px;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 800;
}

.history-filter button.active {
  color: var(--active-text);
  background: var(--active-bg);
}

.history-list {
  display: grid;
  gap: 8px;
  align-content: start;
  overflow-y: auto;
  padding-right: 2px;
}

.history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  gap: 6px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px;
  color: var(--control-text);
  background: var(--control-bg);
  text-align: left;
}

.history-item.active {
  border-color: var(--active-border);
  background: var(--active-bg);
  color: var(--active-text);
}

.history-item.built-in {
  border-style: dashed;
}

.history-item span,
.history-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item span {
  font-size: 13px;
  font-weight: 760;
}

.history-item small {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
}

.history-item small b {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  color: var(--active-text);
  background: var(--active-bg);
  font-size: 10px;
  font-weight: 850;
  line-height: 18px;
}

.history-item.active small {
  color: currentColor;
  opacity: 0.72;
}

.history-item.active small b {
  color: var(--active-bg);
  background: var(--active-text);
}

.history-empty {
  padding: 12px 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--control-bg);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.history-open {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 6px;
  color: inherit;
  background: transparent;
  text-align: left;
  justify-content: stretch;
}

.history-delete {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: currentColor;
  background: transparent;
  opacity: 0.62;
}

.history-delete:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
  opacity: 1;
}

.history-delete svg {
  width: 16px;
  height: 16px;
}

.history-lock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: currentColor;
  opacity: 0.5;
}

.history-lock svg {
  width: 15px;
  height: 15px;
}

.panel-section {
  border-top: 1px solid var(--line);
  padding: 18px 0;
}

.editor-controls {
  position: relative;
  z-index: 8;
  display: grid;
  gap: 10px;
  padding: 10px 0 12px;
  border-top: 1px solid var(--line);
}

.section-title {
  margin-bottom: 12px;
  color: var(--control-text);
  font-size: 13px;
  font-weight: 800;
}

.toolbar {
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 0;
}

.tool-button,
.icon-button,
.secondary-button,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.tool-button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--control-text);
  font-size: 13px;
  font-weight: 760;
  position: relative;
}

.tool-button:hover,
.secondary-button:hover,
.primary-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.tool-button svg,
.secondary-button svg,
.primary-button svg,
.icon-button svg {
  width: 18px;
  height: 18px;
}

.file-tool input,
.avatar-picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.color-tool,
.bg-color-tool {
  overflow: hidden;
}

.color-tool::after,
.bg-color-tool::after {
  content: "";
  position: absolute;
  inset: auto 7px 6px;
  height: 3px;
  border-radius: 2px;
}

.color-tool::after {
  background: var(--brush-color);
}

.bg-color-tool::after {
  background: var(--text-bg-brush-color);
}

textarea {
  width: 100%;
  flex: 1;
  min-height: 0;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 15px;
  color: var(--ink);
  background: var(--control-bg);
  line-height: 1.65;
  outline: 0;
}

.editor-textarea {
  height: auto;
  min-height: 360px;
}

.workflow-import-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--soft);
}

.workflow-preview-panel {
  max-width: 920px;
  margin: 0 auto 4px;
}

.workflow-import-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.workflow-import-head > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.workflow-import-head strong {
  overflow: hidden;
  color: var(--control-text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workflow-import-head span,
.workflow-image-count,
.article-import-notice {
  color: var(--muted);
  font-size: 12px;
}

.workflow-image-count {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--paper);
}

.workflow-title-choices {
  display: grid;
  gap: 6px;
}

.workflow-title-choice {
  grid-template-columns: auto 22px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--control-text);
  background: var(--paper);
  cursor: pointer;
}

.workflow-title-choice:has(input:checked) {
  border-color: var(--active-border);
  box-shadow: 0 0 0 2px var(--focus-ring);
}

.workflow-title-choice input {
  margin: 0;
  accent-color: var(--active-bg);
}

.workflow-title-number {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 6px;
  color: var(--active-text) !important;
  background: var(--active-bg);
  font-size: 11px !important;
  font-weight: 800;
}

.article-import-notice {
  margin: 0;
  white-space: pre-wrap;
}

.article-import-notice.is-error {
  color: #dc2626;
  font-weight: 700;
}

textarea:focus,
input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input[type="text"],
input[type="number"],
select {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 11px;
  color: var(--ink);
  background: var(--control-bg);
  outline: 0;
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) 16px,
    calc(100% - 10px) 16px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 28px;
}

input[type="color"] {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 3px;
  background: var(--control-bg);
}

.compact-input {
  min-width: 0;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--ink);
  background: var(--control-bg);
  outline: 0;
}

.profile-inline {
  display: grid;
  grid-template-columns: 42px minmax(110px, 1.2fr) minmax(96px, 1fr) 36px;
  gap: 8px;
  align-items: center;
}

body[data-app-mode="article"] .profile-inline {
  display: none;
}

.two-col,
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.wide {
  grid-column: 1 / -1;
}

.profile-grid {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 14px;
  align-items: start;
}

.avatar-picker {
  position: relative;
  display: block;
  width: 74px;
  height: 74px;
  border: 1px solid var(--line);
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  background: var(--avatar-bg);
}

.profile-inline .avatar-picker {
  width: 42px;
  height: 42px;
}

.avatar-picker img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-fields {
  display: grid;
  gap: 10px;
}

.tool-menu {
  position: relative;
}

.tool-menu summary {
  list-style: none;
}

.tool-menu summary::-webkit-details-marker {
  display: none;
}

.tool-menu[open] > summary {
  border-color: var(--active-border);
  color: var(--active-text);
  background: var(--active-bg);
}

.tool-button.active {
  border-color: var(--active-border);
  color: var(--active-text);
  background: var(--active-bg);
}

.secondary-button.active {
  border-color: var(--active-border);
  color: var(--active-text);
  background: var(--active-bg);
}

.tool-popover {
  position: absolute;
  top: 44px;
  left: 0;
  right: auto;
  z-index: 30;
  width: min(370px, calc(100vw - 36px));
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--popover-bg);
  box-shadow: var(--shadow-popover);
}

.search-popover,
.settings-popover {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.color-popover {
  display: grid;
  gap: 12px;
  width: 280px;
}

.color-guide {
  display: grid;
  gap: 5px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--guide-text);
  background: var(--guide-bg);
}

.color-guide strong {
  color: var(--ink);
  font-size: 13px;
}

.color-guide span {
  font-size: 12px;
  line-height: 1.5;
}

.color-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.image-popover {
  width: min(420px, calc(100vw - 36px));
  max-height: 330px;
  overflow: auto;
}

.image-batch-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.percent-input,
.unit-input {
  position: relative;
  display: block;
}

.percent-input input,
.unit-input input {
  padding-right: 34px;
}

.percent-input b,
.unit-input b {
  position: absolute;
  top: 50%;
  right: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  transform: translateY(-50%);
  pointer-events: none;
}

.image-list {
  display: grid;
  gap: 10px;
}

.image-row {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--control-bg);
}

.image-thumb {
  width: 54px;
  height: 42px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--thumb-bg);
}

.image-meta {
  min-width: 0;
}

.image-meta strong,
.image-meta span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-meta strong {
  color: var(--control-text);
  font-size: 13px;
  font-weight: 650;
}

.image-meta span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.image-row-actions {
  display: flex;
  gap: 6px;
}

.image-row-actions button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--control-text);
  background: var(--control-bg);
}

.secondary-button,
.primary-button {
  height: 38px;
  gap: 8px;
  padding: 0 12px;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 800;
}

.secondary-button {
  border: 1px solid var(--line);
  color: var(--control-text);
  background: var(--control-bg);
}

.primary-button,
.icon-button.dark {
  color: var(--primary-text);
  background: var(--primary-bg);
}

.primary-button {
  padding-inline: 15px;
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  color: var(--control-text);
  background: var(--control-bg);
}

.icon-button.ghost {
  border: 1px solid var(--line);
  color: var(--control-text);
  background: var(--control-bg);
}

.preview-panel {
  padding: 24px 28px 40px;
  background: var(--preview-bg);
}

.preview-topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  margin: -24px -28px 24px;
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--preview-mask);
  box-shadow: var(--shadow-soft);
}

.preview-topbar::before,
.preview-topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  pointer-events: none;
  background: var(--preview-mask);
}

.preview-topbar::before {
  top: -120px;
  height: 120px;
}

.preview-topbar::after {
  bottom: -24px;
  height: 24px;
}

.preview-topbar h2 {
  font-size: 22px;
}

.topbar-actions {
  gap: 10px;
}

.export-progress {
  position: fixed;
  inset: 0;
  z-index: 10040;
  display: grid;
  place-items: center;
  width: auto;
  padding: 20px;
  background: rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(6px);
}

.export-progress-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px 14px;
  width: min(440px, calc(100vw - 40px));
  padding: 24px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--active-border) 34%, var(--line));
  border-radius: 20px;
  color: var(--ink);
  background: color-mix(in srgb, var(--active-bg) 6%, var(--popover-bg));
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
}

.export-progress[hidden] {
  display: none;
}

.export-progress-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  grid-column: 1;
  grid-row: 1 / span 2;
  align-self: start;
  margin: 2px 0 0;
  border-radius: 999px;
  color: var(--active-text);
  background: var(--active-bg);
}

.export-progress-icon svg {
  display: block;
  width: 20px;
  height: 20px;
  margin: 0;
  animation: export-progress-spin 1s linear infinite;
}

.export-progress-copy {
  display: grid;
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  gap: 3px;
}

.export-progress-copy strong {
  font-size: 15px;
  font-weight: 850;
}

.export-progress-copy span,
.export-progress-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.export-progress-percent {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  color: var(--ink);
  font-size: 28px;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
  letter-spacing: -0.04em;
}

.export-progress-meta {
  grid-column: 2 / 4;
  grid-row: 2;
  justify-self: start;
  white-space: nowrap;
}

.export-progress-track {
  position: relative;
  grid-column: 1 / -1;
  grid-row: 3;
  height: 8px;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: color-mix(in srgb, var(--line) 78%, transparent);
}

.export-progress-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  background: var(--active-bg);
  transition: width 220ms ease;
}

.export-progress.is-success .export-progress-card {
  border-color: color-mix(in srgb, #16a34a 42%, var(--line));
  background: color-mix(in srgb, #16a34a 7%, var(--popover-bg));
}

.export-progress.is-success .export-progress-icon,
.export-progress.is-success .export-progress-fill {
  color: #fff;
  background: #16a34a;
}

.export-progress.is-success .export-progress-icon svg,
.export-progress.is-error .export-progress-icon svg,
.export-progress.is-cancelled .export-progress-icon svg {
  animation: none;
}

.export-progress.is-error .export-progress-card {
  border-color: color-mix(in srgb, #dc2626 42%, var(--line));
  background: color-mix(in srgb, #dc2626 7%, var(--popover-bg));
}

.export-progress.is-error .export-progress-icon,
.export-progress.is-error .export-progress-fill {
  color: #fff;
  background: #dc2626;
}

.export-progress.is-cancelled .export-progress-card {
  border-color: color-mix(in srgb, var(--muted) 34%, var(--line));
  background: color-mix(in srgb, var(--muted) 5%, var(--popover-bg));
}

.export-progress.is-cancelled .export-progress-icon {
  color: var(--muted);
  background: var(--soft);
}

.export-progress.is-cancelled .export-progress-fill {
  background: var(--muted);
}

.export-progress-compact {
  z-index: 10050;
}

body.export-busy .page-actions button,
body.export-busy #downloadZipBtn,
body.export-busy #downloadArticleBtn {
  cursor: progress;
}

body.export-busy {
  overflow: hidden;
}

@keyframes export-progress-spin {
  to { transform: rotate(360deg); }
}

.preview-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: start;
}

.pages {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  padding-top: 28px;
  align-items: start;
}

.pages.article-mode {
  display: flex;
  justify-content: center;
  padding: 36px 28px 54px;
}

.article-settings {
  position: sticky;
  top: 118px;
  display: grid;
  gap: 20px;
  width: 260px;
  max-height: calc(100vh - 150px);
  overflow: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
}

.article-settings[hidden] {
  display: none;
}

.article-settings section {
  display: grid;
  gap: 10px;
}

.article-settings h3 {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
}

.article-option-grid,
.article-color-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.article-option-grid.three {
  grid-template-columns: repeat(3, 1fr);
}

.article-option,
.article-color {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--control-text);
  background: var(--control-bg);
  font-size: 13px;
  font-weight: 800;
}

.article-option.active,
.article-color.active {
  border-color: var(--active-border);
  box-shadow: inset 0 0 0 1px var(--active-border);
}

.article-color {
  position: relative;
  justify-content: flex-start;
  padding-left: 28px;
  text-align: left;
}

.article-color::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--swatch);
  transform: translateY(-50%);
}

.article-preview {
  width: min(520px, 100%);
  min-height: 820px;
  padding: 44px 42px 56px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #1f2937;
  background: #fff;
  box-shadow: var(--shadow-card);
  font-family: var(--article-font, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
  letter-spacing: 0.02em;
  line-height: 2;
}

.article-font-serif {
  --article-font: Georgia, "Times New Roman", "Songti SC", SimSun, serif;
}

.article-font-mono {
  --article-font: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.article-size-small {
  font-size: 15px;
}

.article-size-normal {
  font-size: 17px;
}

.article-size-large {
  font-size: 19px;
}

.article-preview h1,
.article-preview h2,
.article-preview h3,
.article-preview p,
.article-preview blockquote,
.article-preview ul,
.article-preview pre,
.article-preview figure,
.article-table-wrap {
  margin: 0 0 24px;
}

.article-preview h1 {
  position: relative;
  padding-bottom: 14px;
  color: #111827;
  font-size: 1.45em;
  line-height: 1.35;
  text-align: center;
}

.article-preview h1::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 0;
  height: 2px;
  background: var(--article-accent);
}

.article-preview h2 {
  display: table;
  margin-top: 34px;
  padding: 3px 8px;
  color: var(--article-accent);
  background: color-mix(in srgb, var(--article-accent) 14%, white);
  font-size: 1.16em;
  line-height: 1.45;
}

.article-preview h3 {
  color: var(--article-accent);
  font-size: 1.02em;
}

.article-preview p {
  letter-spacing: inherit;
}

.article-preview strong {
  background: color-mix(in srgb, var(--article-accent) 18%, transparent);
  font-weight: 800;
}

.article-preview blockquote {
  padding: 18px 20px;
  border-left: 4px solid var(--article-accent);
  border-radius: 8px;
  color: #273445;
  background: color-mix(in srgb, var(--article-accent) 10%, white);
  font-style: italic;
}

.article-preview code {
  padding: 2px 5px;
  border-radius: 4px;
  color: #d92d20;
  background: #f6f7f9;
  font-family: "SFMono-Regular", Consolas, monospace;
}

.article-preview pre {
  overflow: auto;
  padding: 18px;
  border-radius: 8px;
  color: #dbeafe;
  background: #0b1117;
}

.article-preview pre code {
  padding: 0;
  color: inherit;
  background: transparent;
}

.article-preview img {
  display: block;
  max-width: 100%;
  border-radius: 8px;
}

.article-live-stage {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: #05070b;
}

.article-live-stage > img {
  width: 100%;
  height: auto;
}

.article-live-video {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.article-live-badge {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.56);
  border-radius: 999px;
  color: #fff;
  background: rgba(5, 8, 14, 0.56);
  backdrop-filter: blur(8px);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.08em;
}

.article-live-badge svg {
  width: 13px;
  height: 13px;
}

.article-table-wrap {
  overflow-x: auto;
  border: 1px solid color-mix(in srgb, var(--article-accent) 26%, #d7dde5);
  border-radius: 8px;
}

.article-preview table {
  width: 100%;
  min-width: 360px;
  border-collapse: collapse;
  font-size: 0.88em;
  line-height: 1.55;
}

.article-preview th,
.article-preview td {
  padding: 10px 12px;
  border-right: 1px solid #e4e8ee;
  border-bottom: 1px solid #e4e8ee;
  text-align: left;
  vertical-align: top;
}

.article-preview th:last-child,
.article-preview td:last-child {
  border-right: 0;
}

.article-preview tbody tr:last-child td {
  border-bottom: 0;
}

.article-preview th {
  color: var(--article-accent);
  background: color-mix(in srgb, var(--article-accent) 11%, #fff);
  font-weight: 800;
}

.article-theme-classic {
  --article-accent: #145da0;
}

.article-theme-elegant {
  background: #fffdf8;
}

.article-theme-clean {
  box-shadow: none;
}

.article-theme-colorful h2:nth-of-type(3n + 1) {
  color: #2563eb;
}

.article-theme-colorful h2:nth-of-type(3n + 2) {
  color: #dc2626;
}

.article-empty {
  color: #94a3b8;
  text-align: center;
}

.page-shell {
  display: grid;
  gap: 10px;
  width: min(100%, 864px);
  justify-self: center;
}

.page-frame {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: var(--shadow-card);
}

.page-frame canvas {
  display: block;
  width: 100%;
  height: auto;
}

.preview-hit-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.preview-image-edit-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.preview-image-box {
  position: absolute;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: grab;
  touch-action: none;
  pointer-events: auto;
}

.preview-image-box:active {
  cursor: grabbing;
}

.preview-image-box.is-dragging {
  z-index: 7;
  border-color: var(--active-border);
  background: rgba(37, 99, 235, 0.08);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
  opacity: 0.38;
  will-change: transform;
}

.preview-image-drop-line {
  position: absolute;
  right: 4.8%;
  left: 4.8%;
  z-index: 6;
  height: 3px;
  border-radius: 999px;
  background: var(--active-border);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--active-border) 18%, transparent);
  pointer-events: none;
}

.preview-image-drop-line::before {
  position: absolute;
  top: 50%;
  left: -4px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--active-border);
  content: "";
  transform: translateY(-50%);
}

.preview-image-box:hover,
.preview-image-box:focus-within,
.preview-image-box.is-resizing {
  border-color: var(--active-border);
  background: rgba(37, 99, 235, 0.06);
}

.preview-image-box.is-live {
  background: #05070b;
}

.preview-live-video {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 7px;
  object-fit: cover;
  pointer-events: none;
}

.preview-live-badge {
  position: absolute;
  left: 8px;
  bottom: 8px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 7px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  color: #fff;
  background: rgba(5, 8, 14, 0.58);
  backdrop-filter: blur(7px);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
  pointer-events: none;
}

.preview-live-badge svg {
  width: 12px;
  height: 12px;
}

.preview-image-align {
  position: absolute;
  top: 8px;
  left: 50%;
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--popover-bg);
  box-shadow: var(--shadow-soft);
  opacity: 0;
  transform: translateX(-50%) translateY(-4px);
  transition: opacity 120ms ease, transform 120ms ease;
  pointer-events: auto;
}

.preview-image-box:hover .preview-image-align,
.preview-image-box:focus-within .preview-image-align,
.preview-image-box.is-resizing .preview-image-align {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.preview-image-box:hover .preview-image-crop,
.preview-image-box:focus-within .preview-image-crop,
.preview-image-box.is-resizing .preview-image-crop {
  opacity: 1;
  transform: translateY(0);
}

.preview-image-align button {
  display: inline-flex;
  width: 24px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  color: var(--control-text);
  background: transparent;
}

.preview-image-align button:hover {
  color: var(--active-text);
  background: var(--active-bg);
}

.preview-image-align svg {
  width: 15px;
  height: 15px;
}

.preview-image-crop {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--control-text);
  background: var(--popover-bg);
  box-shadow: var(--shadow-soft);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 120ms ease, transform 120ms ease;
  pointer-events: auto;
}

.preview-image-crop:hover {
  color: var(--active-text);
  background: var(--active-bg);
}

.preview-image-crop svg {
  width: 17px;
  height: 17px;
}

.preview-image-resize {
  position: absolute;
  right: -8px;
  bottom: -8px;
  width: 20px;
  height: 20px;
  border: 2px solid var(--paper);
  border-radius: 999px;
  background: var(--active-border);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.22);
  cursor: nwse-resize;
  pointer-events: auto;
}

.preview-text-hit {
  position: absolute;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  cursor: text;
  pointer-events: auto;
}

.preview-text-hit:hover,
.preview-text-hit:focus-visible {
  outline: 1px solid var(--active-border);
  background: rgba(37, 99, 235, 0.13);
}

.page-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.page-actions button {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--control-text);
  background: var(--control-bg);
}

.empty-state {
  padding: 48px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--soft);
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--modal-overlay);
}

.modal.hidden {
  display: none;
}

.modal-card {
  width: min(1060px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border-radius: 8px;
  background: var(--popover-bg);
  box-shadow: var(--shadow-popover);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.modal-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 19px;
  line-height: 1.2;
}

.modal-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.account-modal-card {
  position: relative;
  width: min(900px, 100%);
  height: min(760px, calc(100vh - 48px));
  max-height: calc(100vh - 48px);
  grid-template-columns: minmax(300px, 0.39fr) minmax(0, 0.61fr);
  grid-template-rows: minmax(0, 1fr);
  border: 1px solid color-mix(in srgb, var(--paper) 72%, var(--line));
  border-radius: 24px;
  background: color-mix(in srgb, var(--popover-bg) 90%, transparent);
  box-shadow: 0 36px 90px rgba(15, 23, 42, 0.28);
  isolation: isolate;
}

#accountModal {
  background: color-mix(in srgb, var(--modal-overlay) 88%, rgba(226, 232, 240, 0.14));
  backdrop-filter: blur(3px) saturate(0.94);
}

.account-modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 3;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.account-modal-close:hover,
.account-modal-close:focus-visible {
  background: color-mix(in srgb, var(--soft) 88%, transparent);
}

.account-value-pane {
  display: grid;
  grid-template-rows: auto auto 1fr;
  align-content: start;
  gap: 34px;
  min-width: 0;
  padding: 72px 42px 46px;
  border-right: 1px solid color-mix(in srgb, var(--line) 64%, transparent);
  background: color-mix(in srgb, var(--soft) 78%, transparent);
  backdrop-filter: blur(20px) saturate(1.06);
}

.account-value-brand {
  color: var(--muted);
  font-size: 14px;
  font-weight: 750;
  letter-spacing: 0.08em;
}

.account-value-pane h3 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(28px, 3vw, 34px);
  font-weight: 850;
  line-height: 1.28;
  letter-spacing: -0.035em;
}

.account-benefits {
  display: grid;
  align-content: start;
  gap: 64px;
  padding-top: 40px;
}

.account-benefit-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
}

.account-benefit-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--line) 74%, transparent);
  border-radius: 13px;
  color: var(--ink);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.account-benefit-icon svg {
  width: 21px;
  height: 21px;
}

.account-benefit-row > div {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.account-benefit-row strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
}

.account-benefit-row span:not(.account-benefit-icon) {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.entry-choice-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 32px;
  background:
    radial-gradient(circle at 12% 14%, color-mix(in srgb, var(--active-bg) 10%, transparent), transparent 30%),
    radial-gradient(circle at 90% 82%, color-mix(in srgb, #f59e0b 9%, transparent), transparent 28%),
    var(--paper);
}

.entry-choice-modal.hidden {
  display: none;
}

.entry-choice-card {
  width: min(880px, 100%);
}

.entry-choice-loading {
  display: grid;
  justify-items: center;
  gap: 8px;
  color: var(--ink);
  text-align: center;
}

.entry-choice-loading[hidden],
.entry-choice-content[hidden] {
  display: none;
}

.entry-choice-loading strong {
  margin-top: 8px;
  font-size: 16px;
}

.entry-choice-loading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.entry-choice-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid var(--line);
  border-top-color: var(--active-bg);
  border-radius: 999px;
  animation: export-progress-spin 0.8s linear infinite;
}

.entry-choice-content {
  display: grid;
  gap: 22px;
}

.entry-choice-head {
  max-width: 650px;
}

.entry-choice-brand {
  display: inline-flex;
  margin-bottom: 18px;
  padding: 7px 10px;
  border-radius: 7px;
  color: #fff;
  background: var(--active-bg);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.entry-choice-head h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.entry-choice-head p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.65;
}

.entry-choice-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.entry-choice-option {
  position: relative;
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  gap: 16px;
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--popover-bg);
  box-shadow: var(--shadow-soft);
}

.entry-choice-option.account-option {
  border-color: color-mix(in srgb, var(--active-border) 62%, var(--line));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--active-border) 45%, transparent), var(--shadow-soft);
}

.entry-choice-option-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 10px;
  color: var(--ink);
  background: var(--soft);
}

.account-option .entry-choice-option-icon {
  color: #fff;
  background: var(--active-bg);
}

.entry-choice-option-icon svg {
  width: 21px;
  height: 21px;
}

.entry-choice-recommended {
  position: absolute;
  top: 18px;
  right: 18px;
  color: var(--active-bg);
  font-size: 11px;
  font-weight: 850;
}

.entry-choice-kicker {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.entry-choice-option h3 {
  margin: 5px 0 8px;
  color: var(--ink);
  font-size: 22px;
}

.entry-choice-option p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.entry-choice-option ul {
  display: grid;
  align-content: start;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.entry-choice-option li {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--control-text);
  font-size: 12px;
  font-weight: 750;
}

.entry-choice-option li svg {
  width: 15px;
  height: 15px;
  color: #16a34a;
}

.guest-option li:last-child svg {
  color: #d97706;
}

.entry-choice-button {
  width: 100%;
  min-height: 46px;
  justify-content: center;
}

.entry-choice-button svg {
  width: 16px;
  height: 16px;
}

.entry-choice-returning {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-choice-notice {
  padding: 11px 13px;
  border-left: 3px solid #f59e0b;
  color: #92400e;
  background: #fffbeb;
  font-size: 12px;
  font-weight: 750;
}

.entry-choice-notice.error {
  border-color: #dc2626;
  color: #b91c1c;
  background: #fef2f2;
}

.entry-choice-footnote {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.welcome-back-modal {
  position: fixed;
  inset: 0;
  z-index: 10020;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 28px;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: none;
}

.welcome-back-modal.hidden {
  display: none;
}

.welcome-back-card {
  position: relative;
  width: min(548px, 100%);
  padding: 34px;
  border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
  border-radius: 24px;
  color: var(--ink);
  background: color-mix(in srgb, var(--popover-bg) 96%, transparent);
  box-shadow: 0 36px 90px rgba(15, 23, 42, 0.28);
}

.welcome-back-close {
  position: absolute;
  top: 18px;
  right: 18px;
}

.welcome-back-head {
  max-width: 500px;
  padding-right: 36px;
}

.welcome-back-head h2 {
  margin: 0;
  font-size: clamp(25px, 3vw, 30px);
  line-height: 1.16;
  letter-spacing: -0.04em;
}

.welcome-back-head p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.65;
}

.welcome-back-features {
  display: grid;
  margin-top: 22px;
  border-top: 1px solid var(--line);
}

.welcome-back-features article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 70px;
  border-bottom: 1px solid var(--line);
}

.welcome-back-feature-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  color: var(--ink);
  background: var(--soft);
}

.welcome-back-feature-icon svg {
  width: 19px;
  height: 19px;
}

.welcome-back-features strong {
  display: block;
  font-size: 15px;
}

.welcome-back-features p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.welcome-back-feature-state {
  padding: 5px 8px;
  border-radius: 999px;
  color: #0066cc;
  background: color-mix(in srgb, #0071e3 8%, var(--paper));
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.welcome-back-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 22px;
}

.welcome-back-actions button {
  min-height: 44px;
  justify-content: center;
}

.welcome-back-footnote {
  margin: 11px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.6;
  text-align: center;
}

.account-modal-body {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 18px;
  overflow: auto;
  min-width: 0;
  padding: 72px clamp(44px, 5vw, 76px);
  background: var(--popover-bg);
}

.account-notice {
  width: min(370px, 100%);
  padding: 12px 14px;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  color: #92400e;
  background: #fffbeb;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
}

.account-notice.error {
  border-color: #ef4444;
  color: #b91c1c;
  background: #fef2f2;
}

.account-notice.success {
  border-color: #16a34a;
  color: #166534;
  background: #f0fdf4;
}

.account-resend-confirmation {
  justify-self: center;
  min-height: 34px;
  border: 0;
  padding: 0 8px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  margin-top: -14px;
  cursor: pointer;
}

.account-resend-confirmation span {
  color: #0071e3;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.account-resend-confirmation[hidden] {
  display: none;
}

.account-auth-form {
  display: grid;
  width: min(370px, 100%);
  gap: 40px;
}

.account-signed-in {
  display: grid;
  width: min(420px, 100%);
  gap: 40px;
}

.account-auth-form[hidden],
.account-signed-in[hidden] {
  display: none;
}

.account-auth-mode {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
}

.account-auth-mode button {
  min-height: 48px;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.account-auth-mode button.is-active {
  color: #fff;
  background: #17202f;
  box-shadow: 0 5px 14px rgb(15 23 42 / 15%);
}

.account-auth-mode button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 28%, transparent);
  outline-offset: 2px;
}

.account-intro {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.account-icon {
  display: grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: #17202f;
}

.account-icon svg {
  width: 20px;
  height: 20px;
}

.account-intro strong,
.account-user-card strong,
.account-sync-card strong {
  color: var(--ink);
  font-size: 14px;
}

.account-intro p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.account-auth-form label {
  display: grid;
  gap: 9px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.account-auth-form input {
  width: 100%;
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--control-bg);
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.account-auth-form input:focus {
  border-color: color-mix(in srgb, #0071e3 66%, var(--line));
  background: var(--popover-bg);
  box-shadow: 0 0 0 4px color-mix(in srgb, #0071e3 12%, transparent);
}

.account-input-wrap {
  position: relative;
  display: block;
}

.account-input-wrap input {
  padding-right: 50px;
}

.account-password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  transform: translateY(-50%);
}

.account-password-toggle:hover,
.account-password-toggle:focus-visible {
  color: var(--ink);
  background: var(--soft);
}

.account-password-toggle svg {
  width: 18px;
  height: 18px;
}

.account-auth-actions {
  display: grid;
}

.account-auth-actions button,
.account-wide-button {
  min-height: 56px;
}

.account-auth-actions .primary-button {
  width: 100%;
  justify-content: center;
  border-radius: 10px;
  color: #fff;
  background: #0071e3;
  box-shadow: 0 10px 24px color-mix(in srgb, #0071e3 22%, transparent);
  font-size: 15px;
}

.account-auth-actions .primary-button:hover:not(:disabled) {
  background: #0066cc;
  transform: translateY(-1px);
}

.account-user-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.account-user-card img {
  width: 46px;
  height: 46px;
  border-radius: 999px;
  object-fit: cover;
}

.account-user-card div {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.account-user-card span:not(.account-online) {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-online {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #15803d;
  font-size: 11px;
  font-weight: 850;
}

.account-online svg {
  width: 15px;
  height: 15px;
}

.account-sync-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 14px;
  border-left: 3px solid #16a34a;
  color: var(--muted);
  background: var(--soft);
  font-size: 12px;
}

.account-wide-button {
  width: 100%;
}

.ghost-button {
  border: 1px solid var(--line);
  color: var(--muted);
  background: transparent;
}

.crop-layout {
  display: grid;
  grid-template-columns: 1fr 220px;
  min-height: 0;
}

.crop-stage {
  min-width: 0;
  padding: 18px;
  background: var(--crop-stage-bg);
}

#cropCanvas {
  display: block;
  width: 100%;
  height: min(500px, calc(100vh - 220px));
  border-radius: 8px;
  background: var(--crop-canvas-bg);
  cursor: crosshair;
}

.crop-controls {
  display: grid;
  align-content: space-between;
  gap: 20px;
  padding: 18px;
  border-left: 1px solid var(--line);
  background: var(--control-bg);
}

.ratio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.ratio-button {
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--control-text);
  background: var(--popover-bg);
  font-size: 13px;
  font-weight: 750;
}

.ratio-button.active {
  border-color: var(--active-border);
  color: var(--active-text);
  background: var(--active-bg);
}

.crop-actions {
  display: grid;
  gap: 10px;
}

.wechat-modal-card {
  width: min(620px, 100%);
}

.wechat-sync-form {
  display: grid;
  gap: 18px;
  overflow: auto;
  padding: 22px;
}

.wechat-field {
  display: grid;
  gap: 8px;
}

.wechat-field > span,
.wechat-cover-copy strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.wechat-field input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  color: var(--ink);
  background: var(--control-bg);
  font: inherit;
}

.wechat-field input:focus {
  border-color: var(--active-border);
  outline: 2px solid color-mix(in srgb, var(--active-border) 18%, transparent);
}

.wechat-cover-field {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}

.wechat-cover-preview {
  aspect-ratio: 2.35 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--soft);
  font-size: 13px;
  font-weight: 700;
}

.wechat-cover-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wechat-cover-preview svg {
  width: 18px;
  height: 18px;
}

.wechat-cover-copy {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.wechat-cover-copy > span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.wechat-cover-button {
  position: relative;
  width: fit-content;
  min-height: 40px;
  padding: 0 13px;
  cursor: pointer;
}

.wechat-cover-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.wechat-service-status {
  padding: 12px 14px;
  border-left: 3px solid var(--line);
  color: var(--muted);
  background: var(--soft);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
}

.wechat-service-status.ready {
  border-left-color: #16a34a;
  color: var(--ink);
}

.wechat-service-status.error {
  border-left-color: #ef4444;
  color: #b91c1c;
}

.wechat-sync-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.wechat-sync-actions button {
  min-height: 44px;
  padding: 0 16px;
}

.live-photo-modal-card {
  width: min(980px, 100%);
  height: min(760px, calc(100vh - 48px));
  max-height: min(760px, calc(100vh - 48px));
}

.live-photo-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(420px, 1.18fr);
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.live-photo-preview-column {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 12px;
  min-width: 0;
  padding: 24px;
  background: var(--crop-stage-bg);
}

.live-photo-preview {
  position: relative;
  aspect-ratio: 18 / 13;
  width: min(100%, 480px, calc((100vh - 210px) * 1.38));
  overflow: hidden;
  border-radius: 10px;
  background: #090d17;
  box-shadow: 0 24px 58px rgba(0, 0, 0, 0.34);
}

.live-photo-preview video {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.live-photo-preview canvas {
  position: absolute;
  inset: 0;
  display: none;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
}

.live-photo-preview.has-video canvas {
  display: block;
}

.live-photo-preview.has-video canvas:active {
  cursor: grabbing;
}


.live-photo-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 9px;
  padding: 24px;
  color: #d9e1ef;
  text-align: center;
}

.live-photo-preview.has-video .live-photo-empty {
  display: none;
}

.live-photo-empty svg {
  width: 34px;
  height: 34px;
  margin-bottom: 5px;
}

.live-photo-empty strong {
  font-size: 16px;
}

.live-photo-empty span {
  color: #9ba9bd;
  font-size: 13px;
}

.live-photo-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  color: #fff;
  background: rgba(5, 8, 14, 0.42);
  backdrop-filter: blur(8px);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.live-photo-badge svg {
  width: 13px;
  height: 13px;
}

.live-photo-preview-note {
  width: min(100%, 360px);
  margin: 0;
  color: #aab5c5;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.55;
  text-align: center;
}

.live-photo-form {
  display: grid;
  align-content: start;
  gap: 16px;
  min-height: 0;
  overflow: auto;
  padding: 22px;
}

.live-photo-section {
  display: grid;
  gap: 10px;
}

.live-photo-section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.live-photo-section-title strong,
.live-photo-section label > span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.live-photo-section-title span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  text-align: right;
}

.live-photo-file-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  min-height: 44px;
  justify-content: center;
  cursor: pointer;
}

.live-photo-file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.live-photo-platforms {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.live-photo-platforms button {
  min-height: 38px;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 850;
}

.live-photo-platforms button.active {
  color: var(--active-text);
  background: var(--active-bg);
}

.live-photo-ratio-grid {
  grid-template-columns: repeat(4, 1fr);
}

.live-photo-custom-ratio {
  display: grid;
  min-height: 64px;
  gap: 7px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.live-photo-custom-ratio.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.live-photo-custom-ratio > span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.live-photo-custom-ratio input {
  width: 100%;
  accent-color: var(--active-bg);
}

.live-photo-number-grid,
.live-photo-focus-grid {
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.live-photo-section label {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.live-photo-section input[type="number"],
.live-photo-section input[type="text"],
.live-photo-section select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 11px;
  color: var(--ink);
  background: var(--control-bg);
}

.live-photo-section input:focus,
.live-photo-section select:focus {
  border-color: var(--active-border);
  outline: 2px solid color-mix(in srgb, var(--active-border) 18%, transparent);
}

.live-photo-section input[type="range"] {
  width: 100%;
  accent-color: var(--active-bg);
}

.live-photo-section output {
  color: var(--muted);
  font-weight: 700;
}


.live-photo-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding-top: 2px;
}

.live-photo-actions button {
  min-height: 44px;
  padding: 0 14px;
}

.live-photo-handoff-card {
  width: min(1400px, 100%);
  max-height: min(900px, calc(100vh - 40px));
}

.live-photo-handoff-layout {
  display: grid;
  grid-template-columns: minmax(500px, 1fr) minmax(500px, 0.95fr);
  min-height: 0;
  overflow: auto;
}

.live-photo-handoff-preview {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  gap: 14px;
  align-content: start;
  min-width: 0;
  min-height: 0;
  padding: 28px 34px 26px;
  border-right: 1px solid var(--line);
  background: var(--soft);
}

.live-photo-handoff-preview-main {
  display: grid;
  place-items: center;
  min-height: 0;
  overflow: hidden;
}

.live-photo-handoff-preview-frame {
  position: relative;
  width: auto;
  height: min(560px, calc(100vh - 320px));
  max-width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.1);
}

.live-photo-handoff-preview-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.live-photo-handoff-preview-hint[hidden] {
  display: none;
}

.live-photo-handoff-preview-frame > canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.live-photo-handoff-video-well {
  position: absolute;
  z-index: 2;
  overflow: hidden;
  border-radius: 1.5%;
  background: #05070b;
}

.live-photo-handoff-video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.live-photo-handoff-live-badge {
  position: absolute;
  left: 3%;
  bottom: 4%;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 999px;
  color: #fff;
  background: rgba(5, 8, 14, 0.62);
  backdrop-filter: blur(7px);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.live-photo-handoff-live-badge svg {
  width: 12px;
  height: 12px;
}

.live-photo-handoff-thumbnails {
  display: flex;
  gap: 12px;
  min-height: 112px;
  overflow-x: auto;
  padding: 2px 2px 8px;
}

.live-photo-handoff-thumbnail {
  flex: 0 0 78px;
  display: grid;
  gap: 6px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.live-photo-handoff-thumbnail .live-photo-handoff-preview-frame {
  width: 78px;
  height: 104px;
  border-radius: 6px;
  box-shadow: none;
}

.live-photo-handoff-thumbnail.active .live-photo-handoff-preview-frame {
  border-color: var(--ink);
  box-shadow: 0 0 0 2px var(--ink);
}

.live-photo-handoff-thumbnail.active {
  color: var(--ink);
}

.live-photo-handoff-results {
  display: grid;
  grid-template-rows: auto auto auto auto auto;
  align-content: stretch;
  gap: 16px;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 38px 44px 30px;
}

.live-photo-handoff-device {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.live-photo-handoff-device[hidden] {
  display: none;
}

.live-photo-handoff-device svg {
  width: 14px;
  height: 14px;
  color: #65a30d;
}

.live-photo-handoff-device strong {
  font-size: 12px;
  font-weight: 700;
}

.live-photo-handoff-summary-block {
  display: grid;
  gap: 8px;
}

.live-photo-handoff-summary-block strong {
  color: var(--ink);
  font-size: 24px;
  line-height: 1.35;
}

.live-photo-handoff-summary-block span,
.live-photo-handoff-hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.live-photo-handoff-files {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: auto;
  overflow: visible;
  overscroll-behavior: contain;
}

.live-photo-handoff-files[hidden] {
  display: none;
}

.live-photo-package-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--popover-bg);
}

.live-photo-package-lead,
.live-photo-package-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 82px;
  padding: 15px 18px;
}

.live-photo-package-row + .live-photo-package-row {
  border-top: 1px solid var(--line);
}

.live-photo-package-lead > span:nth-child(2),
.live-photo-package-row > span,
.live-photo-package-helper > span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.live-photo-package-lead strong,
.live-photo-package-row strong,
.live-photo-package-helper strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
}

.live-photo-package-lead small,
.live-photo-package-row small,
.live-photo-package-helper small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.live-photo-package-lead em,
.live-photo-package-row em {
  padding: 5px 9px;
  border-radius: 999px;
  color: #3f7d1c;
  background: #eaf7df;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.live-photo-package-icon,
.live-photo-package-row > svg {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: var(--ink);
}

.live-photo-package-icon svg {
  width: 30px;
  height: 30px;
}

.live-photo-package-row > svg {
  width: 22px;
  height: 22px;
}

.live-photo-package-contents {
  padding: 4px 18px 0;
  border-top: 1px solid var(--line);
}

.live-photo-package-contents > strong {
  display: block;
  padding: 13px 0 5px;
  color: var(--muted);
  font-size: 12px;
}

.live-photo-package-contents > div {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 54px;
  border-bottom: 1px solid var(--line);
}

.live-photo-package-contents > div:last-child {
  border-bottom: 0;
}

.live-photo-package-contents svg {
  width: 19px;
  height: 19px;
  color: var(--ink);
}

.live-photo-package-contents span {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.live-photo-package-contents b {
  color: var(--ink);
  font-size: 13px;
}

.live-photo-package-contents small {
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.live-photo-package-details {
  border-top: 1px solid var(--line);
}

.live-photo-package-details summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 18px;
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
  list-style: none;
}

.live-photo-package-details summary::-webkit-details-marker {
  display: none;
}

.live-photo-package-details summary svg {
  width: 17px;
  height: 17px;
}

.live-photo-package-details[open] summary svg:last-child {
  transform: rotate(180deg);
}

.live-photo-package-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 0 18px 14px 45px;
  color: var(--muted);
  font-size: 11px;
}

.live-photo-package-detail-grid span {
  display: grid;
  gap: 2px;
}

.live-photo-package-detail-grid strong {
  color: var(--ink);
  font-size: 11px;
}

.live-photo-package-note {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 10px 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: var(--soft);
  font-size: 11px;
  line-height: 1.5;
}

.live-photo-package-note svg {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
}

.live-photo-package-helper {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  padding: 15px 17px;
  border: 1px solid color-mix(in srgb, #4f8fd8 24%, var(--line));
  border-radius: 12px;
  background: color-mix(in srgb, #dcecff 38%, var(--popover-bg));
}

.live-photo-package-helper > svg {
  width: 26px;
  height: 26px;
  color: #3478c7;
}

.live-photo-package-helper.is-warning {
  border-color: color-mix(in srgb, #c78b34 30%, var(--line));
  background: color-mix(in srgb, #fff0d5 34%, var(--popover-bg));
}

.live-photo-package-helper.is-warning > svg {
  color: #a56816;
}

.live-photo-handoff-file {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.live-photo-handoff-file svg {
  width: 17px;
  height: 17px;
}

.live-photo-handoff-file strong {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.live-photo-handoff-primary-actions {
  display: grid;
  gap: 12px;
}

.live-photo-handoff-primary-actions button {
  min-height: 52px;
  justify-content: center;
  font-size: 14px;
}

.live-photo-handoff-hint {
  margin: 0;
  text-align: center;
}

.live-photo-handoff-cancel {
  justify-self: center;
  padding: 7px 16px;
  color: var(--ink);
  background: transparent;
  font-size: 13px;
  font-weight: 750;
}

.live-photo-handoff-cancel:hover {
  color: var(--active-text);
}

.export-progress-compact .handoff-progress-card {
  grid-template-columns: 1fr;
  justify-items: center;
  gap: 18px;
  width: min(430px, calc(100vw - 40px));
  padding: 28px 34px 24px;
  text-align: center;
}

.export-progress-compact .handoff-progress-copy {
  grid-column: 1;
  grid-row: auto;
  justify-items: center;
  gap: 5px;
}

.export-progress-compact .handoff-progress-copy strong {
  font-size: 18px;
}

.export-progress-compact .handoff-progress-ring-wrap {
  position: relative;
  display: grid;
  place-items: center;
  grid-column: 1;
  grid-row: auto;
  width: 96px;
  height: 96px;
}

.export-progress-compact .handoff-progress-ring {
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  margin: 0;
  color: var(--active-text);
  background: transparent;
}

.export-progress-compact .handoff-progress-ring svg {
  width: 96px;
  height: 96px;
  margin: 0;
  stroke-width: 1.7;
}

.export-progress-compact .handoff-progress-ring-wrap .export-progress-percent {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--ink);
  font-size: 20px;
  font-weight: 850;
  letter-spacing: -0.03em;
}

.export-progress-compact:is(.is-success, .is-error, .is-cancelled) .handoff-progress-ring-wrap .export-progress-percent {
  inset: auto 0 0;
  display: block;
  font-size: 15px;
  line-height: 1;
}

.export-progress-compact:is(.is-success, .is-error, .is-cancelled) .handoff-progress-ring-wrap {
  height: 116px;
}

.export-progress-compact:is(.is-success, .is-error, .is-cancelled) .handoff-progress-ring {
  align-self: start;
}

.export-progress-compact.is-success .handoff-progress-ring-wrap .export-progress-percent {
  color: #15803d;
}

.export-progress-compact.is-error .handoff-progress-ring-wrap .export-progress-percent {
  color: #b91c1c;
}

.handoff-progress-steps {
  display: grid;
  grid-column: 1;
  grid-row: auto;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
}

.handoff-progress-step {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
}

.handoff-progress-step > span,
.handoff-progress-step > strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.handoff-progress-step > strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 750;
}

.handoff-progress-step svg {
  width: 13px;
  height: 13px;
}

.handoff-progress-step.is-complete > strong {
  color: #65a30d;
}

.handoff-progress-step.is-active > strong {
  color: var(--active-text);
}

.handoff-progress-step.is-active svg {
  animation: export-progress-spin 1s linear infinite;
}

.export-progress-compact .export-progress-meta {
  display: none;
}

.export-progress-compact .export-progress-track {
  grid-column: 1;
  grid-row: auto;
  width: 100%;
  height: 4px;
  margin-top: 0;
}

.onboarding-tour {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.onboarding-tour.hidden {
  display: none;
}

body.onboarding-account-step .site-footer {
  z-index: 1002;
}

.onboarding-focus {
  position: fixed;
  z-index: 1000;
  border: 2px solid #fff;
  border-radius: 10px;
  box-shadow: 0 0 0 100vmax rgba(15, 23, 42, 0.66), 0 0 0 5px rgba(255, 255, 255, 0.2), 0 10px 28px rgba(15, 23, 42, 0.28);
  pointer-events: none;
  transition: top 180ms ease, left 180ms ease, width 180ms ease, height 180ms ease;
}

.onboarding-tooltip {
  position: fixed;
  z-index: 1001;
  width: min(320px, calc(100vw - 32px));
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: var(--popover-bg);
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.24);
}

.onboarding-tooltip h3 {
  margin: 0 0 9px;
  font-size: 19px;
  line-height: 1.35;
}

.onboarding-tooltip p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.onboarding-action-button {
  width: 100%;
  min-height: 40px;
  justify-content: center;
  margin-top: 14px;
}

.onboarding-arrow {
  position: absolute;
  width: 12px;
  height: 12px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background: var(--popover-bg);
  transform: rotate(45deg);
}

.onboarding-tooltip[data-placement="bottom"] .onboarding-arrow {
  top: -7px;
  left: 24px;
}

.onboarding-tooltip[data-placement="top"] .onboarding-arrow {
  bottom: -7px;
  left: 24px;
  transform: rotate(225deg);
}

.onboarding-actions,
.onboarding-actions > div {
  display: flex;
  align-items: center;
}

.onboarding-actions {
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
}

.onboarding-actions > div {
  gap: 8px;
}

.onboarding-actions > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.onboarding-actions button {
  min-height: 38px;
  padding: 0 13px;
}

@media (max-width: 820px) {
  .account-modal-card {
    width: min(560px, 100%);
    height: auto;
    max-height: calc(100vh - 24px);
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    overflow: auto;
    border-radius: 20px;
  }

  .account-value-pane {
    gap: 16px;
    padding: 30px 28px 24px;
    border-right: 0;
    border-bottom: 1px solid color-mix(in srgb, var(--line) 64%, transparent);
  }

  .account-value-pane h3 {
    padding-right: 42px;
    font-size: 25px;
  }

  .account-benefits {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-content: start;
    gap: 12px;
    padding-top: 6px;
  }

  .account-benefit-row {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 8px;
  }

  .account-benefit-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
  }

  .account-benefit-icon svg {
    width: 17px;
    height: 17px;
  }

  .account-benefit-row span:not(.account-benefit-icon) {
    display: none;
  }

  .account-modal-body {
    padding: 28px;
  }

  .account-auth-form,
  .account-signed-in {
    gap: 20px;
  }

  .account-resend-confirmation {
    margin-top: 0;
  }
}

@media (max-width: 980px) {
  body {
    overflow: auto;
  }

  .workspace {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
  }

  .workspace.history-open {
    grid-template-columns: 1fr;
  }

  .site-footer {
    right: 12px;
    bottom: 10px;
    gap: 6px;
  }

  .site-credit,
  .account-dock-button {
    font-size: 11px;
  }

  .panel-resizer {
    display: none;
  }

  .history-sidebar {
    width: auto;
    height: 50px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .history-sidebar.open {
    width: auto;
    height: 250px;
  }

  .history-tab {
    top: 7px;
    left: 14px;
  }

  .history-drawer {
    width: 100%;
    padding: 14px;
  }

  .editor-panel {
    height: 72vh;
    min-height: 560px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .preview-panel {
    overflow: visible;
  }

  .preview-body {
    grid-template-columns: 1fr;
  }

  .article-settings {
    position: static;
    width: 100%;
    max-height: none;
    order: -1;
  }

  .live-photo-layout {
    grid-template-columns: minmax(260px, 0.8fr) minmax(390px, 1.2fr);
  }
}

@media (max-width: 680px) {
  .live-photo-handoff-layout {
    grid-template-columns: 1fr;
  }

  .live-photo-handoff-preview {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 18px;
  }

  .live-photo-handoff-preview-frame {
    height: min(440px, calc(100vh - 300px));
  }

  .live-photo-handoff-results {
    padding: 28px 22px 34px;
  }
}

@media (max-width: 620px) {
  .welcome-back-modal {
    align-items: start;
    padding: 16px;
  }

  .welcome-back-card {
    padding: 32px 22px 24px;
    border-radius: 18px;
  }

  .welcome-back-features article {
    grid-template-columns: auto minmax(0, 1fr);
    padding: 12px 0;
  }

  .welcome-back-feature-state {
    grid-column: 2;
    justify-self: start;
  }

  .welcome-back-actions {
    grid-template-columns: 1fr;
  }

  .entry-choice-modal {
    align-items: start;
    padding: 22px 16px;
  }

  .entry-choice-options {
    grid-template-columns: 1fr;
  }

  .entry-choice-option {
    padding: 20px;
  }

  .entry-choice-head h2 {
    font-size: 32px;
  }

  .editor-panel,
  .preview-panel {
    padding: 14px;
  }

  .editor-panel {
    height: 78vh;
    min-height: 560px;
    gap: 10px;
  }

  .brand-row h1 {
    font-size: 20px;
  }

  .brand-row {
    align-items: flex-start;
  }

  .mode-switch {
    width: 100%;
    order: 3;
  }

  .live-photo-modal-card {
    height: calc(100vh - 24px);
    max-height: calc(100vh - 24px);
  }

  .live-photo-layout {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .live-photo-preview-column {
    padding: 18px;
  }

  .live-photo-preview {
    width: min(72vw, 290px);
  }

  .live-photo-form {
    overflow: visible;
    padding: 18px;
  }

  .live-photo-number-grid,
  .live-photo-focus-grid {
    grid-template-columns: 1fr;
  }

  .live-photo-ratio-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .live-photo-section-title {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .live-photo-section-title span {
    text-align: left;
  }

  .live-photo-actions {
    flex-wrap: wrap;
  }

  .profile-inline {
    grid-template-columns: 38px minmax(0, 1fr) minmax(0, 0.82fr) 34px;
    gap: 6px;
  }

  .profile-inline .avatar-picker {
    width: 38px;
    height: 38px;
  }

  .compact-input {
    height: 34px;
    padding-inline: 8px;
    font-size: 13px;
  }

  .toolbar {
    gap: 6px;
  }

  .tool-button {
    width: 34px;
    height: 34px;
    font-size: 12px;
  }

  .tool-popover {
    position: fixed;
    top: 104px;
    left: 12px;
    right: 12px;
    width: auto;
    max-height: calc(100vh - 128px);
    overflow: auto;
  }

  .search-popover,
  .settings-popover {
    grid-template-columns: 1fr;
  }

  .preview-topbar {
    position: static;
    display: grid;
    margin: -18px -18px 18px;
    padding: 18px 18px 14px;
  }

  .preview-topbar::before,
  .preview-topbar::after {
    display: none;
  }

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .topbar-actions {
    flex-wrap: wrap;
  }

  .pages {
    grid-template-columns: 1fr;
  }

  .crop-layout {
    grid-template-columns: 1fr;
  }

  .crop-controls {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .wechat-cover-field {
    grid-template-columns: 1fr;
  }

  .wechat-cover-preview {
    width: min(100%, 320px);
  }

  .wechat-sync-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}
