:root {
    --bg: #f4f6f3;
    --ink: #17201c;
    --muted: #69736d;
    --line: rgba(23, 32, 28, .1);
    --green: #176a50;
    --amber: #b8771b;
    --card: #fffefa;
    --soft: #eef4ed;
    --radius: 4px;
    --shadow: 0 8px 24px rgba(23, 32, 28, .08);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background:
        linear-gradient(180deg, rgba(23, 106, 80, .12), transparent 260px),
        var(--bg);
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.help-app {
    width: min(100%, 720px);
    margin: 0 auto;
    padding: 0 10px 28px;
}

.help-hero {
    position: relative;
    overflow: hidden;
    margin: 0 -10px;
    padding: 12px 10px 18px;
    color: #f8f4e8;
    background:
        linear-gradient(140deg, rgba(14, 54, 44, .98), rgba(28, 112, 78, .96)),
        repeating-linear-gradient(45deg, rgba(255, 255, 255, .05) 0 1px, transparent 1px 14px);
    border-radius: var(--radius);
}

.help-hero::after {
    content: "";
    position: absolute;
    right: -58px;
    bottom: -72px;
    width: 180px;
    height: 180px;
    border-radius: var(--radius);
    background: rgba(241, 190, 86, .16);
    transform: rotate(18deg);
}

.help-nav,
.help-hero h1,
.help-hero p {
    position: relative;
    z-index: 1;
}

.help-nav {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

.help-nav a,
.help-nav span {
    min-height: 32px;
    color: #f8ecd0;
    text-decoration: none;
    border: 1px solid rgba(248, 236, 208, .3);
    border-radius: var(--radius);
    padding: 6px 10px;
    background: rgba(255, 255, 255, .08);
    font-size: 12px;
}

.help-hero h1 {
    margin: 22px 0 10px;
    font-size: 31px;
    line-height: 1.08;
    letter-spacing: -.04em;
}

.help-hero p {
    max-width: 620px;
    margin: 0;
    color: rgba(255, 255, 255, .78);
    font-size: 13px;
    line-height: 1.65;
}

.toc {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    gap: 6px;
    overflow-x: auto;
    margin-top: 10px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 254, 250, .94);
    box-shadow: var(--shadow);
    scrollbar-width: none;
}

.toc::-webkit-scrollbar {
    display: none;
}

.toc a {
    flex: 0 0 auto;
    border-radius: var(--radius);
    padding: 8px 10px;
    color: var(--green);
    text-decoration: none;
    background: rgba(23, 106, 80, .07);
    font-size: 12px;
    font-weight: 800;
}

.help-section {
    margin-top: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--card);
    box-shadow: var(--shadow);
}

.help-section h2 {
    margin: 0 0 8px;
    font-size: 18px;
}

.section-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.section-title-row h2 {
    margin-bottom: 6px;
}

.section-title-row p {
    margin-bottom: 0;
}

