:root {
  --bg: #f4f6f8;
  --bg2: #eef2f4;
  --panel: #ffffff;
  --line: #dce4e7;
  --text: #172c30;
  --subtext: #64777b;
  --brand: #178c7c;
  --brand-strong: #0c675d;
  --brand-soft: #e7f6f2;
  --danger: #b42318;
  --shadow-soft: 0 18px 50px rgba(26, 57, 62, 0.07);
  --shadow-card: 0 8px 24px rgba(26, 57, 62, 0.07);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  font-family: "Microsoft YaHei UI", "PingFang SC", "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% -10%, #d9f0e9 0%, transparent 35%),
    radial-gradient(circle at 90% 0%, #e2edf0 0%, transparent 30%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%);
  min-height: 100vh;
}

.privacy-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid #b9ddcf;
  border-radius: 16px;
  background: #effaf5;
  color: #245b49;
  box-shadow: var(--shadow-card);
}

.privacy-banner b {
  display: grid;
  place-items: center;
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: #d8f3e8;
}

.privacy-banner strong,
.privacy-banner span {
  display: block;
}

.privacy-banner > div {
  min-width: 0;
}

.privacy-banner.online {
  border-color: #c9daf7;
  color: #244f7d;
  background: #f3f7ff;
}

.privacy-banner.online b {
  color: #245790;
  background: #dceaff;
}

.privacy-banner.online span {
  color: #58708e;
}

.privacy-banner.server {
  border-color: #c8d7ee;
  background: #f2f7ff;
}

.privacy-banner.server b {
  color: #31567f;
  background: #dfeaff;
}

.privacy-banner.server span {
  color: #526780;
}

.privacy-banner span {
  margin-top: 3px;
  color: #4f7568;
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.site-footer {
  padding: 18px 8px 2px;
  color: var(--subtext);
  font-size: 12px;
  text-align: center;
}

.page {
  width: min(94vw, 1500px);
  margin: 0 auto;
  padding: 24px 10px 18px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 18px;
  padding: 8px 4px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(145deg, var(--brand), var(--brand-strong));
  box-shadow: 0 12px 24px rgba(23, 140, 124, 0.24);
  font-size: 23px;
  font-weight: 900;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(28px, 3vw, 38px);
  letter-spacing: -0.02em;
  font-weight: 800;
}

.topbar p {
  margin: 10px 0 0;
  color: var(--subtext);
  font-size: 15px;
}

.language-switcher {
  display: flex;
  gap: 6px;
  border: 1px solid rgba(15, 98, 254, 0.14);
  border-radius: 14px;
  padding: 5px;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-card);
}

.lang-btn {
  border: none;
  background: transparent;
  border-radius: 10px;
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 600;
  color: var(--subtext);
  min-width: 52px;
}

.lang-btn.active {
  color: #fff;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-strong) 100%);
  box-shadow: 0 8px 16px rgba(15, 98, 254, 0.28);
}

.workspace {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 20px;
  min-height: calc(100vh - 150px);
}

.sidebar,
.content {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(10px);
}

.sidebar {
  padding: 16px;
  overflow: auto;
}

.sidebar h2 {
  margin: 0 0 14px;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.tool-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tool-filters {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.tool-search-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
}

.tool-search-input:focus {
  outline: none;
  border-color: #89abed;
  box-shadow: 0 0 0 3px rgba(15, 98, 254, 0.12);
}

.category-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.category-chip {
  border: 1px solid #c8d7f0;
  background: #f7faff;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
  color: #44608e;
  cursor: pointer;
  transition: all 150ms ease;
}

.category-chip:hover {
  border-color: #95b6ee;
  background: #eaf2ff;
}

.category-chip.active {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-strong) 100%);
  box-shadow: 0 8px 14px rgba(15, 98, 254, 0.24);
}

.tool-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  text-align: left;
  display: flex;
  gap: 10px;
  align-items: center;
  background: #fff;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.tool-card:hover {
  border-color: #8dc9be;
  box-shadow: 0 10px 18px rgba(26, 73, 146, 0.12);
  transform: translateY(-1px);
}

.tool-card.active {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 12px 20px rgba(23, 140, 124, 0.14);
}

.tool-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: #eef7f5;
  font-size: 13px;
  line-height: 1;
  min-width: 54px;
  white-space: nowrap;
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--brand-strong);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
}

