:root {
  --bg: #f2f3f0;
  --panel: #ffffff;
  --ink: #1f262e;
  --ink-soft: #313a44;
  --muted: #68737e;
  --line: #e2e5e8;
  --line-strong: #cdd3d8;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --accent-soft: #e3f0ee;
  --warm: #f8f7f4;
  --danger: #b6423c;
  --shadow: 0 12px 34px rgba(24, 33, 42, 0.12);
  --radius: 8px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: 268px;
  flex: 0 0 268px;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 18px 16px 14px;
  gap: 18px;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 4px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 800;
  flex: 0 0 auto;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.brand-text strong {
  font-size: 16px;
}

.brand-text span {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.ai-banner {
  background: linear-gradient(135deg, #0f766e, #145d5a);
  color: #fff;
  border-radius: var(--radius);
  padding: 16px;
}

.ai-banner-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 7px;
}

.ai-banner p {
  margin: 0 0 12px;
  font-size: 12.5px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.86);
}

.ai-config-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.9);
  font-size: 11.5px;
}

.ai-config-state::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e8b04b;
}

.ai-config-state.ready::before {
  background: #6fe3a8;
}

.sidebar-section {
  min-height: 0;
}

.sidebar-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  margin: 0 4px 8px;
}

.section-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  text-align: left;
  padding: 9px 10px;
  border-radius: 7px;
  font-size: 13px;
  transition: background 0.15s, color 0.15s;
}

.nav-item:hover {
  background: var(--warm);
  color: var(--ink);
}

.nav-item svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
  flex: 0 0 auto;
}

.sidebar-footer {
  margin-top: auto;
  padding: 10px 4px 0;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.sidebar-note {
  color: var(--muted);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 2px;
}

.dot-online {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2f9e63;
  display: inline-block;
}

.workspace {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 64px;
  flex: 0 0 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.topbar-heading {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
}

.topbar-heading h1 {
  font-size: 17px;
  margin: 0;
  white-space: nowrap;
}

.save-state {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.save-state.saving {
  color: #a06b14;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.zoom-group {
  display: flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--panel);
  height: 36px;
}

.zoom-group .icon-btn {
  border: 0;
  background: transparent;
  width: 32px;
  height: 36px;
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1;
}

.zoom-group .icon-btn:hover {
  background: var(--warm);
}

.zoom-label {
  min-width: 46px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  line-height: 34px;
}

.template-select {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.template-select select {
  height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
  padding: 0 28px 0 10px;
  font-size: 13px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.btn svg {
  width: 16px;
  height: 16px;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-strong);
}

.btn-accent {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.34);
  backdrop-filter: blur(4px);
}

.btn-accent:hover {
  background: rgba(255, 255, 255, 0.24);
}

.btn-ghost {
  background: var(--panel);
  color: var(--ink-soft);
  border-color: var(--line-strong);
}

.btn-ghost:hover {
  border-color: var(--muted);
  color: var(--ink);
}

.btn-block {
  width: 100%;
}

.btn-small {
  height: 30px;
  padding: 0 12px;
  font-size: 12px;
}

.btn-dashed {
  width: 100%;
  border: 1px dashed var(--line-strong);
  background: transparent;
  color: var(--muted);
  font-weight: 500;
  margin-top: 12px;
}

.btn-dashed:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.icon-btn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-soft);
  font-size: 20px;
  line-height: 1;
}

.icon-btn:hover {
  background: var(--warm);
  border-color: var(--line);
}

.layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 580px minmax(0, 1fr);
}

.form-panel {
  overflow-y: auto;
  background: var(--bg);
  padding: 18px 18px 60px;
  border-right: 1px solid var(--line);
}

.preview-panel {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #e9ebe9;
}

.preview-head {
  height: 44px;
  flex: 0 0 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 18px;
  background: var(--warm);
  border-bottom: 1px solid var(--line);
}

.preview-title {
  font-size: 13px;
  font-weight: 700;
}

.page-count {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 700;
}

.preview-hint {
  font-size: 12px;
  color: var(--muted);
}

.preview-stage {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 22px 16px 40px;
}

.pages {
  display: flex;
  flex-direction: column;
  align-items: center;
  --zoom: 0.9;
}

.page {
  width: 210mm;
  height: 297mm;
  background: #fff;
  color: var(--ink);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 14mm;
  zoom: var(--zoom);
  flex: 0 0 auto;
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}