.section-title-row > span {
    flex: 0 0 auto;
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(23, 106, 80, .16);
    border-radius: var(--radius);
    padding: 0 9px;
    color: var(--green);
    background: rgba(23, 106, 80, .08);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.help-section p {
    margin: 0 0 10px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.7;
}

.starter-section {
    border-color: rgba(23, 106, 80, .16);
    background:
        radial-gradient(circle at 90% 0, rgba(215, 164, 61, .16), transparent 30%),
        linear-gradient(135deg, #f8fcf9 0%, #ffffff 52%, #fff9ed 100%);
}

.starter-hero {
    display: grid;
    gap: 12px;
    margin-bottom: 14px;
}

.starter-kicker {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    min-height: 26px;
    margin-bottom: 8px;
    border: 1px solid rgba(23, 106, 80, .18);
    border-radius: var(--radius);
    padding: 0 8px;
    color: var(--green);
    background: rgba(23, 106, 80, .08);
    font-size: 12px;
    font-weight: 900;
}

.starter-hero h2 {
    margin: 0 0 8px;
    font-size: 24px;
    line-height: 1.25;
    letter-spacing: -.03em;
}

.starter-hero p {
    max-width: 760px;
    margin: 0;
    color: #52635d;
    font-size: 13px;
    line-height: 1.8;
}

.starter-hero a {
    width: fit-content;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    border-radius: var(--radius);
    padding: 0 12px;
    color: #fff;
    background: linear-gradient(180deg, #177858, var(--green));
    box-shadow: 0 10px 22px rgba(23, 106, 80, .18);
    text-decoration: none;
    font-size: 12px;
    font-weight: 900;
}

.starter-steps {
    display: grid;
    gap: 8px;
    counter-reset: starterStep;
}

.starter-steps article {
    position: relative;
    overflow: hidden;
    display: grid;
    gap: 5px;
    border: 1px solid rgba(23, 106, 80, .10);
    border-radius: var(--radius);
    padding: 11px 12px;
    background: rgba(255, 255, 255, .86);
    box-shadow: 0 8px 18px rgba(23, 32, 28, .045);
}

.starter-steps article::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: var(--green);
}

.starter-steps b {
    color: var(--green);
    font-size: 12px;
}

.starter-steps strong {
    color: var(--ink);
    font-size: 15px;
}

.starter-steps p {
    margin: 0;
    font-size: 12px;
    line-height: 1.68;
}

.value-section {
    border-color: rgba(215, 164, 61, .20);
    background:
        linear-gradient(90deg, rgba(215, 164, 61, .13) 0 3px, transparent 3px),
        linear-gradient(180deg, #fffaf0 0%, #fffdf8 100%);
}

.value-grid {
    display: grid;
    gap: 8px;
}

.value-grid article {
    display: grid;
    gap: 5px;
    border: 1px solid rgba(138, 106, 46, .15);
    border-radius: var(--radius);
    padding: 11px;
    background: rgba(255, 255, 255, .72);
}

.value-grid b {
    color: #8a6a2e;
    font-size: 12px;
}

.value-grid strong {
    color: var(--ink);
    font-size: 15px;
}

.value-grid p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.65;
}

.plain-example {
    margin-top: 10px;
    border: 1px dashed rgba(23, 106, 80, .24);
    border-radius: var(--radius);
    padding: 11px;
    background: rgba(23, 106, 80, .06);
}

.plain-example strong {
    display: block;
    margin-bottom: 5px;
    color: var(--green);
    font-size: 13px;
}

.plain-example p {
    margin: 0;
}

.flowchart-section {
    border-color: rgba(23, 106, 80, .14);
    background:
        radial-gradient(circle at 86% 0, rgba(215, 164, 61, .12), transparent 28%),
        linear-gradient(180deg, rgba(255, 255, 255, .96), rgba(247, 250, 248, .96));
}

.quant-flowchart {
    position: relative;
    display: grid;
    gap: 10px;
    counter-reset: quantFlow;
}

.flow-node {
    counter-increment: quantFlow;
    position: relative;
    overflow: visible;
    display: grid;
    gap: 5px;
    border: 1px solid rgba(23, 106, 80, .12);
    border-radius: var(--radius);
    min-width: 0;
    padding: 14px 14px 14px 44px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(23, 32, 28, .055);
}

.flow-node::before {
    content: counter(quantFlow);
    position: absolute;
    top: 14px;
    left: 12px;
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: var(--radius);
    color: #fff;
    background: var(--green);
    font-size: 12px;
    font-weight: 900;
    line-height: 1;
}

.flow-node b {
    color: var(--green);
    font-size: 12px;
}

.flow-node strong {
    color: var(--ink);
    font-size: 15px;
    overflow-wrap: anywhere;
}

.flow-node p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.flow-node-source::before {
    background: #2f6f9f;
}

.flow-node-source b {
    color: #2f6f9f;
}

.flow-node-strategy::before {
    background: #7c5a17;
}

.flow-node-strategy b {
    color: #7c5a17;
}

.flow-node-ticket::before {
    background: #9f3d2f;
}

.flow-node-ticket b {
    color: #9f3d2f;
}

.flow-arrow {
    display: none;
}

.flow-arrow::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 16px;
    background: rgba(23, 106, 80, .35);
    transform: translateX(-50%);
}

.flow-arrow::after {
    content: "";
    position: absolute;
    bottom: 2px;
    left: 50%;
    width: 9px;
    height: 9px;
    border-right: 2px solid rgba(23, 106, 80, .45);
    border-bottom: 2px solid rgba(23, 106, 80, .45);
    transform: translateX(-50%) rotate(45deg);
}

.flow-branches {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.flow-branches article {
    display: grid;
    gap: 5px;
    border: 1px dashed rgba(184, 119, 27, .26);
    border-radius: var(--radius);
    padding: 10px;
    background: rgba(184, 119, 27, .07);
}

.flow-branches b {
    color: #7b5012;
    font-size: 13px;
}

.flow-branches span {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
}

.term-list {
    display: grid;
    gap: 8px;
    margin: 0;
}

.term-list dt {
    margin: 0;
    color: var(--ink);
    font-size: 13px;
    font-weight: 900;
}

.term-list dd {
    margin: -4px 0 0;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(23, 32, 28, .08);
    color: var(--muted);
    font-size: 12px;
    line-height: 1.65;
}

.term-list dd:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.flow {
    display: grid;
    gap: 6px;
    margin: 10px 0 12px;
}

.flow span {
    border: 1px solid rgba(23, 106, 80, .16);
    border-left: 3px solid var(--green);
    border-radius: var(--radius);
    padding: 8px 10px;
    color: var(--ink);
    background: var(--soft);
    font-size: 12px;
    font-weight: 900;
}

.note {
    margin-top: 12px;
    border: 1px solid rgba(184, 119, 27, .18);
    border-left: 3px solid var(--amber);
    border-radius: var(--radius);
    padding: 10px;
    background: rgba(184, 119, 27, .08);
}

.note strong {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
}

.note p {
    margin: 0;
}

.play-grid {
    display: grid;
    gap: 8px;
}

.play-grid article {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 8px;
    align-items: start;
    border: 1px solid rgba(29, 45, 39, .1);
    border-radius: var(--radius);
    padding: 9px;
    background: rgba(255, 255, 255, .72);
}

.play-grid b {
    color: var(--green);
    font-size: 13px;
}

.play-grid span {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.55;
}

@media (min-width: 760px) {
    .help-app {
        width: min(100% - 28px, 980px);
        padding-bottom: 42px;
    }

    .help-hero {
        margin: 12px 0 0;
        padding: 18px;
    }

    .help-hero h1 {
        font-size: 38px;
    }

    .starter-hero {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: end;
    }

    .starter-steps {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .starter-steps article {
        min-height: 178px;
        align-content: start;
    }

    .value-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .value-grid article {
        min-height: 150px;
        align-content: start;
    }

    .term-list {
        grid-template-columns: 150px minmax(0, 1fr);
        gap: 0 14px;
    }

    .term-list dt,
    .term-list dd {
        padding: 9px 0;
        border-bottom: 1px solid rgba(23, 32, 28, .08);
    }

    .term-list dd {
        margin: 0;
    }

    .flow {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .quant-flowchart {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 12px;
    }

    .quant-flowchart::before {
        content: "";
        position: absolute;
        top: 25px;
        left: 10%;
        right: 10%;
        height: 2px;
        background: linear-gradient(90deg, rgba(47, 111, 159, .24), rgba(23, 106, 80, .28), rgba(159, 61, 47, .24));
    }

    .quant-flowchart::after {
        content: "";
        position: absolute;
        top: 20px;
        right: 9.5%;
        width: 10px;
        height: 10px;
        border-right: 2px solid rgba(159, 61, 47, .36);
        border-bottom: 2px solid rgba(159, 61, 47, .36);
        transform: rotate(-45deg);
    }

    .flow-node {
        min-height: 210px;
        align-content: start;
        padding: 44px 12px 12px;
        z-index: 1;
    }

    .flow-node::before {
        top: 13px;
        left: 50%;
        width: 26px;
        height: 26px;
        transform: translateX(-50%);
        box-shadow: 0 0 0 6px #fff;
    }

    .flow-node b,
    .flow-node strong,
    .flow-node p {
        text-align: center;
    }

    .flow-branches {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .play-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
