/* ====== 全局重置 ====== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box
}

/* ====== 色板 ====== */
:root {
    --bg: #0d1117;
    --card: #161b22;
    --border: #30363d;
    --text: #c9d1d9;
    --dim: #8b949e;
    --accent: #f0883e;
    --blue: #58a6ff;
    --green: #3fb950;
    --red: #f85149;
    --gold: #d29922
}

/* ====== 基础布局 ====== */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh
}

/* ====== 外层容器 ====== */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px
}

/* ====== 导航栏 ====== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px
}

/* ====== 导航栏标题 ====== */
.header h1 {
    font-size: 1.6rem;
    background: linear-gradient(135deg, var(--accent), var(--gold));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent
}

/* ====== 导航按钮区 ====== */
.header nav {
    display: flex;
    gap: 8px
}

/* ====== 导航按钮 ====== */
.nav-btn {
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: .9rem;
    transition: .2s
}

.nav-btn:hover {
    border-color: var(--accent);
    color: var(--accent)
}

.nav-btn.active {
    border-color: var(--accent);
    background: rgba(240, 136, 62, .15);
    color: var(--accent)
}

.nav-btn[disabled] {
    opacity: .4;
    cursor: default;
    pointer-events: none
}

/* ====== 卡片容器 ====== */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px
}

/* ====== 卡片标题 ====== */
.card-title {
    font-size: 1.2rem;
    margin-bottom: 16px;
    display: flex;
    align-items: baseline;
    gap: 8px
}

/* ====== 按钮系统 ====== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: .9rem;
    transition: .2s
}

.btn-primary {
    background: var(--accent);
    color: #fff
}

.btn-primary:hover {
    filter: brightness(1.1)
}

.btn-second {
    background: var(--border);
    color: var(--text)
}

.btn-second:hover {
    background: #3a404b
}

.btn-danger {
    background: var(--red);
    color: #fff
}

.btn-sm {
    padding: 4px 10px;
    font-size: .8rem
}

.btn-mid {
    padding: 6px 14px;
    font-size: .85rem
}

.btn:disabled {
    filter:brightness(0.5);
    cursor:not-allowed;
}

/* ====== 翻页 ====== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 0 8px
}
.pagination .pinfo {
    font-size: .85rem;
    color: var(--dim);
    min-width: 40px;
    text-align: center
}

/* ====== 表单控件 ====== */
input,
select {
    background: #0d1117;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px 12px;
    color: var(--text);
    font-size: .9rem;
    width: 100%
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--accent)
}

/* ====== 标签 ====== */
label {
    display: block;
    margin: 8px 0;
    color: var(--dim);
    font-size: .85rem
}

/* ====== 表单组 ====== */
.fg {
    margin-bottom: 12px
}

.fr {
    display: flex;
    align-items: flex-end;
    gap: 12px
}

.fr>* {
    flex: 1
}

/* ====== 布局工具类 ====== */
.mb {
    margin-bottom: 10px
}

.mt {
    margin-top: 10px
}

.mla {
    margin-left: auto
}

.gp {
    gap:10px
}

.gp20 {
    gap:20px
}

.text-center {
    text-align: center
}

.text-small {
    font-size: .85rem
}

.text-large {
    font-size: 1.5rem
}

.bold {
    font-weight: 700
}

.flex-between {
    display: flex;
    justify-content: space-between
}

.flex-center {
    display: flex;
    align-items: center;
}

.dim {
    color: var(--dim)
}

.accent {
    color: var(--accent)
}

.green {
    color: var(--green)
}

.red {
    color: var(--red)
}

.gold {
    color: var(--gold)
}

.blue {
    color: var(--blue)
}

/* ====== 网格布局 ====== */
.g2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px
}
/* ====== 语音提示 ====== */
.voice-tip{
    position:fixed;left:50%;bottom:90px;transform:translateX(-50%);
    background:rgba(0,0,0,.8);color:#fff;
    padding:8px 14px;border-radius:6px;
    font-size:13px;text-align:center;
    max-width:80%;z-index:99;
}

.voice-btn{
    display:flex;align-items:center;justify-content:center;
    position:fixed;right:18px;bottom:110px;z-index:99;
    width:64px;height:64px;border-radius:50%;
    border:none;background:rgba(0,0,0,.45);color:#fff;
    font-size:28px;cursor:pointer;
    box-shadow:0 4px 12px rgba(0,0,0,.3);-webkit-tap-highlight-color:transparent;
}
/* ====== 玩家卡片 ====== */
.pc {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: .2s
}

.pc:hover {
    border-color: var(--blue)
}

.pa {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--border)
}

.pap {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--border);
    color: var(--dim);
    font-size: 1.2rem
}

.s36 {
    width: 36px;
    height: 36px
}

