:root {
    --primary: #2457d6;
    --primary-dark: #183b95;
    --bg: #f5f7fb;
    --card: #ffffff;
    --text: #172033;
    --muted: #667085;
    --border: #dce3ee;
    --soft: #eef3ff;
    --success: #087a55;
    --success-soft: #e7f8f1;
    --warning: #9a5200;
    --warning-soft: #fff5e7;
    --danger: #b42318;
    --shadow: 0 10px 36px rgba(20, 35, 70, .07);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI",
                 "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.65;
}
button, input, select, textarea { font: inherit; }
.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid rgba(220, 227, 238, .9);
    background: rgba(255, 255, 255, .92);
    backdrop-filter: blur(12px);
}
.header-inner {
    width: min(1180px, calc(100% - 32px));
    min-height: 64px;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.brand {
    color: var(--text);
    font-weight: 800;
    text-decoration: none;
}
.link-button {
    padding: 6px 0;
    border: 0;
    background: transparent;
    color: var(--primary);
    cursor: pointer;
}
.page {
    width: min(1180px, calc(100% - 32px));
    margin: 30px auto 60px;
}
.card {
    margin-bottom: 22px;
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--card);
    box-shadow: var(--shadow);
}
.hero {
    background:
        radial-gradient(circle at 90% 20%, rgba(36,87,214,.15), transparent 30%),
        white;
}
h1, h2, h3, h4 { line-height: 1.3; }
h1 { margin: 8px 0 10px; font-size: clamp(28px, 4vw, 42px); }
h2 { margin: 0 0 18px; font-size: 24px; }
h3 { margin: 24px 0 12px; }
h4 { margin: 18px 0 8px; }
p { margin: 8px 0; }
.eyebrow {
    color: var(--primary);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.grid-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
}
.dimension-list {
    margin: 0;
    padding-left: 24px;
}
.dimension-list li { margin: 14px 0; }
.dimension-list strong { display: block; }
.dimension-list span { color: var(--muted); }
.tip, .warning, .flash {
    margin: 18px 0;
    padding: 14px 16px;
    border-radius: 12px;
}
.tip { background: var(--soft); color: var(--primary-dark); }
.warning, .flash { background: var(--warning-soft); color: var(--warning); }
.stack-form {
    display: grid;
    gap: 16px;
}
.stack-form label > span,
.comment-field > span {
    display: block;
    margin-bottom: 7px;
    font-weight: 700;
}
.stack-form b, .required-note { color: var(--danger); }
input[type="text"], input:not([type]), select, textarea,
.stack-form input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #c8d2e2;
    border-radius: 11px;
    background: white;
    color: var(--text);
}
textarea { min-height: 130px; resize: vertical; }
input:focus, select:focus, textarea:focus {
    outline: 3px solid rgba(36, 87, 214, .14);
    border-color: var(--primary);
}
.primary-button, .secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    padding: 12px 18px;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
}
.primary-button {
    border: 1px solid var(--primary);
    background: var(--primary);
    color: white;
}
.primary-button:hover { background: var(--primary-dark); }
.secondary-button {
    border: 1px solid var(--border);
    background: white;
    color: var(--text);
}
.inline { width: auto; }
.progress-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.progress-card h1 { font-size: 30px; }
.progress-dots {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}
.progress-dot {
    width: 36px;
    height: 36px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--muted);
    background: white;
    text-decoration: none;
    font-weight: 800;
}
.progress-dot.done {
    border-color: var(--success);
    background: var(--success-soft);
    color: var(--success);
}
.progress-dot.current {
    outline: 3px solid rgba(36, 87, 214, .18);
    border-color: var(--primary);
    color: var(--primary);
}
.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}
.section-heading > div {
    display: flex;
    align-items: center;
    gap: 12px;
}
.section-heading h1, .section-heading h2 { margin: 0; }
.section-number {
    width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    border-radius: 10px;
    background: var(--soft);
    color: var(--primary);
    font-weight: 900;
}
.sample-id, .status-pill {
    padding: 6px 10px;
    border-radius: 999px;
    background: #f2f4f7;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}
.status-pill.yes { background: var(--success-soft); color: var(--success); }
.status-pill.no { background: #f2f4f7; color: var(--muted); }
.info-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}
.info-grid.compact {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 14px;
}
.info-item {
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 12px;
}
.info-item span {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 13px;
}
.info-item strong { word-break: break-word; }
details {
    margin-top: 16px;
    border-top: 1px solid var(--border);
    padding-top: 15px;
}
summary {
    color: var(--primary);
    font-weight: 800;
    cursor: pointer;
}
.dialogue {
    display: grid;
    gap: 18px;
}
.bubble-row {
    width: min(78%, 760px);
}
.bubble-row.user { margin-left: auto; }
.role-label {
    display: flex;
    gap: 8px;
    align-items: center;
    margin: 0 8px 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}
.bubble-row.user .role-label { justify-content: flex-end; }
.role-label span {
    padding: 2px 6px;
    border-radius: 999px;
    background: var(--soft);
    color: var(--primary);
}
.bubble {
    padding: 15px 17px;
    border-radius: 16px;
    background: #f2f4f7;
    white-space: pre-wrap;
}
.bubble-row.user .bubble {
    background: var(--primary);
    color: white;
}
.api-card, .memory-card {
    margin: 14px 0;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fbfcfe;
}
.api-card.inset { background: white; }
.api-title, .memory-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    color: var(--primary-dark);
    font-weight: 900;
}
.api-title > span, .memory-header > span {
    color: var(--muted);
    font-size: 13px;
}
.key-values {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
.key-values > div {
    padding: 10px 12px;
    border-radius: 10px;
    background: white;
}
.key-values span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}
.key-values strong { word-break: break-word; }
.empty-state {
    padding: 20px;
    border: 1px dashed #b9c5d8;
    border-radius: 14px;
    background: #fafbfc;
}
.empty-state p, .muted { color: var(--muted); }
.json-block {
    max-height: 360px;
    overflow: auto;
    padding: 15px;
    border-radius: 12px;
    background: #172033;
    color: #e8eef8;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    white-space: pre-wrap;
    word-break: break-word;
}
.score-guide {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 20px;
}
.score-guide span {
    padding: 8px;
    border-radius: 9px;
    background: #f4f6f9;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}
.rating-row, .tag-section {
    margin: 0 0 20px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 14px;
}
.rating-row legend, .tag-section legend {
    width: 100%;
    padding: 0 6px;
}
.rating-row legend strong, .rating-row legend span,
.tag-section legend strong, .tag-section legend span {
    display: block;
}
.rating-row legend span, .tag-section legend span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 14px;
}
.score-options {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-top: 14px;
}
.score-options label, .tag-options label { cursor: pointer; }
.score-options input, .tag-options input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.score-options span {
    display: grid;
    min-height: 46px;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: white;
    font-size: 18px;
    font-weight: 900;
}
.score-options input:checked + span {
    border-color: var(--primary);
    background: var(--soft);
    color: var(--primary);
    box-shadow: 0 0 0 3px rgba(36, 87, 214, .12);
}
.tag-options {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 14px;
}
.tag-options span {
    display: inline-block;
    padding: 8px 11px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: white;
}
.tag-options input:checked + span {
    border-color: var(--primary);
    background: var(--soft);
    color: var(--primary);
}
.comment-field { display: block; margin-top: 20px; }
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 22px;
}
.complete-card { text-align: center; }
.success-icon {
    width: 68px;
    height: 68px;
    margin: 0 auto 14px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--success-soft);
    color: var(--success);
    font-size: 34px;
    font-weight: 900;
}
.progress-dots.large {
    justify-content: center;
    margin: 28px 0;
}
.summary-box, .summary-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 22px;
}
.summary-box > div, .summary-cards > div {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 12px;
    text-align: left;
}
.summary-box span, .summary-cards span {
    display: block;
    color: var(--muted);
    font-size: 13px;
}
.summary-cards strong {
    display: block;
    margin-top: 5px;
    font-size: 28px;
}
.summary-cards.scores {
    grid-template-columns: repeat(5, 1fr);
}
.table-wrap { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
th, td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
    white-space: nowrap;
}
th { color: var(--muted); }

@media (max-width: 900px) {
    .grid-two { grid-template-columns: 1fr; }
    .info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .info-grid.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .key-values { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .score-guide { grid-template-columns: 1fr; }
    .summary-cards, .summary-cards.scores, .summary-box {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 640px) {
    .page { width: min(100% - 20px, 1180px); margin-top: 16px; }
    .card { padding: 18px; border-radius: 14px; }
    .progress-card, .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }
    .progress-dots { justify-content: flex-start; }
    .info-grid, .info-grid.compact, .key-values,
    .summary-cards, .summary-cards.scores, .summary-box {
        grid-template-columns: 1fr;
    }
    .bubble-row { width: 92%; }
    .score-options { gap: 6px; }
    .form-actions { flex-direction: column-reverse; }
    .primary-button, .secondary-button { width: 100%; }
}
