/* 注意：PoE2 调色板变量已统一迁移到 poe2-deep-shell.css 顶部（含 light/dark 两套）
   这里不再重复定义，避免覆盖导致两套 :root 冲突。 */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
}

.poe2-section-navbar {
    display: flex;
    justify-content: center;
    margin: 8px 0 18px;
}

/* ?? ???????????????? */
.hero-lang-toggle {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-top: 12px;
    background: var(--chip-bg);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 3px;
}

.hero-lang-btn {
    padding: 4px 14px;
    font-size: 13px;
    font-weight: 600;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: var(--chip-muted);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.hero-lang-btn:hover {
    color: var(--muted);
}

.hero-lang-btn--active,
.hero-lang-btn.active {
    background: var(--chip-bg-active);
    color: var(--brand);
}

.hero {
    margin-bottom: 20px;
}

.poe2-deep-view--home .hero {
    display: none;
}

.hero h1 {
    margin: 0 0 10px;
    font-size: 34px;
    color: var(--brand-2);
    letter-spacing: 1px;
}

.hero p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

/* 同 poe2-deep-shell.css：主容器背景透明，只留边框；详见那边的说明。
   两个文件都保留是为了避免加载顺序问题或单独引入 shell/deep 时行为不一致。 */
.panel {
    background: transparent;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 20px;
    box-shadow: none;
}

.input-panel {
    margin-bottom: 20px;
}

.input-panel textarea {
    width: 100%;
    min-height: 180px;
    resize: vertical;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--input-bg);
    color: var(--text);
    padding: 14px;
    font: inherit;
    line-height: 1.6;
}

.button-row {
    display: flex;
    gap: 12px;
    margin-top: 14px;
    flex-wrap: wrap;
}

button {
    appearance: none;
    border: 1px solid var(--brand);
    border-radius: 10px;
    padding: 10px 16px;
    font: inherit;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(180deg, var(--brand), var(--brand-2));
    cursor: pointer;
    transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px var(--accent-gold-tint-strong);
}

button.secondary {
    background: var(--panel-gradient);
    color: var(--text);
    border-color: var(--line);
}

/* ??????????????*/
.navbar .nav-btn {
    appearance: none;
    border: none;
    border-radius: var(--radius-sm);
    padding: 0;
    color: var(--text-primary);
    background: transparent;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
    transform: none;
}

.navbar .nav-btn:hover {
    transform: none;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
    background: var(--bg-tertiary);
}

.navbar .nav-btn:active {
    transform: none;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.08);
}

.navbar .lang-toggle {
    width: auto;
    min-width: 36px;
    padding: 0 var(--spacing-sm);
}

.hint {
    margin-top: 10px;
    color: var(--muted);
    font-size: 13px;
}

.error-box {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 10px;
    background: var(--danger-bg);
    border: 1px solid var(--danger-border);
    color: var(--danger-text);
}

.section-title {
    margin: 0 0 14px;
    font-size: 18px;
    color: var(--brand-2);
    letter-spacing: 0.5px;
}

.summary-grid,
.double-grid,
.triple-grid {
    display: grid;
    gap: 14px;
}

.banner-top-bar {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.banner-top-bar .summary-grid {
    flex: 1;
    min-width: 0;
}

.summary-grid {
    grid-template-columns: 1fr;
}

.double-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 20px;
}

.triple-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.summary-card,
.entity-card {
    background: var(--card-bg);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px;
}

.summary-label {
    color: var(--muted);
    font-size: 13px;
    margin-bottom: 8px;
}

.summary-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--brand);
    word-break: break-word;
}

.wegame-char-shell {
    margin-bottom: 10px;
}

.wegame-char-banner {
    padding: 14px 18px;
    border-radius: 18px;
    background: transparent;
    border: 0;
    box-shadow: none;
}

.snapshot-warning-box {
    margin-top: 14px;
    border-radius: 14px;
    background: var(--color-warning-bg);
    border: 1px solid var(--color-warning-border);
    color: var(--color-warning);
}

.snapshot-warning-details {
    padding: 0;
}

.snapshot-warning-toggle {
    font-weight: 700;
    color: var(--color-warning);
    cursor: pointer;
    padding: 12px 16px;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
}

