/* =========================================================
   TrustHarbor.app - App.css (Simplified, No CSS Variables)
   - No Bootstrap, no UI libs
   - Mobile-first, bilingual friendly (EN + 中文)
   - All values are explicit and easy to understand
   ========================================================= */

/* -----------------------------
   1) Base Reset / Defaults
   ----------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans", sans-serif;
    font-size: 16px;
    line-height: 1.55;
    color: #0B1220;
    background: #FFFFFF;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

html[lang="zh"], html[lang="zh-CN"] {
    line-height: 1.7;
}

img, svg, video, canvas {
    max-width: 100%;
    height: auto;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

p {
    margin: 0 0 16px;
}

h1, h2, h3, h4 {
    margin: 0 0 12px;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

h1 { font-size: 32px; }
h2 { font-size: 24px; }
h3 { font-size: 20px; }
h4 { font-size: 18px; }

small {
    font-size: 12px;
    color: #64748B;
}

hr {
    border: 0;
    border-top: 1px solid #E5E7EB;
    margin: 24px 0;
}

/* -----------------------------
   2) Layout Helpers
   ----------------------------- */
.th-container {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding-left: 24px;
    padding-right: 24px;
}

/* Reduce padding for medium mobile screens */
@media (min-width: 376px) and (max-width: 767px) {
    .th-container {
        padding-left: 20px;
        padding-right: 20px;
    }
}