.page-inner {
  height: 100%;
  padding: 13mm 14mm 12mm;
  display: flex;
  flex-direction: column;
}

/* Form sections */
.form-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}

.form-section-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 13px 15px;
  cursor: pointer;
  user-select: none;
  font-size: 14px;
  font-weight: 700;
}

.form-section-head svg {
  width: 17px;
  height: 17px;
  color: var(--accent);
  flex: 0 0 auto;
}

.form-count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--warm);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  display: grid;
  place-items: center;
}

.chevron {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  transition: transform 0.15s;
}

.form-section-head.collapsed .chevron {
  transform: rotate(-90deg);
}

.form-section-body {
  border-top: 1px solid var(--line);
  padding: 14px 15px 16px;
  display: block;
}

.form-section-head.collapsed + .form-section-body {
  display: none;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field > span {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  padding: 9px 11px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.field textarea {
  resize: vertical;
  line-height: 1.6;
  min-height: 64px;
}

.field input:disabled {
  background: var(--warm);
  color: var(--muted);
}

.photo-uploader {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  margin-bottom: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--warm);
}

.photo-box {
  width: 84px;
  height: 112px;
  flex: 0 0 auto;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  background: #fff;
  overflow: hidden;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--muted);
}

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

.photo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  font-size: 11px;
}

.photo-placeholder svg {
  width: 26px;
  height: 26px;
}

.photo-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
  min-width: 0;
}

.photo-tip {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.55;
}

.photo-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-remove-photo {
  color: var(--danger);
}

.btn-remove-photo:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: #fbecea;
}

.field-span-2 {
  grid-column: 1 / -1;
}

.field-check {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding-top: 20px;
}

.field-check input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.field-check span {
  font-size: 13px;
  color: var(--ink-soft);
}

.entry-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}

.entry-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  background: var(--warm);
  border-bottom: 1px solid var(--line);
}

.entry-index {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  flex: 0 0 auto;
}

.entry-name {
  font-size: 13px;
  font-weight: 700;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entry-actions {
  margin-left: auto;
}

.btn-icon-danger {
  height: 28px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--danger);
  font-size: 12px;
}

.btn-icon-danger:hover {
  background: #fbecea;
  border-color: #efc8c4;
}

.entry-card .form-grid {
  padding: 12px;
}

/* Resume page typography */
.resume-block + .resume-block {
  margin-top: 4.2mm;
}

.resume-header {
  display: flex;
  align-items: flex-start;
  gap: 4.5mm;
}

.resume-header-main {
  flex: 1;
  min-width: 0;
}

.resume-photo {
  width: 22mm;
  height: 29mm;
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: 1.6mm;
  border: 0.5mm solid #dfe3e6;
  background: #f5f6f7;
}

.resume-name {
  margin: 0;
  font-size: 8.6mm;
  font-weight: 800;
  line-height: 1.15;
  color: #1b232b;
}

.resume-title {
  margin-top: 1.1mm;
  font-size: 4mm;
  font-weight: 600;
}

.contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1mm 3.4mm;
  margin-top: 2.4mm;
  font-size: 2.85mm;
  color: #4c5660;
}

.contact-item {
  white-space: nowrap;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 2.2mm;
  margin: 0 0 2.4mm;
  font-size: 3.9mm;
  font-weight: 800;
  color: #1b232b;
}

.section-title::after {
  content: "";
  flex: 1;
  height: 0.32mm;
  background: #dfe3e6;
}

.resume-block p,
.resume-block li {
  font-size: 3.05mm;
  line-height: 1.62;
  color: #2b333c;
}

.resume-block p {
  margin: 0;
}

.bullet-list {
  margin: 1.5mm 0 0;
  padding-left: 4mm;
}

.bullet-list li {
  margin: 0.9mm 0;
}

.bullet-list li::marker {
  color: var(--accent);
}

.exp-item + .exp-item,
.project-item + .project-item,
.edu-item + .edu-item {
  margin-top: 3.4mm;
}

.exp-head,
.project-head,
.edu-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 1.2mm 2.6mm;
}

.exp-role,
.project-name,
.edu-school {
  font-size: 3.55mm;
  font-weight: 800;
  color: #1b232b;
}

.exp-org,
.project-role,
.edu-degree {
  font-size: 3.2mm;
  font-weight: 600;
  color: var(--accent);
}

.exp-date,
.project-date,
.edu-date {
  margin-left: auto;
  font-size: 2.75mm;
  color: #5a6570;
  white-space: nowrap;
}

