/* Layout and components. Colours come from the --brand-* variables in the theme file.
   The look follows the China Consular Services site: pale sky-blue banner, white navigation bar with an
   orange active marker, white content cards on a light grey page, blue headings with a pointer underline,
   grey accordion rows and a solid blue footer. */

body {
    background: var(--brand-page);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .h1, .h2, .h3, .h4, .display-5, .display-6 {
    color: var(--brand-dark);
    font-weight: 700;
}

.skip-link {
    position: absolute;
    top: .5rem;
    left: .5rem;
    z-index: 2000;
    padding: .5rem 1rem;
    background: #fff;
    border-radius: var(--bs-border-radius);
}

/* ---------- Header ---------- */
.site-header {
    border-top: 4px solid var(--brand-primary-dark);
    background: #fff;
    box-shadow: 0 2px 10px rgba(11, 59, 110, .08);
}

.site-notice {
    background: var(--brand-primary-softer);
    border-bottom: 1px solid var(--brand-border-soft);
    color: var(--brand-ink);
    font-size: .8125rem;
    line-height: 1.35;
    padding: .35rem 0;
}

.site-notice p {
    margin: 0;
}

.site-notice a {
    color: var(--brand-primary-dark);
    font-weight: 600;
    text-decoration: none;
}

.site-notice a:hover {
    text-decoration: underline;
}

.site-notice strong {
    color: var(--brand-primary-dark);
    font-weight: 700;
}

.site-notice .bi {
    color: var(--brand-primary);
}

/* .navbar.navbar-site outranks Bootstrap's .navbar colour variables */
.navbar.navbar-site {
    background: #fff;
    --bs-navbar-padding-y: .5rem;
    --bs-navbar-color: #333;
    --bs-navbar-hover-color: var(--brand-primary-dark);
    --bs-navbar-active-color: var(--brand-orange-text);
    --bs-navbar-nav-link-padding-x: .85rem;
}

.navbar-site .navbar-brand {
    font-size: 1.1rem;
    color: var(--brand-dark);
}

.brand-text {
    font-weight: 600;
    color: var(--brand-primary-dark);
}

.brand-text strong {
    font-weight: 800;
    color: var(--brand-dark);
}

.navbar-site .nav-link {
    font-weight: 600;
    font-size: 1rem;
    position: relative;
}

@media (min-width: 1200px) {
    .navbar-site .nav-link {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    .navbar-site .nav-link.active::after {
        content: "";
        position: absolute;
        left: .85rem;
        right: .85rem;
        bottom: -.5rem;
        height: 3px;
        background: var(--brand-orange);
    }
}

@media (max-width: 1199.98px) {
    .navbar-site .navbar-collapse {
        padding-bottom: .75rem;
    }

    .navbar-site .nav-link.active {
        border-left: 3px solid var(--brand-orange);
        padding-left: .75rem;
    }
}

.nav-cta {
    border-radius: 999px;
    padding-left: 1rem;
    padding-right: 1rem;
}

/* ---------- Banner art (shared by home and page banners) ---------- */
.hero-home,
.page-hero {
    position: relative;
    overflow: hidden;
}

.hero-home::before,
.page-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url("../img/banner-waves.svg") center bottom / cover no-repeat;
    pointer-events: none;
}

/* ---------- Home banner ---------- */
.hero-home {
    background: var(--brand-hero-gradient);
    color: var(--brand-ink);
    text-align: center;
}

.hero-content {
    position: relative;
    z-index: 1;
    padding-top: 3.5rem;
    padding-bottom: 3.25rem;
}

.hero-home h1 {
    color: var(--brand-primary-dark);
    font-weight: 800;
    letter-spacing: .01em;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: #24303D;
    margin-bottom: .25rem;
}

.hero-subtitle-zh {
    font-size: 1rem;
    color: #24303D;
    letter-spacing: .08em;
}

.hero-pill {
    display: flex;
    align-items: center;
    gap: .75rem;
    max-width: 44rem;
    margin: 1.75rem auto 0;
    padding: .4rem .4rem .4rem 1.5rem;
    background: #fff;
    border-radius: 999px;
    box-shadow: 0 .5rem 1.5rem rgba(29, 105, 183, .18);
    text-align: left;
}

.hero-pill-text {
    flex: 1 1 auto;
    color: var(--brand-ink);
    font-size: .98rem;
    line-height: 1.35;
}

.hero-pill .btn {
    flex: 0 0 auto;
    border-radius: 999px;
    padding: .65rem 1.4rem;
}

.hero-popular {
    margin-top: 1rem;
    font-size: .9rem;
    color: #24303D;
}

.hero-popular a {
    color: var(--brand-primary-darker);
    font-weight: 600;
    text-decoration: none;
    margin: 0 .4rem;
}

.hero-popular a:hover {
    text-decoration: underline;
}

@media (max-width: 575.98px) {
    .hero-pill {
        flex-direction: column;
        border-radius: 1rem;
        padding: 1rem;
        text-align: center;
    }

    .hero-pill .btn {
        width: 100%;
    }
}

/* Key dates strip under the banner (like the official "important news" bar) */
.notice-strip {
    position: relative;
    z-index: 2;
    display: flex;
    margin-top: -1.5rem;
    background: #fff;
    border-radius: var(--bs-border-radius-lg);
    box-shadow: 0 .5rem 1.5rem rgba(11, 59, 110, .1);
    overflow: hidden;
}

.notice-label {
    flex: 0 0 5.5rem;
    display: grid;
    place-items: center;
    align-content: center;
    gap: .35rem;
    padding: 1rem .5rem;
    background: var(--brand-primary);
    color: #fff;
    font-weight: 700;
    text-align: center;
    line-height: 1.2;
}

.notice-label .bi {
    font-size: 1.4rem;
}

.notice-items {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.notice-items li {
    display: flex;
    gap: .9rem;
    align-items: flex-start;
    padding: 1rem 1.25rem;
    border-left: 1px solid var(--brand-border-soft);
}

.notice-items li:first-child {
    border-left: 0;
}

.notice-date {
    flex: 0 0 auto;
    text-align: center;
    color: var(--brand-primary-dark);
    line-height: 1.15;
    min-width: 3.4rem;
}

.notice-date strong {
    display: block;
    font-size: 1.35rem;
}

.notice-date span {
    font-size: .78rem;
}

.notice-text {
    font-size: .92rem;
    line-height: 1.45;
}

.notice-text a {
    color: var(--brand-ink);
    text-decoration: none;
}

.notice-text a:hover {
    color: var(--brand-primary-dark);
    text-decoration: underline;
}

@media (max-width: 991.98px) {
    .notice-strip {
        flex-direction: column;
    }

    .notice-label {
        flex-basis: auto;
        grid-auto-flow: column;
        padding: .6rem;
    }

    .notice-items {
        grid-template-columns: 1fr;
    }

    .notice-items li {
        border-left: 0;
        border-top: 1px solid var(--brand-border-soft);
    }

    .notice-items li:first-child {
        border-top: 0;
    }
}

/* Centred section titles with rules either side */
.section-title-center {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--brand-primary-dark);
    font-size: 1.45rem;
    text-align: center;
}

.section-title-center::before,
.section-title-center::after {
    content: "";
    flex: 0 0 2.5rem;
    height: 2px;
    background: var(--brand-primary);
}

/* Blue tiles with a white circle icon */
.tile {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    height: 100%;
    min-height: 8rem;
    padding: 1.25rem 1.5rem;
    border-radius: var(--bs-border-radius-lg);
    background: linear-gradient(135deg, #2272C2 0%, var(--brand-primary) 55%, #1A5FA8 100%);
    color: #fff;
    text-decoration: none;
    overflow: hidden;
    transition: transform .15s ease, box-shadow .15s ease;
}

.tile::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url("../img/tile-lines.svg") right center / cover no-repeat;
    opacity: .5;
    pointer-events: none;
}

.tile:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 .75rem 1.5rem rgba(29, 105, 183, .3);
}