.tool-meta {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.tool-meta small {
  color: var(--subtext);
  font-size: 12px;
  line-height: 1.35;
}

.tool-meta strong {
  font-size: 17px;
  letter-spacing: -0.01em;
}

.tool-list-summary {
  margin: 12px 4px 2px;
  color: #5d7397;
  font-size: 12px;
  font-weight: 600;
}

.content {
  padding: 18px;
  min-height: 100%;
}

.panel-head h3 {
  margin: 0 0 14px;
  font-size: 27px;
  letter-spacing: -0.02em;
}

.tool-host {
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 16px;
  min-height: calc(100vh - 255px);
  background: #fff;
}

.welcome {
  overflow: hidden;
  position: relative;
  padding: clamp(28px, 5vw, 64px);
  border-radius: 20px;
  color: #fff;
  background:
    radial-gradient(circle at 85% 20%, rgba(255, 255, 255, 0.18), transparent 28%),
    linear-gradient(135deg, #147f72 0%, #0e5c56 100%);
}

.welcome::after {
  content: "";
  position: absolute;
  right: -50px;
  bottom: -95px;
  width: 280px;
  height: 280px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
}

.welcome-eyebrow {
  display: inline-flex;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.welcome h4 {
  max-width: 720px;
  margin: 22px 0 12px;
  font-size: clamp(30px, 5vw, 54px);
  line-height: 1.12;
  letter-spacing: -0.04em;
}

.welcome p {
  max-width: 700px;
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 16px;
  line-height: 1.75;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.trust-row span {
  padding: 9px 13px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 13px;
  font-weight: 700;
}

.coming-section {
  padding: 30px 4px 4px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 16px;
}

.section-title h4 {
  margin: 0;
  font-size: 22px;
}

.section-title p {
  margin: 7px 0 0;
  color: var(--subtext);
  font-size: 13px;
}

.coming-pill {
  color: var(--brand-strong);
  background: var(--brand-soft);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.coming-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.coming-card {
  width: 100%;
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 8px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fafcfc;
  font-family: inherit;
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.coming-card:hover {
  transform: translateY(-2px);
  border-color: #8dc9be;
  box-shadow: var(--shadow-card);
}

.coming-card span {
  width: fit-content;
  padding: 5px 8px;
  border-radius: 8px;
  color: var(--brand-strong);
  background: var(--brand-soft);
  font-size: 10px;
  font-weight: 900;
}

.coming-card strong {
  font-size: 17px;
}

.coming-card small {
  color: var(--subtext);
  line-height: 1.55;
}

.tool-placeholder h4 {
  margin: 0;
}

.tool-placeholder p {
  color: var(--subtext);
}

.tool-placeholder code {
  display: inline-block;
  margin-top: 8px;
  background: #e9eef9;
  border-radius: 8px;
  padding: 4px 8px;
}

.empty {
  color: var(--subtext);
  font-size: 20px;
  margin: 18px 6px;
}

.tool-layout {
  display: grid;
  gap: 14px;
}

.tool-upload {
  border: 1px dashed #8dc9be;
  border-radius: 14px;
  padding: 20px 16px;
  text-align: center;
  background: linear-gradient(180deg, #f8fcfb 0%, #f0f8f6 100%);
  transition: border-color 180ms ease, background 180ms ease;
}

.tool-upload.dragover {
  border-color: var(--brand-strong);
  background: #e7f1ff;
}

.hint {
  margin: 10px 0 0;
  color: var(--subtext);
  font-size: 14px;
}

.tool-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.tool-controls label {
  font-size: 13px;
  color: var(--subtext);
  display: grid;
  gap: 6px;
}

.tool-controls input,
.tool-controls select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
}

.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.action-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 9px 13px;
  cursor: pointer;
  font-weight: 600;
  color: #263b5e;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.action-btn:hover {
  transform: translateY(-1px);
  border-color: #aac3ef;
  box-shadow: 0 6px 12px rgba(19, 60, 130, 0.12);
}

.action-btn.primary {
  border-color: var(--brand);
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-strong) 100%);
  color: #fff;
}

.action-btn.danger {
  border-color: #f3b9b9;
  color: var(--danger);
  background: #fff6f6;
}

.progress {
  display: grid;
  gap: 6px;
}

.progress-bar {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #ecf1fb;
  overflow: hidden;
}

.progress-bar > span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #0b5cff, #3f89ff);
}

.progress p {
  margin: 0;
  color: var(--subtext);
  font-size: 13px;
}

.tool-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.thumb-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: #fff;
  box-shadow: var(--shadow-card);
}

.thumb-wrap {
  height: 120px;
  display: grid;
  place-items: center;
  background: #f6f8fd;
  border-radius: 8px;
  overflow: hidden;
}

.thumb {
  max-width: 100%;
  max-height: 100%;
}

.thumb-name {
  margin: 8px 0;
  font-size: 12px;
  color: var(--subtext);
  word-break: break-all;
}

.thumb-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.thumb-actions button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 8px;
  background: #fff;
  cursor: pointer;
}

.preview-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  min-height: 240px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  align-items: start;
  background: #fff;
}

.pdf-page-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  background: #fff;
}

.pdf-page-card h5 {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--subtext);
}

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

.file-stack {
  display: grid;
  gap: 8px;
}

.file-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: #fff;
  box-shadow: var(--shadow-card);
}

.file-row p {
  margin: 4px 0 0;
  color: var(--subtext);
  font-size: 12px;
}

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

