/* User guide — same paper, forest, and type as the rest of the library */
.ug-page {
    color: var(--uc-ink, #15261a);
    font-family: var(--uc-font-ui, "Manrope", "Noto Sans SC", "PingFang SC", "Segoe UI", sans-serif);
}

.ug-hero-actions .btn-light {
    color: var(--uc-forest, #205A28);
}

.ug-wrap {
    max-width: 1120px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 3rem;
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 1.75rem 2rem;
    align-items: start;
}

.ug-article {
    min-width: 0;
}

.ug-toc {
    position: sticky;
    top: 5.25rem;
    max-height: calc(100vh - 6.5rem);
    overflow: auto;
    padding: 0.15rem 0 0.5rem;
}

.ug-toc-label {
    margin: 0 0 0.55rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(21, 38, 26, 0.45);
}

.ug-toc ol {
    list-style: none;
    margin: 0;
    padding: 0;
    border-left: 1px solid rgba(21, 38, 26, 0.12);
}

.ug-toc a {
    display: block;
    padding: 0.32rem 0 0.32rem 0.85rem;
    margin-left: -1px;
    border-left: 2px solid transparent;
    color: rgba(21, 38, 26, 0.72);
    text-decoration: none;
    font-size: 0.84rem;
    line-height: 1.35;
}

.ug-toc a:hover,
.ug-toc a:focus-visible,
.ug-toc a.is-current {
    color: var(--uc-forest, #205A28);
    border-left-color: var(--uc-forest, #205A28);
}

.ug-article h2 {
    font-family: var(--uc-font-display, "Literata", "Noto Serif SC", Georgia, serif);
    font-size: 1.45rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 2.25rem 0 0.75rem;
    padding-top: 0.35rem;
    scroll-margin-top: 5.25rem;
}

.ug-article h2:first-child {
    margin-top: 0;
}

.ug-article h3 {
    font-size: 1.02rem;
    font-weight: 700;
    margin: 1.25rem 0 0.45rem;
}

.ug-article p,
.ug-article li {
    line-height: 1.7;
    font-size: 0.98rem;
}

.ug-article p {
    margin: 0 0 0.75rem;
}

.ug-lead {
    font-size: 1.05rem !important;
    color: rgba(21, 38, 26, 0.82);
}

.ug-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 0.25rem 0 1.25rem;
}

.ug-step {
    background: #fff;
    border: 1px solid rgba(21, 38, 26, 0.1);
    padding: 0.85rem 0.9rem 0.95rem;
    min-height: 100%;
}

.ug-step-no {
    display: inline-block;
    font-family: var(--uc-font-display, "Literata", Georgia, serif);
    color: var(--uc-gold, #b08d3e);
    font-weight: 600;
    letter-spacing: 0.04em;
    margin-bottom: 0.3rem;
}

.ug-step strong {
    display: block;
    margin-bottom: 0.25rem;
}

.ug-step p {
    margin: 0;
    font-size: 0.86rem !important;
    color: rgba(21, 38, 26, 0.72);
}

.ug-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 0.4rem 0 1rem;
}

.ug-card {
    background: #fff;
    border: 1px solid rgba(21, 38, 26, 0.1);
    padding: 0.85rem 1rem;
}

.ug-card h3 {
    margin: 0 0 0.3rem;
    font-size: 0.95rem;
}

.ug-card p {
    margin: 0;
    font-size: 0.88rem !important;
    color: rgba(21, 38, 26, 0.72);
}

.ug-card i {
    color: var(--uc-forest, #205A28);
    margin-right: 0.3rem;
}

.ug-ol,
.ug-ul {
    margin: 0 0 0.9rem;
    padding-left: 1.2rem;
}

.ug-note,
.ug-tip {
    border-left: 3px solid var(--uc-gold, #b08d3e);
    background: rgba(176, 141, 62, 0.08);
    padding: 0.75rem 0.9rem;
    margin: 0.4rem 0 1rem;
}

.ug-tip {
    border-left-color: var(--uc-forest, #205A28);
    background: rgba(32, 90, 40, 0.06);
}

.ug-note p,
.ug-tip p {
    margin: 0;
}

.ug-figure {
    margin: 0.85rem 0 1.15rem;
    background: #fff;
    border: 1px solid rgba(21, 38, 26, 0.1);
}

.ug-figure img {
    display: block;
    width: 100%;
    height: auto;
    background: #e8eee8;
}

.ug-figure figcaption {
    padding: 0.55rem 0.8rem 0.7rem;
    font-size: 0.82rem;
    color: rgba(21, 38, 26, 0.62);
    line-height: 1.5;
}

.ug-table-wrap {
    overflow-x: auto;
    margin: 0.5rem 0 1rem;
    border: 1px solid rgba(21, 38, 26, 0.1);
    background: #fff;
}

.ug-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.ug-table th,
.ug-table td {
    text-align: left;
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid rgba(21, 38, 26, 0.08);
    vertical-align: top;
}

.ug-table th {
    background: #e8eee8;
    font-weight: 700;
    white-space: nowrap;
}

.ug-table tr:last-child td {
    border-bottom: none;
}

.ug-table code,
.ug-article code {
    font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
    font-size: 0.84em;
    color: var(--uc-forest-deep, #163f1c);
    background: rgba(32, 90, 40, 0.06);
    padding: 0.05rem 0.28rem;
    overflow-wrap: anywhere;
}

.ug-table a {
    color: var(--uc-forest, #205A28);
    text-decoration: none;
    font-weight: 600;
}

.ug-table a:hover {
    text-decoration: underline;
}

.ug-faq details {
    background: #fff;
    border: 1px solid rgba(21, 38, 26, 0.1);
    padding: 0.7rem 0.9rem;
    margin-bottom: 0.5rem;
}

.ug-faq summary {
    cursor: pointer;
    font-weight: 700;
}

.ug-faq details p {
    margin: 0.55rem 0 0.15rem;
}

@media (max-width: 900px) {
    .ug-page .uc-hero {
        padding: 1rem 0 1.05rem;
    }

    .ug-page .uc-hero-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 0.85rem;
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }

    .ug-page .uc-hero-title {
        font-size: 1.5rem;
        line-height: 1.25;
    }

    .ug-page .uc-hero-support {
        max-width: none;
        font-size: 0.98rem;
        line-height: 1.65;
    }

    .ug-page .ug-hero-actions {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 0.5rem;
    }

    .ug-page .ug-hero-actions .btn {
        width: 100%;
        min-height: 2.75rem;
        flex: none;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0.35rem;
        font-size: 1rem;
        padding: 0.55rem 0.9rem;
    }

    .ug-wrap {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
        width: 100%;
        max-width: 100%;
        padding: 0 0 calc(4.75rem + env(safe-area-inset-bottom));
    }

    .ug-toc {
        position: sticky;
        top: 0;
        z-index: 20;
        min-width: 0;
        max-width: 100%;
        max-height: none;
        overflow: visible;
        background: rgba(246, 247, 244, 0.96);
        border-bottom: 1px solid rgba(21, 38, 26, 0.1);
        padding: 0.45rem 0 0.4rem;
        backdrop-filter: blur(8px);
    }

    .ug-toc-label {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .ug-toc ol {
        display: flex;
        gap: 0.4rem;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
        scrollbar-width: none;
        border-left: none;
        padding: 0.1rem max(1rem, env(safe-area-inset-right)) 0.35rem max(1rem, env(safe-area-inset-left));
    }

    .ug-toc ol::-webkit-scrollbar {
        display: none;
    }

    .ug-toc li {
        flex: 0 0 auto;
    }

    .ug-toc a {
        display: inline-flex;
        align-items: center;
        min-height: 2.5rem;
        border: 1px solid rgba(21, 38, 26, 0.12);
        border-radius: 999px;
        margin-left: 0;
        white-space: nowrap;
        padding: 0.35rem 0.85rem;
        background: #fff;
        font-size: 0.92rem;
        scroll-snap-align: start;
    }

    .ug-toc a.is-current {
        border-color: var(--uc-forest, #205A28);
        background: rgba(32, 90, 40, 0.08);
        font-weight: 700;
    }

    .ug-article {
        padding: 1.05rem max(1rem, env(safe-area-inset-right)) 0 max(1rem, env(safe-area-inset-left));
    }

    .ug-article h2 {
        font-size: 1.35rem;
        line-height: 1.35;
        margin: 1.85rem 0 0.7rem;
        scroll-margin-top: 3.85rem;
    }

    .ug-article h3 {
        font-size: 1.05rem;
        line-height: 1.4;
    }

    .ug-article p,
    .ug-article li {
        font-size: 1rem;
        line-height: 1.75;
    }

    .ug-lead {
        font-size: 1.05rem !important;
    }

    .ug-steps {
        grid-template-columns: 1fr;
        gap: 0;
        margin-bottom: 0.5rem;
    }

    .ug-step {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        column-gap: 0.75rem;
        align-items: start;
        background: transparent;
        border: none;
        border-left: 2px solid rgba(176, 141, 62, 0.55);
        border-radius: 0;
        padding: 0 0 1rem 0.85rem;
        margin-left: 0.15rem;
    }

    .ug-step-no {
        grid-row: 1 / span 2;
        margin: 0.15rem 0 0;
        font-size: 0.95rem;
    }

    .ug-step strong,
    .ug-step p {
        grid-column: 2;
    }

    .ug-step p {
        font-size: 0.95rem !important;
        line-height: 1.65;
    }

    .ug-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.65rem;
    }

    .ug-card {
        padding: 0.8rem 0.85rem;
    }

    .ug-card h3 {
        font-size: 1rem;
    }

    .ug-card p {
        font-size: 0.92rem !important;
        line-height: 1.6;
    }

    .ug-ol,
    .ug-ul {
        padding-left: 1.15rem;
    }

    .ug-note,
    .ug-tip {
        padding: 0.8rem 0.9rem;
    }

    .ug-figure {
        margin-left: calc(-1 * max(1rem, env(safe-area-inset-left)));
        margin-right: calc(-1 * max(1rem, env(safe-area-inset-right)));
        border-left: none;
        border-right: none;
    }

    .ug-figure img {
        cursor: zoom-in;
    }

    .ug-figure figcaption {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
        font-size: 0.88rem;
        line-height: 1.55;
    }

    html[lang^="zh"] .ug-figure figcaption::after {
        content: " · 点按可放大";
    }

    html[lang^="en"] .ug-figure figcaption::after {
        content: " · Tap to enlarge";
    }

    .ug-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
    }

    .ug-table,
    .ug-table tbody,
    .ug-table tr,
    .ug-table td {
        display: block;
        width: 100%;
    }

    .ug-table-wrap {
        overflow: visible;
        border: none;
        background: transparent;
    }

    .ug-table tr {
        background: #fff;
        border: 1px solid rgba(21, 38, 26, 0.1);
        padding: 0.75rem 0.9rem 0.8rem;
        margin-bottom: 0.5rem;
    }

    .ug-table td {
        border: none;
        padding: 0.12rem 0;
        font-size: 0.98rem;
    }

    .ug-table td:nth-child(1) {
        font-weight: 700;
        padding-bottom: 0.2rem;
    }

    .ug-table td:nth-child(2) {
        overflow-wrap: anywhere;
        font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
        font-size: 0.86rem;
        color: var(--uc-forest-deep, #163f1c);
    }

    .ug-table td:nth-child(3) {
        display: inline-block;
        width: auto;
        max-width: 100%;
        margin-top: 0.4rem;
        padding: 0.15rem 0.5rem;
        font-size: 0.78rem;
        font-weight: 700;
        line-height: 1.4;
        white-space: normal;
        overflow-wrap: anywhere;
        color: var(--uc-forest, #205A28);
        background: rgba(32, 90, 40, 0.08);
    }

    .ug-faq summary {
        display: flex;
        align-items: center;
        min-height: 2.75rem;
        font-size: 1rem;
        line-height: 1.45;
        padding: 0.35rem 0.15rem;
    }

    .ug-faq details {
        padding: 0.2rem 0.9rem 0.75rem;
    }

    .ug-faq details p {
        font-size: 0.98rem;
        line-height: 1.7;
    }
}

@media (max-width: 640px) {
    .ug-grid {
        grid-template-columns: 1fr;
    }
}

.ug-zoom {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    margin: 0;
    padding: 3.25rem 0 1.25rem;
    border: none;
    background: #0f1f14;
    color: #f4f7f4;
    overflow: auto;
}

.ug-zoom::backdrop {
    background: rgba(8, 16, 10, 0.55);
}

.ug-zoom img {
    display: block;
    width: max(100%, 880px);
    max-width: none;
    height: auto;
    background: #e8eee8;
}

.ug-zoom p {
    margin: 0.75rem 1rem 0.25rem;
    font-size: 0.92rem;
    line-height: 1.55;
    color: rgba(244, 247, 244, 0.82);
}

.ug-zoom-close {
    position: fixed;
    top: max(0.6rem, env(safe-area-inset-top));
    right: max(0.6rem, env(safe-area-inset-right));
    z-index: 2;
    width: 2.75rem;
    height: 2.75rem;
    border: none;
    border-radius: 999px;
    background: #fff;
    color: #15261a;
    font-size: 1.5rem;
    line-height: 1;
}

@media print {
    .ug-toc,
    .ug-hero-actions,
    .navbar,
    .ai-fab,
    footer.site-footer {
        display: none !important;
    }

    .ug-wrap {
        display: block;
        max-width: none;
        padding: 0;
    }

    .ug-figure {
        break-inside: avoid;
    }
}