.tile-text {
    position: relative;
}

.tile-title {
    display: block;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.3;
}

.tile-sub {
    display: block;
    font-size: .9rem;
    opacity: .95;
    margin-top: .2rem;
}

.tile-icon {
    position: relative;
    flex: 0 0 4.25rem;
    display: grid;
    place-items: center;
    width: 4.25rem;
    height: 4.25rem;
    border-radius: 50%;
    background: #fff;
    color: var(--brand-primary);
    font-size: 1.9rem;
}

/* ---------- Guide page banner ---------- */
.page-hero {
    background: var(--brand-page-hero-gradient);
    color: var(--brand-ink);
    padding: 1.5rem 0 2.25rem;
    border-bottom: 1px solid var(--brand-border-soft);
}

/* Keep the heading, text and icon above the banner art. */
.page-hero > .container {
    z-index: 1;
}

.page-hero h1 {
    color: var(--brand-primary-darker);
}

.page-hero .lead {
    color: #24303D;
    max-width: 52rem;
    font-size: 1.1rem;
}

.hero-meta {
    color: #3B4654;
}

.hero-icon {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: var(--brand-primary);
    color: #fff;
    font-size: 1.6rem;
    box-shadow: 0 .4rem 1rem rgba(29, 105, 183, .3);
}

