/* ============================================================
 * 2.0 · 新页面公共样式（bp / trend / matrix）
 * 与站内 character.html 一致：浅灰底 + 白卡片 + 绿色主色
 * ============================================================ */

:root {
    --v2-accent: #667eea;
    --v2-accent2: #764ba2;
    --v2-ink: #2c3145;
    --v2-ink2: #5b6584;
    --v2-ink3: #9aa3bd;
    --v2-line: #e8ebf4;
    --v2-bg: #f6f7fb;
    --v2-gold: #d4a017;
    --v2-green: #2e9e6b;
    --v2-red: #d0516b;
}

* { box-sizing: border-box; }

body.v2page {
    margin: 0;
    font-family: Arial, 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    color: var(--v2-ink);
    padding: 20px 16px 60px;
    min-height: 100vh;
}

.v2wrap {
    max-width: 1180px;
    margin: 0 auto;
}

.v2top {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
    margin: 10px 0 18px;
    color: #333;
    position: relative;
}

.v2top .v2back {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #4CAF50;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s, transform .15s;
    flex: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, .2);
}

.v2top .v2back:hover { background: #45a049; transform: translateY(-50%) scale(1.05); }

.v2top h1 {
    margin: 0;
    font-size: 23px;
    font-weight: 700;
    letter-spacing: .5px;
    color: #333;
    text-shadow: none;
}

.v2top .v2sub {
    flex-basis: 100%;
    margin: 0;
    font-size: 12px;
    color: #6b7280;
    text-align: center;
    line-height: 1.5;
}

.v2card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .08);
    padding: 16px 18px;
    margin-bottom: 16px;
}

.v2card > h2 {
    margin: 0 0 6px;
    padding-left: 9px;
    border-left: 4px solid #4CAF50;
    font-size: 15px;
    font-weight: 700;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.4;
}

.v2card > .v2desc {
    margin: 0 0 14px;
    font-size: 12px;
    color: var(--v2-ink3);
    line-height: 1.6;
}

/* ---------- 筛选 chips ---------- */
.v2filter { display: flex; flex-direction: column; gap: 8px; }