.file-row-actions button {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 8px;
  background: #fff;
  cursor: pointer;
}

.status {
  min-height: 20px;
  font-size: 13px;
  color: var(--subtext);
}

.status.success {
  color: #0f6b3e;
}

.status.error {
  color: #b31b1b;
}

.load-error {
  max-width: 520px;
  margin: 40px auto;
  padding: 26px;
  border: 1px solid #efc6c1;
  border-radius: 16px;
  text-align: center;
  background: #fff7f6;
}

.load-error strong {
  font-size: 22px;
  color: #8e2f25;
}

.load-error p {
  margin: 10px 0 18px;
  color: #7b625f;
  line-height: 1.65;
}

.range-control {
  display: grid;
  grid-template-columns: 1fr 52px;
  gap: 8px;
  align-items: center;
}

.range-control input[type="range"] {
  padding: 0;
  accent-color: var(--brand);
}

.range-control output {
  color: var(--brand-strong);
  font-weight: 800;
  text-align: right;
}

.tool-controls label small {
  color: #829295;
  font-size: 11px;
}

.convert-file-card {
  position: relative;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 30px;
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.convert-file-card img {
  width: 76px;
  height: 64px;
  border-radius: 9px;
  object-fit: cover;
  background: #f1f5f4;
}

.convert-file-card div {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.convert-file-card strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.convert-file-card small {
  color: var(--subtext);
  font-size: 11px;
}

.remove-file-btn {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 9px;
  color: #8b4b4b;
  background: #fff0f0;
  cursor: pointer;
  font-size: 18px;
}

.feature-note {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid #b9ddcf;
  border-radius: 14px;
  background: #effaf5;
  color: #245b49;
}

.feature-note span {
  color: #56786e;
  font-size: 13px;
  line-height: 1.5;
}

.feature-note.warning {
  border-color: #ead8a7;
  background: #fff9e9;
  color: #6d5314;
}

.dual-upload-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.card-upload {
  position: relative;
  min-height: 210px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 7px;
  border: 1px dashed #8dc9be;
  border-radius: 16px;
  background: #f6fbfa;
  cursor: pointer;
}

.card-upload img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #eef3f2;
}

.card-side {
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--brand-strong);
  background: var(--brand-soft);
  font-size: 12px;
  font-weight: 800;
}

.card-upload small {
  color: var(--subtext);
}

.a4-preview {
  min-height: 360px;
  padding: 34px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f1f3f4;
}

.a4-preview.vertical {
  flex-direction: column;
}

.id-card-placeholder {
  position: relative;
  aspect-ratio: 85.6 / 54;
  width: min(42%, 300px);
  display: grid;
  place-items: center;
  border: 1px dashed #9fb2b5;
  border-radius: 12px;
  color: var(--subtext);
  background: #fff;
  font-size: 12px;
}

.id-card-placeholder img {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 11px;
  object-fit: cover;
}

.id-card-preview-button {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  display: block;
  padding: 0;
  border: 0;
  border-radius: 11px;
  background: #fff;
  cursor: zoom-in;
}

.id-card-preview-button span {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 5px 9px;
  border-radius: 999px;
  color: #fff;
  background: rgba(19, 39, 43, .76);
  font-size: 11px;
  font-weight: 700;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .18s ease, transform .18s ease;
}

.id-card-preview-button:hover span,
.id-card-preview-button:focus-visible span {
  opacity: 1;
  transform: translateY(0);
}

.id-card-preview-button:focus-visible {
  outline: 3px solid rgba(25, 215, 181, .42);
  outline-offset: 3px;
}

.crop-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.crop-dialog[hidden] {
  display: none;
}

.crop-dialog {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  padding: 18px;
  background: rgba(10, 30, 32, 0.72);
  backdrop-filter: blur(8px);
}

.crop-dialog-card {
  width: min(94vw, 920px);
  min-width: 0;
  margin: auto 0;
  overflow: visible;
  padding: 20px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.28);
}

.crop-dialog-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.crop-dialog-head div {
  display: grid;
  gap: 5px;
}

.crop-dialog-head strong {
  font-size: 22px;
}

.crop-dialog-head span {
  color: var(--subtext);
  font-size: 13px;
}

.crop-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 11px;
  color: #53666a;
  background: #edf2f1;
  cursor: pointer;
  font-size: 24px;
}

.crop-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 85.6 / 54;
  overflow: hidden;
  border-radius: 16px;
  background: #1d292b;
  touch-action: none;
}

.crop-stage canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
}

.crop-stage canvas:active {
  cursor: grabbing;
}

.crop-frame {
  position: absolute;
  pointer-events: none;
  inset: 7px;
  border: 2px dashed rgba(255, 255, 255, 0.92);
  border-radius: 13px;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.12);
}