.breadcrumb-light {
    --bs-breadcrumb-divider-color: #5E6672;
    --bs-breadcrumb-item-active-color: #3B4654;
    --bs-breadcrumb-divider: ">";
    font-size: .875rem;
    align-items: center;
}

.breadcrumb-pin {
    color: var(--brand-primary);
    margin-right: .4rem;
    font-size: 1rem;
}

.breadcrumb-light a {
    color: #24303D;
    text-decoration: none;
}

.breadcrumb-light a:hover {
    color: var(--brand-primary-dark);
    text-decoration: underline;
}

@media (max-width: 575.98px) {
    .hero-icon {
        display: none;
    }
}

/* ---------- Sections ---------- */
.section {
    padding: 3.5rem 0;
}

.section-white {
    background: #fff;
}

.section-title {
    margin-bottom: .5rem;
    color: var(--brand-primary-darker);
}

.section-kicker {
    color: var(--brand-orange-text);
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    font-size: .8rem;
    margin-bottom: .5rem;
}

.panel {
    background: #fff;
    border-radius: var(--bs-border-radius-lg);
    padding: 1.75rem;
    box-shadow: 0 .25rem 1rem rgba(11, 59, 110, .05);
    height: 100%;
}

.panel-title {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-size: 1.2rem;
    color: var(--brand-primary-dark);
    margin-bottom: 1rem;
}

.panel-title::before {
    content: "";
    width: 4px;
    height: 1.2em;
    background: var(--brand-orange);
}

/* ---------- Guide cards ---------- */
.guide-card {
    position: relative;
    border: 1px solid var(--brand-border-soft);
    border-radius: var(--bs-border-radius-lg);
    background: #fff;
    box-shadow: 0 .25rem .9rem rgba(11, 59, 110, .05);
    text-decoration: none;
    color: inherit;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.guide-card:hover,
.guide-card:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 .75rem 1.5rem rgba(11, 59, 110, .12);
    border-color: var(--brand-border);
}

.guide-card .card-body {
    padding: 1.35rem 1.35rem 2.6rem;
}

.guide-card .card-title {
    color: var(--brand-primary-darker);
    font-weight: 700;
}

.card-arrow {
    position: absolute;
    right: 1.25rem;
    bottom: 1rem;
    color: var(--brand-primary);
    font-size: 1.2rem;
    transition: transform .15s ease;
}

.guide-card:hover .card-arrow {
    transform: translateX(4px);
}

.icon-bubble {
    display: inline-grid;
    place-items: center;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: var(--brand-primary-soft);
    color: var(--brand-primary);
    font-size: 1.35rem;
}

.visa-card {
    border: 1px solid var(--brand-border-soft);
    border-left: 4px solid var(--brand-primary);
    border-radius: var(--bs-border-radius-lg);
    padding: 1.25rem;
    background: #fff;
}

.visa-card h3 a {
    color: var(--brand-primary-darker);
    text-decoration: none;
}

.visa-card h3 a:hover {
    color: var(--brand-primary);
    text-decoration: underline;
}

/* Long dropdowns split into two columns on desktop */
@media (min-width: 1200px) {
    .dropdown-menu-cols {
        column-count: 2;
        column-gap: 0;
        min-width: 32rem;
    }

    .dropdown-menu-cols li {
        break-inside: avoid;
    }
}

/* ---------- Article (white content card on the grey page) ---------- */
.article {
    position: relative;
    isolation: isolate;
    font-size: 1.0625rem;
    line-height: 1.75;
    padding-top: 2rem;
    padding-bottom: 2rem;
    padding-left: calc(var(--bs-gutter-x) * .5 + 2rem);
    padding-right: calc(var(--bs-gutter-x) * .5 + 2rem);
}