.v2fline {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.v2flabel {
    font-size: 12px;
    color: var(--v2-ink3);
    width: 34px;
    flex: none;
}

.chip {
    border: 1px solid transparent;
    background: #e7e7e7;
    color: #333;
    font-size: 13px;
    padding: 5px 14px;
    border-radius: 20px;
    cursor: pointer;
    transition: all .15s;
    user-select: none;
    white-space: nowrap;
}

.chip:hover { background: #d5d5d5; }

.chip.on {
    background: #4CAF50;
    border-color: #4CAF50;
    color: #fff;
    box-shadow: 0 2px 6px rgba(76, 175, 80, .35);
}

.chip.sm { padding: 3px 10px; font-size: 12px; }

/* ---------- 表格 ---------- */
.v2table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    background: #fff;
}

.v2table th {
    text-align: center;
    font-weight: 600;
    font-size: 13px;
    color: #fff;
    background: #4CAF50;
    padding: 8px 10px;
    border: 1px solid #ddd;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 2;
}

.v2table td {
    padding: 7px 10px;
    border: 1px solid #e6e6e6;
    white-space: nowrap;
}

.v2table tbody tr:nth-child(even) { background: #f9f9f9; }
.v2table tbody tr:hover { background: #f1f1f1; }
.v2table .num { text-align: right; font-variant-numeric: tabular-nums; }

.v2scroll {
    overflow: auto;
    max-height: 74vh;
    border-radius: 5px;
    border: 1px solid #ddd;
}

/* ---------- 矩阵 ---------- */
.mx { border-collapse: separate; border-spacing: 0; font-size: 12px; }

.mx th, .mx td {
    border-right: 1px solid #fff;
    border-bottom: 1px solid #fff;
    padding: 6px 8px;
    text-align: center;
    white-space: nowrap;
}

.mxthead th {
    background: #4CAF50;
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 3;
    font-weight: 600;
}

.mxrowh {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #f0f5f1 !important;
    text-align: left !important;
    font-weight: 600;
    color: #2c3145;
}

.mx td.cell {
    cursor: pointer;
    transition: filter .12s;
    color: #2b3247;
}

.mx td.cell:hover { filter: brightness(.94); outline: 2px solid #4CAF50; outline-offset: -2px; }
.mx td.diag { background: #f4f5fa; color: #c3c9db; cursor: default; }

.mx .cell .rate { display: block; font-weight: 700; font-size: 13px; }
.mx .cell .rec { display: block; font-size: 10px; opacity: .72; }

/* ---------- 图表 ---------- */
.v2chart { width: 100%; position: relative; }
.v2chart svg { display: block; width: 100%; overflow: visible; }

.v2legend {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--v2-ink2);
    margin-top: 8px;
}

.v2legend i {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 3px;
    margin-right: 5px;
    vertical-align: -1px;
}

/* ---------- 空态 ---------- */
.v2empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--v2-ink3);
    font-size: 13px;
    line-height: 1.9;
}

.v2empty .big { font-size: 34px; display: block; margin-bottom: 8px; opacity: .7; }

.v2wip {
    background: #fbfbfe;
    border: 1px dashed #d9def0;
    border-radius: 12px;
    padding: 46px 20px;
    text-align: center;
    color: #8a92ab;
    font-size: 13px;
    line-height: 2;
}

.v2wip .big { font-size: 40px; display: block; margin-bottom: 10px; opacity: .55; }

.v2badge {
    display: inline-block;
    font-size: 11px;
    padding: 1px 8px;
    border-radius: 10px;
    background: #fff3d6;
    color: #96700f;
    border: 1px solid #f2dfae;
}

.v2badge.gray { background: #f1f2f7; color: #8a92ab; border-color: #e3e6f0; }

/* ---------- tab ---------- */
.v2tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.v2tab {
    padding: 8px 18px;
    border-radius: 6px;
    border: 1px solid #dfe3ea;
    background: #f1f1f1;
    color: #5b6584;
    font-size: 14px;
    cursor: pointer;
}

.v2tab:hover { background: #e7e7e7; }

.v2tab.on {
    background: #4CAF50;
    color: #fff;
    border-color: #4CAF50;
    box-shadow: 0 2px 6px rgba(76, 175, 80, .3);
}

.v2tab[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- 双列 ---------- */
.v2cols2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 860px) {
    .v2cols2 { grid-template-columns: 1fr; }
    .v2top h1 { font-size: 17px; }
    .v2top .v2sub { display: none; }
    body.v2page { padding: 14px 10px 40px; }
    .v2card { padding: 14px 12px; border-radius: 12px; }
}

/* ---------- 提示 ---------- */
.v2tip {
    position: fixed;
    pointer-events: none;
    background: rgba(30, 34, 54, .94);
    color: #fff;
    font-size: 12px;
    line-height: 1.55;
    padding: 7px 10px;
    border-radius: 7px;
    z-index: 5000;
    max-width: 260px;
    opacity: 0;
    transition: opacity .12s;
    white-space: pre-line;
}

.v2tip.on { opacity: 1; }

/* 竖向条形（队伍 BP 画像） */
.vbars { display: flex; flex-direction: column; gap: 6px; }

.vbar {
    display: grid;
    grid-template-columns: 92px 1fr 46px;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.vbar .name { color: var(--v2-ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.vbar .track {
    height: 16px;
    background: #f2f4fb;
    border-radius: 4px;
    overflow: hidden;
}

.vbar .fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, #66bb6a, #2e7d32);
}

.vbar .val { text-align: right; color: var(--v2-ink2); font-variant-numeric: tabular-nums; }

/* ---------- 截图按钮（与 character.html 同款；v2 页面用） ---------- */
.screenshot-btn {
    background: #4CAF50;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background .15s, transform .15s;
    flex: none;
}
.screenshot-btn:hover { background: #45a049; }
.screenshot-btn:active { transform: scale(.96); }

.v2top .screenshot-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}
.v2top .screenshot-btn:active { transform: translateY(-50%) scale(.96); }

@media (max-width: 860px) {
    .v2top { padding: 0 4px; }
    .v2top h1 { font-size: 18px; }
    .v2top .v2back { width: 34px; height: 34px; font-size: 16px; }
    .v2top .screenshot-btn {
        position: static;
        transform: none;
        margin: 2px auto 0;
        padding: 6px 14px;
        font-size: 13px;
    }
    .v2top .v2sub { display: block; }
}
