:root {
  color-scheme: light;
  --bg: #f6f1e7;
  --bg-secondary: #fbf8f2;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-strong: rgba(255, 255, 255, 0.9);
  --surface-soft: rgba(255, 250, 244, 0.64);
  --border: rgba(31, 41, 55, 0.1);
  --text: #172033;
  --muted: #627086;
  --accent: #0f766e;
  --accent-strong: #0d9488;
  --accent-soft: rgba(13, 148, 136, 0.12);
  --gold: #c18c3f;
  --shadow: 0 28px 90px rgba(23, 32, 51, 0.12);
  --shadow-soft: 0 14px 34px rgba(23, 32, 51, 0.08);
  --preview-bg: #fffdfa;
  --preview-text: #172033;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #071118;
  --bg-secondary: #0b1620;
  --surface: rgba(12, 22, 32, 0.72);
  --surface-strong: rgba(15, 28, 40, 0.86);
  --surface-soft: rgba(15, 28, 40, 0.68);
  --border: rgba(148, 163, 184, 0.18);
  --text: #ecf3ff;
  --muted: #9fb2c7;
  --accent: #5eead4;
  --accent-strong: #99f6e4;
  --accent-soft: rgba(94, 234, 212, 0.14);
  --gold: #f4bf72;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.32);
  --shadow-soft: 0 18px 36px rgba(0, 0, 0, 0.24);
  --preview-bg: #09131c;
  --preview-text: #ecf3ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(193, 140, 63, 0.18), transparent 24%),
    radial-gradient(circle at top right, rgba(15, 118, 110, 0.16), transparent 28%),
    linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg) 100%);
  font-family: "Avenir Next", "PingFang SC", "Segoe UI", sans-serif;
  transition: background 220ms ease, color 220ms ease;
}

a {
  color: inherit;
  text-decoration: none;
}

code {
  padding: 0.15rem 0.35rem;
  border-radius: 999px;
  background: var(--accent-soft);
  font-size: 0.95em;
}

.page-shell {
  min-height: 100vh;
  padding: 28px 24px 42px;
}

.site-header {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  max-width: 1200px;
  margin: 0 auto 26px;
}

.brand {
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: white;
  background: linear-gradient(135deg, var(--accent-strong), var(--gold));
  box-shadow: var(--shadow-soft);
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong {
  font-size: 1.02rem;
  letter-spacing: 0.01em;
}

.brand-copy small {
  color: var(--muted);
  font-size: 0.88rem;
}

.hero-shell,
.feature-strip,
.contact-section,
.faq-section,
.page-footer,
.content-card {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.hero-panel,
.feature-card,
.content-card {
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-panel {
  border-radius: 36px;
  padding: 24px;
}

.utility-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.segmented-group {
  display: grid;
  gap: 10px;
}

.segment-label {
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.segmented-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.segment-button {
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.segment-button:hover {
  color: var(--text);
}

.segment-button.is-active {
  color: var(--text);
  background: var(--surface-strong);
  box-shadow: var(--shadow-soft);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(340px, 430px);
  gap: 26px;
  align-items: stretch;
}

.hero-copy,
.content-card {
  padding: 22px;
}

.upload-card {
  position: relative;
  overflow: hidden;
  padding: 28px;
  border-radius: 30px;
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent),
    var(--surface-strong);
  box-shadow: var(--shadow);
}

.upload-orb {
  position: absolute;
  top: -52px;
  right: -42px;
  width: 150px;
  height: 150px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.92), transparent 28%),
    linear-gradient(135deg, rgba(193, 140, 63, 0.26), rgba(15, 118, 110, 0.34));
  filter: blur(2px);
  opacity: 0.95;
  pointer-events: none;
}

.upload-head {
  position: relative;
  z-index: 1;
}

.upload-head p {
  margin: 12px 0 20px;
  color: var(--muted);
  line-height: 1.8;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--gold);
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

h1,
h2 {
  margin: 0;
  line-height: 1.12;
  font-family: "Iowan Old Style", "Songti SC", Georgia, serif;
}

h1 {
  max-width: 11ch;
  font-size: clamp(2.6rem, 4.5vw, 4.5rem);
}

h2 {
  font-size: clamp(1.35rem, 2.6vw, 2rem);
}

html[lang="zh-CN"] h1 {
  max-width: 13ch;
  line-height: 1.24;
  letter-spacing: 0.02em;
}

html[lang="en"] h1 {
  max-width: 10ch;
  line-height: 1.06;
}

.hero-text,
.content-card p {
  margin: 18px 0 0;
  max-width: 60ch;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.86;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
  color: var(--muted);
}

.hero-meta span {
  padding: 11px 15px;
  border-radius: 999px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
}

.hero-points {
  display: grid;
  gap: 14px;
  margin-top: 28px;
}

.point-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
}

.point-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent-soft), rgba(193, 140, 63, 0.15));
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 800;
}