.article::before {
    content: "";
    position: absolute;
    z-index: -1;
    top: 0;
    bottom: 0;
    left: calc(var(--bs-gutter-x) * .5);
    right: calc(var(--bs-gutter-x) * .5);
    background: #fff;
    border-radius: var(--bs-border-radius-lg);
    box-shadow: 0 .25rem 1rem rgba(11, 59, 110, .05);
}

@media (max-width: 575.98px) {
    .article {
        padding-top: 1.25rem;
        padding-bottom: 1.25rem;
        padding-left: calc(var(--bs-gutter-x) * .5 + 1rem);
        padding-right: calc(var(--bs-gutter-x) * .5 + 1rem);
    }
}

.article > h2,
.article section > h2 {
    position: relative;
    margin-top: 2.5rem;
    margin-bottom: 1.1rem;
    padding-bottom: .55rem;
    font-size: 1.45rem;
    color: var(--brand-primary-dark);
    border-bottom: 1px solid var(--brand-border-soft);
    scroll-margin-top: 7rem;
}

/* Short blue bar with a small pointer under each heading, as on the official pages */
.article > h2::after,
.article section > h2::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 5rem;
    height: 3px;
    background: var(--brand-primary);
}

.article > h2::before,
.article section > h2::before {
    content: "";
    position: absolute;
    left: 2.2rem;
    bottom: -8px;
    border: 5px solid transparent;
    border-top-color: var(--brand-primary);
}

.article h3 {
    margin-top: 1.75rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--brand-primary-darker);
}

.article .intro {
    font-size: 1.12rem;
    color: #2B3440;
}

.article ul li,
.article ol li {
    margin-bottom: .35rem;
}

.toc {
    background: var(--brand-primary-softer);
    border: 1px solid var(--brand-border-soft);
    border-radius: var(--bs-border-radius-lg);
    padding: 1.1rem 1.4rem;
    margin: 1.5rem 0;
}

.toc p {
    font-weight: 700;
    margin-bottom: .5rem;
    color: var(--brand-primary-darker);
}

.toc ol {
    margin: 0;
    padding-left: 1.25rem;
    columns: 2;
    column-gap: 2rem;
}

@media (max-width: 575.98px) {
    .toc ol {
        columns: 1;
    }
}

.toc a {
    text-decoration: none;
}

.toc a:hover {
    text-decoration: underline;
}

/* Spec tables */
.spec-table-wrap {
    border: 1px solid var(--brand-border-soft);
    border-radius: var(--bs-border-radius-lg);
    overflow: hidden;
    margin: 1.25rem 0;
    background: #fff;
}

.table-spec {
    font-size: .98rem;
}

.table-spec th {
    width: 36%;
    background: var(--brand-primary-softer);
    color: var(--brand-primary-darker);
    font-weight: 700;
}

.table-spec td,
.table-spec th {
    padding: .8rem 1rem;
}

.table-spec tr:last-child th,
.table-spec tr:last-child td {
    border-bottom: 0;
}

.table-compare {
    font-size: .92rem;
}

.table-compare thead th {
    background: var(--brand-primary);
    color: #fff;
    font-weight: 700;
    white-space: nowrap;
    vertical-align: middle;
}

.table-compare tbody th {
    font-weight: 700;
    color: var(--brand-primary-darker);
    min-width: 11rem;
}

.table-compare td {
    min-width: 7.5rem;
}

/* Callouts */
.callout {
    border-left: 4px solid;
    border-radius: 0 var(--bs-border-radius-lg) var(--bs-border-radius-lg) 0;
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
}

.callout-title {
    font-weight: 700;
    margin-bottom: .35rem;
}

.callout-body > :last-child {
    margin-bottom: 0;
}

.callout-official {
    border-color: var(--brand-primary);
    background: var(--brand-official-soft);
}

.callout-official .callout-title {
    color: var(--brand-primary-darker);
}

.callout-tip {
    border-color: var(--brand-orange);
    background: var(--brand-orange-soft);
}

.callout-tip .callout-title {
    color: var(--brand-orange-text);
}

.callout-warning {
    border-color: var(--brand-danger);
    background: var(--brand-danger-soft);
}