.snapshot-warning-toggle::-webkit-details-marker {
    display: none;
}

.snapshot-warning-toggle::before {
    content: ">";
    display: inline-block;
    transition: transform 0.2s;
    font-size: 12px;
}

.snapshot-warning-details[open] > .snapshot-warning-toggle::before {
    transform: rotate(90deg);
}

.snapshot-warning-count {
    font-weight: 400;
    color: var(--muted);
    font-size: 13px;
}

.snapshot-warning-body {
    padding: 0 16px 14px;
}

.snapshot-warning-header {
    font-weight: 700;
    color: var(--color-warning);
    margin-bottom: 10px;
}

.snapshot-warning-section + .snapshot-warning-section {
    margin-top: 12px;
}

.snapshot-warning-title {
    color: var(--brand-2);
    font-size: 13px;
    margin-bottom: 6px;
}

.snapshot-warning-list {
    display: grid;
    gap: 6px;
}

.snapshot-warning-item {
    padding: 8px 10px;
    border-radius: 10px;
    background: var(--card-bg-solid);
    border: 1px solid var(--color-warning-border);
    color: var(--text);
    line-height: 1.6;
    word-break: break-word;
}

/* ===== Build Info Panel (banner ?? PoB ???? ===== */

.build-info-panel {
    width: 260px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.build-info-panel:empty {
    display: none;
}

.banner-summary-meta-slot {
    margin-top: 12px;
}

.banner-summary-meta-slot:empty {
    display: none;
}

.build-info-card {
    padding: 10px 14px;
    border-radius: 16px;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.build-info-card h3 {
    margin: 0 0 12px;
    color: var(--brand-2);
    font-size: 14px;
    letter-spacing: 0.5px;
    padding-bottom: 8px;
    border-bottom: 0;
}

.build-info-stats-row {
    display: flex;
    gap: 12px;
}

.build-info-stat {
    flex: 1;
    text-align: center;
    padding: 10px 6px;
    border-radius: 10px;
    background: transparent;
    border: 0;
}

.build-info-stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--brand);
}

.build-info-stat-label {
    margin-top: 4px;
    font-size: 11px;
    color: var(--muted);
}

.build-info-nodes {
    margin-top: 14px;
}

.build-info-nodes-label {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 6px;
}

.build-info-card .with-detail {
    cursor: help;
    text-decoration: underline dotted rgba(185, 173, 133, 0.4);
}

.build-info-stats-row--wrap {
    flex-wrap: wrap;
}

.build-info-card--stats {
    grid-column: 1 / -1;
}

/* ?? ???????? ?? */
.build-info-card--unified {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 8px 12px;
}

.summary-layout--d {
    gap: 8px;
    padding: 2px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.summary-layout--meta {
    padding: 8px 12px;
    border: 0;
    border-radius: 16px;
    background: transparent;
    box-shadow: none;
}

.summary-minimal-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.summary-minimal-row + .summary-minimal-row {
    margin-top: 4px;
}

.summary-minimal-item {
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 2px 0;
}

.summary-minimal-label {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.2;
    white-space: nowrap;
}

.summary-minimal-value {
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    word-break: break-word;
}

.summary-tone--fire .summary-minimal-value {
    color: #df897d;
}

.summary-tone--cold .summary-minimal-value {
    color: #88bde8;
}

.summary-tone--lightning .summary-minimal-value {
    color: #d9c06d;
}

.summary-tone--chaos .summary-minimal-value {
    color: #b497cc;
}

.summary-tone--move .summary-minimal-value {
    color: #7fbfb6;
}

.summary-tone--str .summary-minimal-value {
    color: #d19688;
}

.summary-tone--dex .summary-minimal-value {
    color: #8dbd8d;
}

.summary-tone--int .summary-minimal-value {
    color: #8cadcf;
}

.summary-layout--d .sr-divider {
    display: none;
}

.sr-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 13px;
    line-height: 1.4;
    min-height: 26px;
}

.sr-label {
    color: var(--muted);
    flex-shrink: 0;
    white-space: nowrap;
}

.sr-value {
    color: var(--text);
    text-align: right;
    font-weight: 500;
}

