:root {
    color-scheme: light;
    --bg: #f9fafb;
    --surface: rgba(255, 255, 255, 0.9);
    --surface-strong: #ffffff;
    --text: #111827;
    --muted: #4b5563;
    --border: #e5e7eb;
    --accent: #09e96c;
    --accent-dark: #0f172a;
    --accent-soft: #ecfdf5;
    --shadow: 0 20px 45px rgba(15, 23, 42, 0.08);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 16px;
    --max-width: 1120px;
    --content-width: 860px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background:
        radial-gradient(circle at top left, rgba(9, 233, 108, 0.10), transparent 28%),
        linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
    color: var(--text);
    line-height: 1.75;
}

a {
    color: #155dfc;
    text-decoration: none;
}

a:hover {
    color: #0f172a;
}

.legal-site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    backdrop-filter: blur(16px);
    background: rgba(255, 255, 255, 0.82);
    border-bottom: 1px solid rgba(229, 231, 235, 0.8);
}

.legal-header-inner,
.legal-main,
.legal-footer-inner {
    width: min(var(--max-width), calc(100% - 32px));
    margin: 0 auto;
}

.legal-header-inner {
    min-height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    color: var(--text);
}

.brand-logo {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    object-fit: cover;
}

.header-links {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav-pill,
.cta-pill,
.btn-primary-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.5rem;
    padding: 0 1.25rem;
    border-radius: 20251300px;
    background: linear-gradient(0deg, #000 0%, #000 100%), linear-gradient(90deg, #155DFC 0%, #9810FA 100%);
    color: #58FBA0;
    font-size: 1rem;
    font-style: normal;
    font-weight: 500;
    line-height: 1;
    border: none;
    white-space: nowrap;
    font-family: FZLanTingHeiPro_GB18030, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.lang-switch {
    min-width: 96px;
    border: 1px solid rgba(88, 251, 160, 0.35);
    box-shadow: inset 0 0 0 1px rgba(88, 251, 160, 0.08);
    position: relative;
}

.lang-switch::before {
    content: "语言";
    display: inline-block;
    margin-right: 8px;
    padding-right: 8px;
    border-right: 1px solid rgba(88, 251, 160, 0.35);
    color: rgba(88, 251, 160, 0.88);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

html[lang="en"] .lang-switch::before {
    content: "LANG";
}

.nav-pill:hover,
.cta-pill:hover,
.btn-primary-link:hover {
    color: #58FBA0;
    filter: brightness(1.06);
}

.legal-main {
    padding: 40px 0 64px;
}

.hero-card,
.legal-card,
.directory-card,
.related-card {
    background: var(--surface);
    border: 1px solid rgba(229, 231, 235, 0.9);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
}

.hero-card {
    padding: 40px;
    margin-bottom: 28px;
}

.hero-kicker,
.section-kicker,
.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: #0f5132;
    font-size: 14px;
    font-weight: 700;
}

.hero-card h1,
.legal-title {
    margin: 18px 0 14px;
    font-size: clamp(32px, 4vw, 48px);
    line-height: 1.18;
}

.hero-card p,
.hero-subtitle,
.legal-intro,
.directory-description {
    margin: 0;
    color: var(--muted);
    font-size: clamp(16px, 2vw, 18px);
}

.hero-language-note {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    padding: 10px 14px;
    border-radius: 14px;
    background: rgba(88, 251, 160, 0.08);
    border: 1px solid rgba(88, 251, 160, 0.22);
    color: #166534;
    font-size: 14px;
    line-height: 1.5;
}

.hero-language-note strong {
    color: #0f5132;
}

.hero-actions,
.page-actions,
.pager,
.page-meta,
.footer-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.hero-actions,
.page-actions,
.page-meta {
    margin-top: 22px;
}

.grid-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.directory-card {
    min-height: 248px;
    padding: 28px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.directory-card .meta-chip {
    margin-bottom: 18px;
}

.directory-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.12);
}

.directory-card h2,
.directory-card h3,
.related-card h2,
.related-card h3 {
    margin: 0 0 14px;
    font-size: 22px;
    line-height: 1.35;
}

.directory-card p,
.related-card p,
.page-summary {
    margin: 0;
    color: var(--muted);
}

.directory-card-footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
    flex-wrap: wrap;
}

.directory-date {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.05);
    border: 1px solid rgba(15, 23, 42, 0.08);
    color: #6b7280;
    font-size: 13px;
    line-height: 1.4;
    white-space: nowrap;
}

.directory-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.doc-language-hint {
    color: #6b7280;
    font-size: 13px;
    line-height: 1.4;
}

.doc-language-hint a {
    font-weight: 700;
}

.directory-card .doc-link,
.related-links a,
.pager a,
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

.directory-card .doc-link {
    min-height: 34px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.06);
    color: #0f172a;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.directory-card .doc-link:hover {
    background: rgba(15, 23, 42, 0.12);
    color: #0f172a;
    transform: translateY(-1px);
}