.exp-meta,
.project-meta,
.edu-meta {
  margin-top: 0.6mm;
  font-size: 2.8mm;
  color: #5a6570;
}

.simple-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.simple-list li {
  display: flex;
  align-items: baseline;
  gap: 2.2mm;
  margin: 1.3mm 0;
}

.simple-list li::before {
  content: "";
  width: 1.4mm;
  height: 1.4mm;
  border-radius: 50%;
  background: var(--accent);
  flex: 0 0 auto;
  transform: translateY(-0.4mm);
}

.skill-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.6mm 2.6mm;
}

.skill-chip {
  display: inline-flex;
  align-items: center;
  gap: 1.8mm;
  border: 0.32mm solid #dfe3e6;
  border-radius: 1.6mm;
  padding: 1.1mm 2.2mm;
  font-size: 2.85mm;
  color: #2b333c;
  background: #fbfbfa;
}

.chip-dots {
  display: inline-flex;
  gap: 0.75mm;
}

.chip-dots i {
  width: 1.45mm;
  height: 1.45mm;
  border-radius: 50%;
  background: #dfe3e6;
}

.chip-dots i.on {
  background: var(--accent);
}

.edu-school-line {
  display: flex;
  align-items: baseline;
  gap: 2.4mm;
  flex-wrap: wrap;
}

/* Templates */
.page.template-classic .resume-header {
  position: relative;
  padding-left: 4.2mm;
  padding-bottom: 3.6mm;
  border-bottom: 0.35mm solid #dfe3e6;
}

.page.template-classic .resume-header::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.6mm;
  bottom: 0.6mm;
  width: 1.15mm;
  border-radius: 1mm;
  background: var(--accent);
}

.page.template-classic .resume-title {
  color: var(--accent);
}

.page.template-minimal .resume-header {
  flex-direction: column;
  align-items: center;
  padding-bottom: 3.2mm;
  border-bottom: 0.55mm solid #1b232b;
}

.page.template-minimal .resume-header-main {
  text-align: center;
  width: 100%;
}

.page.template-minimal .contact-row {
  justify-content: center;
}

.page.template-minimal .section-title {
  font-size: 3.7mm;
}

.page.template-minimal .section-title::after {
  height: 0.25mm;
  background: #d5dade;
}

.page.template-modern .resume-header {
  margin: -13mm -14mm 0;
  padding: 12mm 14mm 9mm;
  background: #123b37;
  color: #fff;
}

.page.template-modern .resume-name {
  color: #fff;
}

.page.template-modern .resume-title {
  color: #8fd8cd;
}

.page.template-modern .contact-row {
  color: rgba(255, 255, 255, 0.78);
}

.page.template-modern .resume-photo {
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 1.2mm 3mm rgba(0, 0, 0, 0.22);
}

.page.template-modern .section-title {
  color: #123b37;
}

.page.template-modern .section-title::before {
  content: "";
  width: 2mm;
  height: 2mm;
  border-radius: 0.5mm;
  background: var(--accent);
  flex: 0 0 auto;
}

.page.template-modern .section-title::after {
  background: #d8e4e1;
}

.page.template-simple .simple-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4mm;
  margin-bottom: 3.6mm;
}

.page.template-simple .simple-title {
  margin: 0;
  font-size: 8mm;
  font-weight: 700;
  color: #14181d;
  text-align: center;
}

.page.template-simple .simple-photo {
  width: 19mm;
  height: 25mm;
  object-fit: cover;
  border: 0.4mm solid #14181d;
  border-radius: 0.8mm;
}

.page.template-simple .simple-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.page.template-simple .simple-table td {
  border: 0.32mm solid #1c232b;
  padding: 1.5mm 2.5mm;
  font-size: 3.1mm;
  line-height: 1.5;
  vertical-align: middle;
  word-break: break-word;
}

.page.template-simple .tbl-label {
  width: 23mm;
  background: #f1f1ee;
  color: #1c232b;
  font-weight: 700;
  text-align: center;
}

.page.template-simple .tbl-value {
  color: #2b333c;
}

.page.template-simple .section-title {
  margin: 4.4mm 0 2.2mm;
  font-size: 4.2mm;
  font-weight: 700;
}

.page.template-simple .section-title::after {
  display: none;
}

.page.template-simple .resume-block + .resume-block {
  margin-top: 3mm;
}