.point-card h2,
.feature-card h2 {
  font-size: 1.16rem;
}

.feature-card h2 {
  margin-top: 14px;
}

.point-card p,
.feature-card p,
.result-note,
.page-footer p {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.75;
}

.contact-section {
  margin-top: 22px;
}

.faq-section {
  margin-top: 22px;
}

.contact-card {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(260px, 360px);
  gap: 20px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 30px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.contact-copy {
  padding: 6px 6px 6px 2px;
}

.contact-copy p,
.contact-note p {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.82;
}

.contact-points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.contact-item,
.contact-note {
  padding: 18px 20px;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
}

.contact-label {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.contact-item strong,
.contact-item a {
  display: inline-block;
  margin-top: 10px;
  color: var(--text);
  font-size: 1.06rem;
  font-weight: 700;
}

.contact-badge {
  display: inline-flex;
  min-height: 30px;
  padding: 0 12px;
  align-items: center;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.faq-card {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 30px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.faq-head p,
.faq-item p {
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.8;
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 22px;
}

.faq-item {
  padding: 20px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
}

.faq-item h3 {
  margin: 0;
  font-size: 1.12rem;
  line-height: 1.45;
}

.format-card {
  padding: 28px;
}

.format-meta {
  margin-top: 20px;
}

.format-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.dropzone {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 260px;
  border: 1.5px dashed rgba(15, 118, 110, 0.38);
  border-radius: 28px;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.46), transparent 36%),
    linear-gradient(160deg, rgba(15, 118, 110, 0.08), rgba(193, 140, 63, 0.08));
  color: var(--text);
  cursor: pointer;
  padding: 32px;
  display: grid;
  gap: 10px;
  text-align: center;
  place-items: center;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.dropzone strong {
  font-size: 1.42rem;
}

.dropzone span {
  color: var(--muted);
  max-width: 24ch;
  line-height: 1.7;
}

.dropzone:hover,
.dropzone.is-dragover {
  transform: translateY(-3px);
  border-color: rgba(15, 118, 110, 0.72);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.58), transparent 34%),
    linear-gradient(160deg, rgba(15, 118, 110, 0.12), rgba(193, 140, 63, 0.13));
}

.status-panel {
  margin-top: 18px;
  padding: 16px 18px 17px;
  border-radius: 20px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}

.status-label {
  display: inline-block;
  margin-bottom: 8px;
  font-weight: 700;
}

.status-panel p,
.upload-footnote {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.upload-footnote {
  margin-top: 14px;
  font-size: 0.95rem;
}

.feature-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 22px;
}

.format-link-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.feature-card {
  border-radius: 28px;
  padding: 24px;
  background: var(--surface);
}

.format-link-card {
  display: block;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.format-link-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.feature-kicker {
  display: inline-flex;
  min-height: 30px;
  padding: 0 12px;
  align-items: center;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.result-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
}

.processing-modal {
  position: fixed;
  inset: 0;
  z-index: 48;
  display: grid;
  place-items: center;
  padding: 24px;
}

.result-overlay {
  position: absolute;
  inset: 0;
  background: rgba(7, 17, 24, 0.46);
  backdrop-filter: blur(8px);
}

.processing-overlay {
  position: absolute;
  inset: 0;
  background: rgba(7, 17, 24, 0.34);
  backdrop-filter: blur(8px);
}

.processing-panel {
  position: relative;
  z-index: 1;
  width: min(520px, calc(100vw - 32px));
  padding: 32px 30px;
  border-radius: 30px;
  border: 1px solid var(--border);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  text-align: center;
}

.processing-panel h2 {
  font-size: clamp(1.5rem, 2.7vw, 2.2rem);
}

.processing-panel p {
  margin: 16px auto 0;
  max-width: 34ch;
  color: var(--muted);
  line-height: 1.82;
}

.processing-ring {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
}

.processing-ring span {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--gold));
  box-shadow: var(--shadow-soft);
  animation: processingPulse 1.2s ease-in-out infinite;
}

