:root {
    --brand: #5453e1;
    --brand-dark: #3c3bb8;
    --brand-soft: #eeeeff;
    --ink: #181923;
    --muted: #656879;
    --line: #e6e7ef;
    --surface: #ffffff;
    --canvas: #f7f7fb;
    --success: #087d68;
    --success-soft: #e7f8f4;
    --warning: #9a5b00;
    --warning-soft: #fff5df;
    --danger: #b3273e;
    --danger-soft: #fff0f2;
    --info: #3156a3;
    --info-soft: #edf3ff;
    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 24px;
    --shadow: 0 12px 34px rgba(31, 34, 65, 0.08);
    --header-height: 68px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 92px; }

body {
    margin: 0;
    color: var(--ink);
    background: var(--canvas);
    font-family: "Noto Sans SC", "HarmonyOS Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.72;
    -webkit-font-smoothing: antialiased;
}

body.nav-open { overflow: hidden; }

img, video { display: block; max-width: 100%; }

a { color: var(--brand-dark); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--brand); }

button, input { font: inherit; }
button { color: inherit; }

:focus-visible {
    outline: 3px solid rgba(84, 83, 225, 0.34);
    outline-offset: 3px;
}

.skip-link {
    position: fixed;
    z-index: 3000;
    top: 10px;
    left: 10px;
    padding: 10px 14px;
    color: #fff;
    background: var(--brand-dark);
    border-radius: 8px;
    transform: translateY(-160%);
}

.skip-link:focus { transform: translateY(0); }

.wiki-header {
    position: sticky;
    z-index: 1000;
    top: 0;
    height: var(--header-height);
    border-bottom: 1px solid rgba(221, 222, 233, 0.86);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.wiki-header-inner {
    width: min(100% - 32px, 1440px);
    height: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 18px;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: var(--ink);
    font-weight: 750;
    text-decoration: none;
    white-space: nowrap;
}

.brand-link img { width: 36px; height: 36px; object-fit: contain; }
.brand-link span { padding-left: 11px; border-left: 1px solid var(--line); }

.header-spacer { flex: 1; }

.header-link,
.header-search,
.menu-toggle {
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--ink);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 14px;
    cursor: pointer;
}

.header-search { width: min(300px, 32vw); justify-content: flex-start; color: var(--muted); }
.header-link:hover, .header-search:hover, .menu-toggle:hover { border-color: #c9c9f5; background: var(--brand-soft); }
.menu-toggle { display: none; width: 46px; padding: 0; font-size: 21px; }
body.in-app [data-hide-when-in-app] { display: none !important; }

.wiki-shell {
    width: min(100% - 32px, 1440px);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 238px minmax(0, 820px) minmax(160px, 220px);
    gap: 36px;
    align-items: start;
}

.wiki-sidebar,
.wiki-toc {
    position: sticky;
    top: calc(var(--header-height) + 22px);
    max-height: calc(100vh - var(--header-height) - 44px);
    overflow: auto;
    padding: 20px 0 28px;
    scrollbar-width: thin;
}

.wiki-nav-label,
.toc-label {
    margin: 0 0 9px;
    padding: 0 10px;
    color: #9294a2;
    font-size: 12px;
    font-weight: 750;
    letter-spacing: 0.08em;
}

.wiki-nav { display: grid; gap: 4px; margin-bottom: 20px; }

.wiki-nav a,
.toc-nav a {
    display: block;
    border-radius: 9px;
    color: #4e5160;
    font-size: 14px;
    line-height: 1.35;
    text-decoration: none;
}

.wiki-nav a { padding: 10px 11px; }
.wiki-nav a:hover, .wiki-nav a.is-active { color: var(--brand-dark); background: var(--brand-soft); }
.wiki-nav a.is-active { font-weight: 700; }

.toc-nav { display: grid; gap: 3px; border-left: 1px solid var(--line); }
.toc-nav a { padding: 6px 0 6px 14px; }
.toc-nav a[data-level="3"] { padding-left: 26px; font-size: 13px; }
.toc-nav a:hover { color: var(--brand-dark); }

.wiki-main {
    min-width: 0;
    padding: 42px 0 80px;
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 7px;
    margin-bottom: 18px;
    color: var(--muted);
    font-size: 14px;
}

.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--brand-dark); }

.page-kicker {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    margin: 0 0 14px;
    padding: 4px 11px;
    border-radius: 999px;
    color: var(--brand-dark);
    background: var(--brand-soft);
    font-size: 13px;
    font-weight: 700;
}

.page-title,
.home-title {
    margin: 0;
    max-width: 760px;
    font-size: clamp(34px, 6vw, 58px);
    line-height: 1.08;
    letter-spacing: -0.045em;
}