.callout-warning .callout-title {
    color: var(--brand-danger-dark);
}

/* Do / Don't lists */
.dd-card {
    border-radius: var(--bs-border-radius-lg);
    padding: 1.25rem 1.25rem .75rem;
}

.dd-title {
    font-weight: 800;
    font-size: 1.05rem;
    margin-bottom: .5rem;
}

.dd-do {
    background: var(--brand-green-soft);
}

.dd-do .dd-title {
    color: var(--brand-green);
}

.dd-dont {
    background: var(--brand-danger-soft);
}

.dd-dont .dd-title {
    color: var(--brand-danger-dark);
}

.dd-list {
    padding-left: 1.1rem;
    font-size: .98rem;
}

/* Sample photos */
.photo-example {
    margin: 0;
    text-align: center;
}

.photo-frame {
    position: relative;
    border-radius: .375rem;
    padding: .4rem;
    background: #fff;
    box-shadow: 0 .25rem .9rem rgba(11, 59, 110, .12);
    border: 3px solid transparent;
}

.is-ok .photo-frame {
    border-color: var(--brand-green);
}

.is-no .photo-frame {
    border-color: var(--brand-danger);
}

.photo-frame svg,
.photo-frame img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 33 / 48;
    border-radius: .2rem;
    outline: 1px solid rgba(11, 59, 110, .14);
}

.photo-badge {
    position: absolute;
    top: -.65rem;
    right: -.65rem;
    display: grid;
    place-items: center;
    width: 1.9rem;
    height: 1.9rem;
    border-radius: 50%;
    color: #fff;
    font-size: 1.1rem;
    box-shadow: 0 .2rem .5rem rgba(0, 0, 0, .2);
}

.is-ok .photo-badge {
    background: var(--brand-green);
}

.is-no .photo-badge {
    background: var(--brand-danger);
}

.photo-example figcaption {
    margin-top: .6rem;
    font-size: .92rem;
    line-height: 1.4;
}

.is-ok figcaption strong {
    color: var(--brand-green);
}

.is-no figcaption strong {
    color: var(--brand-danger-dark);
}

/* Dimension diagram */
.diagram {
    background: var(--brand-primary-softer);
    border: 1px solid var(--brand-border-soft);
    border-radius: var(--bs-border-radius-lg);
    padding: 1.25rem;
    margin: 1.5rem 0;
    text-align: center;
}

.diagram img {
    max-width: 100%;
    height: auto;
}

.diagram figcaption {
    font-size: .9rem;
    color: var(--bs-secondary-color);
    margin-top: .5rem;
}

/* Steps */
.steps {
    counter-reset: step;
    list-style: none;
    padding-left: 0;
}

.steps > li {
    position: relative;
    padding-left: 3.25rem;
    margin-bottom: 1.25rem;
}

.steps > li::before {
    counter-increment: step;
    content: counter(step);
    position: absolute;
    left: 0;
    top: .1rem;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 800;
    color: #fff;
    background: var(--brand-primary);
}

/* ---------- Sidebar ---------- */
.sidebar-sticky {
    position: sticky;
    top: 7.5rem;
    display: grid;
    gap: 1.25rem;
}

.side-card {
    border-left: 4px solid var(--brand-primary);
    border-radius: var(--bs-border-radius-lg);
    padding: 1.25rem 1.25rem 1.25rem 1.1rem;
    background: #fff;
    box-shadow: 0 .25rem 1rem rgba(11, 59, 110, .05);
}

/* Blue pill heading, as in the official sidebar */
.side-title {
    display: inline-block;
    font-weight: 700;
    color: #fff;
    background: var(--brand-primary);
    border-radius: 999px 0 0 999px;
    padding: .35rem 1.25rem .35rem 1rem;
    margin-bottom: .9rem;
}

.qf-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .45rem 0;
    border-bottom: 1px dashed var(--brand-border-soft);
    font-size: .93rem;
}

.qf-row:last-child {
    border-bottom: 0;
}

.qf-row dt {
    font-weight: 600;
    color: var(--bs-secondary-color);
}

.qf-row dd {
    margin: 0;
    font-weight: 700;
    text-align: right;
    color: var(--brand-primary-darker);
}

.related-list li a {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .45rem .25rem;
    text-decoration: none;
    color: #333;
    border-radius: .3rem;
}