.processing-ring span:nth-child(2) {
  animation-delay: 0.16s;
}

.processing-ring span:nth-child(3) {
  animation-delay: 0.32s;
}

.processing-file {
  margin: 20px auto 0;
  max-width: min(100%, 380px);
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-section {
  position: relative;
  z-index: 1;
  width: min(1100px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow: hidden;
  padding: 26px;
  border-radius: 30px;
  border: 1px solid var(--border);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.result-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 6px;
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.result-actions {
  display: flex;
  gap: 12px;
}

.modal-close-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 160ms ease, background 160ms ease;
}

.modal-close-button:hover {
  transform: translateY(-1px);
  background: var(--surface-strong);
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, color 160ms ease;
}

.primary-button {
  background: linear-gradient(135deg, var(--accent), var(--gold));
  color: white;
  border: 0;
}

.primary-button:hover {
  transform: translateY(-1px);
}

.secondary-button {
  background: var(--surface-strong);
  color: var(--text);
}

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

.markdown-preview {
  margin: 0;
  padding: 22px;
  min-height: 420px;
  max-height: calc(100vh - 260px);
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  border-radius: 22px;
  border: 1px solid var(--border);
  background: var(--preview-bg);
  color: var(--preview-text);
  font-size: 0.95rem;
  line-height: 1.7;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.content-card {
  max-width: 900px;
  margin: 0 auto;
  border-radius: 28px;
}

.page-footer {
  margin-top: 18px;
  padding: 0 6px;
}

.page-footer p {
  text-align: center;
  font-size: 0.95rem;
}

.is-hidden {
  display: none;
}

body.modal-open {
  overflow: hidden;
}

@keyframes processingPulse {
  0%,
  80%,
  100% {
    transform: scale(0.72);
    opacity: 0.5;
  }

  40% {
    transform: scale(1);
    opacity: 1;
  }
}

@media (max-width: 960px) {
  .utility-bar,
  .hero-grid,
  .feature-strip,
  .contact-card,
  .faq-grid,
  .format-grid {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .site-header {
    margin-bottom: 18px;
  }

  .result-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .result-section {
    width: min(100%, calc(100vw - 24px));
    max-height: calc(100vh - 24px);
    padding: 20px;
  }

  .processing-panel {
    width: min(100%, calc(100vw - 24px));
    padding: 26px 22px;
  }

  .result-actions {
    width: 100%;
    flex-direction: column;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .page-shell {
    padding-left: 16px;
    padding-right: 16px;
  }

  .hero-panel,
  .result-section,
  .feature-card,
  .content-card {
    border-radius: 24px;
  }

  h1 {
    max-width: none;
    font-size: clamp(2.25rem, 10vw, 3.2rem);
  }

  .utility-bar {
    gap: 14px;
  }

  .segmented-control {
    flex-wrap: wrap;
    border-radius: 22px;
  }

  .segment-button {
    flex: 1 1 auto;
  }

  .contact-points {
    grid-template-columns: 1fr;
  }

  .result-modal {
    padding: 12px;
  }

  .markdown-preview {
    max-height: calc(100vh - 300px);
  }
}
