:root {
  --bg: #f4efe6;
  --paper: #fffdf8;
  --paper-strong: #ffffff;
  --ink: #1f2a24;
  --muted: #68756e;
  --line: #d7cdbd;
  --accent: #0b7a5b;
  --accent-deep: #0f5c47;
  --accent-soft: #dff3eb;
  --sun: #c98a3d;
  --sun-soft: #fff1d9;
  --shadow: 0 20px 50px rgba(36, 41, 31, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(201, 138, 61, 0.16), transparent 30%),
    radial-gradient(circle at top right, rgba(11, 122, 91, 0.10), transparent 25%),
    linear-gradient(180deg, #f7f2e9 0%, #eee7dc 100%);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", Arial, sans-serif;
}

.page-shell {
  width: min(1320px, calc(100% - 56px));
  margin: 0 auto;
  padding: 32px 0 44px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.9fr);
  gap: 22px;
  align-items: stretch;
}

.hero-copy,
.glass-panel,
.upload-panel,
.result-panel {
  border: 1px solid rgba(215, 205, 189, 0.75);
  background: rgba(255, 253, 248, 0.90);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.hero-copy {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  padding: 32px 34px 28px;
}

.hero-copy::after {
  content: "";
  position: absolute;
  right: -72px;
  top: -72px;
  width: 230px;
  height: 230px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(11, 122, 91, 0.14), rgba(11, 122, 91, 0));
}

.hero-tag,
.section-kicker {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  color: var(--accent-deep);
  background: var(--accent-soft);
  font-size: 13px;
  font-weight: 800;
}

.hero-tag {
  padding: 8px 14px;
}

.hero h1 {
  position: relative;
  margin: 18px 0 12px;
  font-size: 38px;
  line-height: 1.18;
  font-weight: 850;
}

.hero p {
  position: relative;
  max-width: 790px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.75;
}

.hero-metrics {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 26px;
}

.metric-card {
  min-height: 92px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 241, 232, 0.90));
}

.metric-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.metric-card strong {
  font-size: 17px;
  line-height: 1.45;
}

.glass-panel {
  height: 100%;
  border-radius: 24px;
  padding: 24px;
}

.panel-title {
  margin-bottom: 16px;
  font-size: 19px;
  font-weight: 800;
}

.scheme-list {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.scheme-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper-strong);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.scheme-item:hover,
.scheme-item:has(input:checked) {
  transform: translateY(-1px);
  border-color: rgba(11, 122, 91, 0.45);
  box-shadow: 0 10px 22px rgba(11, 122, 91, 0.08);
}

.scheme-item input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.scheme-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.scheme-text strong {
  font-size: 15px;
  line-height: 1.4;
}

.scheme-text small,
.scheme-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.scheme-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.scheme-note {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(340px, 420px) minmax(0, 1fr);
  gap: 22px;
  margin-top: 22px;
}

.upload-panel,
.result-panel {
  border-radius: 24px;
  padding: 26px;
}

.section-head {
  margin-bottom: 20px;
}

.section-kicker {
  margin-bottom: 10px;
  padding: 6px 11px;
}

.section-head h2 {
  margin: 0;
  font-size: 25px;
  line-height: 1.32;
}

.section-head p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.upload-form {
  margin-top: 0;
}

.dropzone {
  position: relative;
  display: block;
  padding: 22px;
  border: 2px dashed rgba(11, 122, 91, 0.25);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(223, 243, 235, 0.65), rgba(255, 253, 248, 0.95));
  cursor: pointer;
}

.image-dropzone {
  margin-top: 14px;
  border-color: rgba(201, 138, 61, 0.35);
  background: linear-gradient(180deg, rgba(255, 243, 223, 0.74), rgba(255, 253, 248, 0.95));
}

.dropzone input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone-inner {
  display: flex;
  align-items: center;
  gap: 16px;
}

.drop-icon {
  flex: 0 0 auto;
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  font-size: 15px;
  font-weight: 850;
}