.related-list li a::before {
    content: "";
    flex: 0 0 6px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--brand-primary);
}

.related-list li a:hover {
    background: var(--brand-primary-soft);
    color: var(--brand-primary-darker);
}

.related-list .bi {
    display: none;
}

/* CTA card */
.cta-card {
    position: relative;
    overflow: hidden;
    border-radius: var(--bs-border-radius-lg);
    padding: 1.5rem;
    color: #fff;
    background: linear-gradient(135deg, #2272C2 0%, var(--brand-primary) 50%, #1A5FA8 100%);
}

.cta-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url("../img/tile-lines.svg") right center / cover no-repeat;
    opacity: .45;
    pointer-events: none;
}

.cta-card > * {
    position: relative;
}

.cta-mark {
    position: absolute;
    right: 1rem;
    top: 1rem;
}

.cta-title {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: .5rem;
    padding-right: 3.75rem;
    min-height: 2.75rem; /* text starts below the corner mark when the title fits on one line */
}

.cta-text {
    color: #fff;
    font-size: .93rem;
}

.cta-card .btn {
    border-radius: 999px;
}

.cta-wide {
    padding: 2rem 2.25rem;
}

.cta-wide .cta-title {
    font-size: 1.5rem;
}

/* Sources */
.sources-card {
    margin-top: 2.5rem;
    padding: 1.25rem 1.5rem;
    border-radius: var(--bs-border-radius-lg);
    background: var(--brand-official-soft);
    border: 1px solid var(--brand-border-soft);
}

.sources-card h2 {
    color: var(--brand-primary-darker);
    letter-spacing: .06em;
}

.sources-card li {
    margin-bottom: .35rem;
    font-size: .95rem;
}

/* FAQ: grey rows with a blue edge and a plus sign, as on the official pages */
.faq-accordion {
    --bs-accordion-bg: var(--brand-grey-row);
    --bs-accordion-border-width: 0;
    --bs-accordion-border-radius: 0;
    --bs-accordion-inner-border-radius: 0;
    --bs-accordion-btn-bg: var(--brand-grey-row);
    --bs-accordion-btn-color: var(--brand-primary-darker);
    --bs-accordion-active-bg: var(--brand-primary-soft);
    --bs-accordion-active-color: var(--brand-primary-darker);
    --bs-accordion-btn-focus-box-shadow: inset 0 0 0 3px var(--brand-primary-darker);
    --bs-accordion-btn-padding-y: .9rem;
    --bs-accordion-btn-icon-width: 1.05rem;
    --bs-accordion-btn-icon-transform: none;
    --bs-accordion-btn-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Crect x='.75' y='.75' width='14.5' height='14.5' rx='1.5' fill='none' stroke='%231D69B7' stroke-width='1.5'/%3E%3Cpath d='M8 4v8M4 8h8' stroke='%231D69B7' stroke-width='1.5'/%3E%3C/svg%3E");
    --bs-accordion-btn-active-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Crect x='.75' y='.75' width='14.5' height='14.5' rx='1.5' fill='none' stroke='%230B4A8B' stroke-width='1.5'/%3E%3Cpath d='M4 8h8' stroke='%230B4A8B' stroke-width='1.5'/%3E%3C/svg%3E");
}

.faq-accordion .accordion-item {
    border-left: 3px solid var(--brand-primary);
    margin-bottom: .6rem;
}

.faq-accordion .accordion-button {
    font-weight: 600;
    font-size: 1rem;
}

.faq-accordion .accordion-body {
    background: #fff;
    border: 1px solid var(--brand-grey-row);
    border-top: 0;
}

.faq-accordion .accordion-body > :last-child {
    margin-bottom: 0;
}

/* ---------- Footer ---------- */
.site-footer {
    margin-top: 4rem;
}