.legal-layout {
    display: grid;
    grid-template-columns: minmax(0, var(--content-width)) minmax(250px, 320px);
    gap: 24px;
    align-items: start;
}

.legal-card {
    padding: 32px;
}

.legal-content {
    color: var(--text);
}

.legal-content h1,
.legal-content h2,
.legal-content h3,
.legal-content h4 {
    margin-top: 28px;
    margin-bottom: 14px;
    line-height: 1.35;
    color: #0f172a;
}

.legal-content h2 {
    font-size: clamp(24px, 2.6vw, 30px);
}

.legal-content h3 {
    font-size: clamp(18px, 2vw, 22px);
}

.legal-content p,
.legal-content li {
    margin: 0 0 14px;
    font-size: 16px;
    color: #1f2937;
    word-break: break-word;
}

.legal-content ul,
.legal-content ol {
    margin: 0 0 18px 24px;
    padding: 0;
}

.legal-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
}

.table-wrap {
    overflow-x: auto;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: #fff;
}

.legal-content th,
.legal-content td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    vertical-align: top;
    text-align: left;
    min-width: 120px;
}

.legal-content tr:last-child td {
    border-bottom: none;
}

.legal-content th:last-child,
.legal-content td:last-child {
    border-right: none;
}

.legal-content th {
    background: #f3f4f6;
    font-weight: 700;
}

.related-card {
    position: sticky;
    top: 104px;
    padding: 24px;
}

.related-links {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.related-links a {
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(243, 244, 246, 0.9);
    color: #1f2937;
}

.related-links a.current {
    background: var(--accent-soft);
    color: #065f46;
}

.page-footer {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.certificate-page-card {
    padding: 28px;
}

.certificate-block {
    display: grid;
    gap: 18px;
    padding-bottom: 32px;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--border);
}

.certificate-block-last {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.certificate-copy h2 {
    margin: 14px 0 10px;
    font-size: clamp(24px, 2.8vw, 32px);
    line-height: 1.25;
}

.certificate-copy p {
    margin: 0;
    color: var(--muted);
}

.certificate-meta {
    margin-top: 8px !important;
    line-height: 1.8;
}

.certificate-figure {
    margin: 0;
    padding: 18px;
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(249, 250, 251, 0.96) 100%);
    border: 1px solid rgba(229, 231, 235, 0.95);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.certificate-figure-horizontal {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    min-height: clamp(760px, 86vw, 980px);
    overflow: hidden;
}

.certificate-figure img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 16px;
}

.certificate-figure-horizontal img {
    width: auto;
    max-width: none;
    height: 100%;
    max-height: 920px;
    transform: rotate(90deg);
    transform-origin: center;
    object-fit: contain;
}

.pager {
    justify-content: space-between;
}

.footer-note {
    margin-top: 16px;
    color: #6b7280;
    font-size: 14px;
}

.legal-site-footer {
    border-top: 1px solid rgba(229, 231, 235, 0.9);
    background: rgba(255, 255, 255, 0.86);
}

.legal-footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 24px 0 36px;
    color: #6b7280;
    font-size: 14px;
}

@media (max-width: 1024px) {
    .grid-list,
    .legal-layout {
        grid-template-columns: 1fr;
    }

    .related-card {
        position: static;
    }
}