.pns {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

/* ====== 比赛时间 ====== */
.match-time {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    flex-wrap: wrap
}

.match-progress {
    margin-top:12px;
    font-size:1.1rem;
    background:rgba(210,146,34,.15);
    padding:8px 20px;
    border-radius:20px
}

/* ====== 比赛桌 ====== */
.table {
    position: relative;
    padding: 40px 20px;
    background: linear-gradient(135deg, #1a3a1a, #0d2818);
    border-radius: 40px;
    min-height: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 3px solid #2d5a27
}

.table-lbl {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    font-weight: 700;
    color: rgba(255, 255, 255, .06);
    white-space: nowrap;
    letter-spacing: 6px;
    pointer-events: none
}

/* ====== 桌边站位 ====== */
.sr {
    display: flex;
    justify-content: space-between;
    width: 40%
}

.st {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 90px
}

.st .av {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid transparent;
    margin-bottom: 4px;
    background: var(--card);
    display: flex;
    align-items: center;
    justify-content: center;
    justify-self: center
}

.st .nm {
    font-size: .85rem;
    font-weight: 600
}

.st.pr .av {
    border-color: var(--blue)
}

.st.op .av {
    border-color: var(--red)
}

.st-top {
    margin-bottom: 30px
}

.st-bot {
    margin-top: 30px
}

.st-cen {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 60px;
    width: 100%
}

/* ====== 标签徽章 ====== */
.lb {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    font-weight: 700;
    font-size: .85rem;
    white-space: nowrap;
    background: rgba(240, 136, 62, .15);
    color: var(--accent);
    border: 1px solid rgba(240, 136, 62, .3)
}

.lb.gn {
    background: rgba(63, 185, 80, .15);
    color: var(--green);
    border-color: rgba(63, 185, 80, .3)
}

.lb.rd {
    background: rgba(248, 81, 73, .15);
    color: var(--red);
    border-color: rgba(248, 81, 73, .3)
}

.lb.gl {
    background: rgba(210, 146, 34, .15);
    color: var(--gold);
    border-color: rgba(210, 146, 34, .3)
}

.lb.bl {
    background: rgba(88, 166, 255, .15);
    color: var(--blue);
    border-color: rgba(88, 166, 255, .3)
}

/* ====== A级下标 ===== */
.lb sub, .gold sub {
    font-size: .65em;
    vertical-align: sub;
    line-height: 1
}

/* ====== 队伍名称 ====== */
.team-name {
    color: var(--dim);
    font-weight: 400
}

.team-name-banker {
    font-weight: 700;
    color: var(--text)
}

/* ====== 庄家级别 ====== */
.banker-label {
    border-width: 3px !important
}

.tbl-lvl {
    font-weight: 700
}

.banker-label .tbl-lvl {
    font-weight: 900;
    font-size: 1.1em
}

/* ====== 最终冠军级别 ====== */
.winner-label {
    border-color: var(--gold) !important;
    border-width: 3px !important;
    background: rgba(210,146,34,.2) !important;
    box-shadow: 0 0 10px rgba(210,146,34,.5)
}

/* ====== 列表行 ====== */
.ri {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 4px;
    border-bottom: 1px solid var(--border);
    font-size: .9rem;
    cursor:pointer;
}

.ri:hover {
    background: rgba(240, 136, 62, .04)
}

.ri:last-child {
    border-bottom: none
}

/* ====== 排名圈圈 ====== */
.rk {
    display: inline-flex;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: .75rem
}

.r1 {
    background: var(--gold);
    color: #000
}

.r2 {
    background: #a0a0b0;
    color: #000
}

.r3 {
    background: #cd7f32;
    color: #fff
}

.r4 {
    background: #555;
    color: #aaa
}

/* ====== 对局记录-名次框 ====== */
.mr-rank {
    display: grid;
    grid-template-columns: 1fr 3fr 1fr 3fr 1fr 3fr 1fr 3fr;
    gap: 4px;
    align-items: center;
    font-size: .85rem;
    line-height: 2
}

/* ====== 对局记录-玩家名 ====== */
.pln {
    margin-right: 6px
}

/* ====== 对局记录-级别 ====== */
.t-lvl {
    font-size:.8rem;
    white-space:nowrap;
}

/* ====== 对局记录-统计卡片 ====== */
.sg {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px
}

.si {
    text-align: center;
    padding: 12px;
    border-radius: 10px;
    background: rgba(48, 54, 61, .3)
}

.sg-sub {
    background: rgba(48, 54, 61, .2);
    border-radius: 10px;
    padding: 12px
}

.card-subtitle {
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text)
}

.sv {
    font-size: 1.4rem;
    font-weight: 700
}

.sl {
    font-size: .8rem;
    color: var(--dim)
}

.pb {
    height: 8px;
    border-radius: 4px;
    background: rgba(48, 54, 61, .5);
    margin: 4px 0
}

.pf {
    height: 100%;
    border-radius: 4px;
    transition: width .3s
}

.pf.gd {
    background: var(--gold)
}

.pf.sv {
    background: #a0a0b0
}

.pf.cp {
    background: #cd7f32
}

.pf.gr {
    background: #555
}

.ps {
    padding:12px 0;
    border-bottom:1px solid var(--border)
}

.ps:last-child {
    border-bottom: none
}

/* ====== 空状态占位 ====== */
.empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--dim)
}