.footer-links-band {
    background: linear-gradient(180deg, #EEF6FE 0%, #E2F0FC 100%);
    border-top: 1px solid var(--brand-border-soft);
    padding: 1.1rem 0;
    font-size: .9rem;
}

.footer-links-band p {
    margin: 0;
}

.footer-links-band .band-label {
    font-weight: 700;
    color: var(--brand-primary-darker);
}

.footer-links-band a {
    color: var(--brand-primary-darker);
    text-decoration: none;
}

.footer-links-band a:hover {
    text-decoration: underline;
}

.footer-body {
    background: var(--brand-primary);
    color: #fff;
    padding: 2.25rem 0 2.5rem;
}

.footer-brand {
    font-size: 1.15rem;
    color: #fff;
}

.footer-brand strong {
    color: #fff;
}

.footer-heading {
    color: #fff;
    font-weight: 700;
    margin-bottom: .75rem;
}

.footer-links li {
    margin-bottom: .4rem;
    font-size: .93rem;
}

.footer-links a,
.footer-body a:not(.btn) {
    color: #fff;
    text-decoration: none;
}

.footer-links a:hover,
.footer-body a:not(.btn):hover {
    text-decoration: underline;
}

.footer-rule {
    border-color: rgba(255, 255, 255, .45);
    opacity: 1;
    margin: 2rem 0 1.25rem;
}

.footer-disclaimer {
    color: #fff;
}
.footer-tools {
    margin-top: 2rem;
}
.footer-tools-list {
    display: flex;
    flex-wrap: wrap;
    column-gap: 1.5rem;
}
.footer-tools-list:last-child {
    margin-bottom: 0;
}
.footer-tools-label {
    font-weight: 700;
    font-size: .93rem;
    margin: .5rem 0 .5rem;
}

/* ---------- Print ---------- */
@media print {
    .site-header,
    .site-footer,
    .sidebar-sticky,
    .cta-card,
    .page-hero::before {
        display: none !important;
    }

    .page-hero {
        background: none;
        padding: 0;
    }

    .article::before {
        box-shadow: none;
    }
}

/* ---------- Quick answer (featured snippets, voice and AI answers) ---------- */
.answer-box {
    border: 1px solid var(--brand-border);
    border-left: .35rem solid var(--brand-primary);
    background: var(--brand-primary-soft);
    border-radius: var(--bs-border-radius-lg);
    padding: 1.1rem 1.25rem;
    margin: 0 0 1.75rem;
}

.answer-kicker {
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--brand-primary-darker);
    margin-bottom: .25rem;
}

.article .answer-box .answer-q {
    font-size: 1.15rem;
    margin: 0 0 .4rem;
    padding: 0;
    border: 0;
}

.article .answer-box .answer-q::after,
.article .answer-box .answer-q::before {
    display: none;
}

.answer-a {
    font-size: 1.05rem;
    line-height: 1.6;
}

/* ---------- Ratings ---------- */
.stars-static {
    --rating: 0;
    position: relative;
    display: inline-block;
    font-family: bootstrap-icons;
    font-size: 1rem;
    line-height: 1;
    letter-spacing: .12em;
    color: #C3CAD4;
    vertical-align: -.1em;
}

.stars-static::before { content: "\f586\f586\f586\f586\f586"; }

.stars-static::after {
    content: "\f586\f586\f586\f586\f586";
    position: absolute;
    inset: 0 auto 0 0;
    width: calc(var(--rating) / 5 * 100%);
    overflow: hidden;
    white-space: nowrap;
    color: var(--brand-orange);
}

.rating-badge {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .2rem .7rem;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--brand-border);
    color: var(--brand-primary-darker);
    font-size: .85rem;
    font-weight: 600;
    text-decoration: none;
}

.rating-badge:hover {
    background: var(--brand-primary-soft);
    color: var(--brand-primary-darker);
}

.rating-badge-count {
    font-weight: 400;
    color: #3B4654;
}

.rating-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 2rem;
    border: 1px solid var(--brand-border-soft);
    border-radius: var(--bs-border-radius-lg);
    padding: 1.25rem 1.5rem;
    margin: 2.5rem 0 1.25rem;
    background: var(--brand-primary-softer);
}

.article .rating-card h2 {
    font-size: 1.15rem;
    font-weight: 800;
    margin: 0 0 .25rem;
    padding: 0;
    border: 0;
}

.article .rating-card h2::after,
.article .rating-card h2::before {
    display: none;
}

.rating-form { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; }
.rating-form .rating-msg { flex-basis: 100%; }
.rating-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Half-star input: nine radios laid out right-to-left so "checked ~ label" fills the lower values. */
.star-input {
    display: inline-flex;
    flex-direction: row-reverse;
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 2rem;
    line-height: 1;
}

.star-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }

.star-input label {
    position: relative;
    display: block;
    width: .5em;
    height: 1em;
    overflow: hidden;
    cursor: pointer;
    color: #C3CAD4;
}

.star-input label.star-full { width: 1em; }

.star-input label::before {
    content: "\f586";
    font-family: bootstrap-icons;
    position: absolute;
    top: 0;
    line-height: 1;
}

.star-input label.star-full::before,
.star-input label.star-left::before { left: 0; }
.star-input label.star-right::before { right: 0; }

.star-input label.star-full,
.star-input label.star-right { margin-right: .12em; }

.star-input input:checked ~ label { color: var(--brand-orange); }
.star-input:hover label { color: #C3CAD4; }

.star-input label:hover,
.star-input label:hover ~ label { color: #F7B03F; }

.star-input input:focus-visible + label { outline: 2px solid var(--brand-primary-darker); outline-offset: 2px; border-radius: 2px; }

/* ---------- Share links ---------- */
.share-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem 1rem;
    margin: 0 0 1.5rem;
}

.share-title { font-weight: 700; font-size: .95rem; color: var(--brand-primary-darker); }
.share-links { display: flex; flex-wrap: wrap; gap: .4rem; }

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .35rem .75rem;
    border: 1px solid var(--brand-border);
    border-radius: 999px;
    background: #fff;
    color: var(--brand-ink);
    font-size: .85rem;
    font-weight: 600;
    text-decoration: none;
    line-height: 1.2;
}

.share-btn:hover { border-color: var(--brand-primary); color: var(--brand-primary-dark); }
.share-btn .bi { font-size: 1rem; }

@media (max-width: 575.98px) {
    .share-btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .share-btn { padding: .5rem .65rem; }
}

/* ---------- Official images reproduced for reference (official_figure()) ---------- */
.official-figure {
    margin: 1.5rem 0;
    padding: 1rem;
    background: #fff;
    border: 1px solid var(--brand-border-soft);
    border-left: 4px solid var(--brand-primary);
    border-radius: var(--bs-border-radius-lg);
}

.official-figure-img {
    display: block;
    text-align: center;
}

.official-figure img {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--brand-border-soft);
}

.official-figure-narrow img {
    max-width: min(100%, 26rem);
}

.official-figure figcaption {
    margin-top: .65rem;
    font-size: .875rem;
    line-height: 1.5;
    color: var(--bs-secondary-color);
}

.official-figure-title {
    display: block;
    color: var(--brand-ink);
    font-weight: 600;
    margin-bottom: .15rem;
}

.official-figure-credit,
.official-figure-licence {
    display: block;
}

/* ---------- Language switch (site notice bar) ---------- */
.site-notice .lang-switch a {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .05rem .65rem;
    background: #fff;
    border: 1px solid var(--brand-border);
    border-radius: 999px;
    white-space: nowrap;
}

.site-notice .lang-switch a:hover {
    background: var(--brand-primary-soft);
    text-decoration: none;
}

/* Phones: keep the notice and the language switch on one line */
@media (max-width: 419.98px) {
    .site-notice .container { column-gap: .5rem !important; }
    .site-notice .lang-switch i { display: none; }
    .site-notice .lang-switch a { padding: .05rem .55rem; }
}

/* ---------- Simplified Chinese pages (the root; English is under /en/): system CJK fonts only, no webfonts ---------- */
:root:lang(zh) {
    --bs-font-sans-serif: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
    --bs-body-font-family: var(--bs-font-sans-serif);
}

:lang(zh) .hero-home h1 {
    letter-spacing: .04em;
    word-break: keep-all; /* break only at the <wbr> hints, so short phrases stay together on phones */
    overflow-wrap: anywhere;
}

/* Photos under a how-to step: AI scene photos and small samples with their badge */
.step-media {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 1rem;
    margin: .85rem 0 1.5rem;
}

.step-media figure {
    margin: 0;
}

.step-media .photo-example {
    width: 7.5rem;
}

.step-media .photo-example figcaption,
.step-scene figcaption {
    margin-top: .45rem;
    font-size: .85rem;
    line-height: 1.35;
    color: var(--bs-secondary-color);
}

.step-scene {
    flex: 1 1 18rem;
    max-width: 26rem;
}

.step-scene-frame img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: .5rem;
    box-shadow: 0 .25rem .9rem rgba(0, 0, 0, .12);
}
