/* ============ 战争雷霆载具数据库 · 本地资料库 ============ */
:root {
    --wt-navy: #123a63;
    --wt-navy-deep: #0d2847;
    --wt-red: #c93650;
    --wt-red-soft: #fff0f2;
    --wt-gold: #e8a72c;
    --wt-cream: #fffdf7;
    --wt-ink: #2e3038;
    --wt-soft: #666a78;
    --wt-line: #e8e0cd;
    --wt-card: rgba(255, 253, 247, .94);
    --wt-shadow: 0 8px 26px rgba(29, 42, 68, .10);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
    font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
    color: var(--wt-ink);
    min-height: 100vh;
    background: #fff6d8 url('/bg2.webp') center / cover fixed no-repeat;
    overflow-x: hidden;
}
body::before {
    content: '';
    position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background:
        radial-gradient(1000px 560px at 8% -10%, rgba(255, 231, 145, .42), transparent 60%),
        radial-gradient(760px 460px at 95% 4%, rgba(180, 211, 255, .30), transparent 62%),
        linear-gradient(180deg, rgba(255, 253, 245, .55), rgba(255, 248, 226, .70));
}
body::after {
    content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .45;
    background-image: radial-gradient(circle, rgba(255,255,255,.95) 1.5px, transparent 1.6px);
    background-size: 132px 132px;
}
@media (min-aspect-ratio: 1/1) {
    body { background-image: url('/bg1.webp'); background-position: center 32%; }
}
.wt-app { max-width: 1240px; margin: 0 auto; padding: 18px 20px 40px; }