.empty i {
    font-size: 3rem;
    margin-bottom: 12px;
    opacity: .5
}

.au {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    background: var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px
}

.au img {
    width: 100%;
    height: 100%;
    object-fit: cover
}

.au input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer
}

.w100 {
    width: 100%
}

/* ====== 标签页切换 ====== */
.tab-nav {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    padding-bottom: 8px;
    overflow-x: auto
}

.tab-nav.match-tab {
    border-bottom: 1px solid var(--border);
    gap: 0
}

.tab-btn {
    background: none;
    color: var(--dim);
    border: none;
    padding: 8px 16px;
    cursor: pointer;
    font-size: .9rem;
    border-bottom: 2px solid transparent;
    transition: .2s;
    white-space: nowrap
}

.tab-btn:hover {
    color: var(--text)
}

.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent)
}

.chart-tab-content {
    display: flex;
    flex-direction: column;
    gap: 20px
}

.chart-section {
    background: rgba(48, 54, 61, .2);
    border-radius: 12px;
    padding: 16px
}

.chart-section canvas {
    max-width: 100%;
    max-height: 300px
}

/* ====== 排名表格 ====== */
.tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: .85rem
}

.tbl th {
    text-align: left;
    padding: 10px 8px;
    border-bottom: 2px solid var(--border);
    color: var(--dim);
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    user-select: none
}

.tbl th:hover {
    color: var(--accent)
}

.tbl th i {
    margin-left: 4px;
    font-size: .75rem
}

.tbl td {
    padding: 8px 8px;
    border-bottom: 1px solid rgba(48, 54, 61, .4)
}

.tbl tr:hover td {
    background: rgba(240, 136, 62, .04)
}

.tbl .num {
    text-align: right;
    font-variant-numeric: tabular-nums
}

.tbl .ctr {
    text-align: center
}

.tbl .rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: .75rem;
    font-weight: 700;
    background: var(--border)
}

.hide-mobile {
    display: table-cell
}

.tbl .rank-1 {
    background: var(--gold);
    color: #000
}

.tbl .rank-2 {
    background: rgba(168, 168, 188, .8);
    color: #000
}

.tbl .rank-3 {
    background: #cd7f32;
    color: #fff
}

.tbl .rank-n {
    background: rgba(48, 54, 61, .6);
    color: var(--dim)
}

/* ====== 能力风格图表 ====== */
.chart-wrap {
    margin: 0;
    padding: 8px 0
}

/* 对比选择器 */
.cmp-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 12px 0;
}

.cmp-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all .15s;
}

.cmp-item:hover {
    background: rgba(255,255,255,0.05)
}

.cmp-item.selected {
    border-color: #64c8ff;
    background: rgba(100,200,255,0.1)
}

.cmp-item .pa,
.cmp-item .pap {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--border);
}

/* 小按钮 */
.btn-sm {
    font-size: .78rem;
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: transparent;
    color: var(--dim);
    cursor: pointer;
    transition: all .15s;
}

.btn-sm:hover {
    border-color: #ffd700;
    color: #ffd700;
    background: rgba(255,215,0,0.08);
}

.card-title.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.style-layout {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center
}

.style-values {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-left: 20px;
    min-width: 80px
}

.sv-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px
}

.sv-label {
    color: var(--dim);
    font-size: .85rem
}

.sv-num {
    font-size: 1rem;
    font-weight: 700;
    color: #ffd700;
    min-width: 20px;
    text-align: right
}

/* ====== 模态框 ====== */
.mo {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, .6);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center
}

.md {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    max-width: 520px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto
}

.md h2 {
    margin-bottom: 16px;
    font-size: 1.3rem
}

/* ====== 响应式 ====== */
@media(max-width:768px) {
    .g2{
        grid-template-columns: 1fr
    }

    .header {
        flex-direction: column
    }

    .pns {
        flex-direction: column;
        align-items: left;
        gap: 0;
    }

    .tbl th,
    .tbl td {
        padding: 6px 4px;
        font-size: .8rem
    }

    .tbl .hide-mobile {
        display: none
    }

    .match-time {
        justify-content: center
    }

    .sr {
        width: 80%
    }
    .mr-rank {
        grid-template-columns: 1fr 3fr 1fr 3fr;
        flex: .88;
    }

    .style-layout {
        flex-direction: column
    }

    .style-values {
        margin: 0;
        flex-direction: row
}