@media (max-width: 720px) {
    body:not(.legal-directory-page) {
        background: #ffffff;
    }

    .legal-header-inner,
    .legal-main,
    .legal-footer-inner {
        width: min(var(--max-width), calc(100% - 20px));
    }

    .legal-main {
        padding-top: 24px;
        padding-bottom: 40px;
    }

    .hero-card,
    .legal-card,
    .related-card,
    .directory-card {
        border-radius: 22px;
    }

    .hero-card,
    .legal-card,
    .related-card {
        padding: 22px;
    }

    .hero-language-note {
        display: flex;
        width: 100%;
        font-size: 13px;
    }

    .certificate-page-card,
    .certificate-figure {
        padding: 16px;
    }

    body:not(.legal-directory-page) .legal-site-header,
    body:not(.legal-directory-page) .legal-site-footer,
    body:not(.legal-directory-page) .hero-kicker,
    body:not(.legal-directory-page) .hero-language-note,
    body:not(.legal-directory-page) .back-link,
    body:not(.legal-directory-page) .related-card,
    body:not(.legal-directory-page) .section-kicker {
        display: none;
    }

    body:not(.legal-directory-page) .legal-main,
    body:not(.legal-directory-page) .hero-card,
    body:not(.legal-directory-page) .legal-card,
    body:not(.legal-directory-page) .certificate-page-card,
    body:not(.legal-directory-page) .certificate-figure,
    body:not(.legal-directory-page) .certificate-block {
        width: min(100%, calc(100% - 24px));
        margin-left: auto;
        margin-right: auto;
        padding: 0;
        background: transparent;
        border: none;
        border-radius: 0;
        box-shadow: none;
    }

    body:not(.legal-directory-page) .legal-main {
        width: calc(100% - 24px);
        padding-top: 12px;
        padding-bottom: 16px;
    }

    body:not(.legal-directory-page) .hero-card {
        display: flex;
        flex-direction: column;
        margin-bottom: 8px;
    }

    body:not(.legal-directory-page) .hero-card h1,
    body:not(.legal-directory-page) .legal-title {
        margin: 0 0 6px;
        font-size: 26px;
        line-height: 1.2;
    }

    body:not(.legal-directory-page) .hero-subtitle,
    body:not(.legal-directory-page) .directory-description,
    body:not(.legal-directory-page) .legal-intro,
    body:not(.legal-directory-page) .legal-content p,
    body:not(.legal-directory-page) .legal-content li {
        font-size: 16px;
        line-height: 1.72;
    }

    body:not(.legal-directory-page) .hero-subtitle {
        color: #64748b;
        font-size: 14px;
        line-height: 1.6;
    }

    body:not(.legal-directory-page) .legal-content a,
    body:not(.legal-directory-page) .certificate-meta a {
        color: #1d4ed8;
        font-weight: 500;
        text-decoration: none;
    }

    body:not(.legal-directory-page) .legal-content a:hover,
    body:not(.legal-directory-page) .certificate-meta a:hover {
        color: #1e3a8a;
    }

    body:not(.legal-directory-page) .page-actions {
        order: 3;
        margin-top: 0;
        display: block;
    }

    body:not(.legal-directory-page) .page-actions .lang-switch {
        display: inline;
        min-height: 0;
        min-width: 0;
        padding: 0;
        border: none;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        color: #1d4ed8;
        font-size: 14px;
        font-weight: 500;
        line-height: 1.6;
        text-decoration: none;
    }

    body:not(.legal-directory-page) .page-actions .lang-switch::before {
        content: none;
    }

    body:not(.legal-directory-page) .page-meta {
        order: 2;
        display: block;
        margin-top: 4px;
        margin-bottom: 0;
    }

    body:not(.legal-directory-page) .meta-chip {
        display: block;
        min-height: 0;
        padding: 0;
        margin: 0 0 2px;
        background: transparent;
        border: none;
        border-radius: 0;
        color: #64748b;
        font-size: 12px;
        font-weight: 400;
        line-height: 1.45;
    }

    body:not(.legal-directory-page) .legal-layout {
        display: block;
    }

    body:not(.legal-directory-page) .legal-content h2,
    body:not(.legal-directory-page) .legal-content h3,
    body:not(.legal-directory-page) .legal-content h4 {
        margin-top: 16px;
        margin-bottom: 6px;
        line-height: 1.4;
    }

    body:not(.legal-directory-page) .legal-content h2 {
        font-size: 20px;
    }

    body:not(.legal-directory-page) .legal-content h3 {
        font-size: 18px;
    }

    body:not(.legal-directory-page) .legal-content h4 {
        font-size: 16px;
    }

    body:not(.legal-directory-page) .certificate-copy,
    body:not(.legal-directory-page) .certificate-block {
        gap: 6px;
    }

    body:not(.legal-directory-page) .certificate-block {
        margin-bottom: 10px;
        padding-bottom: 10px;
        border-bottom: none;
    }

    body:not(.legal-directory-page) .certificate-figure-horizontal,
    body:not(.legal-directory-page) .certificate-figure-horizontal img {
        min-height: 0;
        width: 100%;
        max-width: 100%;
        height: auto;
        max-height: none;
        transform: none;
    }

    body:not(.legal-directory-page) .certificate-figure {
        padding: 0;
    }

    body:not(.legal-directory-page) .certificate-figure img {
        border-radius: 0;
    }

    .certificate-figure-horizontal {
        padding: 4px;
        min-height: 460px;
    }

    .certificate-figure-horizontal img {
        height: auto;
        width: min(88vw, 500px);
        max-width: none;
        max-height: none;
        transform: rotate(90deg);
    }

    .legal-header-inner,
    .legal-footer-inner {
        padding: 12px 0;
        flex-direction: column;
        align-items: stretch;
    }

    .header-links,
    .footer-actions,
    .pager {
        width: 100%;
        justify-content: space-between;
    }

    .nav-pill,
    .cta-pill,
    .btn-primary-link {
        flex: 1 1 auto;
    }

    .directory-actions {
        width: 100%;
        align-items: flex-start;
    }

    .doc-language-hint {
        font-size: 12px;
    }

    .directory-date {
        font-size: 12px;
        min-height: 28px;
        padding: 0 10px;
    }

    .lang-switch {
        min-width: 0;
    }

    .lang-switch::before {
        margin-right: 6px;
        padding-right: 6px;
        font-size: 11px;
    }

    .legal-content p,
    .legal-content li {
        font-size: 15px;
    }

    .legal-content th,
    .legal-content td {
        min-width: 160px;
        padding: 12px 14px;
    }

    .certificate-block {
        padding-bottom: 24px;
        margin-bottom: 24px;
    }

}