.sr-value--quest {
    color: var(--text);
    text-align: left;
    font-size: 12px;
    font-weight: 400;
}

.sr-row--quest {
    justify-content: flex-start;
}

.sr-divider {
    display: none;
}

.sr-divider--thin {
    display: none;
}

.sr-quest-pob-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.sr-quest-pob-row .quest-stats-list {
    flex: 1 1 auto;
    min-width: 0;
}

.sr-quest-pob-row .quest-stats-details {
    flex-shrink: 0;
}

.sr-quest-pob-row .quest-stats-summary {
    padding: 2px 0;
}

.sr-quest-pob-row .sr-row--pob {
    min-width: 0;
    width: 260px;
    flex-shrink: 0;
    padding: 0;
    min-height: 0;
    margin-left: auto;
}

/* ?? PoB ?????? */
.sr-row--pob {
    gap: 10px;
    align-items: center;
}

.sr-pob-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sr-pob-input {
    flex: 1;
    min-width: 0;
    height: 28px;
    padding: 0 8px;
    background: var(--pob-input-bg);
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--muted);
    font-size: 11px;
    font-family: "Consolas", "SFMono-Regular", monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: default;
    outline: none;
}

.sr-pob-copy {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: var(--accent-gold-tint);
    border: 1px solid var(--accent-gold-tint-strong);
    border-radius: 6px;
    color: var(--brand);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.sr-pob-copy svg {
    width: 14px;
    height: 14px;
}

.sr-pob-copy:hover {
    background: var(--accent-gold-tint-strong);
    color: var(--brand-2);
}

.sr-pob-copy--done {
    background: rgba(100, 200, 100, 0.18) !important;
    border-color: rgba(100, 200, 100, 0.3) !important;
    color: #7ecf7a !important;
}

.sr-pob-copy--fail {
    background: rgba(220, 80, 80, 0.18) !important;
    border-color: rgba(220, 80, 80, 0.3) !important;
    color: #ff7a6e !important;
}

/* ?? ???????? ?? */
.season-build-level {
    font-size: 13px;
    font-weight: 700;
    color: var(--brand-2);
    text-align: center;
    padding-top: 6px;
}

.season-build-date {
    font-size: 11px;
    color: var(--muted);
    text-align: center;
    padding-bottom: 4px;
}

.build-info-card--quest {
    grid-column: 1 / -1;
}

.build-info-card--pob {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 14px 16px;
}

.build-info-card--pob .build-info-code {
    flex: 1;
    min-height: 80px;
    resize: none;
    font-size: 11px;
}

.build-info-hint {
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.build-info-error {
    margin-bottom: 10px;
    padding: 10px 12px;
    border: 1px solid var(--danger-border);
    border-radius: 10px;
    background: var(--danger-bg);
    color: var(--danger-text);
    font-size: 12px;
    line-height: 1.5;
    word-break: break-word;
}

.build-info-code {
    width: 100%;
    min-height: 128px;
    resize: vertical;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px 14px;
    background: var(--code-bg);
    color: var(--text);
    font: 12px/1.5 Consolas, "Courier New", monospace;
    box-sizing: border-box;
}

.build-info-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

.build-info-copy-btn {
    width: auto;
    min-width: 112px;
    padding: 10px 16px;
}

.quest-stat-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 4px 16px;
}

.quest-stat-item {
    font-size: 13px;
    /* 走主文字色：亮色黑 / 暗色白，和全站其它构筑属性保持一致 */
    color: var(--text);
    padding: 2px 0;
}

/* ?? ??????? */
.stat-groups {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-group-title {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    opacity: 0.85;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid currentColor;
    opacity: 0.6;
}

.stat-group-cells {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 5px;
}

/* ?? ???????? ?? */
.quest-stats-details {
    cursor: default;
}

.quest-stats-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    list-style: none;
    font-size: 13px;
    font-weight: 600;
    color: var(--brand-2);
    padding: 4px 0;
    user-select: none;
}

.quest-stats-details[open] .quest-stats-summary {
    padding-bottom: 4px;
    border-bottom: 0;
    margin-bottom: 2px;
}

.quest-stats-summary::-webkit-details-marker { display: none; }

.quest-stats-summary::before {
    content: ">";
    font-size: 10px;
    color: var(--muted);
    transition: transform 0.18s;
}

.quest-stats-details[open] .quest-stats-summary::before {
    transform: rotate(90deg);
}

.quest-stats-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 18px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--accent-gold-tint);
    border: 1px solid var(--accent-gold-tint-strong);
    font-size: 11px;
    font-weight: 700;
    color: var(--brand);
}

