/* 天赋面板：由内部区域各自滚动，避免与 .panel 默认 overflow 叠套 */
#panel-talent.panel.active {
    overflow: hidden;
    padding: 6px 10px max(6px, env(safe-area-inset-bottom, 0px));
    min-height: 0;
    box-sizing: border-box;
}

.talent-panel-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    max-height: 100%;
    box-sizing: border-box;
    padding: 0;
    background: radial-gradient(circle at 50% 12%, rgba(255, 183, 77, 0.08), rgba(7, 11, 18, 0.97) 55%);
    overflow: hidden;
}

.talent-fixed-header {
    flex: 0 0 auto;
    margin: 0 8px 8px;
    padding: 8px 10px 9px;
    border-radius: 10px;
    border: 1px solid rgba(129, 212, 250, 0.28);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, transparent 24%),
        linear-gradient(145deg, rgba(16, 22, 34, 0.98) 0%, rgba(8, 12, 18, 0.99) 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    z-index: 8;
}

.talent-fixed-header__loadout {
    padding-bottom: 8px;
    margin-bottom: 8px;
    border-bottom: 1px solid rgba(100, 130, 160, 0.2);
}

.talent-fixed-header__rowhead {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 4px 10px;
    margin-bottom: 6px;
}

.talent-fixed-header__title {
    font-size: 12px;
    font-weight: 800;
    color: rgba(129, 212, 250, 0.98);
    letter-spacing: 0.4px;
}

.talent-fixed-header__sub {
    font-size: 10px;
    color: rgba(144, 164, 184, 0.9);
    line-height: 1.35;
}

.talent-header-muted {
    font-size: 10px;
    color: rgba(144, 164, 184, 0.85);
    line-height: 1.4;
    white-space: nowrap;
}

.talent-loadout-slots--header {
    gap: 6px;
    margin-bottom: 6px;
}

.talent-loadout-slots--header .talent-loadout-cell {
    min-height: 44px;
    max-width: 64px;
}

.talent-loadout-slot--header {
    padding: 4px 2px 6px;
    border-radius: 8px;
}

.talent-loadout-pool-strip {
    display: flex;
    flex-wrap: nowrap;
    gap: 5px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
    margin: 0 -2px;
    scrollbar-width: thin;
}

.talent-loadout-pool-strip::-webkit-scrollbar {
    height: 3px;
}

.talent-loadout-pool-strip::-webkit-scrollbar-thumb {
    background: rgba(255, 183, 77, 0.35);
    border-radius: 3px;
}

.talent-loadout-pick--header {
    flex: 0 0 auto;
    aspect-ratio: auto;
    min-height: 28px;
    min-width: 52px;
    max-width: 88px;
    padding: 4px 7px;
    font-size: 9px;
    border-radius: 8px;
}

.talent-fixed-header__attrs .talent-fixed-header__title {
    margin-bottom: 5px;
    display: block;
}

.talent-fixed-header__chips {
    max-height: none;
    overflow: visible;
}

.talent-tab-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: flex-end;
    flex: 2 1 220px;
}

.talent-tab-row--tree {
    flex: none;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 5px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 2px 0 4px;
    margin: 0 -2px;
    scrollbar-width: thin;
}

.talent-tab-row--tree::-webkit-scrollbar {
    height: 4px;
}

.talent-tab-row--tree::-webkit-scrollbar-thumb {
    background: rgba(129, 212, 250, 0.35);
    border-radius: 4px;
}

.talent-tab {
    flex-shrink: 0;
    padding: 6px 11px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 8px;
    border: 1px solid rgba(129, 212, 250, 0.38);
    background: rgba(14, 18, 28, 0.95);
    color: #b3e5fc;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.talent-tab.is-active {
    border-color: rgba(77, 208, 225, 0.85);
    background: linear-gradient(180deg, rgba(20, 42, 48, 0.98), rgba(12, 28, 36, 0.99));
    color: #e0f7fa;
    box-shadow: 0 0 10px rgba(77, 208, 225, 0.22);
}

.talent-tab.is-locked {
    opacity: 0.42;
    cursor: not-allowed;
    pointer-events: none;
}

.talent-tree-title {
    font-size: 21px;
    font-weight: 800;
    color: #ffd180;
    letter-spacing: 1px;
    text-shadow: 0 0 8px rgba(255, 183, 77, 0.3);
}