.crop-guide {
  position: absolute;
  pointer-events: none;
  left: 50%;
  bottom: 14px;
  translate: -50% 0;
  padding: 7px 11px;
  border-radius: 999px;
  color: #fff;
  background: rgba(0, 0, 0, 0.52);
  font-size: 12px;
}

.crop-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 14px;
}

.crop-zoom {
  min-width: 220px;
  flex: 1;
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--subtext);
  font-size: 13px;
}

.crop-zoom input {
  flex: 1;
  accent-color: var(--brand);
}

.crop-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.corner-dialog-card .crop-dialog-actions .action-btn {
  width: auto;
  min-width: 142px;
  min-height: 42px;
  flex: 0 1 168px;
  padding: 10px 14px;
}

.crop-dialog-open {
  overflow: hidden;
}

.corner-dialog-card {
  width: min(96vw, 1040px);
}

.corner-editor {
  overflow: hidden;
  border-radius: 16px;
  background: #1b2527;
  touch-action: none;
}

.corner-editor canvas {
  width: 100%;
  height: auto;
  display: block;
  cursor: crosshair;
  touch-action: none;
}

.corner-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.corner-legend span {
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--brand-strong);
  background: var(--brand-soft);
  font-size: 12px;
  font-weight: 700;
}

.corner-tip {
  color: var(--subtext);
  font-size: 13px;
}

.id-preview-dialog-card {
  width: min(94vw, 980px);
}

