/* ============================================================
   Guotushi Navigator — China Territorial & Spatial Planning
   Directory site stylesheet. Pure CSS, no framework dependency.
   ============================================================ */

/* ===== Design tokens ===== */
:root {
    --ts-ink: #0b1020;
    --ts-ink-2: #1a2238;
    --ts-muted: #6b7390;
    --ts-line: #e7e9f2;
    --ts-bg: #f6f7fb;
    --ts-card: #ffffff;
    --ts-primary: #2b5cff;
    --ts-primary-2: #6a3cff;
    --ts-gold: #c9a96a;
    --ts-success: #1f9d63;
    --ts-grad: linear-gradient(135deg, #2b5cff 0%, #6a3cff 55%, #b14bff 100%);
    --ts-grad-soft: linear-gradient(135deg, #eef2ff 0%, #f4eefe 100%);
    --ts-shadow-sm: 0 2px 8px rgba(20, 30, 60, .06);
    --ts-shadow: 0 12px 40px rgba(20, 30, 60, .10);
    --ts-shadow-lg: 0 24px 70px rgba(20, 30, 60, .16);
    --ts-radius: 18px;
    --ts-radius-sm: 12px;
    --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-display: var(--font-sans);
}

/* ===== Reset & base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.65;
    color: var(--ts-ink);
    background: var(--ts-bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--ts-primary); text-decoration: none; }
a:hover { color: var(--ts-primary-2); }
ul, ol { list-style: none; }
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    letter-spacing: -.02em;
    line-height: 1.22;
    color: var(--ts-ink);
}
h1 { font-size: clamp(1.9rem, 4vw, 3rem); font-weight: 800; }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); font-weight: 800; }
h3 { font-size: 1.2rem; }
h5, h6 { font-size: 1rem; }
p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

/* ===== SVG icons ===== */
.icon {
    width: 1em; height: 1em;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    vertical-align: -.125em;
    flex: none;
}
.icon.ok { color: var(--ts-success); }

/* ===== Layout ===== */
.container {
    width: 100%;
    max-width: 1140px;
    margin-inline: auto;
    padding-inline: 1rem;
}
.row { display: grid; grid-template-columns: repeat(12, 1fr); gap: 1rem; }
.row.g-2 { gap: .6rem; }
.row.g-3 { gap: 1rem; }
.row.g-4 { gap: 1.5rem; }
.row.g-5 { gap: 2.4rem; }

.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-6 { grid-column: span 6; }
.col-12 { grid-column: span 12; }
.col-md-4, .col-md-6, .col-lg-3, .col-lg-4, .col-lg-6,
.col-lg-7, .col-lg-8, .col-lg-9 { grid-column: span 12; }

@media (min-width: 768px) {
    .col-md-4 { grid-column: span 4; }
    .col-md-6 { grid-column: span 6; }
}
@media (min-width: 992px) {
    .col-lg-3 { grid-column: span 3; }
    .col-lg-4 { grid-column: span 4; }
    .col-lg-6 { grid-column: span 6; }
    .col-lg-7 { grid-column: span 7; }
    .col-lg-8 { grid-column: span 8; }
    .col-lg-9 { grid-column: span 9; }
}

/* ===== Utilities (subset) ===== */
.text-center { text-align: center; }
.text-white { color: #fff; }
.text-gradient {
    background: var(--ts-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.text-muted-2 { color: var(--ts-muted); }
.fw-bold { font-weight: 700; }
.fw-semibold { font-weight: 600; }
.small { font-size: .875rem; }
.lead { font-size: 1.12rem; color: var(--ts-muted); }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: .25rem !important; }
.mb-2 { margin-bottom: .5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mt-1 { margin-top: .25rem !important; }
.mt-2 { margin-top: .5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 3rem !important; }
.pt-0 { padding-top: 0 !important; }
.mx-auto { margin-inline: auto; }
.w-100 { width: 100% !important; }
.h-100 { height: 100%; }
.d-flex { display: flex; }
.d-inline-flex { display: inline-flex; }
.flex-wrap { flex-wrap: wrap; }
.flex-column { flex-direction: column; }
.align-items-center { align-items: center; }
.align-items-start { align-items: flex-start; }
.justify-content-center { justify-content: center; }
.justify-content-between { justify-content: space-between; }
.gap-1 { gap: .25rem; }
.gap-2 { gap: .5rem; }
.gap-3 { gap: 1rem; }
.rounded-3 { border-radius: .8rem; }
.rounded-4 { border-radius: 1.1rem; }
.bg-white { background: #fff; }
.border { border: 1px solid var(--ts-line); }
.text-nowrap { white-space: nowrap; }

/* ===== Navbar ===== */
.ts-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    background: rgba(255, 255, 255, .85);
    border-bottom: 1px solid rgba(231, 233, 242, .8);
}
.nav-inner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem 1rem;
    padding-block: .55rem;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    font-weight: 700;
    color: var(--ts-ink);
}
.brand:hover { color: var(--ts-ink); }
.gs-logo {
    width: 38px; height: 38px;
    border-radius: 10px;
    background: var(--ts-grad);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: .88rem;
    font-weight: 800;
    letter-spacing: .04em;
    box-shadow: 0 6px 18px rgba(43, 92, 255, .35);
    flex: none;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-size: 1.02rem; font-weight: 800; color: var(--ts-ink); }
.ts-brand-sub { font-size: .74rem; font-weight: 600; color: var(--ts-ink-2); letter-spacing: .02em; }

.nav-toggle { display: none; }
.nav-burger {
    display: none;
    margin-left: auto;
    font-size: 1.7rem;
    color: var(--ts-ink);
    cursor: pointer;
    padding: .2rem .5rem;
    border-radius: 10px;
}
.nav-burger:hover { background: rgba(43, 92, 255, .06); }
.nav-menu {
    display: flex;
    align-items: center;
    gap: .1rem;
    margin-left: auto;
}
.nav-menu > a {
    padding: .45rem .7rem;
    border-radius: 10px;
    color: var(--ts-ink-2);
    font-weight: 500;
    font-size: .93rem;
    transition: all .2s ease;
    white-space: nowrap;
}
.nav-menu > a:hover { color: var(--ts-primary); background: rgba(43, 92, 255, .06); }
.nav-menu > a.active { color: var(--ts-primary); background: rgba(43, 92, 255, .08); }

@media (max-width: 991.98px) {
    .nav-burger { display: block; }
    .nav-menu {
        display: none;
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        padding-block: .6rem;
    }
    .nav-menu > a { padding: .65rem .8rem; }
    .nav-toggle:checked ~ .nav-menu { display: flex; }
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.4;
    padding: .7rem 1.5rem;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
}
.btn-grad {
    background: var(--ts-grad);
    color: #fff;
    box-shadow: 0 8px 22px rgba(43, 92, 255, .28);
}
.btn-grad:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 14px 32px rgba(43, 92, 255, .36); }
.btn-ghost {
    background: rgba(255, 255, 255, .7);
    color: var(--ts-ink);
    border: 1px solid var(--ts-line);
}
.btn-ghost:hover { background: #fff; border-color: var(--ts-primary); color: var(--ts-primary); transform: translateY(-2px); }
.btn-light { background: #fff; color: var(--ts-primary); }
.btn-light:hover { color: var(--ts-primary-2); transform: translateY(-2px); }
.btn-sm { padding: .42rem 1rem; font-size: .9rem; border-radius: 10px; }

/* ===== Hero ===== */
.gs-hero {
    position: relative;
    overflow: hidden;
    padding: 5.5rem 0 3.5rem;
    background:
        radial-gradient(1100px 600px at 80% -10%, rgba(106, 60, 255, .18), transparent 60%),
        radial-gradient(900px 500px at 10% 10%, rgba(43, 92, 255, .16), transparent 60%),
        linear-gradient(180deg, #fbfcff 0%, #f6f7fb 100%);
}
.gs-hero::after {
    content: "";
    position: absolute; inset: 0;
    background-image: radial-gradient(rgba(20, 30, 60, .05) 1px, transparent 1px);
    background-size: 22px 22px;
    mask-image: linear-gradient(180deg, #000 0%, transparent 70%);
    -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 70%);
    pointer-events: none;
}
.gs-hero > .container { position: relative; z-index: 2; }
.eyebrow {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .4rem .9rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .8);
    border: 1px solid var(--ts-line);
    color: var(--ts-ink-2);
    font-size: .85rem; font-weight: 500;
    box-shadow: var(--ts-shadow-sm);
}
.hero-stats { display: flex; flex-wrap: wrap; gap: .6rem 1.6rem; margin-top: 1.4rem; color: var(--ts-muted); font-size: .9rem; }
.hero-stats .icon { color: var(--ts-success); }

/* Category page hero (compact) */
.page-hero {
    position: relative;
    overflow: hidden;
    padding: 4.2rem 0 2.6rem;
    background:
        radial-gradient(900px 480px at 85% -10%, rgba(106, 60, 255, .15), transparent 60%),
        radial-gradient(760px 420px at 8% 10%, rgba(43, 92, 255, .14), transparent 60%),
        linear-gradient(180deg, #fbfcff 0%, #f6f7fb 100%);
}
.page-hero::after {
    content: "";
    position: absolute; inset: 0;
    background-image: radial-gradient(rgba(20, 30, 60, .05) 1px, transparent 1px);
    background-size: 22px 22px;
    mask-image: linear-gradient(180deg, #000 0%, transparent 70%);
    -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 70%);
    pointer-events: none;
}
.page-hero > .container { position: relative; z-index: 2; }
.page-hero h1 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
.page-hero .intro { color: var(--ts-muted); max-width: 50rem; margin-top: .9rem; }

.breadcrumb { display: flex; flex-wrap: wrap; gap: .45rem; font-size: .88rem; margin-bottom: 1rem; }
.breadcrumb a { color: var(--ts-muted); }
.breadcrumb .sep { color: var(--ts-muted); }
.breadcrumb .current { color: var(--ts-ink); font-weight: 600; }

/* ===== Sections ===== */
.section { padding: 3.6rem 0; }
.section-head { text-align: center; margin-bottom: 2.4rem; }
.section-eyebrow {
    color: var(--ts-primary);
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    font-size: .78rem;
    margin-bottom: .6rem;
}
.section-title { font-weight: 800; }
.section-sub { color: var(--ts-muted); margin-top: .6rem; }

/* ===== Featured banner (Guoturen) ===== */
.featured-banner {
    position: relative;
    overflow: hidden;
    border-radius: 1.3rem;
    padding: 2.6rem 2.2rem;
    background:
        radial-gradient(700px 320px at 90% -20%, rgba(106, 60, 255, .35), transparent 60%),
        linear-gradient(135deg, #101736 0%, #1a2238 60%, #232a52 100%);
    color: #eef1fb;
    box-shadow: var(--ts-shadow-lg);
}
.featured-banner::before {
    content: "";
    position: absolute; inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px);
    background-size: 22px 22px;
    pointer-events: none;
}
.featured-banner > * { position: relative; }
.feat-eyebrow {
    display: inline-flex; align-items: center; gap: .5rem;
    font-size: .76rem; font-weight: 700;
    letter-spacing: .14em; text-transform: uppercase;
    color: var(--ts-gold);
    margin-bottom: .8rem;
}
.featured-banner h2 { color: #fff; }
.featured-banner p { color: #b9c1e0; max-width: 40rem; }
.feat-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; align-items: center; }
@media (min-width: 992px) { .feat-grid { grid-template-columns: 7fr 5fr; } }
.feat-links { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.feat-link {
    display: flex; flex-direction: column; gap: .15rem;
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: .85rem;
    padding: .85rem 1rem;
    color: #fff;
    transition: all .2s ease;
}
.feat-link:hover {
    background: rgba(255, 255, 255, .14);
    border-color: rgba(255, 255, 255, .3);
    color: #fff;
    transform: translateY(-2px);
}
.feat-link .t { font-weight: 700; font-size: .95rem; display: flex; align-items: center; gap: .4rem; }
.feat-link .d { font-size: .78rem; color: #aab2d4; }

/* ===== Category cards ===== */
.cat-card {
    display: flex; flex-direction: column;
    background: var(--ts-card);
    border: 1px solid var(--ts-line);
    border-radius: var(--ts-radius);
    padding: 1.5rem;
    height: 100%;
    color: var(--ts-ink);
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.cat-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--ts-shadow);
    border-color: rgba(43, 92, 255, .25);
    color: var(--ts-ink);
}
.cat-card h5 { margin-bottom: .4rem; }
.cat-card p { color: var(--ts-muted); font-size: .9rem; }
.cat-card .count { margin-top: auto; padding-top: .8rem; font-size: .8rem; color: var(--ts-primary); font-weight: 600; }
.ts-icon {
    width: 52px; height: 52px;
    border-radius: 14px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.4rem;
    color: #fff;
    background: var(--ts-grad);
    box-shadow: 0 8px 20px rgba(43, 92, 255, .28);
    margin-bottom: 1rem;
}
.ts-icon.alt-1 { background: linear-gradient(135deg, #00c6ff, #0072ff); }
.ts-icon.alt-2 { background: linear-gradient(135deg, #ff9966, #ff5e62); }
.ts-icon.alt-3 { background: linear-gradient(135deg, #11998e, #38ef7d); }
.ts-icon.alt-4 { background: linear-gradient(135deg, #f7971e, #ffd200); }
.ts-icon.alt-5 { background: linear-gradient(135deg, #8e2de2, #4a00e0); }
.ts-icon.alt-6 { background: linear-gradient(135deg, #ee0979, #ff6a00); }

/* ===== Resource items ===== */
.res-list { display: flex; flex-direction: column; gap: .8rem; }
.res-item {
    display: flex; gap: 1.05rem;
    align-items: flex-start;
    background: #fff;
    border: 1px solid var(--ts-line);
    border-radius: var(--ts-radius-sm);
    padding: 1.05rem 1.2rem;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.res-item:hover {
    transform: translateY(-3px);
    box-shadow: var(--ts-shadow);
    border-color: rgba(43, 92, 255, .28);
}
.res-fav {
    width: 42px; height: 42px;
    border-radius: 11px;
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 800; font-size: .95rem;
    background: var(--ts-grad);
    box-shadow: 0 6px 16px rgba(43, 92, 255, .25);
    flex: none;
}
.res-fav.alt-1 { background: linear-gradient(135deg, #00c6ff, #0072ff); }
.res-fav.alt-2 { background: linear-gradient(135deg, #ff9966, #ff5e62); }
.res-fav.alt-3 { background: linear-gradient(135deg, #11998e, #38ef7d); }
.res-fav.alt-4 { background: linear-gradient(135deg, #f7971e, #ffd200); }
.res-fav.alt-5 { background: linear-gradient(135deg, #8e2de2, #4a00e0); }
.res-fav.alt-6 { background: linear-gradient(135deg, #ee0979, #ff6a00); }
.res-body { min-width: 0; }
.res-title-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .6rem; }
.res-name { font-weight: 700; color: var(--ts-ink); font-size: 1.02rem; }
.res-name:hover { color: var(--ts-primary); }
.res-domain { color: var(--ts-muted); font-size: .8rem; }
.res-desc { color: var(--ts-ink-2); font-size: .9rem; margin-top: .25rem; }
.res-tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .5rem; }
.tag {
    display: inline-block;
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .03em;
    text-transform: uppercase;
    padding: .18rem .55rem;
    border-radius: 999px;
    background: rgba(43, 92, 255, .08);
    color: var(--ts-primary);
}
.tag.tag-official { background: rgba(201, 169, 106, .15); color: #9a7b3f; }
.tag.tag-data { background: rgba(17, 153, 142, .1); color: #0e8c7f; }
.tag.tag-opensource { background: rgba(31, 157, 99, .12); color: var(--ts-success); }
.tag.tag-chinese { background: rgba(238, 9, 121, .08); color: #d40e68; }
.tag.tag-intl { background: rgba(106, 60, 255, .1); color: #6a3cff; }

/* ===== Featured resource hero (Chinese resources page) ===== */
.res-featured {
    display: grid; grid-template-columns: 1fr; gap: 1.8rem;
    background:
        radial-gradient(700px 320px at 90% -20%, rgba(106, 60, 255, .35), transparent 60%),
        linear-gradient(135deg, #101736 0%, #1a2238 60%, #232a52 100%);
    border-radius: 1.3rem;
    padding: 2.4rem 2rem;
    color: #eef1fb;
    box-shadow: var(--ts-shadow-lg);
}
@media (min-width: 992px) { .res-featured { grid-template-columns: 6fr 6fr; align-items: center; } }
.res-featured h2 { color: #fff; }
.res-featured p { color: #b9c1e0; }

/* ===== Further reading card ===== */
.further {
    display: flex; gap: 1rem; align-items: flex-start;
    background: var(--ts-grad-soft);
    border: 1px solid var(--ts-line);
    border-radius: var(--ts-radius);
    padding: 1.6rem 1.8rem;
}
.further .icon { color: var(--ts-primary); font-size: 1.6rem; margin-top: .15rem; }
.further a { font-weight: 600; }

/* ===== Info card ===== */
.soft-card {
    border-radius: 1.1rem;
    padding: 2.6rem 2rem;
    background: var(--ts-grad-soft);
    border: 1px solid var(--ts-line);
}

/* ===== Footer ===== */
.ts-footer {
    background: linear-gradient(180deg, #0b1020 0%, #141a30 100%);
    color: #e8ebf5;
    padding: 4rem 0 2rem;
    margin-top: 4rem;
}
.ts-footer h5 { color: #fff; font-weight: 700; font-size: 1rem; margin-bottom: 1.1rem; }
.ts-footer p { color: #d6dae8; }
.ts-footer a { color: #d6dae8; }
.ts-footer a:hover { color: #fff; }
.gs-footer-logo {
    width: 38px; height: 38px; border-radius: 10px;
    background: var(--ts-grad);
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff; font-size: .8rem; font-weight: 800;
}
.ts-footer .foot-link { color: #b8bedd; }
.ts-footer .foot-link:hover { color: #fff; }
.foot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem 1.5rem; padding-bottom: 2.2rem; }
@media (min-width: 992px) {
    .foot-grid { grid-template-columns: 5fr 3fr 4fr; }
}
.foot-bottom {
    display: flex; flex-direction: column;
    justify-content: space-between;
    align-items: center;
    gap: .5rem;
    border-top: 1px solid rgba(255, 255, 255, .12);
    padding-top: 1.4rem;
    font-size: .85rem;
    color: #9aa1b4;
    text-align: center;
}
@media (min-width: 768px) {
    .foot-bottom { flex-direction: row; text-align: left; }
}

/* ===== Animations ===== */
@keyframes gs-fade-up {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
.ts-reveal { animation: gs-fade-up .7s ease both; }
.ts-reveal.delay { animation-delay: .15s; }
@media (prefers-reduced-motion: reduce) {
    .ts-reveal { animation: none; }
}

/* ===== Check list (criteria / policy) ===== */
.check-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: .65rem;
}
.check-list li {
    display: flex;
    gap: .6rem;
    align-items: flex-start;
    color: var(--ts-muted);
    font-size: .95rem;
    line-height: 1.55;
}
.check-list .icon {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin-top: 2px;
    color: var(--ts-success);
}

/* ===== Responsive ===== */
@media (max-width: 991.98px) {
    .section { padding: 2.6rem 0; }
    .featured-banner { padding: 2rem 1.4rem; }
    .res-featured { padding: 1.9rem 1.4rem; }
}

@media (max-width: 575.98px) {
    .gs-hero { padding: 2.6rem 0 1.8rem; }
    .gs-hero h1 { font-size: 1.65rem; }
    .gs-hero .lead { font-size: .97rem; }
    .page-hero { padding: 2.6rem 0 1.6rem; }
    .page-hero h1 { font-size: 1.5rem; }
    .featured-banner { padding: 1.7rem 1.1rem; }
    .feat-links { grid-template-columns: 1fr; }
    .res-item { padding: .9rem .95rem; gap: .8rem; }
    .res-fav { width: 36px; height: 36px; font-size: .85rem; }
    .res-name { font-size: .96rem; }
    .res-desc { font-size: .85rem; }
    .cat-card { padding: 1.15rem; }
    .cat-card p { font-size: .82rem; }
    .ts-icon { width: 42px; height: 42px; font-size: 1.1rem; margin-bottom: .7rem; }
    .container { padding-inline: .9rem; }
    .nav-menu > a { font-size: 1rem; }
}
