:root {
    color-scheme: light;
    --cream-50: #fbfbf9;
    --cream-100: #f3f2ee;
    --cream-200: #e5e4de;
    --cream-300: #d7d3c7;
    --onyx: #18181b;
    --onyx-soft: #27272a;
    --muted: #71717a;
    --faint: #a1a1aa;
    --amber-300: #fcd34d;
    --amber-400: #fbbf24;
    --amber-500: #f59e0b;
    --danger: #b91c1c;
    --success: #15803d;
    --surface: rgba(255, 255, 255, 0.82);
    --line: rgba(24, 24, 27, 0.08);
    --shadow-neuro: 0 4px 20px -2px rgba(0, 0, 0, 0.05), 0 0 3px rgba(0, 0, 0, 0.05);
    --shadow-lift: 0 24px 70px rgba(24, 24, 27, 0.10);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--onyx);
    font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", ui-sans-serif, system-ui, sans-serif;
    background-color: var(--cream-50);
    background-image:
        radial-gradient(circle at 10% 20%, rgba(245, 158, 11, 0.06) 0%, transparent 40%),
        radial-gradient(circle at 90% 10%, rgba(0, 0, 0, 0.035) 0%, transparent 38%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.42;
    background-image:
        linear-gradient(rgba(24, 24, 27, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(24, 24, 27, 0.025) 1px, transparent 1px);
    background-size: 32px 32px;
    mask-image: linear-gradient(to bottom, #000, transparent 74%);
}

body::after {
    content: "";
    position: fixed;
    right: -120px;
    bottom: -160px;
    width: 420px;
    height: 420px;
    border-radius: 999px;
    pointer-events: none;
    background: rgba(251, 191, 36, 0.12);
    filter: blur(70px);
}

a { color: var(--onyx); text-decoration: none; }
a:hover { color: var(--amber-500); }

.shell {
    width: min(64rem, calc(100% - 32px));
    margin: 0 auto;
    padding: 40px 0 72px;
    position: relative;
}

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

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--onyx);
    font-size: 20px;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.brand-mark {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: var(--onyx);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    box-shadow: 0 10px 22px rgba(24, 24, 27, 0.18);
}

.brand-muted {
    color: #a1a1aa;
    font-weight: 500;
}

.nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
}

.nav a {
    color: #52525b;
    padding: 9px 13px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 800;
    transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.nav a.active,
.nav a:hover {
    color: var(--onyx);
    background: #fff;
    box-shadow: var(--shadow-neuro);
    transform: translateY(-1px);
}

.hero {
    display: grid;
    grid-template-columns: minmax(260px, 4fr) minmax(0, 8fr);
    gap: 24px;
    align-items: start;
}

.panel,
.card,
.modal-card {
    border: 1px solid var(--cream-100);
    border-radius: 28px;
    background: var(--surface);
    box-shadow: var(--shadow-neuro);
    backdrop-filter: blur(12px);
}

.panel {
    position: relative;
    overflow: hidden;
    padding: 24px;
}

.panel::before {
    content: "";
    position: absolute;
    top: -32px;
    right: -20px;
    width: 120px;
    height: 120px;
    border-radius: 999px;
    background: rgba(251, 191, 36, 0.13);
    filter: blur(28px);
}

.panel > * { position: relative; }

.eyebrow {
    display: inline-flex;
    color: #71717a;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p { margin-top: 0; }

h1 {
    margin-bottom: 12px;
    font-size: clamp(38px, 7vw, 68px);
    line-height: 0.98;
    letter-spacing: -0.075em;
}

.hero .panel h1 {
    margin: 8px 0 6px;
    font-size: 28px;
    line-height: 1.1;
    letter-spacing: -0.045em;
}

h2 {
    margin-bottom: 12px;
    font-size: 26px;
    line-height: 1.12;
    letter-spacing: -0.045em;
}

h3 {
    margin-bottom: 10px;
    font-size: 19px;
    line-height: 1.25;
    letter-spacing: -0.035em;
}

p {
    color: var(--muted);
    line-height: 1.75;
}

.form-grid {
    display: grid;
    gap: 17px;
    margin-top: 24px;
}

.field { display: grid; gap: 8px; }
.field label,
.check {
    color: var(--onyx);
    font-size: 14px;
    font-weight: 850;
}

input,
select,
button,
textarea { font: inherit; }

input[type="text"],
input[type="number"],
select,
textarea {
    width: 100%;
    border: 1px solid var(--cream-200);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--onyx);
    padding: 13px 14px;
    outline: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
    border-color: rgba(245, 158, 11, 0.78);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.18);
}

input[type="range"] {
    width: 100%;
    accent-color: var(--onyx);
}

.range-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
}

.value-pill,
.tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 31px;
    border-radius: 999px;
    background: var(--onyx);
    color: #fff;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 900;
    white-space: nowrap;
}

.tag.soft,
.value-pill {
    background: var(--cream-100);
    color: var(--onyx);
}

.check {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid var(--cream-200);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.68);
}

.check input { accent-color: var(--onyx); }

.btn,
button.btn,
a.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    border: 0;
    border-radius: 16px;
    background: var(--onyx);
    color: #fff;
    padding: 12px 18px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 14px 30px rgba(24, 24, 27, 0.20), 0 0 0 1px rgba(24, 24, 27, 0.02);
    transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease, opacity 150ms ease;
}

.btn:hover,
a.btn:hover {
    color: #fff;
    background: #27272a;
    transform: translateY(-2px);
    box-shadow: 0 18px 36px rgba(24, 24, 27, 0.25);
}