/* ?? ??stat-grid ???? ?? */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}

.stat-cell {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    border-radius: 10px;
    background: var(--card-bg-solid);
    border: 1px solid var(--line);
}

.stat-cell-label {
    font-size: 12px;
    color: var(--muted);
}

.stat-cell-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--brand);
}

/* ===== Equipment + Skill Side-by-Side Layout ===== */

.wg-panel.equip-skill-panel {
    padding: 0;
    overflow: visible;
    border: none;
    box-shadow: none;
    background: transparent;
    border-radius: 0;
}

.wg-panel.equip-skill-panel::before {
    display: none;
}

.equip-skill-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
}

.equip-skill-col {
    min-width: 0;
    width: 100%;
}

.equip-skill-col--equip {
    position: relative;
}

.equip-skill-col--skill {
    position: relative;
}

/* ===== Unified Section Title Bar ===== */

.bd-section-title-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 16px;
}

.bd-section-title-pill {
    min-width: 160px;
    text-align: center;
    padding: 10px 24px;
    border-radius: 999px;
    border: 1px solid var(--brand);
    background: linear-gradient(180deg, var(--brand), var(--brand-2));
    color: #ffffff;
    font-weight: 800;
    font-size: 15px;
    letter-spacing: 2px;
    box-shadow: var(--shadow-md);
}

.wegame-tree-section {
    margin-top: 4px;
}

.ornament {
    flex: 1;
    max-width: 220px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--brand), transparent);
    position: relative;
}

.ornament::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    background: var(--brand);
    box-shadow: 0 0 12px color-mix(in srgb, var(--brand) 50%, transparent);
}

.tree-stage-shell {
    min-width: 0;
}

.tree-stage-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    margin-bottom: 12px;
    padding: 0 6px;
}