.page-lead,
.home-lead {
    max-width: 700px;
    margin: 20px 0 0;
    color: var(--muted);
    font-size: clamp(17px, 2.2vw, 21px);
}

.page-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin: 18px 0 0;
    color: #858796;
    font-size: 13px;
}

.content-section { margin-top: 54px; }
.content-section:first-of-type { margin-top: 40px; }

.content-section h2 {
    margin: 0 0 18px;
    font-size: clamp(25px, 3vw, 34px);
    line-height: 1.25;
    letter-spacing: -0.025em;
}

.content-section h3 { margin: 30px 0 10px; font-size: 21px; line-height: 1.35; }
.content-section p { margin: 10px 0; }
.content-section ul, .content-section ol { padding-left: 1.35em; }
.content-section li + li { margin-top: 7px; }

.home-hero {
    padding: 34px;
    overflow: hidden;
    border: 1px solid #e1e1fb;
    border-radius: var(--radius-lg);
    background:
        radial-gradient(circle at 95% 0%, rgba(84, 83, 225, 0.18), transparent 34%),
        linear-gradient(140deg, #ffffff 0%, #f5f5ff 100%);
}

.home-search {
    display: flex;
    gap: 10px;
    max-width: 680px;
    margin-top: 28px;
    padding: 8px;
    border: 1px solid #d7d7ef;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(45, 45, 105, 0.08);
}

.home-search input {
    flex: 1;
    min-width: 0;
    min-height: 46px;
    padding: 0 10px;
    border: 0;
    outline: 0;
    color: var(--ink);
    background: transparent;
}

.primary-button,
.secondary-button,
.text-button {
    min-height: 44px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.primary-button { border: 1px solid var(--brand); color: #fff; background: var(--brand); }
.primary-button:hover { border-color: var(--brand-dark); color: #fff; background: var(--brand-dark); }
.secondary-button { border: 1px solid #cfcfea; color: var(--brand-dark); background: #fff; }
.secondary-button:hover { border-color: var(--brand); background: var(--brand-soft); }
.text-button { border: 0; color: var(--brand-dark); background: transparent; padding-inline: 0; }

.card-grid,
.journey-grid,
.download-grid,
.faq-grid,
.action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.journey-card,
.info-card,
.download-card,
.faq-card,
.action-card,
.support-card {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 8px 24px rgba(31, 34, 65, 0.045);
}

.journey-card,
.info-card,
.faq-card,
.support-card { padding: 22px; }

.journey-card { display: flex; flex-direction: column; min-height: 250px; color: var(--ink); text-decoration: none; }
.journey-card:hover { border-color: #c9c9f5; color: var(--ink); box-shadow: var(--shadow); transform: translateY(-2px); }
.journey-card .card-icon, .quick-icon { font-size: 25px; }
.journey-card h3, .info-card h3, .download-card h3, .faq-card h3 { margin: 14px 0 6px; font-size: 20px; }
.journey-card p, .info-card p, .download-card p, .faq-card p { margin: 0; color: var(--muted); }
.journey-card .card-link { margin-top: auto; padding-top: 20px; color: var(--brand-dark); font-weight: 700; }

.quick-list { display: grid; gap: 10px; }
.quick-link {
    min-height: 66px;
    display: grid;
    grid-template-columns: 42px 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: 13px;
    color: var(--ink);
    background: #fff;
    text-decoration: none;
}
.quick-link:hover { border-color: #c6c6ef; color: var(--ink); background: #fbfbff; }
.quick-link strong { display: block; }
.quick-link small { display: block; margin-top: 2px; color: var(--muted); }

.callout {
    margin: 22px 0;
    padding: 17px 18px;
    border: 1px solid transparent;
    border-radius: 13px;
}
.callout strong { display: block; margin-bottom: 4px; }
.callout.info { color: #263d71; border-color: #cad9fa; background: var(--info-soft); }
.callout.success { color: #075c4f; border-color: #bce8de; background: var(--success-soft); }
.callout.warning { color: #754700; border-color: #efd59d; background: var(--warning-soft); }
.callout.danger { color: #852034; border-color: #f1c6ce; background: var(--danger-soft); }

.status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 750;
}
.status.ok { color: var(--success); background: var(--success-soft); }
.status.conditional { color: var(--warning); background: var(--warning-soft); }
.status.no { color: var(--danger); background: var(--danger-soft); }
.status.pending { color: var(--info); background: var(--info-soft); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.data-table { width: 100%; min-width: 680px; border-collapse: collapse; }
.data-table th, .data-table td { padding: 15px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.data-table th { color: #555867; background: #fafafe; font-size: 13px; }
.data-table tr:last-child td { border-bottom: 0; }

.download-card { display: flex; flex-direction: column; padding: 22px; }
.download-card .platform-icon { font-size: 30px; }
.download-card .download-meta { display: grid; gap: 5px; margin: 18px 0; color: var(--muted); font-size: 14px; }
.download-card .primary-button { margin-top: auto; }

.step-list { display: grid; gap: 18px; counter-reset: steps; }
.step-card {
    position: relative;
    counter-increment: steps;
    padding: 24px 24px 24px 76px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}
.step-card::before {
    content: counter(steps, decimal-leading-zero);
    position: absolute;
    top: 23px;
    left: 22px;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #fff;
    background: var(--brand);
    font-weight: 800;
}
.step-card h3 { margin: 0 0 7px; }
.step-card p:last-child { margin-bottom: 0; }
.step-card .step-tip { color: var(--muted); font-size: 14px; }

.stage-overview {
    margin: 22px 0 0;
    padding: 22px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(circle at 92% 0%, rgba(84, 83, 225, 0.16), transparent 42%),
        linear-gradient(180deg, #ffffff 0%, #f7f7ff 100%);
}
.stage-overview-intro { margin-bottom: 18px; }
.stage-overview-kicker {
    margin: 0 0 8px;
    color: var(--brand);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.02em;
}
.stage-overview-kicker::before {
    content: '';
    display: inline-block;
    width: 18px;
    height: 2px;
    margin: 0 8px 4px 0;
    vertical-align: middle;
    background: var(--brand);
}
.stage-overview-lead {
    margin: 0;
    color: var(--ink);
    font-size: clamp(18px, 3.4vw, 24px);
    font-weight: 780;
    line-height: 1.45;
}
.stage-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.stage-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 14px;
    align-items: start;
    min-height: 100%;
    padding: 18px;
    border: 1px solid rgba(84, 83, 225, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 8px 22px rgba(31, 34, 65, 0.04);
}
.stage-index {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: #fff;
    background: var(--brand);
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
}
.stage-copy h3 {
    margin: 2px 0 6px;
    font-size: 16px;
    line-height: 1.35;
}
.stage-copy p {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}
.stage-overview-tip {
    margin: 16px 0 0;
    padding: 14px 16px;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(135deg, #4b4ad6 0%, #6a69ea 100%);
    font-size: 14px;
    line-height: 1.55;
}
.stage-overview-tip strong { font-weight: 780; }

.screenshot-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 22px 0; }
.screenshot-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.screenshot {
    margin: 0;
    padding: 12px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}
.screenshot img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    background: #f2f3f8;
    object-fit: contain;
}
.screenshot.phone img { max-height: 620px; object-fit: contain; }
.screenshot figcaption { margin-top: 10px; color: var(--muted); font-size: 13px; line-height: 1.5; }

.tabs { margin-top: 22px; }
.tab-list { display: flex; gap: 8px; margin-bottom: 16px; padding: 5px; border-radius: 13px; background: #ececf3; }
.tab-button { min-height: 42px; flex: 1; border: 0; border-radius: 9px; background: transparent; cursor: pointer; }
.tab-button[aria-selected="true"] { color: var(--brand-dark); background: #fff; box-shadow: 0 4px 12px rgba(32, 34, 68, 0.08); font-weight: 750; }
.tab-panel[hidden] { display: none; }

.faq-list { display: grid; gap: 10px; }
.faq-list details { border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.faq-list summary { min-height: 58px; padding: 16px 48px 16px 18px; cursor: pointer; font-weight: 700; list-style: none; position: relative; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: '+'; position: absolute; top: 13px; right: 18px; color: var(--brand); font-size: 24px; }
.faq-list details[open] summary::after { content: '−'; }
.faq-answer { padding: 0 18px 18px; color: #505363; }
.faq-answer p:first-child { margin-top: 0; }

.action-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 22px 0; }
.action-search { min-height: 46px; flex: 1 1 280px; padding: 0 14px; border: 1px solid #d8d9e3; border-radius: 11px; background: #fff; }
.filter-button { min-height: 42px; padding: 0 13px; border: 1px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; }
.filter-button[aria-pressed="true"] { color: #fff; border-color: var(--brand); background: var(--brand); }
.action-count { width: 100%; color: var(--muted); font-size: 14px; }
.action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.action-card { padding: 18px; }
.action-card h3 { margin: 10px 0 5px; font-size: 19px; }
.action-card p { margin: 0 0 15px; color: var(--muted); font-size: 14px; }
.action-card[hidden] { display: none; }

.search-dialog,
.video-dialog {
    width: min(720px, calc(100% - 28px));
    max-height: min(760px, calc(100vh - 36px));
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 28px 90px rgba(20, 22, 52, 0.28);
}
.search-dialog::backdrop, .video-dialog::backdrop { background: rgba(21, 22, 37, 0.58); backdrop-filter: blur(3px); }
.dialog-header { display: flex; gap: 10px; align-items: center; padding: 15px; border-bottom: 1px solid var(--line); }
.dialog-header input { flex: 1; min-width: 0; min-height: 48px; padding: 0 13px; border: 1px solid #d8d9e3; border-radius: 11px; }
.dialog-close { width: 46px; height: 46px; border: 1px solid var(--line); border-radius: 11px; background: #fff; cursor: pointer; }
.search-results { min-height: 180px; max-height: 560px; overflow: auto; padding: 10px; }
.search-result { display: block; padding: 13px 14px; border-radius: 11px; color: var(--ink); text-decoration: none; }
.search-result:hover { color: var(--ink); background: var(--brand-soft); }
.search-result strong { display: block; }
.search-result span { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; }
.search-empty { padding: 44px 20px; color: var(--muted); text-align: center; }
.video-dialog .video-wrap { padding: 16px; }
.video-dialog video { width: 100%; max-height: 70vh; border-radius: 12px; background: #111; }

.page-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 56px; }
.page-nav a { min-height: 88px; padding: 17px; border: 1px solid var(--line); border-radius: 13px; color: var(--ink); background: #fff; text-decoration: none; }
.page-nav a:hover { border-color: #c6c6ef; color: var(--ink); }
.page-nav small { display: block; color: var(--muted); }
.page-nav strong { display: block; margin-top: 3px; }
.page-nav .next { text-align: right; }

.support-checklist { margin: 18px 0 0; padding: 0; list-style: none; }
.support-checklist li { position: relative; padding-left: 28px; }
.support-checklist li::before { content: '✓'; position: absolute; left: 0; color: var(--success); font-weight: 850; }

.wiki-footer { border-top: 1px solid var(--line); background: #fff; }
.wiki-footer-inner { width: min(100% - 32px, 1440px); margin: 0 auto; padding: 26px 0; display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; color: var(--muted); font-size: 13px; }
.wiki-footer a { color: var(--muted); }

@media (max-width: 1180px) {
    .wiki-shell { grid-template-columns: 230px minmax(0, 1fr); }
    .wiki-toc { display: none; }
}

@media (max-width: 860px) {
    :root { --header-height: 62px; }
    .wiki-header-inner, .wiki-shell, .wiki-footer-inner { width: min(100% - 24px, 760px); }
    .wiki-header-inner { gap: 8px; }
    .brand-link span, .header-link { display: none; }
    .header-search { width: 46px; padding: 0; justify-content: center; }
    .header-search .search-label { display: none; }
    .menu-toggle { display: inline-flex; }
    .wiki-shell { display: block; }
    .wiki-sidebar {
        position: fixed;
        z-index: 900;
        top: var(--header-height);
        left: 0;
        width: min(320px, 88vw);
        height: calc(100vh - var(--header-height));
        max-height: none;
        padding: 22px 16px 38px;
        background: #fff;
        visibility: hidden;
        box-shadow: none;
        transform: translateX(-105%);
        transition: transform 180ms ease;
    }
    body.nav-open .wiki-sidebar { visibility: visible; box-shadow: 18px 0 44px rgba(25, 27, 58, 0.18); transform: translateX(0); }
    body.nav-open::after { content: ''; position: fixed; z-index: 850; inset: var(--header-height) 0 0; background: rgba(19, 20, 35, 0.48); }
    .wiki-main { padding-top: 28px; }
    .page-title, .home-title { font-size: clamp(34px, 10vw, 48px); }
}

@media (max-width: 640px) {
    .home-hero { padding: 24px 20px; }
    .home-search { display: block; }
    .home-search .primary-button { width: 100%; margin-top: 8px; }
    .card-grid, .journey-grid, .download-grid, .faq-grid, .action-grid, .screenshot-row, .screenshot-row.three, .stage-grid, .page-nav { grid-template-columns: 1fr; }
    .step-card { padding: 74px 18px 20px; }
    .step-card::before { top: 18px; left: 18px; }
    .data-table { min-width: 620px; }
    .screenshot.phone img { max-height: 560px; }
    .stage-overview { padding: 18px; }
    .stage-overview-lead { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

@media print {
    .wiki-header, .wiki-sidebar, .wiki-toc, .page-nav, .wiki-footer, .header-search { display: none !important; }
    .wiki-shell { display: block; width: 100%; }
    .wiki-main { padding: 0; }
    body { color: #000; background: #fff; }
    .info-card, .step-card, .faq-list details { break-inside: avoid; box-shadow: none; }
}