.btn.secondary,
a.btn.secondary {
    border: 1px solid var(--cream-200);
    background: #fff;
    color: var(--onyx);
    box-shadow: none;
}

.btn.secondary:hover,
a.btn.secondary:hover {
    color: var(--onyx);
    background: #fffbeb;
    border-color: rgba(251, 191, 36, 0.48);
}

.btn:disabled {
    opacity: 0.58;
    cursor: wait;
    transform: none;
}

.progress-wrap { margin-top: 22px; }

.progress-track {
    height: 10px;
    border-radius: 999px;
    background: var(--cream-100);
    overflow: hidden;
}

.progress-bar {
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--onyx), var(--amber-500));
    transition: width 240ms ease;
}

.status-line {
    min-height: 26px;
    margin: 9px 0 0;
    color: var(--onyx-soft);
    font-size: 13px;
    font-weight: 850;
}

.stack {
    display: grid;
    gap: 18px;
}

.result-column { align-content: start; }

.card {
    padding: 22px;
}

.result-intro {
    min-height: 160px;
}

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

.metric {
    border: 1px solid var(--cream-100);
    border-radius: 20px;
    padding: 16px;
    background: #fff;
}

.metric span {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}

.metric strong {
    display: block;
    font-size: 26px;
    letter-spacing: -0.05em;
}

.pain-card {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--cream-100);
    border-radius: 24px;
    padding: 22px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow-neuro);
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.pain-card:hover {
    transform: translateY(-2px);
    border-color: rgba(251, 191, 36, 0.58);
    box-shadow: var(--shadow-lift);
}

.pain-card-head,
.pain-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pain-card-head {
    justify-content: space-between;
    margin-bottom: 14px;
}

.pain-meta { flex-wrap: wrap; }

.score-ring {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 999px;
    color: var(--onyx);
    font-size: 18px;
    font-weight: 950;
    background:
        radial-gradient(circle at center, #fff 0 55%, transparent 56%),
        conic-gradient(var(--amber-400), var(--onyx));
    box-shadow: inset 0 0 0 1px rgba(24, 24, 27, 0.05);
}

.pain-opportunity {
    display: grid;
    gap: 5px;
    margin: 18px 0;
    padding: 14px 16px;
    border-radius: 18px;
    background: #fffbeb;
    border: 1px solid rgba(251, 191, 36, 0.28);
}

.pain-opportunity span {
    color: #92400e;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.08em;
}

.pain-opportunity strong {
    color: var(--onyx);
    line-height: 1.45;
}

.product-card {
    position: relative;
    overflow: hidden;
}

.product-card::after {
    content: "AI";
    position: absolute;
    right: -14px;
    top: -35px;
    color: rgba(251, 191, 36, 0.13);
    font-size: 120px;
    font-weight: 950;
    letter-spacing: -0.10em;
    pointer-events: none;
}

.product-card > * { position: relative; }

.product-card h2 {
    margin-top: 10px;
    font-size: 32px;
}

.product-card > p:first-of-type {
    font-style: italic;
    color: #52525b;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--cream-100);
    border-radius: 22px;
    background: #fff;
    box-shadow: var(--shadow-neuro);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

th,
td {
    border-bottom: 1px solid var(--cream-100);
    padding: 13px 14px;
    text-align: left;
    vertical-align: top;
}

th {
    background: var(--cream-100);
    color: #71717a;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.04em;
}

tr:last-child td { border-bottom: 0; }
tr:hover td { background: #fffbeb; }

.empty {
    padding: 30px;
    border: 1px dashed var(--cream-300);
    border-radius: 24px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.58);
    text-align: center;
}

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

.list {
    margin: 8px 0 0;
    padding-left: 20px;
    color: var(--muted);
    line-height: 1.85;
}

.list li::marker { color: var(--amber-500); }

.modal {
    position: fixed;
    inset: 0;
    display: none;
    place-items: center;
    padding: 24px;
    background: rgba(24, 24, 27, 0.58);
    z-index: 20;
    backdrop-filter: blur(8px);
}

.modal.open { display: grid; }

.modal-card {
    width: min(780px, 100%);
    max-height: 88vh;
    overflow: auto;
    padding: 24px;
    background: rgba(255, 255, 255, 0.94);
}

.modal-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: start;
}

.close {
    border: 0;
    border-radius: 12px;
    background: #fee2e2;
    color: #991b1b;
    font-weight: 900;
    cursor: pointer;
    padding: 8px 12px;
}

.notice {
    border: 1px solid rgba(185, 28, 28, 0.18);
    border-radius: 18px;
    padding: 13px 16px;
    background: #fef2f2;
    color: #991b1b;
    font-weight: 850;
}

code {
    border-radius: 8px;
    background: var(--cream-100);
    padding: 2px 6px;
    color: var(--onyx-soft);
}

@media (max-width: 900px) {
    .hero { grid-template-columns: 1fr; }
    .topbar { align-items: flex-start; flex-direction: column; margin-bottom: 30px; }
    .nav { justify-content: flex-start; }
    .metric-row { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
    .shell { width: min(100% - 24px, 64rem); padding-top: 22px; }
    .panel, .card, .modal-card, .pain-card { border-radius: 20px; }
    .nav a { padding: 8px 10px; }
    .pain-card-head { align-items: flex-start; }
    .score-ring { width: 48px; height: 48px; }
    .actions { align-items: stretch; }
    .actions .btn { width: 100%; }
}