.id-preview-stage {
  min-height: min(66vh, 660px);
  padding: 22px;
  display: grid;
  place-items: center;
  overflow: auto;
  border-radius: 16px;
  background:
    linear-gradient(45deg, #1b2527 25%, transparent 25%) 0 0 / 24px 24px,
    linear-gradient(-45deg, #1b2527 25%, transparent 25%) 0 0 / 24px 24px,
    linear-gradient(45deg, transparent 75%, #1b2527 75%) 0 0 / 24px 24px,
    linear-gradient(-45deg, transparent 75%, #1b2527 75%) 0 0 / 24px 24px,
    #253234;
}

.id-preview-stage img {
  width: auto;
  max-width: 100%;
  max-height: min(62vh, 620px);
  display: block;
  border-radius: 18px;
  box-shadow: 0 18px 55px rgba(0, 0, 0, .32);
}

.id-preview-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

@media (max-width: 760px), (max-height: 720px) {
  .crop-dialog {
    padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom));
  }

  .crop-dialog-card {
    width: 100%;
    margin: 0;
    padding: 14px;
    border-radius: 16px;
  }

  .crop-dialog-head {
    margin-bottom: 10px;
  }

  .crop-dialog-head strong {
    font-size: 18px;
  }

  .corner-editor canvas {
    max-height: 62dvh;
    object-fit: contain;
  }

  .corner-dialog-card .crop-dialog-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .corner-dialog-card .crop-dialog-actions .action-btn {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 10px 8px;
  }

  .id-card-preview-button span {
    opacity: 1;
    transform: none;
  }

  .id-preview-stage {
    min-height: 48dvh;
    padding: 10px;
  }

  .id-preview-stage img {
    max-height: 56dvh;
  }

  .id-preview-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

.portrait-workspace {
  display: grid;
  grid-template-columns: minmax(280px, 520px) minmax(240px, 1fr);
  gap: 20px;
  align-items: start;
}

.portrait-preview-wrap {
  position: relative;
  width: min(100%, 520px);
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #eef2f2;
}

.portrait-preview-wrap canvas {
  width: 100%;
  height: auto;
  display: block;
  cursor: grab;
  touch-action: none;
}

.portrait-preview-wrap canvas:active {
  cursor: grabbing;
}

.portrait-preview-wrap > p {
  position: absolute;
  margin: 0;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--subtext);
  background: rgba(255,255,255,.88);
  font-size: 13px;
}

.portrait-face-guide {
  position: absolute;
  pointer-events: none;
  top: 20%;
  left: 21%;
  right: 21%;
  height: 30%;
  border: 1px dashed rgba(255,255,255,.8);
  border-radius: 50%;
}

.portrait-face-guide span {
  position: absolute;
  left: 50%;
  bottom: -26px;
  translate: -50% 0;
  white-space: nowrap;
  padding: 4px 7px;
  border-radius: 999px;
  color: #fff;
  background: rgba(0,0,0,.38);
  font-size: 10px;
}

.portrait-settings {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fafcfc;
}

.portrait-settings > label {
  display: grid;
  gap: 8px;
  color: var(--subtext);
  font-size: 13px;
}

.portrait-settings select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.background-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.background-swatch {
  width: 42px;
  height: 42px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: 0 0 0 1px var(--line);
  cursor: pointer;
}

.background-swatch.active {
  box-shadow: 0 0 0 3px var(--brand);
}

.custom-swatch {
  display: flex !important;
  grid-auto-flow: column;
  align-items: center;
  gap: 6px !important;
}

.custom-swatch input {
  width: 42px;
  height: 42px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 50%;
}

@media (max-width: 760px) {
  .portrait-workspace {
    grid-template-columns: 1fr;
  }
}

.edit-canvas-wrap {
  min-height: 300px;
  display: grid;
  place-items: center;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background:
    linear-gradient(45deg, #eef1f1 25%, transparent 25%),
    linear-gradient(-45deg, #eef1f1 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #eef1f1 75%),
    linear-gradient(-45deg, transparent 75%, #eef1f1 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}

.edit-canvas-wrap canvas {
  max-width: 100%;
  max-height: 70vh;
}

.check-label {
  display: flex !important;
  grid-auto-flow: column;
  justify-content: flex-start;
  align-items: center;
}

.check-label input {
  width: auto;
}

@media (max-width: 900px) {
  .page {
    width: 100%;
    padding: 14px 10px;
  }

  .topbar {
    padding: 4px 4px 10px;
    flex-direction: column;
    align-items: stretch;
  }

  .language-switcher {
    width: fit-content;
  }

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

  .sidebar {
    overflow: hidden;
  }

  .tool-list {
    flex-direction: row;
    overflow-x: auto;
    padding: 2px 2px 10px;
    scroll-snap-type: x proximity;
  }

  .tool-card {
    flex: 0 0 235px;
    scroll-snap-align: start;
  }

  .tool-host {
    min-height: 520px;
  }

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

  .dual-upload-grid {
    grid-template-columns: 1fr;
  }

  .feature-note {
    align-items: flex-start;
    flex-direction: column;
  }

  .welcome {
    padding: 28px 22px;
  }

  .panel-head h3 {
    font-size: 24px;
  }

  .tool-icon {
    min-width: 54px;
    font-size: 14px;
  }
}

.tool-kind {
  display: inline-flex;
  align-items: center;
  margin-left: 7px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 10px;
  line-height: 1.4;
  vertical-align: 2px;
}

.tool-kind.online {
  color: #9a5a00;
  background: #fff1ce;
  border: 1px solid #f3d18b;
}

.tool-kind.private {
  color: #31567f;
  background: #e7effb;
}

.office-convert-tool {
  max-width: 920px;
  margin: 0 auto;
}

.office-mode-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.office-mode {
  display: grid;
  grid-template-columns: 44px 1fr;
  column-gap: 12px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--text);
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.office-mode > span {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  color: var(--brand);
  background: var(--soft);
  font-weight: 900;
}

.office-mode strong,
.office-mode small {
  display: block;
}

.office-mode small {
  margin-top: 4px;
  color: var(--subtext);
  line-height: 1.45;
}

.office-mode.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 13%, transparent);
}

.office-mode.active > span {
  color: #fff;
  background: var(--brand);
}

.office-upload {
  min-height: 180px;
  display: grid;
  place-content: center;
  gap: 8px;
  cursor: pointer;
}

.office-upload.dragging {
  border-color: var(--brand-strong);
  background: var(--soft);
}

.office-upload .upload-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin: 0 auto 3px;
  border-radius: 50%;
  color: #fff;
  background: var(--brand);
  font-size: 28px;
}

.office-upload small { color: var(--subtext); }

.office-file-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 36px;
  gap: 13px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
}

.office-file-card[hidden] { display: none; }

.office-file-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  color: var(--brand);
  background: var(--soft);
  font-size: 12px;
  font-weight: 900;
}

.office-file-card strong,
.office-file-card small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.office-file-card small { margin-top: 4px; color: var(--subtext); }
.office-file-card button { border: 0; color: var(--subtext); background: transparent; font-size: 25px; cursor: pointer; }

.office-quality {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
}

.office-quality[hidden] { display: none; }
.office-quality legend { padding: 0 7px; font-weight: 800; }
.office-quality label { display: flex; gap: 8px; align-items: flex-start; padding: 10px; border-radius: 11px; cursor: pointer; }
.office-quality label:has(input:checked) { background: var(--soft); }
.office-quality b, .office-quality small { display: block; }
.office-quality small { margin-top: 3px; color: var(--subtext); line-height: 1.45; }
.office-quality input { margin-top: 3px; accent-color: var(--brand); }
.office-quality label[hidden] { display: none; }
.office-quality em {
  display: inline-flex;
  margin-left: 5px;
  padding: 2px 7px;
  border-radius: 999px;
  color: #9a5b00;
  background: #fff0cc;
  font-size: 11px;
  font-style: normal;
  vertical-align: 2px;
}

.office-server-note {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 13px 15px;
  border-radius: 13px;
  color: #526780;
  background: #f2f7ff;
  font-size: 13px;
  line-height: 1.55;
}

.office-server-note b { flex: none; color: #31567f; }
.office-convert-button { width: 100%; }
.office-progress .progress-bar > span { transition: width 180ms ease; }

.office-result-link {
  display: inline-flex;
  margin-left: 10px;
  padding: 5px 11px;
  border-radius: 999px;
  color: #fff;
  background: var(--brand);
  font-weight: 800;
  text-decoration: none;
}

.office-report {
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--brand) 32%, var(--line));
  border-radius: 18px;
  background: #fff;
}