.talent-tree-title--chrome {
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.6px;
    text-align: center;
    margin: 0 4px 2px;
    line-height: 1.25;
    color: #ffe082;
    text-shadow: 0 0 10px rgba(255, 213, 128, 0.25);
}

.talent-tree-host {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    margin: 0 8px 6px;
    border: 1px solid rgba(77, 208, 225, 0.22);
    border-radius: 12px;
    overflow: hidden;
    background:
        linear-gradient(165deg, rgba(18, 28, 38, 0.55) 0%, rgba(6, 10, 16, 0.92) 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 4px 18px rgba(0, 0, 0, 0.35);
}

.talent-tree-chrome {
    flex-shrink: 0;
    padding: 8px 10px 6px;
    border-bottom: 1px solid rgba(77, 208, 225, 0.18);
    background: linear-gradient(180deg, rgba(12, 22, 32, 0.95), rgba(8, 14, 22, 0.88));
}

.talent-tree-stage {
    position: relative;
    flex: 1 1 auto;
    min-height: 140px;
}

/* 旧版整块汇总区已拆为 .talent-fixed-header；保留选择器以免外置引用报错 */
.talent-summary-block {
    display: none;
}

.talent-summary-section + .talent-summary-section {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(100, 130, 160, 0.22);
}

.talent-summary-label {
    font-size: 11px;
    line-height: 1.35;
    color: rgba(129, 212, 250, 0.95);
    letter-spacing: 0.5px;
    margin-bottom: 5px;
    font-weight: 700;
}

.talent-summary-chips {
    margin-top: 0;
}

.talent-summary-muted {
    font-size: 11px;
    color: rgba(144, 164, 184, 0.88);
    line-height: 1.45;
}

.talent-summary-skills {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.talent-summary-skill-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.35;
}

.talent-summary-skill-name {
    font-size: 12px;
    font-weight: 700;
    color: #ffe082;
}

.talent-summary-skill-desc {
    font-size: 10px;
    color: rgba(200, 215, 230, 0.9);
    word-break: break-word;
}

.talent-tree-scroll {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    padding-bottom: 96px;
    overscroll-behavior: contain;
}

.talent-tree-canvas {
    position: relative;
    width: 100%;
    min-height: 1680px;
}

.talent-tree-lines {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.talent-tree-lines line {
    stroke: rgba(255, 214, 128, 0.5);
    stroke-width: 0.42;
}

.talent-tree-nodes {
    position: absolute;
    inset: 0;
}

.talent-node {
    position: absolute;
    transform: translate(-50%, -50%);
    width: 58px;
    height: 58px;
    border-radius: 8px;
    border: 1px solid rgba(255, 193, 93, 0.65);
    background: #141b28;
    color: #f5f7fa;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 4px;
    z-index: 2;
    box-shadow: inset 0 0 0 1px rgba(8, 12, 18, 0.9);
}

.talent-node.is-big {
    width: 76px;
    height: 76px;
    border-width: 2px;
    border-color: rgba(255, 167, 38, 0.98);
    background: #1a2233;
    box-shadow: 0 0 12px rgba(255, 152, 0, 0.22), inset 0 0 0 1px rgba(28, 18, 8, 0.85);
}

.talent-node.state-locked {
    background: #0f1521;
    border-color: rgba(102, 118, 138, 0.9);
    box-shadow: inset 0 0 0 1px rgba(8, 12, 18, 1);
}

.talent-node.state-locked .talent-node-name,
.talent-node.state-locked .talent-node-level {
    color: #8ea0b2;
}

.talent-node.state-can {
    background: #132434;
    border-color: #4caf50;
    box-shadow: 0 0 12px rgba(76, 175, 80, 0.45), inset 0 0 0 1px rgba(8, 18, 12, 0.95);
}

.talent-node.state-can .talent-node-name {
    color: #c8f7c5;
}

.talent-node.state-can .talent-node-level {
    color: #b9f6ca;
}

.talent-node.state-active {
    background: #2a1f13;
    border-color: #ffca6c;
    box-shadow: 0 0 12px rgba(255, 202, 108, 0.42), inset 0 0 0 1px rgba(44, 28, 8, 0.95);
}

.talent-node.state-active .talent-node-name {
    color: #ffe7b6;
}

.talent-node.state-active .talent-node-level {
    color: #ffd180;
}

.talent-node.is-selected {
    border-color: #81d4fa;
    box-shadow: 0 0 12px rgba(129, 212, 250, 0.45), inset 0 0 0 1px rgba(8, 18, 28, 1);
}

.talent-node-name {
    width: 100%;
    text-align: center;
    font-size: 9px;
    line-height: 1.15;
    color: #ffe0b2;
    font-weight: 700;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.talent-node.is-big .talent-node-name {
    font-size: 11px;
    font-weight: 800;
}

.talent-node-level {
    font-size: 11px;
    color: #b3e5fc;
    font-weight: 700;
}

.talent-node.is-big .talent-node-level {
    font-size: 12px;
    color: #ffe082;
}

.talent-corner-stats {
    position: absolute;
    left: 14px;
    bottom: 12px;
    z-index: 3;
    font-size: 14px;
    line-height: 1.5;
    color: #9ad9ff;
    text-shadow: 0 0 6px rgba(4, 10, 18, 0.7);
}

.talent-reset-btn {
    position: absolute;
    right: 12px;
    bottom: 12px;
    min-width: 108px;
    border: 1px solid rgba(255, 193, 93, 0.95);
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(28, 34, 46, 0.95), rgba(12, 16, 24, 0.95));
    color: #ffe0b2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 10px;
    z-index: 3;
}

.talent-reset-cost {
    font-size: 10px;
    color: #ffcc80;
    opacity: 0.95;
}

.talent-reset-text {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 1px;
}

.talent-node-popup {
    position: fixed;
    z-index: 420;
    max-width: min(288px, calc(100vw - 16px));
    box-sizing: border-box;
    pointer-events: none;
}

.talent-node-popup__panel {
    pointer-events: auto;
    position: relative;
    border: 1px solid rgba(129, 212, 250, 0.45);
    border-radius: 10px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, transparent 28%),
        linear-gradient(145deg, rgba(14, 22, 32, 0.98) 0%, rgba(6, 10, 16, 0.99) 100%);
    box-shadow:
        0 8px 28px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    padding: 8px 10px 10px;
}

.talent-node-popup__close {
    position: absolute;
    top: 4px;
    right: 4px;
    z-index: 2;
    width: 28px;
    height: 28px;
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 8px;
    background: rgba(8, 12, 20, 0.75);
    color: rgba(200, 215, 230, 0.95);
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.talent-node-popup__close:active {
    background: rgba(30, 40, 55, 0.9);
}

.talent-node-popup-card {
    border: none;
    border-radius: 0;
    background: transparent;
    padding: 0 22px 0 0;
    box-shadow: none;
}

.talent-detail-head--popup {
    margin-bottom: 6px;
    padding-right: 0;
}

.talent-node-detail-title--popup {
    padding-left: 0;
    text-align: left;
    font-size: 16px;
}

.talent-detail-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 7px;
}

.talent-node-detail-title {
    font-size: 18px;
    font-weight: 700;
    color: #ffd180;
    letter-spacing: 1px;
    text-align: center;
    flex: 1;
    padding-left: 28px;
}

.talent-detail-level-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid rgba(201, 162, 74, 0.42);
    background: rgba(7, 10, 16, 0.86);
    color: #e8d4a8;
    font-size: 12px;
    font-weight: 700;
    font-family: "Consolas", "Monaco", monospace;
}

