* {
    box-sizing: border-box;
}

:root {
    --bg: #f5efe5;
    --panel: #fffaf3;
    --panel-strong: #fff;
    --line: #e8dccb;
    --text: #2a2118;
    --muted: #786856;
    --accent: #bf5a2b;
    --accent-dark: #8f3f1d;
    --accent-soft: #f9dfcf;
    --good: #1d7a45;
    --bad: #b5352b;
    --shadow: 0 16px 40px rgba(61, 39, 23, 0.08);
}

body {
    margin: 0;
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(191, 90, 43, 0.15), transparent 28%),
        linear-gradient(180deg, #f6efe7 0%, #f8f3ec 40%, #f4ede2 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

.site-shell {
    min-height: 100vh;
    width: min(1180px, calc(100% - 28px));
    margin: 0 auto;
    padding: 18px 0 40px;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    background: rgba(255, 250, 243, 0.82);
    border: 1px solid rgba(232, 220, 203, 0.8);
    border-radius: 24px;
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
}

.brand {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 1px;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.nav-cta,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    border: none;
    cursor: pointer;
    font-weight: 700;
    transition: transform 0.18s ease, background 0.18s ease;
}

.button.secondary {
    background: transparent;
    color: var(--accent-dark);
    border: 1px solid var(--line);
}

.button:hover,
.nav-cta:hover {
    transform: translateY(-1px);
    background: var(--accent-dark);
}

.button.secondary:hover {
    color: #fff;
    border-color: var(--accent-dark);
}

.flash {
    margin: 18px 0;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: #fff;
}

.flash-success {
    border-color: rgba(29, 122, 69, 0.2);
    color: var(--good);
}

.flash-error {
    border-color: rgba(181, 53, 43, 0.2);
    color: var(--bad);
}

.hero {
    margin-top: 22px;
    padding: 42px 28px;
    border-radius: 32px;
    border: 1px solid rgba(232, 220, 203, 0.75);
    background:
        radial-gradient(circle at right top, rgba(191, 90, 43, 0.16), transparent 24%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 245, 236, 0.95));
    box-shadow: var(--shadow);
}

.eyebrow {
    display: inline-block;
    padding: 7px 12px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-size: 14px;
    font-weight: 700;
}

.hero-grid,
.grid-2,
.grid-3,
.panel-grid {
    display: grid;
    gap: 18px;
}

.hero-grid {
    margin-top: 18px;
    grid-template-columns: 1.3fr 0.9fr;
}

.hero h1 {
    margin: 0 0 16px;
    font-size: clamp(34px, 7vw, 68px);
    line-height: 1.04;
}

.hero p {
    margin: 0;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.75;
}

.hero-actions,
.quick-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 24px;
}

.card,
.metric,
.form-card,
.table-card,
.faq-card {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.card,
.form-card,
.table-card,
.faq-card {
    padding: 22px;
}

.metric {
    padding: 18px 20px;
}

.metric strong {
    display: block;
    margin-top: 6px;
    font-size: 28px;
}

.section {
    margin-top: 22px;
}

.section-title {
    margin: 0 0 14px;
    font-size: 26px;
}

.section-subtitle {
    margin: -6px 0 18px;
    color: var(--muted);
}

.grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.form-card {
    width: min(540px, 100%);
    margin: 28px auto 0;
}

.form-card.wide {
    width: 100%;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    min-height: 46px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: #fff;
    font: inherit;
    color: var(--text);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

.field {
    margin-bottom: 16px;
}

.field-help,
.muted {
    color: var(--muted);
    font-size: 14px;
}

.code-tabs {
    margin-top: 14px;
}

.code-tab-list {
    display: flex;
    gap: 10px;
    flex-wrap: nowrap;
    margin-bottom: 12px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: thin;
}

.code-tab {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.9);
    color: var(--accent-dark);
    font: inherit;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
}

.code-tab.is-active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.code-panel {
    display: none;
    padding: 16px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.9);
}

.code-panel.is-active {
    display: block;
}

.code-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.code-panel-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.code-copy-button {
    min-height: 38px;
    padding: 0 14px;
}

.code-block {
    min-height: 220px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
    line-height: 1.65;
    white-space: pre;
    overflow: auto;
    background: #fffdf9;
    cursor: text;
}

@media (max-width: 900px) {
    .code-panel-actions {
        width: 100%;
    }

    .code-panel-actions .button {
        flex: 1 1 auto;
    }
}

.panel-grid {
    grid-template-columns: 280px 1fr;
    align-items: start;
}

.sidebar {
    position: sticky;
    top: 18px;
    padding: 18px;
}

.sidebar a {
    display: block;
    padding: 12px 14px;
    margin-bottom: 10px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid var(--line);
}

.content-stack > * + * {
    margin-top: 18px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 12px 10px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    font-size: 14px;
}

th {
    color: var(--muted);
    font-weight: 700;
}

.tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-size: 12px;
    font-weight: 700;
}

.status-success {
    color: var(--good);
}

.status-danger {
    color: var(--bad);
}

.status-muted {
    color: var(--muted);
}

.empty {
    padding: 28px;
    text-align: center;
    color: var(--muted);
}

.footer-note {
    margin-top: 26px;
    color: var(--muted);
    text-align: center;
    font-size: 13px;
}

@media (max-width: 900px) {
    .hero-grid,
    .grid-2,
    .grid-3,
    .panel-grid {
        grid-template-columns: 1fr;
    }

    .site-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .site-nav {
        width: 100%;
    }
}