.image-icon {
  background: linear-gradient(135deg, var(--sun), #9a5b12);
}

.dropzone strong {
  display: block;
  font-size: 16px;
  line-height: 1.45;
}

#file-name,
#image-file-name {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.primary-btn,
.download-btn {
  min-height: 48px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 22px;
  font-size: 16px;
  font-weight: 800;
  text-decoration: none;
}

.primary-btn {
  width: 100%;
  margin-top: 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  box-shadow: 0 16px 32px rgba(11, 122, 91, 0.22);
}

.primary-btn:hover,
.download-btn:hover {
  filter: brightness(1.03);
}

.tips-card {
  margin-top: 18px;
  padding: 16px 17px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper-strong);
}

.tips-title {
  margin-bottom: 8px;
  font-weight: 800;
}

.tips-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.empty-state {
  min-height: 410px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.96), rgba(246, 241, 232, 0.84));
  text-align: center;
}

.empty-graphic {
  position: relative;
  width: 108px;
  height: 108px;
  margin-bottom: 16px;
  border-radius: 30px;
  background: linear-gradient(135deg, rgba(11, 122, 91, 0.14), rgba(201, 138, 61, 0.22));
}

.empty-graphic::before,
.empty-graphic::after {
  content: "";
  position: absolute;
  left: 30px;
  height: 8px;
  border-radius: 999px;
  background: rgba(15, 92, 71, 0.78);
}

.empty-graphic::before {
  top: 32px;
  width: 50px;
}

.empty-graphic::after {
  top: 54px;
  width: 42px;
}

.empty-state strong {
  font-size: 18px;
}

.empty-state p {
  max-width: 480px;
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.result-state {
  margin-top: 0;
}

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

.summary-box {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper-strong);
}

.summary-box span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.summary-box strong {
  font-size: 30px;
  line-height: 1;
}

.result-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.download-btn {
  color: var(--accent-deep);
  background: var(--accent-soft);
}

.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 24px 0 14px;
}

.preview-head h3 {
  margin: 0;
  font-size: 21px;
}

.badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 8px 13px;
  color: #8a5620;
  background: rgba(201, 138, 61, 0.18);
  font-size: 13px;
  font-weight: 800;
}

.preview-list {
  display: grid;
  gap: 13px;
}

.preview-card {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(245, 241, 232, 0.92));
}

.preview-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.preview-title {
  font-size: 17px;
  line-height: 1.45;
  font-weight: 800;
}

.match-chip {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 800;
}

.match-rule {
  color: var(--accent-deep);
  background: rgba(11, 122, 91, 0.13);
}

.match-llm {
  color: #8a5620;
  background: rgba(201, 138, 61, 0.18);
}

.preview-path {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.preview-samples {
  margin: 12px 0 0;
  padding-left: 18px;
  line-height: 1.75;
}

.loading-mask {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 1000;
  background: rgba(27, 35, 30, 0.35);
}

.loading-card {
  width: min(440px, calc(100vw - 32px));
  padding: 30px 28px;
  border-radius: 24px;
  background: rgba(255, 253, 248, 0.96);
  box-shadow: var(--shadow);
  text-align: center;
}

.spinner {
  width: 62px;
  height: 62px;
  margin: 0 auto 18px;
  border-radius: 50%;
  border: 6px solid rgba(11, 122, 91, 0.12);
  border-top-color: var(--accent);
  animation: spin 1s linear infinite;
}

.loading-card h3 {
  margin: 0 0 10px;
  font-size: 24px;
}

.loading-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.hidden {
  display: none !important;
}

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

@media (max-width: 1020px) {
  .page-shell {
    width: min(760px, calc(100% - 28px));
    padding: 20px 0 32px;
  }

  .hero,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 32px;
  }

  .hero-metrics,
  .summary-strip {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 560px) {
  .page-shell {
    width: calc(100% - 20px);
    padding-top: 10px;
  }

  .hero-copy,
  .glass-panel,
  .upload-panel,
  .result-panel {
    border-radius: 18px;
    padding: 20px;
  }

  .hero h1 {
    font-size: 28px;
  }

  .dropzone-inner {
    align-items: flex-start;
  }

  .drop-icon {
    width: 52px;
    height: 52px;
    border-radius: 15px;
  }
}