.tree-stage-subtitle {
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.tree-stage-header h2 {
    margin: 4px 0 0;
    color: var(--brand-2);
    font-size: 24px;
}

.tree-stage-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tree-control-btn {
    padding: 9px 14px;
    font-size: 13px;
}

.tree-stage-frame {
    position: relative;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
}

.tree-stage-frame::before,
.tree-stage-frame::after {
    display: none;
}

.tree-stage-inner {
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
}

.wegame-tree-section .tree-stage-frame {
    background: var(--panel-strong);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-sizing: border-box;
    overflow: hidden;
}

.wegame-tree-section .tree-stage-inner {
    border-radius: inherit;
    overflow: hidden;
}

.wegame-tree-wrapper {
    position: relative;
    height: 720px;
    border-radius: 14px;
    overflow: hidden;
    background:
        radial-gradient(circle at center, rgba(51, 60, 80, 0.16), transparent 38%),
        #020203;
    border: 1px solid rgba(255,255,255,0.04);
}

.wegame-tree-wrapper::before,
.wegame-tree-wrapper::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.wegame-tree-wrapper::before {
    border: 2px solid rgba(50, 44, 36, 0.7);
    box-shadow:
        inset 0 0 38px rgba(0, 0, 0, 0.78),
        inset 0 0 0 1px rgba(190, 158, 90, 0.12);
    z-index: 2;
}

.wegame-tree-wrapper::after {
    background:
        radial-gradient(circle at center, transparent 56%, rgba(0, 0, 0, 0.16) 76%, rgba(0, 0, 0, 0.42) 100%);
    z-index: 2;
}

.wegame-tree-wrapper--caimogu {
    contain: layout paint;
    isolation: isolate;
    background: #000;
}

.wegame-tree-wrapper--caimogu::before,
.wegame-tree-wrapper--caimogu::after {
    display: none;
}

.wg-tree-wrapper {
    position: relative;
}

.wg-tree-wrapper canvas,
.wg-tree-wrapper iframe,
.wg-tree-wrapper .caimogu-tree-frame {
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

.wg-tree-wrapper iframe,
.wg-tree-wrapper .caimogu-tree-frame {
    border: 0;
    background: #000;
    contain: strict;
    transform: translateZ(0);
}

.content-panel {
    min-height: 100%;
}

/* ===== WeGame BD Section ===== */

.bd-section {
    margin-top: 28px;
}

.wg-panel {
    position: relative;
    padding: 20px;
    border-radius: 18px;
    background: var(--panel-gradient);
    border: 1px solid var(--line-bright);
    box-shadow: var(--deep-shadow);
    overflow: hidden;
}

.wg-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url("../wegame-local-assets/assets/p-bg-BTr7eRYQ.webp") center/cover no-repeat;
    opacity: 0.08;
    pointer-events: none;
}

[data-theme="dark"] .wg-panel::before {
    opacity: 0.15;
}

@media (max-width: 1024px) {
    .double-grid,
    .triple-grid {
        grid-template-columns: 1fr;
    }

    .build-info-panel {
        width: 220px;
    }

    .summary-minimal-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .wegame-tree-wrapper {
        height: 500px;
    }

    .tree-stage-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .equip-cont {
        flex-direction: column;
        align-items: flex-start;
        overflow-x: auto;
    }

    .equip-detail-box {
        width: 100%;
        min-width: 600px;
    }

    .skill-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .buff-box {
        width: 100%;
        min-width: 600px;
        height: auto;
        min-height: 300px;
    }

    .buff-item {
        width: 100%;
    }
}

@media (max-width: 720px) {
    .abm-tabs { flex-direction: column; }

    .page {
        width: min(100%, calc(100% - 20px));
        padding-top: 20px;
    }

    .hero h1 {
        font-size: 28px;
    }

    .bd-section-title-pill {
        min-width: 0;
        width: 100%;
        max-width: 200px;
        font-size: 13px;
        padding: 8px 18px;
    }

    .ornament {
        display: none;
    }

    .wegame-tree-wrapper {
        height: 360px;
    }

    .wegame-char-banner {
        padding: 12px 14px;
        border-radius: 16px;
    }

    .banner-top-bar {
        flex-direction: column;
        gap: 12px;
    }

    .banner-stats-toggle {
        width: 100%;
        justify-content: flex-start;
    }

    .sr-quest-pob-row .sr-row--pob {
        width: 100%;
        min-width: 0;
        flex: 1 1 100%;
    }

    .equip-detail-box,
    .buff-box {
        min-width: 100%;
    }

    .snapshot-warning-box {
        margin-top: 10px;
    }

    .build-info-panel {
        width: 100%;
    }

    .summary-minimal-row {
        grid-template-columns: 1fr;
    }

    .sr-quest-pob-row {
        flex-wrap: wrap;
    }

    .equip-msg-box {
        width: 100%;
        height: auto;
        min-height: 300px;
    }

    .buff-img-box {
        flex-wrap: wrap;
    }
}

@media (max-width: 520px) {
    .page {
        width: min(100%, calc(100% - 16px));
    }

    .wegame-char-banner {
        padding: 10px 12px;
    }

    .summary-minimal-row {
        gap: 8px;
    }

    .sr-minimal-item,
    .summary-minimal-item {
        padding: 8px 10px;
    }

    .wegame-tree-wrapper {
        height: 300px;
        border-radius: 12px;
    }

    .jewel-showcase {
        overflow-x: auto;
    }
}

/* ?? ???? ?? */
.debug-section {
    max-width: 1200px;
    margin: 16px auto 32px;
    padding: 0 16px;
}

.debug-toggle-btn {
    background: transparent;
    border: 1px solid #3d3020;
    color: #5a4a30;
    font-size: 12px;
    padding: 4px 14px;
    cursor: pointer;
    border-radius: 3px;
    letter-spacing: 0.05em;
    transition: color 0.15s, border-color 0.15s;
}

.debug-toggle-btn:hover {
    color: #7a6a4a;
    border-color: #5a4a30;
}

.debug-panel {
    background: #08070505;
    border: 1px solid #2a1e0e;
    border-radius: 4px;
    margin-top: 6px;
    overflow: hidden;
}

.debug-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-bottom: 1px solid #2a1e0e;
    background: #0e0b0840;
}