.office-report[hidden] { display: none; }
.office-report-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 18px 20px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand-strong), var(--brand));
}
.office-report-head span,
.office-report-head strong { display: block; }
.office-report-head span { margin-bottom: 4px; font-size: 12px; opacity: .82; }
.office-report-head strong { font-size: 18px; }
.office-report-head small { opacity: .8; }
.office-report-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
}
.office-report-metrics div {
  display: grid;
  gap: 3px;
  justify-items: center;
  padding: 17px 8px;
  background: #fff;
}
.office-report-metrics strong { color: var(--brand-strong); font-size: 25px; }
.office-report-metrics span { color: var(--subtext); font-size: 12px; }
.office-report-metrics .needs-review strong { color: #d97706; }
.office-report-actions { display: flex; gap: 10px; padding: 16px 18px 6px; }
.office-report-actions a {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--brand);
  border-radius: 11px;
  color: #fff;
  background: var(--brand);
  font-weight: 800;
  text-align: center;
  text-decoration: none;
}
.office-report-actions a.secondary { color: var(--brand); background: #fff; }
.office-review { margin: 10px 18px; border-top: 1px solid var(--line); }
.office-review summary { padding: 14px 0; color: var(--brand-strong); font-weight: 800; cursor: pointer; }
.office-review ol { display: grid; gap: 8px; margin: 0 0 14px; padding-left: 24px; }
.office-review li { padding-left: 4px; }
.office-review li b,
.office-review li span,
.office-review li small { display: block; }
.office-review li span { margin: 3px 0; }
.office-review li small { color: var(--subtext); }
.office-report > p { margin: 0; padding: 12px 18px 17px; color: var(--subtext); font-size: 12px; }

@media (max-width: 720px) {
  .office-mode-grid,
  .office-quality {
    grid-template-columns: 1fr;
  }

  .office-mode {
    padding: 13px;
  }

  .office-upload {
    min-height: 145px;
  }

  .office-server-note {
    align-items: flex-start;
    flex-direction: column;
  }

  .office-report-metrics { grid-template-columns: repeat(2, 1fr); }
  .office-report-actions { flex-direction: column; }
}

.media-tool {
  max-width: 920px;
  margin: 0 auto;
}

.online-tool-notice {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 18px;
  border: 1px solid #c9daf7;
  border-radius: 16px;
  background: #f3f7ff;
}

.online-tool-notice > span {
  flex: none;
  padding: 7px 10px;
  border-radius: 999px;
  color: #245790;
  background: #dceaff;
  font-size: 12px;
  font-weight: 800;
}

.online-tool-notice strong,
.online-tool-notice p {
  display: block;
  margin: 0;
}

.online-tool-notice p {
  margin-top: 5px;
  color: #58708e;
  font-size: 13px;
  line-height: 1.6;
}

.media-input-panel {
  display: grid;
  gap: 10px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-card);
}

.media-input-panel label {
  font-weight: 800;
}

.media-input-panel textarea {
  width: 100%;
  min-height: 116px;
  resize: vertical;
  padding: 14px;
  border: 1px solid #cfdade;
  border-radius: 13px;
  color: var(--text);
  background: #fbfcfd;
  font: inherit;
  line-height: 1.65;
}

.media-input-panel textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(23, 140, 124, 0.12);
}

.detected-platform {
  min-height: 22px;
  color: var(--subtext);
  font-size: 13px;
}

.detected-platform.ready {
  color: #087a5b;
  font-weight: 700;
}

.media-provider-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 2px 0;
  padding: 0;
  border: 0;
}

.media-provider-picker legend {
  grid-column: 1 / -1;
  margin-bottom: 8px;
  color: var(--subtext);
  font-size: 13px;
  font-weight: 700;
}

.media-provider-picker label {
  cursor: pointer;
}

.media-provider-picker input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.media-provider-picker span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 10px 13px;
  border: 1px solid #d8e1e4;
  border-radius: 13px;
  background: #fbfcfd;
  transition: 0.18s ease;
}

.media-provider-picker small {
  color: var(--subtext);
  font-size: 12px;
  font-weight: 600;
}

.media-provider-picker input:checked + span {
  border-color: var(--brand);
  color: var(--brand);
  background: rgba(23, 140, 124, 0.08);
  box-shadow: 0 0 0 2px rgba(23, 140, 124, 0.08);
}

.media-resolve-btn {
  width: 100%;
  min-height: 48px;
}

.media-resolve-btn:disabled {
  opacity: 0.62;
  cursor: wait;
}

.platform-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.platform-cloud span {
  padding: 7px 11px;
  border: 1px solid #d8e1e4;
  border-radius: 999px;
  color: #52676b;
  background: #fff;
  font-size: 12px;
  font-weight: 700;
}