.talent-node-detail-grid {
    display: grid;
    grid-template-columns: 64px 1fr;
    row-gap: 4px;
    column-gap: 8px;
    margin-bottom: 0;
}

.talent-detail-section {
    margin-bottom: 6px;
}

.talent-node-detail-label {
    font-size: 11px;
    line-height: 1.45;
    color: rgba(205, 214, 226, 0.92);
    letter-spacing: 1px;
}

.talent-node-detail-value {
    margin-top: 2px;
    font-size: 12px;
    line-height: 1.4;
    color: #d7e3ec;
    word-break: break-word;
}

.talent-node-detail-attr-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.talent-node-detail-attr-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid rgba(201, 162, 74, 0.36);
    background: rgba(7, 10, 16, 0.78);
    color: rgba(235, 241, 248, 0.9);
    font-size: 11px;
}

.talent-node-detail-lines {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.talent-node-detail-item {
    line-height: 1.45;
}

.talent-node-detail-req-lines {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.talent-node-detail-req-line {
    line-height: 1.45;
    color: #d7e3ec;
    font-size: 12px;
}

.talent-node-activate-btn {
    width: 100%;
    margin-top: 6px;
    border: 1px solid rgba(201, 162, 74, 0.46);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(54, 67, 90, 0.95), rgba(26, 34, 48, 0.95));
    color: #f0f5ff;
    font-size: 15px;
    font-weight: 700;
    padding: 7px 0;
}

.talent-node-activate-btn:disabled {
    border-color: rgba(96, 125, 139, 0.65);
    color: #90a4ae;
    background: rgba(25, 32, 44, 0.92);
}

.talent-active-skill-bar {
    position: absolute;
    right: 8px;
    bottom: 10px;
    left: auto;
    top: auto;
    /* 高于 .map-btn(50) 等侧键，避免第二个技能格被侧键命中层挡住 */
    z-index: 60;
    display: none;
    flex-direction: column-reverse;
    align-items: flex-end;
    justify-content: flex-start;
    gap: 6px;
    flex-wrap: nowrap;
    pointer-events: auto;
    max-width: min(120px, 28vw);
}

.talent-active-skill-btn {
    position: relative;
    box-sizing: border-box;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    min-width: 48px;
    padding: 4px;
    border: 1px solid rgba(255, 179, 71, 0.85);
    border-radius: 6px;
    background: rgba(16, 16, 26, 0.9);
    color: #fff3e0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.05;
    font-size: 10px;
    -webkit-tap-highlight-color: transparent;
    cursor: pointer;
    overflow: hidden;
}

.talent-active-skill-btn.is-cd {
    border-color: rgba(120, 144, 156, 0.9);
    color: #eceff1;
    cursor: default;
}

.talent-active-skill-name {
    font-weight: 700;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-all;
    max-height: 100%;
    font-size: 9px;
    letter-spacing: 0.02em;
}

.talent-active-skill-cd-face {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.58);
    border-radius: 5px;
    pointer-events: none;
}