.debug-toolbar-hint {
    flex: 1;
    font-size: 11px;
    color: #4a3820;
}

.debug-toolbar button {
    font-size: 11px;
    padding: 2px 10px;
    background: transparent;
    border: 1px solid #3d3020;
    color: #7a6a4a;
    cursor: pointer;
    border-radius: 2px;
}

.debug-toolbar button:hover {
    background: #1a1008;
    color: #c8a96e;
}

.debug-log {
    font-family: "Consolas", "Courier New", monospace;
    font-size: 11px;
    line-height: 1.6;
    padding: 8px 10px;
    max-height: 320px;
    overflow-y: auto;
    color: #5a4a30;
    white-space: pre-wrap;
    word-break: break-all;
}

.debug-log .dl-info  { color: #6a8a5a; }
.debug-log .dl-warn  { color: #b89030; }
.debug-log .dl-error { color: #b84040; }
.debug-log .dl-data  { color: #5a7a9a; }

/* =============================================
   PoE Auth Panel
   ============================================= */
.poe-auth-panel {
    margin-bottom: 12px;
    min-height: 60px;
    padding: 12px 0;
}

.poe-auth-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.poe-auth-center {
    justify-content: center;
    gap: 12px;
}

.poe-auth-form-header {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
}

.poe-auth-form-icon {
    font-size: 26px;
    flex-shrink: 0;
    opacity: 0.85;
}

.poe-auth-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.poe-auth-desc {
    font-size: 12px;
    color: var(--text-tertiary);
    line-height: 1.5;
}

.poe-auth-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-left: auto;
}

/* ---- ?? ---- */
.poe-auth-btn {
    padding: 7px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
}

.poe-auth-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.poe-auth-btn-primary {
    background: var(--accent-blue, #3b82f6);
    color: #fff;
    font-weight: 700;
}

.poe-auth-btn-primary:hover:not(:disabled) {
    background: var(--accent-blue-hover, #2563eb);
}

.poe-auth-btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.poe-auth-btn-secondary:hover:not(:disabled) {
    background: var(--bg-secondary);
    border-color: var(--border-medium);
}

.poe-auth-btn-ghost {
    background: transparent;
    color: var(--text-tertiary);
    border: 1px solid var(--border-light);
}

.poe-auth-btn-ghost:hover:not(:disabled) {
    color: var(--text-primary);
    border-color: var(--border-medium);
}

.poe-btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

/* ---- ?????? ---- */
.poe-auth-login-form {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
}

.poe-login-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.poe-form-input {
    flex: 1;
    min-width: 140px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s;
}

.poe-form-input:focus {
    border-color: var(--accent-blue, #3b82f6);
}

.poe-login-error {
    font-size: 12px;
    color: var(--accent-red, #ef4444);
    padding: 4px 2px;
}

/* ---- ?????? ---- */
.poe-char-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.poe-char-panel-account {
    display: flex;
    align-items: center;
    gap: 8px;
}

.poe-account-icon {
    font-size: 18px;
    opacity: 0.8;
}

.poe-account-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.poe-account-count {
    font-size: 12px;
    color: var(--text-tertiary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: 20px;
    padding: 2px 9px;
}

.poe-char-panel-actions {
    display: flex;
    gap: 8px;
}

/* ---- ?????? ---- */
.poe-char-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 370px;
    overflow-y: auto;
    padding-right: 4px;
}

.poe-char-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    height: 80px;
    padding: 0 12px 0 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.poe-char-card:hover {
    border-color: var(--border-medium);
    background: var(--bg-tertiary);
}

.poe-char-card.selected {
    border-color: var(--accent-blue, #3b82f6);
    background: color-mix(in srgb, var(--accent-blue, #3b82f6) 8%, var(--bg-secondary));
}

.poe-char-portrait-wrap {
    flex-shrink: 0;
    width: 76px;
    height: 76px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-tertiary);
}

.poe-char-portrait {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.poe-char-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    padding: 8px 0;
}

.poe-char-header-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.poe-char-class-badge {
    font-size: 12px;
    letter-spacing: 0.02em;
    color: var(--text-primary);
    font-weight: 500;
}

.poe-char-level {
    font-size: 11px;
    color: var(--text-primary);
    font-weight: 500;
}

.poe-char-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-blue, #3b82f6);
    word-break: break-all;
    line-height: 1.3;
}

.poe-char-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.poe-char-league {
    font-size: 11px;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border-radius: 4px;
    padding: 1px 5px;
}

.poe-char-current-badge {
    font-size: 10px;
    /* 「当前」标签：紫色系（和信息流讨论按钮/构筑库紫色点缀一致），和绿色 league 标签拉开区分 */
    color: var(--accent-purple);
    background: color-mix(in srgb, var(--accent-purple) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent-purple) 35%, transparent);
    border-radius: 4px;
    padding: 1px 5px;
}

/* ---- ??????---- */
.poe-build-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-tertiary);
}

.poe-build-progress-inner {
    display: none;
}

/* ---- ?????? ---- */
.poe-char-loaded-bar {
    flex-wrap: nowrap;
}

.poe-loaded-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.poe-loaded-check {
    font-size: 18px;
    color: #6ecfbe;
    flex-shrink: 0;
}

.poe-loaded-desc {
    font-size: 14px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.poe-loaded-league {
    font-size: 12px;
    color: var(--muted);
    margin-left: 2px;
}

/* ---- ?? Spinner ---- */
.poe-auth-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-light);
    border-top-color: var(--accent-blue, #3b82f6);
    border-radius: 50%;
    animation: poeSpinnerRotate 0.8s linear infinite;
    flex-shrink: 0;
}

@keyframes poeSpinnerRotate {
    to { transform: rotate(360deg); }
}

.poe-auth-loading-text {
    font-size: 13px;
    color: var(--text-tertiary);
}

/* ---- Toast ?? ---- */
.poe-auth-toast {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 9999;
    padding: 11px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
    max-width: 360px;
}

.poe-auth-toast.poe-toast-visible {
    opacity: 1;
    transform: translateY(0);
}

.poe-auth-toast-success {
    background: rgba(20, 50, 35, 0.97);
    border: 1px solid rgba(80, 170, 120, 0.45);
    color: #7ee8a2;
}

.poe-auth-toast-error {
    background: rgba(50, 18, 18, 0.97);
    border: 1px solid rgba(200, 60, 60, 0.4);
    color: #ff8a8a;
}

/* ---- ?????? ---- */
.poe-scope-warn {
    flex-wrap: wrap;
    gap: 14px;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    padding: 14px 16px;
    background: var(--bg-tertiary);
}

.poe-scope-warn-icon {
    font-size: 26px;
    color: var(--text-tertiary);
    flex-shrink: 0;
}

/* ????????????????????????????????????????????????   Banner Stats Collapsible Toggle
   ????????????????????????????????????????????????*/

.banner-stats-toggle {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    margin-top: 12px;
    margin-bottom: 0;
    border: 0;
    background: transparent;
    color: var(--brand-2);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition: color 0.15s ease;
}

.banner-stats-toggle:hover {
    color: var(--brand-2);
}

.banner-stats-toggle.is-open {
    color: var(--brand-2);
    padding-bottom: 4px;
    border-bottom: 1px solid var(--divider-soft);
    margin-bottom: 2px;
}

.banner-stats-toggle-icon {
    display: inline-block;
    transition: transform 0.22s ease;
    font-size: 11px;
    line-height: 1;
    color: var(--muted);
}

.banner-stats-toggle.is-open .banner-stats-toggle-icon {
    transform: rotate(90deg);
}

.banner-stats-toggle-label {
    line-height: 1;
}

.banner-stats-toggle:focus-visible {
    outline: none;
}

/* Collapsible stats wrapper ??collapsed by default */
.banner-stats-wrap {
    overflow: visible;
    max-height: none;
    opacity: 1;
    margin-top: 12px;
    transition: max-height 0.32s ease, opacity 0.25s ease, margin-top 0.25s ease;
}

.banner-stats-wrap.is-open {
    max-height: 900px;
    opacity: 1;
    margin-top: 12px;
}

/* inline discussion and summary hero moved to poe2-deep-discussion.css / poe2-deep-library.css */