.media-rights-note {
  margin: 0;
  padding: 14px 16px;
  border-radius: 14px;
  color: #735f3b;
  background: #fff9e8;
  font-size: 13px;
  line-height: 1.7;
}

.media-result-card {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.media-result-card img,
.media-result-placeholder {
  width: 140px;
  height: 96px;
  border-radius: 12px;
  object-fit: cover;
  background: #e8eef0;
}

.media-result-placeholder {
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #213a5d, #31567f);
  font-size: 30px;
}

.media-result-card span {
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
}

.media-result-card h3 {
  margin: 5px 0;
  font-size: 18px;
  line-height: 1.45;
}

.media-result-card p {
  margin: 0;
  color: var(--subtext);
}

.media-result-group {
  margin-top: 16px;
}

.media-result-group h4 {
  margin: 0 0 9px;
}

.media-result-group h4 small {
  margin-left: 6px;
  color: var(--subtext);
  font-weight: 500;
}

.media-link-list {
  display: grid;
  gap: 8px;
}

.media-download-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--text);
  background: #fff;
  text-decoration: none;
  transition: border-color 150ms ease, transform 150ms ease;
}

.media-download-link:hover {
  border-color: var(--brand);
  transform: translateY(-1px);
}

.media-download-link span,
.media-download-link small {
  display: block;
}

.media-download-link small {
  margin-top: 3px;
  color: var(--subtext);
}

.media-download-link strong {
  color: var(--brand);
  white-space: nowrap;
}

.local-media-tool {
  max-width: 960px;
  margin: 0 auto;
}

.local-media-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid #b9ddcf;
  border-radius: 15px;
  color: #245b49;
  background: #effaf5;
}

.local-media-banner b {
  flex: none;
  padding: 6px 10px;
  border-radius: 999px;
  background: #d8f3e8;
  font-size: 12px;
}

.local-media-banner span {
  font-size: 13px;
  line-height: 1.55;
}

.media-file-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.media-file-summary strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-file-summary span {
  flex: none;
  color: var(--subtext);
  font-size: 13px;
}

.media-limit-note {
  margin: 0;
  padding: 13px 15px;
  border-radius: 13px;
  color: #6f6656;
  background: #f7f5f1;
  font-size: 12px;
  line-height: 1.65;
}

@media (max-width: 640px) {
  .online-tool-notice {
    display: grid;
  }

  .media-input-panel {
    padding: 16px;
  }

  .media-result-card {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 12px;
  }

  .media-result-card img,
  .media-result-placeholder {
    width: 96px;
    height: 76px;
  }

  .media-download-link {
    align-items: flex-start;
  }

  .local-media-banner,
  .media-file-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .media-file-summary span {
    flex: auto;
  }
}

