:root {
    --ink: #112d3b;
    --ink-soft: #526873;
    --navy: #0d2634;
    --teal: #0f766e;
    --teal-bright: #1b9b8e;
    --amber: #f2b84b;
    --cream: #f5f1e9;
    --paper: #fffdf8;
    --line: #d9e0df;
    --success: #18785e;
    --danger: #b43c3c;
    --shadow: 0 24px 70px rgba(17, 45, 59, .12);
    --radius: 22px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--ink);
    background: var(--cream);
    font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.eyebrow { margin: 0 0 12px; color: var(--teal); font-size: 12px; font-weight: 800; letter-spacing: .16em; }
.note { color: var(--ink-soft); font-size: 13px; line-height: 1.7; }

.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.02em; }
.brand-mark { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 11px; background: var(--teal); color: #fff; font-size: 16px; box-shadow: 0 8px 18px rgba(15, 118, 110, .24); }
.brand--dark { color: var(--ink); }
.brand--light { color: #fff; }
.brand--light .brand-mark { background: var(--amber); color: var(--navy); box-shadow: none; }

.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 46px; padding: 0 20px; border: 1px solid transparent; border-radius: 14px; font-size: 14px; font-weight: 800; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button--primary { background: var(--teal); color: #fff; box-shadow: 0 12px 28px rgba(15, 118, 110, .22); }
.button--primary:hover:not(:disabled) { background: #0b625c; box-shadow: 0 16px 34px rgba(15, 118, 110, .28); }
.button--subtle { background: rgba(255,255,255,.72); color: var(--ink); border-color: var(--line); }
.button--ghost { min-height: 38px; padding: 0 15px; background: transparent; border-color: var(--line); }
.button--small { font-size: 13px; }
.button--wide { width: 100%; }

.site-header { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; max-width: 1240px; margin: 0 auto; padding: 22px 28px; background: rgba(245, 241, 233, .84); backdrop-filter: blur(14px); }
.header-actions { display: flex; align-items: center; gap: 24px; color: var(--ink-soft); font-size: 14px; font-weight: 700; }
.header-actions a:hover { color: var(--teal); }

.hero { display: grid; grid-template-columns: minmax(0, 1.06fr) minmax(360px, .94fr); gap: 68px; align-items: center; max-width: 1240px; min-height: 660px; margin: 0 auto; padding: 58px 28px 88px; }
.hero h1 { max-width: 700px; margin: 0 0 24px; font-size: clamp(44px, 5.4vw, 74px); line-height: 1.03; letter-spacing: -.055em; }
.hero h1 span { color: var(--teal); }
.hero-lead { max-width: 660px; margin: 0 0 30px; color: var(--ink-soft); font-size: 17px; line-height: 1.85; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.status-strip { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.status-strip span { display: inline-flex; align-items: center; gap: 7px; }
.status-strip span::before { width: 7px; height: 7px; border-radius: 50%; background: #9aa9ae; content: ""; }
.status-strip .status-ok::before { background: var(--success); }
.status-strip .status-warn::before { background: var(--amber); }
.status-strip .status-muted::before { background: #9aa9ae; }

.hero-visual { position: relative; min-height: 470px; }
.report-card { border-radius: 26px; }
.report-card--main { position: absolute; inset: 20px 22px 20px 0; padding: 32px; background: var(--navy); color: #fff; box-shadow: var(--shadow); overflow: hidden; }
.report-card--main::after { position: absolute; right: -90px; bottom: -120px; width: 300px; height: 300px; border: 50px solid rgba(255,255,255,.05); border-radius: 50%; content: ""; }
.report-topline { display: flex; align-items: center; justify-content: space-between; color: #a9bfc8; font-size: 13px; }
.report-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 6px rgba(242,184,75,.12); }
.report-number { margin-top: 42px; font-size: 38px; font-weight: 800; letter-spacing: -.045em; }
.report-label { color: #b5c7ce; font-size: 13px; }
.report-bars { display: flex; align-items: flex-end; gap: 8px; height: 120px; margin: 30px 0 26px; padding-bottom: 1px; border-bottom: 1px solid rgba(255,255,255,.12); }
.report-bars span { flex: 1; min-width: 0; border-radius: 7px 7px 0 0; background: linear-gradient(180deg, var(--amber), #d79625); opacity: .9; }
.report-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; position: relative; z-index: 1; }
.report-grid div { padding: 14px; border: 1px solid rgba(255,255,255,.11); border-radius: 14px; background: rgba(255,255,255,.04); }
.report-grid b { display: block; font-size: 20px; }
.report-grid small { color: #a9bfc8; font-size: 11px; }
.report-card--float { position: absolute; right: -12px; bottom: -10px; width: 240px; padding: 20px; background: var(--paper); border: 1px solid rgba(17,45,59,.08); box-shadow: 0 20px 50px rgba(17,45,59,.16); }
.report-card--float .mini-label, .report-card--float small { display: block; color: var(--ink-soft); font-size: 11px; }
.report-card--float strong { display: block; margin: 5px 0 4px; color: var(--success); font-size: 17px; }

.section { max-width: 1240px; margin: 0 auto; padding: 88px 28px; }
.section--split { display: grid; grid-template-columns: .85fr 1.15fr; gap: 80px; align-items: start; padding-bottom: 120px; }
.section-heading { max-width: 700px; margin-bottom: 38px; }
.section h2 { margin: 0; font-size: clamp(30px, 3.4vw, 48px); line-height: 1.15; letter-spacing: -.04em; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature-card { position: relative; min-height: 230px; padding: 28px; border: 1px solid rgba(17,45,59,.10); border-radius: var(--radius); background: rgba(255,253,248,.64); }
.feature-card:hover { transform: translateY(-3px); box-shadow: 0 18px 45px rgba(17,45,59,.09); transition: .2s ease; }
.feature-index { color: var(--teal); font-size: 12px; font-weight: 900; letter-spacing: .12em; }
.feature-card h3 { margin: 58px 0 12px; font-size: 20px; }
.feature-card p, .security-copy p { margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.8; }
.security-copy { padding: 6px 0 0; }
.security-copy p + p { margin-top: 18px; }
.site-footer { display: flex; justify-content: space-between; max-width: 1240px; margin: 0 auto; padding: 28px; border-top: 1px solid rgba(17,45,59,.11); color: var(--ink-soft); font-size: 12px; }

.plan-shell { min-height: 100vh; background: #eef2f1; }
.app-header { display: flex; align-items: center; justify-content: space-between; height: 72px; padding: 0 28px; background: var(--navy); color: #fff; }
.app-header-meta { display: inline-flex; align-items: center; gap: 9px; color: #c2d2d8; font-size: 13px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #39c69b; box-shadow: 0 0 0 5px rgba(57,198,155,.12); }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; max-width: 1440px; height: calc(100vh - 72px); margin: 0 auto; padding: 18px; }
.chat-panel, .summary-panel { min-height: 0; }
.chat-panel { display: flex; flex-direction: column; padding: 28px 30px 20px; border-radius: 22px; background: var(--paper); box-shadow: 0 10px 35px rgba(17,45,59,.06); }
.panel-heading { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.panel-heading h1 { margin: 0 0 6px; font-size: 25px; letter-spacing: -.03em; }
.panel-heading p:not(.eyebrow) { margin: 0; color: var(--ink-soft); font-size: 13px; }
.step-badge, .table-status { display: inline-flex; align-items: center; align-self: flex-start; padding: 7px 11px; border-radius: 999px; background: #e8f5f1; color: var(--success); font-size: 12px; font-weight: 800; white-space: nowrap; }
.inline-alert { display: flex; gap: 10px; margin-top: 16px; padding: 13px 15px; border: 1px solid #f0d598; border-radius: 13px; background: #fff9e9; color: #76551a; font-size: 13px; line-height: 1.55; }
.inline-alert a { color: #9b5b00; text-decoration: underline; }
.payment-notice { display: flex; gap: 12px; align-items: center; margin-top: 16px; padding: 13px 15px; border: 1px solid #b8ddd5; border-radius: 13px; background: #edf8f5; color: #245e55; }
.payment-notice-icon { display: grid; flex: 0 0 34px; width: 34px; height: 34px; place-items: center; border-radius: 11px; background: var(--teal); color: #fff; font-weight: 900; }
.payment-notice strong, .payment-notice span { display: block; }
.payment-notice div span { margin-top: 3px; color: #52766f; font-size: 11px; }

.message-list { flex: 1; min-height: 0; overflow-y: auto; padding: 24px 5px 18px; }
.message { display: flex; gap: 13px; max-width: 82%; margin-bottom: 22px; }
.message--user { flex-direction: row-reverse; margin-left: auto; }
.message-avatar { display: grid; flex: 0 0 34px; width: 34px; height: 34px; place-items: center; border-radius: 11px; background: #e7eeed; color: var(--ink-soft); font-size: 12px; font-weight: 900; }
.message--assistant .message-avatar { background: var(--teal); color: #fff; }
.message-body { padding: 13px 16px; border-radius: 4px 16px 16px 16px; background: #f2f5f4; color: var(--ink); font-size: 14px; line-height: 1.75; white-space: pre-line; }
.message--user .message-body { border-radius: 16px 4px 16px 16px; background: #e2f2ef; }
.typing-row { display: flex; align-items: center; gap: 5px; padding: 8px 5px 10px; color: var(--ink-soft); font-size: 12px; }
.typing-row span { width: 6px; height: 6px; border-radius: 50%; background: var(--teal); animation: bounce 1s infinite alternate; }
.typing-row span:nth-child(2) { animation-delay: .15s; }
.typing-row span:nth-child(3) { animation-delay: .3s; }
.typing-row small { margin-left: 6px; }
@keyframes bounce { to { opacity: .3; transform: translateY(-3px); } }

.chat-form { display: flex; gap: 12px; align-items: flex-end; padding: 12px; border: 1px solid var(--line); border-radius: 18px; background: #fff; }
.chat-form textarea { flex: 1; min-height: 52px; max-height: 160px; padding: 8px 5px; border: 0; outline: 0; resize: none; color: var(--ink); background: transparent; line-height: 1.6; }
.button--send { min-height: 50px; padding: 0 18px; border-radius: 14px; }
.button--send span { font-size: 18px; }
.form-note { margin: 9px 0 0; color: #7a8a91; font-size: 11px; text-align: center; }

.summary-panel { display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }
.summary-block { padding: 22px; border: 1px solid rgba(17,45,59,.08); border-radius: 20px; background: var(--paper); box-shadow: 0 8px 30px rgba(17,45,59,.05); }
.summary-title { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 15px; font-size: 14px; font-weight: 800; }
.summary-title > span:last-child { color: var(--teal); font-size: 12px; }
.progress-track { height: 8px; overflow: hidden; border-radius: 99px; background: #e7edec; }
.progress-track span { display: block; height: 100%; min-width: 8px; border-radius: inherit; background: linear-gradient(90deg, var(--teal), var(--teal-bright, #1b9b8e)); }
.missing-list { margin-top: 17px; }
.missing-list p { margin: 0 0 8px; color: var(--ink-soft); font-size: 12px; }
.missing-list span { display: block; margin-top: 6px; padding: 8px 10px; border-radius: 9px; background: #fff7e8; color: #76551a; font-size: 11px; line-height: 1.45; }
.ready-copy { margin: 14px 0 0; color: var(--success); font-size: 12px; font-weight: 700; }
.empty-copy { margin: 0; color: var(--ink-soft); font-size: 12px; line-height: 1.65; }
.assumption-list { max-height: 320px; overflow-y: auto; }
.assumption-list div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid #edf0ef; font-size: 12px; }
.assumption-list div:first-child { border-top: 0; }
.assumption-list span { color: var(--ink-soft); }
.assumption-list strong { text-align: right; font-size: 12px; }
.summary-block--action { background: var(--navy); color: #fff; }
.summary-block--action h2 { margin: 0 0 8px; font-size: 18px; }
.summary-block--action p { margin: 0 0 17px; color: #afc2c9; font-size: 12px; line-height: 1.65; }
.summary-block--action .button--primary { background: var(--amber); color: var(--navy); box-shadow: none; }
.download-link { display: flex; justify-content: center; gap: 6px; margin-top: 14px; color: #cfe0e5; font-size: 12px; text-decoration: underline; }
.generate-result { margin-top: 14px; padding: 12px; border-radius: 12px; background: rgba(255,255,255,.08); color: #dbe8eb; font-size: 12px; line-height: 1.6; }
.generate-result.success { color: #c4f0df; }
.generate-result.error { color: #ffd1cd; }
.generate-result a { color: #fff; text-decoration: underline; }
.payment-qr-panel { text-align: center; }
.payment-qr-title { margin-bottom: 12px; color: #fff; font-weight: 800; }
.payment-qr-code { display: inline-flex; padding: 10px; border-radius: 12px; background: #fff; }
.payment-qr-code img, .payment-qr-code canvas { display: block; max-width: 100%; }
.payment-qr-hint { margin: 10px 0; color: #dbe8eb; font-size: 11px; line-height: 1.5; }

.auth-page, .error-page { display: grid; min-height: 100vh; place-items: center; padding: 28px; background: radial-gradient(circle at 20% 10%, #dcece7, transparent 35%), var(--cream); }
.auth-card, .error-card { width: min(100%, 440px); padding: 36px; border: 1px solid rgba(17,45,59,.09); border-radius: 24px; background: var(--paper); box-shadow: var(--shadow); }
.auth-card h1, .error-card h1 { margin: 38px 0 10px; font-size: 32px; letter-spacing: -.04em; }
.auth-card > p:not(.eyebrow), .error-card > p:not(.eyebrow) { margin: 0 0 26px; color: var(--ink-soft); line-height: 1.7; }
.stack-form label { display: block; margin-bottom: 16px; color: var(--ink); font-size: 13px; font-weight: 800; }
.stack-form input[type="text"], .stack-form input[type="password"], .stack-form input[type="url"], .stack-form select { display: block; width: 100%; height: 48px; margin-top: 8px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; outline: 0; background: #fff; color: var(--ink); }
.stack-form input:focus, .chat-form:focus-within { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(15,118,110,.10); }
.stack-form small { display: block; margin-top: 7px; color: var(--ink-soft); font-size: 11px; font-weight: 400; line-height: 1.5; }
.form-error, .notice.error { margin-bottom: 16px; padding: 12px 14px; border-radius: 11px; background: #fdecea; color: var(--danger); font-size: 13px; }
.notice.success { margin-bottom: 18px; padding: 12px 14px; border-radius: 11px; background: #e7f6ef; color: var(--success); font-size: 13px; }
.checkbox-label { display: flex !important; align-items: center; gap: 8px; font-weight: 400 !important; }
.checkbox-label input { width: auto !important; height: auto !important; margin: 0 !important; }

.admin-header { display: flex; align-items: center; justify-content: space-between; height: 72px; padding: 0 32px; background: var(--navy); color: #fff; }
.text-button { padding: 7px 0; border: 0; background: transparent; color: #c8d8dd; }
.text-button:hover { color: #fff; }
.admin-main { max-width: 1240px; margin: 0 auto; padding: 48px 28px 80px; }
.admin-title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 28px; }
.admin-title-row h1 { margin: 0 0 10px; font-size: clamp(32px, 4vw, 52px); letter-spacing: -.05em; }
.admin-title-row p:not(.eyebrow) { max-width: 680px; margin: 0; color: var(--ink-soft); line-height: 1.7; }
.health-pills { display: flex; flex-wrap: wrap; gap: 9px; }
.health-pills span { padding: 8px 11px; border-radius: 99px; background: #ecefed; color: var(--ink-soft); font-size: 11px; font-weight: 800; }
.health-pills .status-ok { background: #e6f5ef; color: var(--success); }
.health-pills .status-warn { background: #fff5dd; color: #8a5d12; }
.admin-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 18px; }
.admin-card { padding: 28px; border: 1px solid rgba(17,45,59,.09); border-radius: 22px; background: var(--paper); box-shadow: 0 12px 38px rgba(17,45,59,.06); }
.admin-card h2 { margin: 0; font-size: 20px; }
.admin-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.admin-card-head p { margin: 6px 0 0; color: var(--ink-soft); font-size: 12px; }
.connection-state { padding: 7px 11px; border-radius: 99px; background: #f1f2f1; color: var(--ink-soft); font-size: 11px; font-weight: 800; }
.connection-state.connected { background: #e6f5ef; color: var(--success); }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.test-result { margin-top: 14px; padding: 11px 13px; border-radius: 10px; background: #f2f5f4; color: var(--ink-soft); font-size: 12px; }
.test-result.success { background: #e7f6ef; color: var(--success); }
.test-result.error { background: #fdecea; color: var(--danger); }
.check-list { margin: 20px 0 24px; padding: 0; list-style: none; }
.check-list li { position: relative; margin: 12px 0; padding-left: 22px; color: var(--ink-soft); font-size: 13px; line-height: 1.55; }
.check-list li::before { position: absolute; top: 2px; left: 0; color: var(--teal); content: "✓"; font-weight: 900; }
code { padding: 2px 5px; border-radius: 5px; background: #edf1ef; color: #214550; font-size: 12px; }
.records-card { margin-top: 18px; }
.payment-card { margin-top: 18px; }
.payment-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 22px; }
.payment-meta div { padding: 14px; border-radius: 13px; background: #f2f5f4; }
.payment-meta span, .payment-meta strong { display: block; }
.payment-meta span { color: var(--ink-soft); font-size: 11px; }
.payment-meta strong { margin-top: 5px; font-size: 17px; }
.payment-form { margin-top: 18px; }
.payment-enable { margin-bottom: 20px !important; }
.payment-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.stack-form textarea { display: block; width: 100%; margin-top: 8px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; outline: 0; resize: vertical; color: var(--ink); background: #fff; font-family: Consolas, monospace; font-size: 12px; line-height: 1.55; }
.stack-form textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 4px rgba(15,118,110,.10); }
.payment-clear-actions { display: flex; flex-wrap: wrap; gap: 16px; margin: 4px 0 18px; }
.payment-callbacks { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.payment-callbacks p { margin: 8px 0; color: var(--ink-soft); font-size: 12px; }
.payment-callbacks code { word-break: break-all; }
.certificate-form { margin-top: 14px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 14px 12px; border-top: 1px solid #edf0ef; text-align: left; font-size: 13px; }
th { color: var(--ink-soft); font-size: 11px; letter-spacing: .06em; }
td strong, td small { display: block; }
td small { margin-top: 4px; color: #87969b; font-size: 10px; }
.table-status { padding: 5px 9px; font-size: 10px; }
.status-generated { background: #e8f5f1; color: var(--success); }
.status-ready { background: #fff5dc; color: #8a5d12; }
.status-interview { background: #edf1f1; color: var(--ink-soft); }
.table-actions { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.table-actions a { color: var(--teal); font-weight: 700; }
.table-actions form { margin: 0; }
.table-delete { padding: 0; border: 0; background: transparent; color: var(--danger); font-size: 13px; font-weight: 700; }
.table-delete:hover { text-decoration: underline; }

@media (max-width: 1000px) {
    .hero, .section--split { grid-template-columns: 1fr; gap: 42px; }
    .hero { min-height: 0; padding-top: 30px; }
    .hero-visual { min-height: 420px; }
    .workspace { grid-template-columns: 1fr; height: auto; }
    .chat-panel { height: calc(100vh - 108px); min-height: 600px; }
    .summary-panel { overflow: visible; }
}

@media (max-width: 720px) {
    .site-header { padding: 16px 18px; }
    .header-actions a:not(.button) { display: none; }
    .hero { padding: 34px 18px 60px; }
    .hero h1 { font-size: 42px; }
    .hero-visual { min-height: 380px; }
    .report-card--main { inset: 10px 10px 22px 0; padding: 24px; }
    .report-card--float { right: 0; }
    .section { padding: 64px 18px; }
    .feature-grid { grid-template-columns: 1fr; }
    .feature-card { min-height: 180px; }
    .feature-card h3 { margin-top: 36px; }
    .site-footer { padding: 22px 18px; }
    .app-header { padding: 0 18px; }
    .app-header-meta { display: none; }
    .workspace { padding: 10px; }
    .chat-panel { padding: 20px 16px 14px; border-radius: 18px; }
    .panel-heading { display: block; }
    .step-badge { margin-top: 12px; }
    .message { max-width: 94%; }
    .admin-header { padding: 0 18px; }
    .admin-main { padding: 36px 18px 60px; }
    .admin-title-row { display: block; }
    .health-pills { margin-top: 18px; }
    .admin-grid { grid-template-columns: 1fr; }
    .payment-grid, .payment-meta { grid-template-columns: 1fr; }
    .admin-card { padding: 21px; }
}