.page.template-simple .bullet-list {
  list-style: none;
  padding-left: 0;
}

.page.template-simple .bullet-list li {
  margin: 0.8mm 0;
}

.page.template-simple .bullet-list li::marker {
  color: inherit;
}

.page.template-simple .simple-list li::before {
  display: none;
}

.page.template-simple .exp-head,
.page.template-simple .project-head,
.page.template-simple .edu-head {
  gap: 1.2mm 2.8mm;
}

.page.template-simple .exp-org,
.page.template-simple .project-role,
.page.template-simple .edu-degree {
  color: #2b333c;
  font-weight: 600;
}

.page.template-simple .exp-date,
.page.template-simple .project-date,
.page.template-simple .edu-date {
  order: -1;
  margin-left: 0;
  margin-right: auto;
  color: #2b333c;
}

.page.template-simple .exp-org {
  order: 0;
}

.page.template-simple .exp-role {
  order: 1;
}

.page.template-simple .skill-chip {
  border: 0;
  background: none;
  padding: 0.5mm 1.8mm;
}

.page.template-simple .skill-chip:first-child {
  padding-left: 0;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 30, 0.46);
  display: grid;
  place-items: center;
  z-index: 100;
  padding: 24px;
}

.modal {
  width: min(880px, 100%);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border-radius: 12px;
  box-shadow: 0 24px 70px rgba(12, 18, 24, 0.28);
  overflow: hidden;
}

.modal-sm {
  width: min(560px, 100%);
}

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

.modal-head h2 {
  margin: 0;
  font-size: 18px;
}

.modal-head p {
  margin: 5px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
}

.modal-body {
  padding: 18px 20px 22px;
  overflow-y: auto;
}

.ai-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

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

.ai-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 4px;
}

.api-status-line {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--warm);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}

.ai-results {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.ai-empty {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 26px 18px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  background: var(--warm);
}

.suggest-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}

.suggest-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--warm);
  border-bottom: 1px solid var(--line);
}

.suggest-title {
  font-size: 13px;
  font-weight: 700;
}

.suggest-body {
  padding: 13px 14px;
}

.suggest-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-strong);
  margin-bottom: 7px;
  text-transform: uppercase;
}

.suggest-text {
  font-size: 13px;
  line-height: 1.75;
  white-space: pre-wrap;
  color: var(--ink-soft);
}

.original-details {
  margin-top: 11px;
  border-top: 1px dashed var(--line);
  padding-top: 9px;
}

.original-details summary {
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.original-text {
  margin-top: 8px;
  padding: 9px 11px;
  background: var(--warm);
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
  color: var(--muted);
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  background: #232b33;
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.24);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 200;
  max-width: min(560px, calc(100vw - 40px));
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.error {
  background: #8f2f2b;
}

@media (max-width: 1100px) {
  .topbar {
    height: auto;
    min-height: 64px;
    padding: 10px 16px;
    flex-wrap: wrap;
    row-gap: 8px;
  }

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

@media (max-width: 1200px) {
  .sidebar {
    width: 220px;
    flex-basis: 220px;
  }

  .layout {
    grid-template-columns: 520px minmax(0, 1fr);
  }

  .template-select span {
    display: none;
  }
}

@media (max-width: 980px) {
  .app {
    height: auto;
    min-height: 100vh;
    overflow: visible;
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    flex-basis: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    max-height: 420px;
  }

  .workspace {
    height: 100vh;
  }

  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) minmax(0, 1.2fr);
  }

  .form-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media print {
  @page {
    size: A4;
    margin: 0;
  }

  html,
  body {
    height: auto;
    background: #fff;
  }

  .sidebar,
  .topbar,
  .form-panel,
  .preview-head,
  .modal-backdrop,
  .toast,
  .save-state {
    display: none !important;
  }

  .app,
  .workspace,
  .layout,
  .preview-panel {
    display: block;
    height: auto;
    overflow: visible;
    background: #fff;
  }

  .preview-panel {
    display: block !important;
  }

  .preview-stage {
    padding: 0;
    overflow: visible;
    background: #fff;
  }

  .pages {
    --zoom: 1;
    display: block;
    align-items: stretch;
  }

  .page {
    zoom: 1 !important;
    width: 210mm;
    height: 296.7mm;
    margin: 0;
    box-shadow: none;
    border-radius: 0;
    break-after: page;
    page-break-after: always;
  }

  .page:last-child {
    break-after: auto;
    page-break-after: auto;
  }
}