/* ---------- 顶栏 ---------- */
.wt-top {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 16px 22px; border-radius: 16px;
    background: linear-gradient(125deg, var(--wt-navy-deep), var(--wt-navy));
    border: 1px solid rgba(255,255,255,.14);
    box-shadow: 0 12px 30px rgba(15, 40, 71, .20);
    color: #fff;
}
.wt-brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.wt-mark { width: 52px; height: 52px; border-radius: 12px; flex: 0 0 auto; box-shadow: 0 3px 12px rgba(0,0,0,.28); }
.wt-brand h1 { margin: 0 0 3px; font-size: clamp(17px, 2.3vw, 24px); letter-spacing: .3px; }
.wt-brand p { margin: 0; font-size: 12px; color: #cfdcf0; }
.wt-top-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.wt-stamp { font-size: 12px; color: #dbe6f5; white-space: nowrap; }
.wt-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 34px; padding: 6px 14px; border-radius: 9px;
    border: 1px solid rgba(255,255,255,.45); background: rgba(255,255,255,.12);
    color: #fff; font: inherit; font-size: 13px; text-decoration: none; cursor: pointer;
    transition: background .18s, transform .18s;
}
.wt-btn:hover { background: rgba(255,255,255,.22); }
.wt-btn:active { transform: translateY(1px); }
.wt-btn-ghost { background: transparent; }
.wt-btn-primary { background: var(--wt-red); border-color: var(--wt-red); }
.wt-btn-primary:hover { background: #b22d46; }
:where(a, button, input, select):focus-visible {
    outline: 3px solid var(--wt-gold); outline-offset: 2px;
}

/* ---------- 页签 ---------- */
.wt-tabs {
    display: flex; gap: 6px; margin: 16px 0; padding: 6px;
    background: var(--wt-card); border: 1px solid var(--wt-line); border-radius: 13px;
    box-shadow: var(--wt-shadow); overflow-x: auto;
}
.wt-tab {
    flex: 1 0 auto; min-width: 88px; padding: 10px 14px; border: 0; border-radius: 9px;
    background: transparent; color: var(--wt-soft); font: inherit; font-size: 14px; cursor: pointer;
    white-space: nowrap;
}
.wt-tab:hover { color: var(--wt-navy); background: #f3f5fb; }
.wt-tab.active { color: #fff; background: var(--wt-navy); font-weight: 600; }
.wt-panel { display: none; }
.wt-panel.active { display: block; }

/* ---------- 通用卡片 ---------- */
.wt-card {
    background: var(--wt-card); border: 1px solid var(--wt-line); border-radius: 14px;
    padding: 18px; box-shadow: var(--wt-shadow);
}
.wt-section-title { margin: 26px 0 12px; font-size: 17px; color: var(--wt-navy); }
.wt-loading { padding: 30px; text-align: center; color: var(--wt-soft); }
.wt-empty { margin: 40px auto; padding: 40px; max-width: 560px; text-align: center;
    background: var(--wt-card); border: 1px solid var(--wt-line); border-radius: 16px; }
.wt-empty h2 { margin-top: 0; }

/* ---------- 首页 ---------- */
.wt-hero {
    display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(240px, .8fr); gap: 20px;
    padding: 28px; border-radius: 18px; color: #fff;
    background: linear-gradient(125deg, #102f52 0%, #164b78 58%, #1d5d86 100%);
    border: 1px solid rgba(255,255,255,.14); box-shadow: 0 14px 34px rgba(15, 40, 71, .22);
}
.wt-badge { display: inline-block; padding: 4px 10px; border-radius: 20px; font-size: 11px; letter-spacing: 1.4px;
    background: rgba(255,255,255,.14); color: #ffd9a0; }
.wt-hero h2 { margin: 12px 0 8px; font-size: clamp(20px, 3vw, 29px); }
.wt-hero p { margin: 0; max-width: 620px; color: #d9e6f5; font-size: 14px; line-height: 1.75; }
.wt-hero-buttons { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.wt-hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-content: center; }
.wt-stat {
    padding: 14px 12px; border-radius: 12px; text-align: center;
    background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.16);
}
.wt-stat b { display: block; font-size: 22px; color: #ffd9a0; }
.wt-stat span { font-size: 12px; color: #dce7f5; }
.wt-feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 12px; }
.wt-feature {
    display: block; width: 100%; text-align: left; padding: 18px; cursor: pointer;
    background: var(--wt-card); border: 1px solid var(--wt-line); border-radius: 14px;
    box-shadow: var(--wt-shadow); color: inherit; font: inherit;
}
.wt-feature:hover { border-color: var(--wt-red); transform: translateY(-2px); }
.wt-feature .ico { font-size: 24px; }
.wt-feature h3 { margin: 10px 0 6px; font-size: 15px; color: var(--wt-navy); }
.wt-feature p { margin: 0; color: var(--wt-soft); font-size: 12.5px; line-height: 1.6; }
.wt-news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.wt-news-item {
    display: block; background: var(--wt-card); border: 1px solid var(--wt-line); border-radius: 13px;
    overflow: hidden; text-decoration: none; color: inherit; box-shadow: var(--wt-shadow);
}
.wt-news-item img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: #dfe6f1; }
.wt-news-item div { padding: 12px; }
.wt-news-item h4 { margin: 0 0 6px; font-size: 13.5px; line-height: 1.5; }
.wt-news-item small { color: var(--wt-soft); font-size: 11px; }

/* ---------- 筛选栏 ---------- */
.wt-toolbar {
    display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap;
    padding: 14px; margin-bottom: 12px; background: var(--wt-card);
    border: 1px solid var(--wt-line); border-radius: 13px; box-shadow: var(--wt-shadow);
}
.wt-field, .wt-search { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--wt-soft); }
.wt-search { flex: 1 1 230px; }
.wt-field select, .wt-search input {
    height: 36px; padding: 0 10px; border: 1px solid var(--wt-line); border-radius: 8px;
    background: #fff; color: var(--wt-ink); font: inherit; font-size: 13px; min-width: 128px;
}
.wt-search input { width: 100%; }
.wt-list-meta { display: flex; justify-content: space-between; gap: 10px; padding: 0 4px 8px;
    color: var(--wt-soft); font-size: 12px; flex-wrap: wrap; }

/* ---------- 载具表 ---------- */
.wt-table-wrap { background: var(--wt-card); border: 1px solid var(--wt-line); border-radius: 13px;
    box-shadow: var(--wt-shadow); overflow-x: auto; }
.wt-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 820px; }
.wt-table th, .wt-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--wt-line); }
.wt-table th { background: #f5f6fb; color: var(--wt-navy); font-size: 12px; white-space: nowrap; }
.wt-table tbody tr:hover { background: #f8faff; }
.wt-table .wt-vname { display: flex; align-items: center; gap: 10px; min-width: 190px; }
.wt-vicon { width: 56px; height: 32px; object-fit: contain; flex: 0 0 auto; background: #edf1f8; border-radius: 5px; }
.wt-vname button { border: 0; background: none; padding: 0; color: var(--wt-navy); cursor: pointer;
    font: inherit; font-weight: 600; text-align: left; }
.wt-vname button:hover { color: var(--wt-red); text-decoration: underline; }
.wt-vname small { display: block; color: var(--wt-soft); font-size: 11px; max-width: 220px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wt-linkish { border: 0; background: none; color: var(--wt-red); cursor: pointer; font: inherit; padding: 0; }
.wt-linkish:hover { text-decoration: underline; }
.wt-pill { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11px;
    background: #eef3fb; color: var(--wt-navy); }
.wt-pill.gold { background: #fff3d6; color: #8a5a00; }
.wt-pager { display: flex; justify-content: center; align-items: center; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
.wt-pager button { min-width: 34px; height: 34px; padding: 0 9px; border-radius: 8px; cursor: pointer;
    border: 1px solid var(--wt-line); background: var(--wt-card); color: var(--wt-ink); font: inherit; font-size: 12px; }
.wt-pager button.active { background: var(--wt-navy); color: #fff; border-color: var(--wt-navy); }
.wt-pager span { color: var(--wt-soft); font-size: 12px; }

/* ---------- 图表 ---------- */
.wt-chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.wt-chart-grid h3 { margin: 0 0 12px; font-size: 15px; color: var(--wt-navy); }
.wt-canvas { position: relative; height: 280px; }

/* ---------- 科技树 ---------- */
.wt-tree { display: flex; gap: 12px; overflow-x: auto; padding: 16px;
    background: var(--wt-card); border: 1px solid var(--wt-line); border-radius: 13px;
    box-shadow: var(--wt-shadow); min-height: 420px; }
.wt-era { flex: 0 0 168px; }
.wt-era-head { padding: 8px 10px; border-radius: 8px 8px 0 0; text-align: center;
    background: var(--wt-navy); color: #fff; font-weight: 600; font-size: 13px; }
.wt-era-body { display: flex; flex-direction: column; gap: 7px; padding: 8px;
    background: #f0f3fa; border-radius: 0 0 8px 8px; min-height: 360px; }
.wt-node { display: flex; flex-direction: column; justify-content: flex-end; min-height: 78px;
    padding: 7px 8px; border-radius: 7px; cursor: pointer; text-align: left; font: inherit;
    color: #fff; border: 1px solid rgba(255,255,255,.28);
    background: linear-gradient(to top, rgba(13,40,71,.96), rgba(19,58,99,.62)), var(--wt-navy);
    background-size: cover; background-position: center;
}
.wt-node:hover { border-color: var(--wt-red); }
.wt-node.premium { border-color: var(--wt-gold); box-shadow: inset 0 0 0 1px var(--wt-gold); }
.wt-node b { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wt-node small { font-size: 11px; color: #d4e2f4; }

/* ---------- 地图 ---------- */
.wt-map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 12px; }
.wt-map { background: var(--wt-card); border: 1px solid var(--wt-line); border-radius: 12px;
    overflow: hidden; cursor: pointer; padding: 0; font: inherit; color: inherit;
    text-align: left; box-shadow: var(--wt-shadow); }
.wt-map:hover { border-color: var(--wt-red); }
.wt-map img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: #dfe6f1; }
.wt-map div { padding: 9px 10px; }
.wt-map b { display: block; font-size: 13px; }
.wt-map small { color: var(--wt-soft); font-size: 11px; }

/* ---------- 更新 ---------- */
.wt-update { margin-bottom: 12px; background: var(--wt-card); border: 1px solid var(--wt-line);
    border-radius: 13px; padding: 16px; box-shadow: var(--wt-shadow); }
.wt-update-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.wt-update h3 { margin: 0 0 6px; font-size: 15px; color: var(--wt-navy); }
.wt-update p { margin: 4px 0; font-size: 13px; }
.wt-change { display: grid; grid-template-columns: 90px 160px 1fr 1fr 1fr; gap: 8px;
    padding: 8px 10px; border-top: 1px solid var(--wt-line); font-size: 12px; }
.wt-change:nth-child(even) { background: #f8f9fd; }
.wt-change span { overflow-wrap: anywhere; }

/* ---------- 抽屉 / 弹窗 ---------- */
.wt-overlay { position: fixed; inset: 0; z-index: 40; background: rgba(11, 21, 36, .5); }
.wt-drawer { position: fixed; z-index: 41; top: 0; right: 0; bottom: 0; width: min(520px, 94vw);
    overflow-y: auto; padding: 26px 22px 40px; background: var(--wt-cream);
    box-shadow: -8px 0 30px rgba(0,0,0,.22); }
.wt-drawer-close, .wt-modal-close { position: absolute; top: 10px; right: 12px; z-index: 2;
    width: 34px; height: 34px; border: 0; border-radius: 50%; cursor: pointer;
    background: rgba(255,255,255,.88); color: var(--wt-ink); font-size: 22px; line-height: 1; }
.wt-drawer h2 { margin: 0 40px 4px 0; font-size: 19px; color: var(--wt-navy); }
.wt-drawer h3 { margin: 22px 0 8px; font-size: 14px; color: var(--wt-navy); }
.wt-drawer .wt-desc { color: var(--wt-soft); font-size: 13px; }
.wt-detail-icon { width: 100%; max-width: 260px; height: auto; display: block; margin: 12px 0; }
.wt-kv { display: grid; grid-template-columns: 120px 1fr; gap: 6px 10px; font-size: 13px; }
.wt-kv dt { color: var(--wt-soft); }
.wt-kv dd { margin: 0; overflow-wrap: anywhere; }
.wt-modal { position: fixed; inset: 0; z-index: 45; display: flex; align-items: center; justify-content: center;
    padding: 20px; background: rgba(11, 21, 36, .58); }
.wt-modal-box { position: relative; width: min(880px, 100%); max-height: 88vh; overflow: auto;
    padding: 24px; background: var(--wt-cream); border-radius: 15px; box-shadow: 0 18px 50px rgba(0,0,0,.3); }
.wt-modal-box h2 { margin: 0 40px 16px 0; font-size: 18px; color: var(--wt-navy); }
.wt-modal-wide { width: min(1040px, 100%); }
.wt-map-full { display: block; max-width: 100%; margin: 0 auto; border-radius: 10px; }
.wt-cmp-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.wt-cmp-table th, .wt-cmp-table td { padding: 8px 10px; border-bottom: 1px solid var(--wt-line); text-align: left; }
.wt-cmp-table th { background: #f1f4fa; color: var(--wt-navy); }
.wt-foot { margin-top: 30px; padding: 18px; text-align: center; color: var(--wt-soft);
    font-size: 12px; line-height: 1.8; }
.wt-foot a { color: var(--wt-navy); }

/* ---------- 深色模式 ---------- */
@media (prefers-color-scheme: dark) {
    :root {
        --wt-cream: #1b1e29; --wt-card: rgba(29, 33, 46, .96); --wt-ink: #e9ebf3;
        --wt-soft: #aeb5c7; --wt-line: #363c50; --wt-shadow: 0 8px 26px rgba(0,0,0,.28);
    }
    body { background-color: #141620; }
    body::before { background: linear-gradient(180deg, rgba(20,22,32,.78), rgba(20,22,32,.86)); }
    .wt-tab:hover { background: #272c3d; color: #fff; }
    .wt-section-title, .wt-foot, .wt-card h3, .wt-feature h3 { color: #e9eef8; }
    .wt-hero { background: linear-gradient(125deg, #0c1e33, #15395c 60%, #1a4c6c); }
    .wt-field select, .wt-search input { background: #242939; color: var(--wt-ink); border-color: var(--wt-line); }
    .wt-table th, .wt-change:nth-child(even), .wt-cmp-table th { background: #242939; color: #d9e1f2; }
    .wt-table tbody tr:hover { background: #262b3c; }
    .wt-pill { background: #273550; color: #cfe0fa; }
    .wt-pill.gold { background: #4a3a17; color: #ffdc8e; }
    .wt-era-body { background: #242a3a; }
    .wt-pager button { background: var(--wt-card); color: var(--wt-ink); }
    .wt-drawer-close, .wt-modal-close { background: #30364a; color: #fff; }
}

@media (max-width: 720px) {
    .wt-app { padding: 12px 10px 30px; }
    .wt-top { padding: 13px; flex-wrap: wrap; }
    .wt-mark { width: 42px; height: 42px; }
    .wt-top-actions { width: 100%; justify-content: flex-start; }
    .wt-stamp { margin-right: auto; }
    .wt-hero { grid-template-columns: 1fr; padding: 20px; }
    .wt-tab { min-width: 76px; padding: 9px 10px; font-size: 13px; }
    .wt-canvas { height: 240px; }
    .wt-change { grid-template-columns: 1fr 1fr; }
    .wt-kv { grid-template-columns: 100px 1fr; }
    .wt-map-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