.talent-active-skill-cd-num {
    font-size: 12px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: #eceff1;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}

.talent-loadout-hint {
    margin-bottom: 6px;
    font-size: 10px;
    line-height: 1.4;
}

.talent-loadout-slots {
    display: grid;
    grid-template-columns: repeat(var(--talent-loadout-n, 4), minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
    max-width: 100%;
}

.talent-loadout-cell {
    position: relative;
    aspect-ratio: 1;
    min-width: 0;
    min-height: 52px;
}

.talent-loadout-slot {
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 6px 4px 8px;
    border-radius: 10px;
    border: 1px solid rgba(129, 212, 250, 0.45);
    background: rgba(12, 18, 28, 0.95);
    color: #ffe082;
    font-size: 10px;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2);
}

.talent-loadout-slot.is-empty {
    color: rgba(144, 164, 184, 0.75);
    border-style: dashed;
    border-color: rgba(129, 212, 250, 0.28);
    background: rgba(10, 14, 22, 0.88);
}

.talent-loadout-slot-label {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    overflow: hidden;
    word-break: break-word;
    line-height: 1.2;
    max-width: 100%;
}

.talent-loadout-slot.is-selected {
    border-color: rgba(76, 175, 80, 0.95);
    box-shadow:
        0 0 10px rgba(76, 175, 80, 0.35),
        inset 0 0 0 1px rgba(76, 175, 80, 0.25);
}

.talent-loadout-slot-clear {
    position: absolute;
    top: 3px;
    right: 3px;
    z-index: 2;
    width: 22px;
    height: 22px;
    padding: 0;
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    line-height: 1;
    border-radius: 6px;
    border: 1px solid rgba(239, 154, 154, 0.65);
    background: rgba(28, 12, 12, 0.92);
    color: #ffcdd2;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

.talent-loadout-slot-clear:active {
    transform: scale(0.92);
}

.talent-loadout-pool {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
    gap: 6px;
}

.talent-loadout-pick {
    box-sizing: border-box;
    aspect-ratio: 1;
    min-height: 0;
    margin: 0;
    padding: 5px 4px;
    font-size: 9px;
    font-weight: 700;
    border-radius: 10px;
    border: 1px solid rgba(255, 183, 77, 0.5);
    background: rgba(28, 22, 14, 0.92);
    color: #ffe0b2;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.15;
    word-break: break-word;
    overflow: hidden;
    hyphens: auto;
}
