/* VetClear · 清残 — platform styles */

:root {
  --green-900: #0a3d2b;
  --green-800: #0b5e41;
  --green-700: #0b8a5e;
  --green-600: #12a573;
  --green-100: #e4f6ee;
  --green-50: #f2fbf7;
  --ink: #17241e;
  --ink-soft: #4d6256;
  --line: #dce8e1;
  --amber: #e8a13a;
  --red: #d05656;
  --card-bg: #ffffff;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(11, 90, 65, 0.08);
  --font: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: #f6faf8;
  line-height: 1.6;
}

.container { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* ---------- top bar ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.topbar.scrolled {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom-color: var(--line);
  box-shadow: 0 4px 18px rgba(11, 90, 65, 0.06);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: #ffffff; transition: color 0.3s ease; }
.topbar.scrolled .brand { color: var(--green-800); }
.brand-mark { width: 28px; height: 28px; color: #6ee7b7; transition: color 0.3s ease; }
.topbar.scrolled .brand-mark { color: var(--green-600); }
.brand-name { font-size: 19px; font-weight: 700; letter-spacing: 0.5px; }
.brand-name em { color: #6ee7b7; font-style: normal; transition: color 0.3s ease; }
.topbar.scrolled .brand-name em { color: var(--green-600); }
.nav { display: flex; gap: 22px; }
.nav a { color: rgba(255, 255, 255, 0.82); text-decoration: none; font-size: 14.5px; transition: color 0.3s ease; }
.nav a:hover { color: #6ee7b7; }
.topbar.scrolled .nav a { color: var(--ink-soft); }
.topbar.scrolled .nav a:hover { color: var(--green-700); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  overflow: hidden;
  background:
    radial-gradient(1100px 600px at 78% -10%, rgba(18, 165, 115, 0.22), transparent 62%),
    radial-gradient(900px 560px at 6% 108%, rgba(232, 161, 58, 0.12), transparent 60%),
    linear-gradient(155deg, #05120c 0%, #072219 45%, #04100b 100%);
}
.hero-particles { position: absolute; inset: 0; width: 100%; height: 100%; }

.hero-glow {
  position: absolute; border-radius: 50%;
  filter: blur(70px); opacity: 0.55; pointer-events: none;
}
.glow-1 { width: 520px; height: 520px; left: -140px; top: -120px; background: radial-gradient(circle, rgba(18, 165, 115, 0.5), transparent 65%); animation: drift 19s ease-in-out infinite; }
.glow-2 { width: 460px; height: 460px; right: -130px; bottom: -120px; background: radial-gradient(circle, rgba(232, 161, 58, 0.3), transparent 65%); animation: drift 25s ease-in-out infinite reverse; }
@keyframes drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(46px, -34px) scale(1.1); }
  66% { transform: translate(-34px, 26px) scale(0.92); }
}

.hero-inner {
  position: relative; z-index: 2;
  width: 100%; max-width: 900px;
  padding: 84px 24px 70px;
  margin-top: -30px;
}

.hero-title { font-size: clamp(30px, 6vw, 54px); font-weight: 800; line-height: 1.28; color: #f2fbf7; letter-spacing: 1px; }
.hero-title .line { display: block; }
.hero-title .line-1 { animation: fadeUp 0.9s cubic-bezier(0.2, 0.7, 0.25, 1) 0.05s both; }
.hero-title .line-2 { animation: fadeUp 0.9s cubic-bezier(0.2, 0.7, 0.25, 1) 0.24s both; }
.hero-title .accent {
  background: linear-gradient(90deg, #34d399, #fbbf24, #6ee7b7, #34d399);
  background-size: 240% auto;
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  animation: gradientFlow 6.5s linear infinite, fadeUp 0.9s cubic-bezier(0.2, 0.7, 0.25, 1) 0.24s both;
}
@keyframes gradientFlow { to { background-position: 240% center; } }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: none; }
}

.hero-sub {
  margin-top: 22px; font-size: 15px; letter-spacing: 6px; color: rgba(214, 240, 228, 0.62);
  animation: fadeUp 0.9s cubic-bezier(0.2, 0.7, 0.25, 1) 0.45s both;
}

/* predictive console embedded in hero */
.hero-predict {
  margin: 36px auto 0;
  max-width: 780px;
  text-align: left;
  background: linear-gradient(180deg, rgba(10, 34, 24, 0.5), rgba(5, 20, 14, 0.42));
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 20px;
  padding: 24px 26px 26px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 24px 70px rgba(2, 20, 12, 0.55);
}
.hero-predict .field label { color: rgba(214, 240, 228, 0.72); }
.hero-predict .smiles-input-wrap input {
  background: rgba(3, 14, 9, 0.55);
  border-color: rgba(255, 255, 255, 0.13);
  color: #eefaf4;
}
.hero-predict .smiles-input-wrap input::placeholder { color: rgba(214, 240, 228, 0.35); }
.hero-predict .smiles-input-wrap input:focus {
  border-color: rgba(52, 211, 153, 0.8);
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.14);
}
.hero-predict .icon-btn { color: rgba(214, 240, 228, 0.5); }
.hero-predict .icon-btn:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.custom-select { position: relative; min-width: 0; }
.hero-predict .smiles-row .example-select { width: 84px; flex: 0 0 84px; }
.select-trigger {
  width: 100%; height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 0 12px; border: 1px solid rgba(255, 255, 255, 0.13); border-radius: 12px;
  background: rgba(3, 14, 9, 0.55); color: #eefaf4; font: inherit; font-size: 14px;
  text-align: left; cursor: pointer;
}
.field-select .select-trigger { height: 43px; border-radius: 9px; }
.select-trigger:hover, .custom-select.open .select-trigger {
  border-color: rgba(52, 211, 153, 0.8);
  background: rgba(3, 18, 12, 0.72);
}
.select-trigger:focus-visible { outline: 2px solid rgba(110, 231, 183, 0.8); outline-offset: 2px; }
.select-trigger svg { width: 17px; height: 17px; flex: 0 0 auto; color: rgba(214, 240, 228, 0.62); }
.select-menu[hidden] { display: none; }
.select-menu {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 40;
  width: 100%; max-height: 250px; overflow-y: auto; padding: 6px;
  border: 1px solid rgba(110, 231, 183, 0.28); border-radius: 12px;
  background: #0a2117; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.38);
  scrollbar-width: thin;
  scrollbar-color: rgba(110, 231, 183, 0.35) transparent;
}
.select-menu::-webkit-scrollbar { width: 5px; }
.select-menu::-webkit-scrollbar-track { background: transparent; }
.select-menu::-webkit-scrollbar-thumb {
  background: rgba(110, 231, 183, 0.35);
  border-radius: 3px;
}
.select-menu::-webkit-scrollbar-thumb:hover { background: rgba(110, 231, 183, 0.55); }
.example-menu { width: 250px; right: 0; left: auto; }
.select-option {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 11px; border: 0; border-radius: 8px; background: transparent;
  color: rgba(238, 250, 244, 0.88); font: inherit; font-size: 13px; text-align: left; cursor: pointer;
}
.select-option:hover, .select-option[aria-selected="true"] { background: rgba(52, 211, 153, 0.14); color: #fff; }
.select-option small { color: rgba(214, 240, 228, 0.48); font-size: 11px; white-space: nowrap; }
.hero-predict .field-status { color: rgba(214, 240, 228, 0.58); }
.hero-predict .field-status.error { color: #ff9c9c; }

.btn-shine { position: relative; overflow: hidden; box-shadow: 0 8px 28px rgba(18, 165, 115, 0.35); animation: btnFloat 3.4s ease-in-out infinite; }
.btn-shine::after {
  content: ""; position: absolute; top: 0; left: -90%; width: 55%; height: 100%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  transform: skewX(-20deg);
  animation: shine 3.4s ease-in-out infinite;
}
@keyframes shine { 0% { left: -90%; } 55%, 100% { left: 150%; } }
@keyframes btnFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

/* ---------- reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.25, 1); }
.reveal.visible { opacity: 1; transform: none; }
.section-head h2 span.reveal-title { display: inline-block; }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; padding: 11px 26px; border-radius: 10px;
  font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer;
  border: 1px solid transparent; transition: all 0.18s ease;
}
.btn-primary { background: var(--green-700); color: #fff; }
.btn-primary:hover { background: var(--green-800); }
.btn-block { width: 100%; margin-top: 8px; }

/* ---------- molecule editor ---------- */
.marvin-modal[hidden] { display: none; }
.marvin-modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 24px; }
.marvin-backdrop { position: absolute; inset: 0; background: rgba(3, 16, 10, 0.6); }
.marvin-dialog {
  position: relative; z-index: 1; width: min(920px, 100%); height: min(700px, calc(100vh - 48px));
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--line); border-radius: 18px;
  background: #fbfefc; box-shadow: 0 28px 90px rgba(2, 20, 12, 0.45);
}
.marvin-dialog-head, .marvin-dialog-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; }
.marvin-dialog-head { border-bottom: 1px solid var(--line); }
.marvin-kicker { display: block; color: var(--green-600); font-size: 10px; letter-spacing: 2px; }
.marvin-dialog-head h2 { margin-top: 2px; color: var(--green-900); font-size: 19px; font-weight: 700; }
.modal-close { width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--ink-soft); cursor: pointer; }
.modal-close:hover { background: var(--green-100); color: var(--green-700); }
.modal-close svg { width: 19px; height: 19px; }
.marvin-stage { position: relative; flex: 1; min-height: 0; background: #fff; }
.marvin-stage iframe { width: 100%; height: 100%; display: block; border: 0; background: #fff; }
.marvin-loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: #fff; color: #4d6256; font-size: 14px; pointer-events: none; }
.marvin-loading[hidden] { display: none; }
.loader-spinner {
  width: 36px; height: 36px; border-radius: 50%;
  border: 3px solid var(--green-100); border-top-color: var(--green-600);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.marvin-dialog-foot { border-top: 1px solid var(--line); }
.marvin-foot-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.marvin-status { min-width: 0; color: var(--ink-soft); font-size: 12px; }
.ref-select { flex: 0 0 auto; }
.ref-select .select-trigger {
  height: 36px; padding: 0 10px; border-radius: 8px; font-size: 13px;
  background: #fff; border: 1px solid var(--line); color: var(--ink);
}
.ref-select .select-trigger:hover { border-color: var(--green-600); background: var(--green-50); }
.ref-select .select-trigger svg { color: var(--ink-soft); }
.ref-menu {
  top: auto; bottom: calc(100% + 8px); left: 0;
  width: 300px;
  background: #fff; border-color: var(--line); box-shadow: 0 18px 40px rgba(11, 90, 65, 0.18);
  scrollbar-color: rgba(18, 165, 115, 0.35) transparent;
}
.ref-menu::-webkit-scrollbar-thumb { background: rgba(18, 165, 115, 0.35); }
.ref-menu .select-option { color: var(--ink); }
.ref-menu .select-option:hover, .ref-menu .select-option[aria-selected="true"] { background: var(--green-100); color: var(--green-900); }
.ref-menu .select-option small { color: var(--ink-soft); }
.modal-actions { display: flex; flex: 0 0 auto; gap: 8px; }
.modal-btn { padding: 8px 16px; border-radius: 8px; font: inherit; font-size: 13px; cursor: pointer; }
.modal-btn-ghost { border: 1px solid var(--line); background: #fff; color: var(--ink); }
.modal-btn-ghost:hover { background: var(--green-50); color: var(--green-800); }
.modal-btn-primary { border: 1px solid transparent; background: #12a573; color: #fff; }
.modal-btn-primary:hover { background: #0b8a5e; }

body.marvin-open { overflow: hidden; }

/* ---------- sections ---------- */
.section { padding: 64px 0; }
.section-alt { background: #ffffff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { text-align: center; margin-bottom: 36px; }
.section-head h2 { font-size: 27px; font-weight: 800; color: var(--green-900); }
.section-head p { color: var(--ink-soft); margin-top: 8px; font-size: 15px; }

.card {
  background: var(--card-bg); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}

/* ---------- workbench ---------- */
.panel-input, .panel-result { padding: 26px; margin-bottom: 20px; }
.panel-result h3 { font-size: 17px; font-weight: 700; margin-bottom: 16px; color: var(--green-900); }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13.5px; font-weight: 600; color: var(--ink-soft); margin-bottom: 8px; }
.field input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px;
  font-size: 14.5px; font-family: var(--font); color: var(--ink); background: #fff;
  transition: border-color 0.15s ease;
}
.field input:focus { outline: none; border-color: var(--green-600); }
.field-status { margin-top: 5px; font-size: 12px; color: #8aa093; }
.field-status.error { color: var(--red); }

/* molecule input row: long input + inline draw icon + example dropdown */
.smiles-row { display: flex; gap: 12px; }
.smiles-input-wrap { position: relative; flex: 1; min-width: 0; }
.smiles-input-wrap input {
  width: 100%; height: 52px; padding: 12px 52px 12px 16px;
  font-size: 15px; letter-spacing: 0.3px;
  border: 1.5px solid var(--line); border-radius: 12px;
  font-family: ui-monospace, "SF Mono", Consolas, monospace;
  background: #fbfefc;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.smiles-input-wrap input:focus {
  outline: none; border-color: var(--green-600);
  box-shadow: 0 0 0 4px rgba(18, 165, 115, 0.12);
}
.icon-btn {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  border: none; border-radius: 9px; background: transparent; color: var(--ink-soft);
  cursor: pointer; transition: background 0.15s ease, color 0.15s ease;
}
.icon-btn:hover { background: var(--green-100); color: var(--green-700); }
.icon-btn svg { width: 19px; height: 19px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { margin-top: 14px; font-size: 12px; color: #8aa093; }

.result-empty { text-align: center; padding: 40px 10px; color: #9db3a6; }
.result-empty svg { width: 52px; height: 52px; margin-bottom: 10px; }
.result-empty p { font-size: 14px; }

.result-body { animation: fadein 0.3s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.result-main { display: grid; grid-template-columns: 1fr 1.1fr; gap: 20px; padding-bottom: 20px; border-bottom: 1px dashed var(--line); }
.result-primary { padding: 18px; border-radius: 12px; background: linear-gradient(135deg, var(--green-50), #fff); border: 1px solid var(--line); }
.result-tag {
  display: inline-block; font-size: 12px; font-weight: 600; color: var(--green-700);
  background: var(--green-100); padding: 3px 10px; border-radius: 999px; margin-bottom: 10px;
}
.result-number { font-size: 44px; font-weight: 800; color: var(--green-800); line-height: 1.1; }
.result-caption { font-size: 13.5px; color: var(--ink-soft); }
.result-ci { font-size: 13px; color: var(--ink-soft); margin-top: 8px; }

.result-side { display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.result-row { display: flex; justify-content: space-between; font-size: 14px; color: var(--ink-soft); }
.result-row b { color: var(--ink); }

.result-charts { display: flex; flex-direction: column; gap: 14px; padding: 20px 0; }
.chart-box { position: relative; border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; background: #fbfefc; }
.chart-box h4 { font-size: 13.5px; color: var(--green-900); margin-bottom: 8px; }
.chart-box canvas { width: 100%; display: block; }
.chart-note { font-size: 12px; color: #8aa093; margin-top: 6px; }
.chart-tip {
  position: absolute; z-index: 6; pointer-events: none;
  background: rgba(15, 38, 28, 0.92); color: #eefaf4;
  font-size: 12px; line-height: 1.5; padding: 4px 9px; border-radius: 6px;
  white-space: nowrap; transform: translate(-50%, calc(-100% - 10px));
}
.chart-tip[hidden] { display: none; }
.model-badge {
  display: inline-block; font-size: 11px; font-weight: 600; vertical-align: 2px;
  color: var(--green-700); background: var(--green-100);
  padding: 2px 9px; border-radius: 999px; margin-left: 8px;
}
.result-tip {
  margin-top: 6px; padding: 13px 16px; border-radius: 10px; font-size: 13.5px;
  background: var(--green-100); color: var(--green-900);
}

/* ---------- footer ---------- */
.footer { background: var(--green-900); color: #cfe9dd; margin-top: 20px; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; padding: 22px 24px; }
.footer .brand-name { color: #fff; }
.footer-note { font-size: 12.5px; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .result-main { grid-template-columns: 1fr; }
  .nav { display: none; }
  .hero-title { font-size: clamp(27px, 9vw, 40px); }
  .smiles-row { flex-direction: column; }
  .hero-predict .smiles-row .example-select { width: 100%; flex-basis: auto; }
  .grid2 { grid-template-columns: 1fr; }
  .hero-predict { padding: 18px 16px 20px; }
  .marvin-modal { padding: 12px; }
  .marvin-dialog { height: calc(100vh - 24px); }
  .marvin-dialog-foot { align-items: stretch; flex-direction: column; }
  .marvin-foot-left { flex-direction: column; align-items: stretch; }
  .modal-actions { justify-content: flex-end; }
}