/* AI document assistant */
.ai-doc-tool { display: grid; gap: 18px; }
.ai-doc-intro { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 24px 28px; border-radius: 20px; color: #fff; background: linear-gradient(135deg, #0f766e, #164e63 72%, #1e3a5f); box-shadow: var(--shadow-card); }
.ai-doc-intro span { font-size: 11px; letter-spacing: .14em; opacity: .72; }
.ai-doc-intro h2 { margin: 5px 0; font-size: clamp(24px, 3vw, 36px); }
.ai-doc-intro p { margin: 0; opacity: .84; }
.ai-doc-intro a { flex: none; padding: 11px 15px; border: 1px solid rgba(255,255,255,.34); border-radius: 12px; color: #fff; text-decoration: none; background: rgba(255,255,255,.1); }
.ai-doc-workspace { display: grid; grid-template-columns: minmax(290px, 390px) minmax(0, 1fr); gap: 18px; align-items: start; }
.ai-doc-controls, .ai-doc-preview-panel { border: 1px solid var(--line); border-radius: 20px; background: var(--panel); box-shadow: var(--shadow-soft); }
.ai-doc-controls { position: sticky; top: 16px; display: grid; gap: 15px; padding: 18px; }
.ai-doc-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; padding: 4px; border-radius: 12px; background: var(--bg); }
.ai-doc-tabs button { padding: 10px 8px; border: 0; border-radius: 9px; color: var(--subtext); background: transparent; cursor: pointer; font-weight: 800; }
.ai-doc-tabs button.active { color: var(--brand-strong); background: #fff; box-shadow: 0 3px 12px rgba(24,54,60,.08); }
.ai-doc-controls label { display: grid; gap: 6px; color: var(--text); font-size: 13px; font-weight: 750; }
.ai-doc-controls select, .ai-doc-preview-head select { width: 100%; min-height: 42px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); background: #fff; }
.ai-doc-two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.ai-doc-prompt-label textarea { min-height: 230px; resize: vertical; padding: 14px; border: 1px solid var(--line); border-radius: 13px; color: var(--text); background: #fbfcfc; font: inherit; line-height: 1.65; }
.ai-doc-prompt-label textarea:focus { border-color: var(--brand); outline: 3px solid rgba(23,140,124,.14); }
.ai-doc-local-fields { display: grid; gap: 8px; }
.ai-doc-local-fields small { color: var(--subtext); line-height: 1.5; }
.ai-doc-file-button { display: block !important; padding: 12px; border: 1px dashed var(--brand); border-radius: 11px; color: var(--brand-strong) !important; text-align: center; cursor: pointer; background: var(--brand-soft); }
.ai-doc-generate { width: 100%; min-height: 46px; }
.ai-doc-usage { padding: 9px 11px; border-radius: 9px; color: #31567f; background: #eef5ff; font-size: 12px; }
.ai-doc-preview-panel { overflow: hidden; }
.ai-doc-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.ai-doc-preview-head span, .ai-doc-preview-head small { display: block; }
.ai-doc-preview-head span { font-weight: 850; }
.ai-doc-preview-head small { margin-top: 3px; color: var(--subtext); }
.ai-doc-preview-head label { display: flex; align-items: center; gap: 8px; color: var(--subtext); font-size: 12px; white-space: nowrap; }
.ai-doc-preview-head select { min-width: 120px; min-height: 36px; }
.ai-doc-paper { width: min(92%, 780px); min-height: 920px; margin: 24px auto; padding: 70px 72px; border: 1px solid #e4e7ea; color: #202326; background: #fff; box-shadow: 0 12px 35px rgba(26,47,55,.1); font-family: "SimSun", "宋体", serif; }
.ai-doc-paper h1 { margin: 0 0 10px; font-family: "SimHei", "黑体", sans-serif; font-size: 28px; line-height: 1.35; text-align: center; }
.ai-doc-paper .ai-doc-subtitle { min-height: 1em; margin: 0 0 30px; color: #6b7280; text-align: center; text-indent: 0; }
.ai-doc-paper h2 { margin: 25px 0 10px; color: #0f766e; font-family: "SimHei", "黑体", sans-serif; font-size: 19px; }
.ai-doc-paper p { margin: 0 0 10px; font-size: 16px; line-height: 1.9; text-align: justify; text-indent: 2em; }
.ai-doc-paper li { margin: 5px 0; font-size: 16px; line-height: 1.7; }
.ai-doc-paper [contenteditable="true"]:focus { border-radius: 4px; outline: 2px solid rgba(23,140,124,.28); background: #f7fffc; }
.ai-doc-table-wrap { max-width: 100%; margin: 16px 0; overflow-x: auto; }
.ai-doc-paper table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.ai-doc-paper th, .ai-doc-paper td { padding: 9px; border: 1px solid #b8c5c7; font-size: 14px; line-height: 1.5; vertical-align: middle; }
.ai-doc-paper th { background: #e7f6f2; }
.ai-doc-empty { display: grid; place-items: center; min-height: 650px; color: var(--subtext); text-align: center; }
.ai-doc-empty b { font-size: 42px; color: var(--brand); }
.ai-doc-empty strong { margin-top: -150px; font-size: 20px; color: var(--text); }
.ai-doc-empty span { max-width: 360px; margin-top: -230px; line-height: 1.7; }
.ai-doc-actions { display: flex; justify-content: flex-end; gap: 10px; padding: 0 20px 14px; }
.ai-doc-actions button { min-width: 140px; padding: 11px 16px; border: 0; border-radius: 11px; color: #fff; background: var(--brand); cursor: pointer; font-weight: 800; }
.ai-doc-actions button.secondary { color: var(--brand); border: 1px solid var(--brand); background: #fff; }
.ai-doc-actions button:disabled { cursor: not-allowed; opacity: .4; }
.ai-doc-privacy { margin: 0; padding: 13px 20px 18px; color: var(--subtext); font-size: 12px; text-align: right; }

@media (max-width: 1199px) {
  .ai-doc-intro { align-items: flex-start; flex-direction: column; padding: 20px; }
  .ai-doc-workspace { grid-template-columns: 1fr; }
  .ai-doc-controls { position: static; }
  .ai-doc-paper { width: calc(100% - 24px); min-height: 680px; margin: 12px; padding: 38px 24px; }
  .ai-doc-preview-head { align-items: flex-start; flex-direction: column; }
  .ai-doc-preview-head label { width: 100%; justify-content: space-between; }
  .ai-doc-preview-head select { width: auto; flex: 1; }
}

@media (max-width: 520px) {
  .ai-doc-two-cols { grid-template-columns: 1fr; }
  .ai-doc-prompt-label textarea { min-height: 190px; }
  .ai-doc-paper { padding: 30px 18px; }
  .ai-doc-paper h1 { font-size: 24px; }
  .ai-doc-paper p, .ai-doc-paper li { font-size: 15px; }
  .ai-doc-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .ai-doc-actions button { min-width: 0; }
}