.th-section {
    /*padding: 32px 0;*/

    padding: 32px 30px 32px 30px;

    .th-stack {
        display: grid;
        gap: 16px;
    }

    .th-row {
        display: flex;
        gap: 16px;
        align-items: center;
    }

    .th-wrap {
        flex-wrap: wrap;
    }

    .th-center {
        display: grid;
        place-items: center;
    }

    .th-spread {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
    }

    .th-hide-mobile {
        display: none;
    }

    @media (min-width: 768px) {
        .th-hide-mobile {
            display: initial;
        }
    }

    .th-hide-desktop {
        display: initial;
    }

    @media (min-width: 768px) {
        .th-hide-desktop {
            display: none;
        }
    }
    /* -----------------------------
   3) Surface / Card
   ----------------------------- */
    .th-card {
        background: #FFFFFF;
        border: 1px solid #E5E7EB;
        border-radius: 16px;
        box-shadow: 0 1px 2px rgba(0,0,0,0.06);
        padding: 24px;
    }

        .th-card.soft {
            background: #F7F8FA;
            border-color: #E5E7EB;
        }

    .th-divider {
        height: 1px;
        background: #E5E7EB;
        margin: 20px 0;
    }
    /* -----------------------------
   4) Buttons
   ----------------------------- */
    .th-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        height: 40px;
        padding: 0 16px;
        border-radius: 12px;
        border: 1px solid transparent;
        cursor: pointer;
        font-size: 14px;
        font-weight: 600;
        user-select: none;
        white-space: nowrap;
        transition: background 0.15s, color 0.15s;
    }

        .th-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

    .th-btn-primary {
        background: #1E3A5F;
        color: #fff;
    }

        .th-btn-primary:hover:not(:disabled) {
            background: #2A4A73;
        }

    .th-btn-secondary {
        background: #fff;
        color: #0B1220;
        border-color: #D6DCE5;
    }

        .th-btn-secondary:hover:not(:disabled) {
            background: #F7F8FA;
        }

    .th-btn-ghost {
        background: transparent;
        color: #0B1220;
        border-color: transparent;
    }

        .th-btn-ghost:hover:not(:disabled) {
            background: rgba(2, 6, 23, 0.05);
        }

    .th-btn-full {
        width: 100%;
    }
    /* -----------------------------
   5) Form Controls
   ----------------------------- */
    .th-label {
        display: block;
        font-size: 14px;
        font-weight: 600;
        margin-bottom: 8px;
    }

    .th-help {
        font-size: 12px;
        color: #64748B;
        margin-top: 8px;
    }

    .th-input,
    .th-select,
    .th-textarea {
        width: 100%;
        border: 1px solid #D6DCE5;
        border-radius: 12px;
        background: #fff;
        color: #0B1220;
        font-size: 16px;
        padding: 10px 12px;
        outline: none;
        transition: border-color 0.15s, box-shadow 0.15s;
    }

    .th-textarea {
        min-height: 120px;
        resize: vertical;
    }

        .th-input:focus,
        .th-select:focus,
        .th-textarea:focus {
            box-shadow: 0 0 0 3px rgba(46, 125, 255, 0.25);
            border-color: rgba(46, 125, 255, 0.65);
        }

    .th-invalid {
        border-color: rgba(180, 35, 24, 0.55) !important;
    }

    .th-error {
        color: #B42318;
        font-size: 12px;
        margin-top: 8px;
    }
    /* -----------------------------
   6) Typography utilities
   ----------------------------- */
    .th-muted {
        color: #64748B;
    }

    .th-text-2 {
        color: #334155;
    }

    .th-strong {
        font-weight: 700;
    }

    .th-hero-title {
        font-size: clamp(26px, 4vw, 40px);
        letter-spacing: -0.02em;
        margin: 0;
        margin-bottom: 12px;
        padding: 0;
    }

    .th-hero-subtitle {
        font-size: 18px;
        color: #334155;
        max-width: 58ch;
        margin: 0;
        padding: 0;
    }
    /* -----------------------------
   7) Navigation (NavMenu)
   ----------------------------- */
    .th-nav {
        position: sticky;
        top: 0;
        z-index: 50;
        background: rgba(255,255,255,0.95);
        backdrop-filter: saturate(180%) blur(10px);
        border-bottom: 1px solid #E5E7EB;
        height: 56px;
        display: flex;
        align-items: center;
        padding: 0 16px;
    }

    @media (min-width: 768px) {
        .th-nav {
            height: 64px;
            padding: 0 24px;
        }
    }

    .th-nav__icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border: none;
        background: transparent;
        cursor: pointer;
        padding: 0;
        border-radius: 8px;
    }

        .th-nav__icon:hover {
            background: rgba(0,0,0,0.05);
        }

    .th-burger {
        position: relative;
        width: 20px;
        height: 2px;
        background: #0B1220;
        display: block;
        transition: background 0.2s;
    }

        .th-burger::before,
        .th-burger::after {
            content: '';
            position: absolute;
            width: 20px;
            height: 2px;
            background: #0B1220;
            left: 0;
            transition: transform 0.2s;
        }

        .th-burger::before {
            top: -6px;
        }

        .th-burger::after {
            top: 6px;
        }

    .th-nav__logo {
        flex: 0 0 auto;
        margin-right: auto;
    }

    .th-brand {
        font-size: 18px;
        font-weight: 700;
        color: #1E3A5F;
    }

    .th-nav__links {
        display: flex;
        gap: 12px;
        align-items: center;
    }

    .th-nav__link {
        font-size: 14px;
        font-weight: 500;
        color: #334155;
        padding: 8px 12px;
        border-radius: 8px;
        transition: color 0.15s, background 0.15s;
    }

        .th-nav__link:hover {
            color: #1E3A5F;
            background: rgba(30, 58, 95, 0.05);
            text-decoration: none;
        }

        .th-nav__link.active {
            color: #1E3A5F;
            font-weight: 600;
        }

    .th-nav__cta {
        margin-left: 12px;
    }


   /* -----------------------------
   8) Mobile Drawer
   ----------------------------- */
    .th-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.4);
        z-index: 60;
        opacity: 0;
        transition: opacity 0.3s;
    }

        .th-overlay.open {
            display: block;
            opacity: 1;
        }

    .th-drawer {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(320px, 85vw);
        background: #FFFFFF;
        box-shadow: -4px 0 24px rgba(0,0,0,0.15);
        z-index: 70;
        transform: translateX(100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        display: flex;
        flex-direction: column;
    }

        .th-drawer.open {
            transform: translateX(0);
        }

    .th-drawer__top {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px;
        border-bottom: 1px solid #E5E7EB;
    }

    .th-drawer__title {
        font-size: 18px;
        font-weight: 600;
        color: #0B1220;
    }

    .th-drawer__links {
        flex: 1;
        padding: 16px;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .th-drawer__link {
        display: block;
        padding: 12px 16px;
        border-radius: 12px;
        color: #0B1220;
        font-size: 16px;
        transition: background 0.15s, color 0.15s;
    }

        .th-drawer__link:hover {
            background: #F7F8FA;
            text-decoration: none;
        }

        .th-drawer__link.active {
            background: rgba(30, 58, 95, 0.08);
            color: #1E3A5F;
            font-weight: 600;
        }

    .th-drawer__lang {
        margin-top: 24px;
        padding-top: 16px;
        border-top: 1px solid #E5E7EB;
    }

    .th-drawer__langLink {
        display: block;
        padding: 12px 16px;
        color: #64748B;
        font-size: 14px;
    }
    /* -----------------------------
   9) Self-Check Progress Bar
   ----------------------------- */
    .th-progress {
        width: 100%;
        height: 8px;
        background: #E5E7EB;
        border-radius: 999px;
        overflow: hidden;
    }

    .th-progress__bar {
        height: 100%;
        background: #1E3A5F;
        border-radius: 999px;
        transition: width 0.3s ease;
    }
    /* -----------------------------
   10) Question Panel
   ----------------------------- */
    .th-q {
        max-width: 640px;
        margin: 0 auto;
    }

    .th-q__title {
        font-size: 20px;
        font-weight: 600;
        color: #0B1220;
        margin-bottom: 24px;
        line-height: 1.4;
    }

    .th-q__actions {
        display: grid;
        gap: 12px;
        margin-bottom: 16px;
    }

    .th-q__btn {
        height: 48px;
        font-size: 16px;
    }
    /* -----------------------------
   11) Result Panel
   ----------------------------- */
    .th-result {
        max-width: 640px;
        margin: 0 auto;
    }

    .th-result__title {
        font-size: 24px;
        font-weight: 700;
        color: #0B1220;
        margin-bottom: 12px;
    }

    .th-result__desc {
        font-size: 16px;
        color: #334155;
        margin-bottom: 24px;
        line-height: 1.6;
    }

    .th-result__card {
        margin-top: 20px;
    }

    .th-result__meta {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 16px;
        padding-bottom: 12px;
        border-bottom: 1px solid #E5E7EB;
    }

    .th-result__list {
        list-style: none;
        padding: 0;
        margin: 0 0 20px;
    }

        .th-result__list li {
            padding-left: 24px;
            position: relative;
            margin-bottom: 12px;
            color: #334155;
            line-height: 1.6;
        }

            .th-result__list li::before {
                content: '•';
                position: absolute;
                left: 12px;
                color: #1E3A5F;
                font-weight: bold;
            }
    /* -----------------------------
   12) Page Main Layout
   ----------------------------- */
    .page-main {
        min-height: calc(100vh - 56px);
    }

    @media (min-width: 768px) {
        .page-main {
            min-height: calc(100vh - 64px);
        }
    }
    /* -----------------------------
   13) Accessibility
   ----------------------------- */
    :focus-visible {
        outline: none;
        box-shadow: 0 0 0 3px rgba(46, 125, 255, 0.25);
        border-radius: 8px;
    }

    @media (prefers-reduced-motion: reduce) {
        *,
        *::before,
        *::after {
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.01ms !important;
            scroll-behavior: auto !important;
        }
    }
    /* -----------------------------
   14) Utility Classes
   ----------------------------- */
    .th-bg-soft {
        background: #F7F8FA;
    }
    /* -----------------------------
   15) Content Pages Helpers
   ----------------------------- */
    .th-h2 {
        font-size: 18px;
        font-weight: 800;
        margin-bottom: 12px;
    }

    .th-text {
        color: #334155;
    }

    .th-grid-2 {
        display: grid;
        grid-template-columns: 1fr;
        gap: 14px;
    }

    @media (min-width: 768px) {
        .th-grid-2 {
            grid-template-columns: 1fr 1fr;
        }
    }

    .th-card__title {
        font-weight: 800;
        margin-bottom: 6px;
    }

    .th-card__body {
        color: #334155;
    }

    .th-actions {
        display: flex;
        gap: 12px;
        flex-wrap: wrap;
    }

    .th-list {
        margin: 0;
        padding-left: 18px;
        color: #334155;
    }

        .th-list li {
            margin-bottom: 8px;
        }
