:root {
  --ink: #15221c;
  --muted: #647168;
  --paper: #f7f8f2;
  --surface: #ffffff;
  --line: #dce1d7;
  --green: #246b4b;
  --green-dark: #164a34;
  --mint: #dff1e5;
  --lime: #d9f06d;
  --yellow: #fff0a8;
  --orange: #df6c33;
  --shadow: 0 24px 70px rgba(28, 54, 39, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 4%, rgba(217, 240, 109, 0.28), transparent 30rem),
    linear-gradient(180deg, #fbfcf7 0%, var(--paper) 100%);
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  padding-bottom: env(safe-area-inset-bottom);
}

button, input, textarea { font: inherit; }
button { cursor: pointer; }

.page-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }

.topbar {
  min-height: 84px;
  padding-top: env(safe-area-inset-top);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.top-actions { display: flex; align-items: center; gap: 8px; }
.service-status { padding: 8px 11px; border-radius: 999px; color: #6d5600; background: var(--yellow); font-size: 12px; font-weight: 800; }
.service-status.live { color: var(--green-dark); background: var(--mint); }

.brand { display: flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; font-size: 20px; font-weight: 800; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; color: white; background: var(--green); transform: rotate(-4deg); }
.privacy-pill { padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--green-dark); background: rgba(255,255,255,.72); font-size: 13px; font-weight: 700; }

.hero { min-height: 650px; display: grid; grid-template-columns: .93fr 1.07fr; gap: 70px; align-items: center; padding: 46px 0 76px; }
.eyebrow { display: inline-flex; padding: 7px 12px; border-radius: 8px; color: var(--green-dark); background: var(--lime); font-size: 13px; font-weight: 800; letter-spacing: .08em; }
.hero h1 { margin: 22px 0; font-size: clamp(52px, 6.3vw, 86px); line-height: .98; letter-spacing: -.06em; }
.hero h1 span { color: var(--green); }
.hero-copy > p { max-width: 520px; margin: 0; color: var(--muted); font-size: 20px; line-height: 1.8; }
.trust-row { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 28px; color: var(--green-dark); font-size: 13px; font-weight: 700; }

.upload-card { padding: 30px; border: 1px solid rgba(36, 107, 75, .14); border-radius: 28px; background: rgba(255,255,255,.94); box-shadow: var(--shadow); }
.card-heading, .result-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.card-heading > div, .result-header > div { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px; }
.card-heading h2, .result-header h2 { margin: 0; font-size: 24px; }
.step { display: grid; place-items: center; width: 34px; height: 26px; border-radius: 8px; color: white; background: var(--green); font-size: 12px; font-weight: 900; }
.text-button { border: 0; color: var(--muted); background: transparent; }

.drop-zone { position: relative; min-height: 230px; margin: 24px 0 18px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; overflow: hidden; border: 1.5px dashed #aab6a9; border-radius: 20px; background: #fafbf7; transition: .2s ease; }
.drop-zone:hover, .drop-zone.dragging { border-color: var(--green); background: #f1f8f1; transform: translateY(-2px); }
.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-icon { display: grid; place-items: center; width: 54px; height: 54px; margin-bottom: 4px; border-radius: 18px; color: var(--green); background: var(--mint); font-size: 32px; font-weight: 300; }
.drop-zone strong { font-size: 18px; }
.drop-zone > span { color: var(--muted); font-size: 13px; }
.drop-zone img { width: 100%; height: 230px; object-fit: contain; background: #edf1ea; }

.context-field { display: grid; gap: 8px; }
.context-field > span { font-weight: 800; font-size: 14px; }
.context-field small { color: var(--muted); font-weight: 400; }
.context-field textarea { width: 100%; resize: vertical; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: white; outline: none; }
.context-field textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(36,107,75,.1); }

.primary-button, .secondary-button { width: 100%; display: flex; align-items: center; justify-content: center; gap: 16px; border: 0; border-radius: 14px; font-weight: 900; transition: .2s ease; }
.primary-button { height: 56px; margin-top: 18px; color: white; background: var(--green); font-size: 17px; }
.primary-button:hover:not(:disabled) { background: var(--green-dark); transform: translateY(-2px); }
.primary-button:disabled { opacity: .42; cursor: not-allowed; }
.secondary-button { max-width: 220px; height: 48px; margin: 28px auto 0; color: var(--green-dark); border: 1px solid var(--green); background: transparent; }

.demo-block { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.demo-block > span { color: var(--muted); font-size: 12px; }
.demo-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.demo-buttons button { padding: 8px 11px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: white; font-size: 12px; }
.demo-buttons button:hover { border-color: var(--green); color: var(--green); }

.loading-panel { margin: 30px auto 100px; padding: 70px 30px; text-align: center; border-radius: 28px; background: white; box-shadow: var(--shadow); }
.loader { width: 54px; height: 54px; margin: 0 auto 18px; border: 5px solid var(--mint); border-top-color: var(--green); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-panel h2 { margin: 0 0 8px; }
.loading-panel p { margin: 0; color: var(--muted); }

.result-section { padding: 36px; margin-bottom: 80px; border-radius: 30px; background: white; box-shadow: var(--shadow); }
.result-header { margin-bottom: 22px; }
.result-header p { grid-column: 2; margin: 2px 0 0; color: var(--green); font-size: 13px; font-weight: 800; }
.mode-badge { padding: 7px 10px; border-radius: 8px; color: #7a5a00; background: var(--yellow); font-size: 12px; font-weight: 800; }
.summary-card { padding: 24px; margin-bottom: 18px; border-radius: 18px; color: white; background: var(--green); }
.card-label { display: block; margin-bottom: 8px; color: var(--lime); font-size: 12px; font-weight: 900; }
.summary-card p { margin: 0; font-size: 21px; font-weight: 700; line-height: 1.6; }
.result-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.result-card { min-height: 220px; padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: #fcfdfb; }
.result-card-title { display: flex; align-items: center; gap: 10px; }
.result-card-title span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; color: var(--green-dark); background: var(--mint); font-weight: 900; }
.risk-card .result-card-title span { color: #8b3b17; background: #ffe5d7; }
.result-card h3 { margin: 0; font-size: 17px; }
.result-card ol { padding-left: 22px; margin: 18px 0 0; }
.result-card li { margin-bottom: 14px; padding-left: 5px; line-height: 1.55; }
.result-card li strong { display: block; margin-bottom: 2px; }
.result-card li span, .result-card p { color: var(--muted); }
.time-item, .risk-item { padding: 14px 0; border-bottom: 1px solid var(--line); }
.time-item:last-child, .risk-item:last-child { border: 0; }
.time-item strong, .risk-item strong { display: block; margin-bottom: 5px; }
.time-item small, .risk-item small { color: var(--muted); }
.risk-level { display: inline-block; margin-bottom: 7px; padding: 4px 7px; border-radius: 6px; color: #8b3b17; background: #ffe5d7; font-size: 11px; font-weight: 900; }
.reply-card > p { min-height: 82px; line-height: 1.75; }
.copy-button { padding: 9px 13px; border: 1px solid var(--green); border-radius: 9px; color: var(--green); background: white; font-weight: 800; }
.safety-note { margin: 20px 0 0; padding: 13px 15px; border-radius: 12px; color: #685200; background: #fff9d9; font-size: 12px; line-height: 1.6; }

.how-it-works { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 0 0 80px; }
.how-it-works div { padding: 22px; border-top: 2px solid var(--green); background: rgba(255,255,255,.65); }
.how-it-works span { color: var(--green); font-size: 12px; font-weight: 900; }
.how-it-works strong { display: block; margin: 8px 0 5px; font-size: 18px; }
.how-it-works p { margin: 0; color: var(--muted); font-size: 13px; }

footer { padding: 26px 0 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.7; text-align: center; }
.footer-links { display: flex; justify-content: center; gap: 18px; margin-top: 8px; }
.footer-links a { color: var(--green); text-decoration: none; font-weight: 700; }
.footer-links a:hover { text-decoration: underline; }
.legal-page { width: min(780px, 100%); margin: 45px auto 90px; padding: 36px; border-radius: 24px; background: white; box-shadow: var(--shadow); }
.legal-page h1 { margin-top: 0; font-size: 34px; }
.legal-page h2 { margin-top: 30px; font-size: 19px; }
.legal-page p, .legal-page li { color: var(--muted); line-height: 1.85; }
.legal-page .updated { color: var(--green); font-size: 13px; font-weight: 800; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); padding: 12px 18px; border-radius: 12px; color: white; background: var(--ink); box-shadow: var(--shadow); font-size: 13px; }

@media (max-width: 860px) {
  .page-shell { width: min(100% - 24px, 680px); }
  .topbar { height: 68px; }
  .hero { grid-template-columns: 1fr; gap: 36px; padding: 36px 0 55px; }
  .hero h1 { font-size: 58px; }
  .hero-copy > p { font-size: 17px; }
  .upload-card { padding: 20px; border-radius: 22px; }
  .result-section { padding: 20px; border-radius: 22px; }
  .result-grid, .how-it-works { grid-template-columns: 1fr; }
  .result-card { min-height: 0; }
}

@media (max-width: 420px) {
  .page-shell { width: min(100% - 20px, 680px); }
  .topbar { align-items: flex-start; padding-top: max(14px, env(safe-area-inset-top)); }
  .top-actions { align-items: flex-end; flex-direction: column-reverse; gap: 5px; }
  .service-status, .privacy-pill { padding: 6px 8px; font-size: 10px; }
  .hero h1 { font-size: 48px; }
  .trust-row { display: grid; gap: 8px; }
  .drop-zone { min-height: 200px; }
  .demo-buttons button { flex: 1 0 calc(50% - 8px); }
  .legal-page { margin-top: 24px; padding: 22px; border-radius: 18px; }
}
