* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #0d1b2a 0%, #1b263b 50%, #2c3e50 100%);
    min-height: 100vh;
    padding: 20px;
    color: #e0e0e0;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
}

h1 {
    text-align: center;
    font-size: 2.2em;
    margin-bottom: 30px;
    background: linear-gradient(90deg, #f39c12, #e74c3c, #f39c12);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
}

.section-title {
    font-size: 1.2em;
    margin-bottom: 15px;
    color: #f39c12;
    border-left: 4px solid #f39c12;
    padding-left: 10px;
}

.input-area,
.search-input {
    width: 100%;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px;
    padding: 12px;
    color: #e0e0e0;
    font-size: 14px;
    outline: none;
}

.input-area {
    min-height: 200px;
    resize: vertical;
    line-height: 1.6;
}

.btn {
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s;
    margin: 5px;
    color: white;
}

.btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.btn-primary {
    background: linear-gradient(135deg, #f39c12, #e67e22);
}

.btn-success {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.btn-info {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.btn-export-data {
    background: linear-gradient(135deg, #8e44ad, #9b59b6);
}

.btn-import-data {
    background: linear-gradient(135deg, #2980b9, #3498db);
}

.btn-style-save {
    background: linear-gradient(135deg, #d4af37, #9f7b16);
    color: #1a1200;
}

.btn-style-reset {
    background: linear-gradient(135deg, #555, #2f2f2f);
    color: #f3f3f3;
}

.btn-material {
    background: linear-gradient(135deg, #b8860b, #d4af37);
    color: #1a1200;
}

.style-scheme-toolbar-label {
    margin-left: 0;
}

.style-scheme-picker {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin: 0;
    z-index: 30;
}

.style-scheme-select {
    min-width: 160px;
    height: 38px;
    padding: 0 34px 0 12px;
    border: 1px solid rgba(212,175,55,0.36);
    border-radius: 6px;
    background: rgba(0,0,0,0.32);
    color: #f7e4a4;
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
    text-align: left;
    position: relative;
}

.style-scheme-select::after {
    content: "▾";
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #d4af37;
}

.style-scheme-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 280px;
    max-height: 280px;
    overflow-y: auto;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid rgba(212,175,55,0.36);
    background: rgba(16,16,16,0.98);
    box-shadow: 0 16px 36px rgba(0,0,0,0.42);
    z-index: 9999;
}

.style-scheme-picker.open .style-scheme-menu {
    display: grid;
    gap: 6px;
}

.style-scheme-empty {
    padding: 9px 10px;
    color: rgba(230,230,230,0.65);
    font-size: 12px;
}

.style-scheme-row {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) auto auto;
    gap: 6px;
    align-items: center;
    padding: 5px;
    border-radius: 7px;
    background: rgba(255,255,255,0.045);
    border: 1px solid transparent;
}

.style-scheme-row.active {
    border-color: rgba(212,175,55,0.72);
    background: rgba(212,175,55,0.14);
}

.style-scheme-name,
.style-scheme-mini {
    height: 28px;
    border: 0;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
}

.style-scheme-name {
    min-width: 0;
    padding: 0 8px;
    background: transparent;
    color: #f3f3f3;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.style-scheme-name:hover {
    background: rgba(212,175,55,0.12);
}

.style-scheme-mini {
    padding: 0 8px;
    background: rgba(255,255,255,0.13);
    color: #e8e8e8;
}

.style-scheme-mini.danger {
    background: rgba(192,57,43,0.92);
    color: #fff;
}

.style-name-dialog .modal {
    max-width: 420px;
}

.style-name-dialog-body {
    display: grid;
    gap: 12px;
}

.style-name-input {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border-radius: 8px;
    border: 1px solid rgba(212,175,55,0.36);
    background: rgba(0,0,0,0.35);
    color: #fff;
    outline: none;
    font-size: 14px;
}

.style-name-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-group {
    margin-top: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

#dataFileInput {
    display: none;
}

#customAssetFileInput {
    display: none;
}

.two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: stretch;
}

.left-column {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.right-column {
    display: flex;
    flex-direction: column;
}

.left-column #classMapperContainer {
    margin-top: auto;
}

.chain-list {
    flex: 1;
    max-height: 500px;
    overflow-y: auto;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 10px;
    margin-top: 10px;
}

.chain-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin: 4px 0;
    background: rgba(255,255,255,0.05);
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.1);
}

.chain-item:hover {
    background: rgba(243,156,18,0.1);
    border-color: #f39c12;
}

.chain-item .name {
    font-weight: bold;
    color: #fff;
}

.chain-item .class {
    color: #f39c12;
    font-size: 0.85em;
    background: rgba(243,156,18,0.2);
    padding: 2px 8px;
    border-radius: 4px;
}

.chain-team-tag {
    flex: 0 0 auto;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(52,152,219,0.22);
    color: #9dd4ff;
    font-size: 12px;
    font-weight: 800;
}

.chain-note-tag {
    flex: 0 1 auto;
    min-width: 0;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.72);
    font-size: 12px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.quick-join-btn {
    padding: 3px 8px;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
    border: none;
    color: white;
    margin-left: 4px;
}

.quick-join-squad {
    background: #3498db;
}

.quick-join-sub {
    background: #9b59b6;
}

.parse-settings-modal {
    max-width: 760px;
}

.parse-settings-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.parse-setting-section {
    padding: 12px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(0,0,0,0.18);
}

.parse-setting-title {
    color: #f3d887;
    font-size: 15px;
    font-weight: 900;
    margin-bottom: 6px;
}

.parse-setting-desc,
.parse-setting-empty {
    color: rgba(230,230,230,0.64);
    font-size: 12px;
    line-height: 1.45;
    margin-bottom: 10px;
}

.parse-setting-list {
    display: grid;
    gap: 8px;
    max-height: 260px;
    overflow-y: auto;
    padding-right: 4px;
}

.parse-setting-row {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
}

.parse-setting-name {
    color: rgba(255,255,255,0.84);
    font-size: 13px;
    font-weight: 800;
}

.parse-setting-row input {
    min-width: 0;
    height: 32px;
    padding: 0 9px;
    border-radius: 7px;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(0,0,0,0.28);
    color: #fff;
    outline: none;
}

.parse-setting-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.grid-wrapper {
    position: relative;
    padding: 20px;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    overflow: hidden;
    margin-top: 15px;
}

.custom-assets-layer {
    position: absolute !important;
    inset: 0;
    z-index: 80 !important;
    pointer-events: none;
    overflow: visible;
}

.custom-asset-item {
    position: absolute;
    transform-origin: center center;
    pointer-events: auto;
    cursor: move;
    user-select: none;
    touch-action: none;
}

.custom-asset-item.locked {
    cursor: default;
}

.custom-asset-item img {
    display: block;
    width: 100%;
    height: auto;
    pointer-events: none;
    user-select: none;
}

.custom-asset-item.active {
    outline: 2px solid rgba(212,175,55,0.95);
    outline-offset: 4px;
    filter: drop-shadow(0 8px 16px rgba(0,0,0,0.35));
}

.custom-asset-item.locked.active {
    outline-style: dashed;
}

.custom-asset-handle {
    position: absolute;
    display: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #d4af37;
    border: 2px solid #1a1200;
    box-shadow: 0 3px 10px rgba(0,0,0,0.35);
    z-index: 2;
}

.custom-asset-item.active .custom-asset-handle {
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-asset-item.locked .custom-asset-handle {
    display: none;
}

.custom-asset-handle.scale-handle {
    right: -12px;
    bottom: -12px;
    cursor: nwse-resize;
}

.custom-asset-handle.rotate-handle {
    left: 50%;
    top: -34px;
    transform: translateX(-50%);
    cursor: grab;
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
    color: #1a1200;
}

.custom-asset-panel {
    display: none;
    margin-top: 12px;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid rgba(212,175,55,0.28);
    background: rgba(8,8,8,0.38);
}

.custom-asset-panel.active {
    display: block;
}

.custom-asset-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.custom-asset-title {
    font-size: 15px;
    font-weight: 800;
    color: #f3d887;
}

.custom-asset-subtitle,
.custom-asset-muted,
.custom-asset-empty {
    color: rgba(230,230,230,0.68);
    font-size: 12px;
}

.custom-asset-panel-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.custom-asset-inspector-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.custom-asset-layer-row.hidden-layer {
    opacity: 0.55;
}

.custom-asset-layer-row.locked-layer .custom-asset-name-input {
    border-color: rgba(212,175,55,0.45);
}

.export-preview-modal {
    position: fixed;
    inset: 0;
    z-index: 9600;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(3, 6, 9, 0.82);
    backdrop-filter: blur(8px);
}

.export-preview-dialog {
    width: min(1120px, calc(100vw - 36px));
    max-height: calc(100vh - 36px);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
    border: 1px solid rgba(212,175,55,0.34);
    border-radius: 8px;
    background: #101721;
    box-shadow: 0 24px 70px rgba(0,0,0,0.55);
}

.export-preview-dialog header,
.export-preview-dialog footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.export-preview-dialog footer {
    justify-content: flex-end;
    border-top: 1px solid rgba(255,255,255,0.1);
    border-bottom: 0;
}

.export-preview-dialog header div {
    display: grid;
    gap: 3px;
}

.export-preview-dialog header span {
    color: rgba(220,230,245,0.62);
    font-size: 12px;
}

.export-preview-dialog header button {
    width: 30px;
    height: 30px;
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 4px;
    background: rgba(255,255,255,0.06);
    color: #e7edf8;
    cursor: pointer;
}

.export-preview-dialog main {
    min-height: 280px;
    overflow: auto;
    padding: 16px;
    background: #080c12;
    text-align: center;
}

.export-preview-dialog img {
    max-width: 100%;
    height: auto;
    background: transparent;
    box-shadow: 0 12px 32px rgba(0,0,0,0.35);
}

.custom-asset-inspector {
    display: none;
}

.custom-asset-inspector-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(220px, 1fr));
    gap: 10px;
}

.custom-asset-inspector-grid label {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 44px;
    gap: 8px;
    align-items: center;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(0,0,0,0.22);
    color: rgba(255,255,255,0.86);
    font-size: 13px;
}

.custom-asset-inspector-grid input[type="range"] {
    width: 100%;
}

.custom-asset-layer-list {
    display: grid;
    gap: 8px;
    overflow-x: auto;
}

.custom-asset-layer-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) repeat(6, max-content);
    gap: 6px;
    align-items: center;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.045);
    min-width: 640px;
}

.custom-asset-layer-row.active {
    border-color: rgba(212,175,55,0.85);
    background: rgba(212,175,55,0.12);
}

.custom-asset-name-input {
    min-width: 0;
    height: 30px;
    padding: 0 10px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.16);
    background: rgba(0,0,0,0.28);
    color: #fff;
    outline: none;
}

.mini-layer-btn {
    min-width: 44px;
    height: 30px;
    padding: 0 8px;
    border: 0;
    border-radius: 6px;
    background: rgba(255,255,255,0.14);
    color: #eee;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.mini-layer-btn:hover:not(:disabled) {
    filter: brightness(1.16);
}

.mini-layer-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.mini-layer-btn.primary {
    background: linear-gradient(135deg, #b8860b, #d4af37);
    color: #1a1200;
}

.mini-layer-btn.danger,
.custom-asset-context-menu .danger {
    background: #c0392b;
    color: #fff;
}

.custom-asset-context-menu {
    position: fixed;
    z-index: 9999;
    display: grid;
    min-width: 118px;
    padding: 6px;
    gap: 5px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.16);
    background: rgba(20,20,20,0.96);
    box-shadow: 0 12px 30px rgba(0,0,0,0.36);
}

.custom-asset-context-menu button {
    height: 30px;
    border: 0;
    border-radius: 6px;
    background: rgba(255,255,255,0.12);
    color: #eee;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    text-align: left;
    padding: 0 10px;
}


.grid-bg-layer {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    border-radius: inherit;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: var(--board-bg-image-opacity, 1);
}

.grid-wrapper > :not(.grid-bg-layer) {
    position: relative;
    z-index: 1;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 12px;
    position: relative;
    min-height: 420px;
    padding-top: 80px;
}

.grid-cell {
    position: relative;
    width: 100%;
    aspect-ratio: 1.4;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 2px solid rgba(243,156,18,0.5);
    background: rgba(0,0,0,0.4);
    padding: 8px 4px;
    min-height: 80px;
    user-select: none;
    transition: all 0.3s;
    overflow: visible;
}

.cell-input {
    width: 95%;
    text-align: center;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 14px;
    font-weight: bold;
    outline: none;
    line-height: 1.4;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    z-index: 2;
}

.cell-input::placeholder {
    color: transparent;
}

.cell-class {
    font-size: 11px;
    transition: color 0.3s;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    position: relative;
    z-index: 2;
}

.cell-controls {
    position: absolute;
    top: 2px;
    right: 2px;
    display: none;
    gap: 2px;
    z-index: 10;
}

.grid-cell:hover .cell-controls {
    display: flex;
}

.cell-controls button,
.cell-controls .cell-class-dot {
    width: 18px;
    height: 18px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.color-btn {
    background: #3498db;
}

.search-btn {
    background: #f39c12;
}

.search-btn::after {
    content: '🔍';
    font-size: 10px;
}

.clear-btn {
    background: #95a5a6;
}

.substitute-btn {
    background: #9b59b6 !important;
    position: relative;
}

.substitute-btn::after {
    content: '🔄';
    font-size: 11px;
}

.cell-class-dot {
    border: 2px solid rgba(255,255,255,0.5) !important;
    box-shadow: 0 0 4px rgba(0,0,0,0.4);
    transition: all 0.2s;
}

.cell-class-dot:hover {
    transform: scale(1.15);
    box-shadow: 0 0 8px rgba(255,255,255,0.6);
}

.grid-cell.bg-image-mode {
    overflow: visible !important;
    background: transparent !important;
    border-color: transparent !important;
}

.board-layout-toggle {
    display: inline-grid;
    width: 34px;
    height: 34px;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(162,189,220,.34);
    border-radius: 4px;
    background: #132331;
    color: #dbeaf8;
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.board-layout-toggle:hover {
    border-color: #5bd6bd;
    background: #193142;
    transform: translateY(-1px);
}

.board-layout-glyph {
    display: grid;
    grid-template-columns: repeat(3, 4px);
    grid-template-rows: repeat(2, 5px);
    gap: 2px;
}

.board-layout-glyph::before,
.board-layout-glyph::after {
    content: '';
    grid-column: 1 / -1;
    border: 1px solid #8db6d9;
    border-radius: 1px;
}

.board-layout-glyph::after { grid-row: 2; }
.board-layout-toggle.is-portrait .board-layout-glyph { grid-template-columns: repeat(2, 5px); grid-template-rows: repeat(3, 4px); }
.board-layout-toggle.is-portrait .board-layout-glyph::before { grid-column: 1; grid-row: 1 / -1; }
.board-layout-toggle.is-portrait .board-layout-glyph::after { grid-column: 2; grid-row: 1 / -1; }

.grid-container.layout-portrait {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    grid-template-rows: repeat(12, auto);
    min-height: 0;
}

.grid-container.layout-portrait .grid-cell { z-index: 2; }

.grid-container.layout-portrait .team-box.portrait-team-box {
    position: relative;
    min-height: 38px !important;
    padding: 5px 10px !important;
    z-index: 3;
    box-shadow: none !important;
}

.grid-container.layout-portrait .portrait-team-box .team-name-text { margin-bottom: 1px; }
.grid-container.layout-portrait .portrait-team-box .team-class-stats { line-height: 1.2; }

/* 排表工具栏：从宽屏的紧凑分组平滑降级到竖屏的完整分行布局。 */
.schedule-section .toolbar-card {
    flex-wrap: wrap;
    align-items: center;
}

.schedule-section .toolbar-group {
    min-width: 0;
}

@media (max-width: 1180px) {
    .schedule-section .toolbar-card {
        gap: 8px;
    }

    .schedule-section .toolbar-export-image-group {
        margin-left: 0;
    }
}

@media (max-width: 760px) {
    .schedule-section .toolbar-card {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 8px;
    }

    .schedule-section .toolbar-group {
        width: 100%;
        flex-wrap: wrap;
        gap: 6px;
        padding-left: 0;
        border-left: 0;
    }

    .schedule-section .toolbar-group .btn {
        flex: 1 1 auto;
        min-width: 0;
    }

    .schedule-section .toolbar-label {
        flex: 0 0 auto;
    }

    .schedule-section .toolbar-roster-plan-group .roster-plan-picker,
    .schedule-section .toolbar-style-group .style-scheme-picker {
        flex: 1 1 150px;
        min-width: 0;
    }

    .schedule-section .roster-plan-select,
    .schedule-section .style-scheme-select {
        width: 100%;
    }

    .schedule-section .toolbar-export-image-group {
        margin-left: 0;
    }

    .schedule-section #snapshotHistoryPicker {
        flex: 1 1 148px;
        min-width: 0;
    }

    .schedule-section .snapshot-history-select {
        width: 100%;
        min-width: 0;
    }

    .schedule-section .snapshot-history-menu {
        width: min(320px, calc(100vw - 48px));
    }
}

.export-progress-modal {
    position: fixed;
    inset: 0;
    z-index: 9700;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(3, 8, 14, .52);
    backdrop-filter: blur(4px);
}

.export-progress-dialog {
    width: min(340px, calc(100vw - 40px));
    display: grid;
    justify-items: center;
    gap: 10px;
    padding: 24px 22px 20px;
    border: 1px solid rgba(107, 219, 199, .35);
    border-radius: 10px;
    background: #101d2b;
    box-shadow: 0 22px 64px rgba(0,0,0,.5);
    color: #eef8ff;
}

.export-progress-dialog strong { font-size: 16px; }
.export-progress-dialog span { min-height: 18px; color: #9cb0c7; font-size: 12px; }
.export-progress-dialog em { color: #63d9c3; font-size: 12px; font-style: normal; }

.export-progress-icon {
    width: 28px;
    height: 28px;
    border: 3px solid rgba(99,217,195,.22);
    border-top-color: #63d9c3;
    border-radius: 50%;
    animation: export-progress-spin .9s linear infinite;
}

.export-progress-track {
    width: 100%;
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255,255,255,.09);
}

.export-progress-track i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #37b8ef, #63d9c3);
    transition: width .26s ease;
}

@keyframes export-progress-spin { to { transform: rotate(360deg); } }

@media (max-width: 420px) {
    .schedule-section .toolbar-group .btn {
        min-height: 36px;
    }

    .schedule-section .toolbar-style-group .style-scheme-picker,
    .schedule-section .toolbar-roster-plan-group .roster-plan-picker,
    .schedule-section #snapshotHistoryPicker {
        flex-basis: 100%;
    }

}

/* 窄屏成员卡：名字、职业图标、职业名称三层居中排列。 */
@media (max-width: 760px) {
    .grid-container .grid-cell .cell-class-line {
        flex-direction: column;
        gap: 1px !important;
        justify-content: center;
        min-height: 0 !important;
    }

    .grid-container .grid-cell .cell-class-icon {
        flex: 0 0 auto;
    }

    .grid-container .grid-cell .cell-class-line .cell-class {
        max-width: 100%;
        text-align: center;
    }
}

.grid-cell .cell-bg-img {
    position: absolute;
    z-index: 0;
    pointer-events: none;
    user-select: none;
    height: auto !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: contain !important;
}

.team-box {
    position: absolute;
    top: 0;
    height: auto;
    min-height: 70px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #fff;
    border-radius: 6px;
    padding: 8px 12px;
    z-index: 3;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    overflow: visible;
    transition: all 0.3s;
}

.team-name-text {
    font-size: 14px;
    margin-bottom: 4px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.team-class-stats {
    font-size: 11px;
    font-weight: normal;
    color: rgba(255,255,255,0.95);
    text-align: center;
    line-height: 1.4;
    word-break: break-all;
    max-width: 100%;
    text-shadow: none;
}

.team-box-controls {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    pointer-events: none;
}

.team-box:hover .team-box-controls {
    display: flex;
}

.team-box-controls > * {
    pointer-events: auto;
}

.team-edit-btn,
.team-remove-btn {
    width: 26px;
    height: 26px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: white;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.3);
    transition: all 0.2s;
}

.team-edit-btn:hover {
    background: rgba(52, 152, 219, 0.9);
}

.team-remove-btn:hover {
    background: rgba(231, 76, 60, 0.9);
}

.team-color-btn {
    width: 26px;
    height: 26px;
    padding: 0;
    border: 2px solid rgba(255,255,255,0.6);
    border-radius: 4px;
    cursor: pointer;
    background: none;
    appearance: none;
    -webkit-appearance: none;
    transition: transform 0.2s;
}

.team-color-btn:hover {
    transform: scale(1.1);
    border-color: #fff;
}

.team-color-btn::-webkit-color-swatch-wrapper {
    padding: 0;
}

.team-color-btn::-webkit-color-swatch {
    border: none;
    border-radius: 2px;
}

.status-bar {
    text-align: center;
    padding: 10px;
    color: #999;
    font-size: 0.9em;
    margin-top: 10px;
}

#substituteSection {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin-bottom: 0 !important;
}

#substituteSection .section-title {
    font-size: 1em;
    margin-bottom: 10px;
    border-left-width: 3px;
    padding-left: 8px;
}

.substitute-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    min-height: 50px;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 10px;
}

.substitute-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    transition: all 0.2s;
    flex-wrap: wrap;
}

.substitute-item:hover {
    background: rgba(243,156,18,0.1);
    border-color: #f39c12;
}

.substitute-name {
    font-weight: bold;
    color: #fff;
    min-width: 50px;
    font-size: 13px;
}

.substitute-class {
    font-size: 0.8em;
    color: #f39c12;
    background: rgba(243,156,18,0.2);
    padding: 1px 5px;
    border-radius: 4px;
}

.substitute-actions {
    display: flex;
    gap: 4px;
    margin-left: auto;
}

.sub-btn {
    width: 24px;
    height: 24px;
    padding: 0;
    font-size: 0;
    border-radius: 4px;
    cursor: pointer;
    border: none;
    color: white;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.sub-btn::after {
    font-size: 12px;
    position: absolute;
}

.sub-btn-fill {
    background: #27ae60;
}

.sub-btn-fill::after {
    content: '↩';
}

.sub-btn-fill:hover {
    background: #2ecc71;
}

.sub-btn-return {
    background: #7f8c8d;
}

.sub-btn-return::after {
    content: '✕';
}

.sub-btn-return:hover {
    background: #95a5a6;
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

/* 全局样式设置弹窗：打开时不压暗背景，方便实时观察预览效果 */
.modal-overlay.global-style-preview-overlay {
    background: transparent !important;
}

.modal-overlay.global-style-preview-overlay .modal {
    box-shadow: 0 24px 70px rgba(0,0,0,0.55);
}

.modal {
    background: #1a1a2e;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 12px;
    padding: 30px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-title {
    font-size: 1.5em;
    color: #f39c12;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: #e74c3c;
    font-size: 24px;
    cursor: pointer;
}

.style-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.style-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.style-label {
    font-size: 13px;
    color: #aaa;
    text-align: center;
}

.style-picker-wrap {
    position: relative;
    width: 100%;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.style-color-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.style-color-preview {
    width: 45px;
    height: 45px;
    border-radius: 8px;
    border: 2px solid rgba(255,255,255,0.3);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: transform 0.2s;
}

.style-picker-wrap:hover .style-color-preview {
    transform: scale(1.05);
    border-color: #fff;
}

.bg-img-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.bg-img-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    cursor: pointer;
}

.bg-img-toggle input {
    width: 18px;
    height: 18px;
    accent-color: #f39c12;
}

.bg-file-input {
    width: 100%;
    padding: 8px;
    background: rgba(0,0,0,0.3);
    border: 1px dashed rgba(255,255,255,0.3);
    border-radius: 6px;
    color: #aaa;
    font-size: 12px;
}

.global-style-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.global-style-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.global-style-section-title {
    font-size: 14px;
    color: #f39c12;
    margin-bottom: 15px;
    font-weight: bold;
}

.global-style-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    gap: 15px;
}

.global-style-row:last-child {
    margin-bottom: 0;
}

.global-style-label {
    font-size: 14px;
    color: #ccc;
    font-weight: bold;
    white-space: nowrap;
}

.global-color-picker-wrap {
    position: relative;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.global-color-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.global-color-preview {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    border: 2px solid rgba(255,255,255,0.3);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: transform 0.2s;
}

.global-color-picker-wrap:hover .global-color-preview {
    transform: scale(1.05);
    border-color: #fff;
}

.global-bg-upload {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.global-bg-file {
    flex: 1;
    padding: 8px;
    background: rgba(0,0,0,0.3);
    border: 1px dashed rgba(255,255,255,0.3);
    border-radius: 6px;
    color: #aaa;
    font-size: 12px;
}

.global-select {
    flex: 1;
    padding: 8px 10px;
    background: rgba(0,0,0,0.35);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 13px;
    outline: none;
}

.global-select:focus {
    border-color: #f39c12;
}

.global-select option {
    background: #1a1a2e;
    color: #e0e0e0;
}

.font-size-section {
    background: rgba(0,0,0,0.2);
    padding: 15px;
    border-radius: 8px;
}

.font-size-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 12px;
}

.font-size-row:last-child {
    margin-bottom: 0;
}

.font-size-row label {
    width: 100px;
    font-size: 13px;
    color: #ccc;
    font-weight: bold;
}

.font-size-row input[type="range"] {
    flex: 1;
    accent-color: #f39c12;
    height: 6px;
}

.font-size-row .size-value {
    width: 50px;
    text-align: right;
    font-size: 13px;
    color: #f39c12;
    font-weight: bold;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding: 10px;
    background: rgba(0,0,0,0.2);
    border-radius: 6px;
}

.checkbox-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #f39c12;
}

.checkbox-row label {
    font-size: 13px;
    color: #ccc;
    cursor: pointer;
    flex: 1;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
}

.modal-actions .btn {
    padding: 12px 40px;
    font-size: 16px;
}

.squad-list {
    list-style: none;
}

.squad-item {
    padding: 12px;
    margin: 6px 0;
    background: rgba(255,255,255,0.05);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.squad-item:hover {
    background: rgba(243,156,18,0.2);
    border-left: 4px solid #f39c12;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin: 10px 0;
}

.col-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px;
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
    cursor: pointer;
}

.dragging {
    opacity: 0.7;
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(243,156,18,0.6) !important;
}

.drop-target {
    border: 2px dashed #f39c12 !important;
    background: rgba(243,156,18,0.1) !important;
}

.highlight {
    animation: highlight-pulse 1s ease-in-out;
}

@keyframes highlight-pulse {
    0%, 100% {
        box-shadow: 0 0 5px rgba(243,156,18,0.3);
    }

    50% {
        box-shadow: 0 0 20px rgba(243,156,18,0.8);
    }
}

.class-mapper-panel {
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    border: 1px solid rgba(255,255,255,0.1);
}

.class-mapper-title {
    font-size: 0.9em;
    color: #aaa;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.class-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}

.class-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: transform 0.2s;
    padding: 5px;
    border-radius: 6px;
    position: relative;
}

.class-item:hover {
    background: rgba(255,255,255,0.05);
    transform: translateY(-2px);
}

.class-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.4);
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
    transition: all 0.3s;
}

.class-name {
    font-size: 12px;
    color: #ddd;
    text-align: center;
    font-weight: 500;
}

.class-delete-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    background: rgba(231, 76, 60, 0.8);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 10px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
}

.class-item:hover .class-delete-btn {
    display: flex;
}

.class-delete-btn:hover {
    background: rgba(231, 76, 60, 1);
    transform: scale(1.1);
}

.add-class-section {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.add-class-input {
    flex: 1;
    padding: 8px 12px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 13px;
    outline: none;
}

.add-class-input:focus {
    border-color: #f39c12;
}

.color-picker-modal {
    position: fixed;
    background: #1a1a2e;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 12px;
    padding: 20px;
    z-index: 2000;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    display: none;
    flex-direction: column;
    gap: 15px;
    width: 220px;
}

.color-picker-modal.active {
    display: flex;
}

.picker-actions {
    display: flex;
    gap: 10px;
}

.picker-actions button {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

.btn-save-color {
    background: #27ae60;
    color: white;
}

.btn-cancel-color {
    background: #555;
    color: white;
}

.class-selector-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.class-selector-item:hover {
    background: rgba(243,156,18,0.15);
    border-color: rgba(243,156,18,0.3);
}

.exporting-image .export-name-text {
    display: block;
    text-align: center;
    line-height: 1.35;
    padding: 2px 0 3px;
    margin-bottom: 1px;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    position: relative;
    z-index: 2;
    pointer-events: none;
}

.exporting-image .cell-class {
    margin-top: 1px;
    line-height: 1.25;
}

@media (max-width: 900px) {
    .two-columns {
        grid-template-columns: 1fr;
    }

    .grid-container {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 600px) {
    .class-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.2);
}

::-webkit-scrollbar-thumb {
    background: rgba(243,156,18,0.5);
    border-radius: 4px;
}
/* ==============================
   UI Layout Upgrade v1
   只优化页面布局与视觉层级，不改变核心功能
   ============================== */
body {
    padding: 24px;
    background:
        radial-gradient(circle at 15% 0%, rgba(243,156,18,0.16), transparent 34%),
        radial-gradient(circle at 85% 10%, rgba(52,152,219,0.12), transparent 30%),
        linear-gradient(135deg, #0b1422 0%, #111c2f 48%, #1d3042 100%);
}

.app-shell {
    width: 100%;
}

.app-header {
    max-width: 1680px;
    margin: 0 auto 22px;
    padding: 22px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0.03));
    box-shadow: 0 18px 45px rgba(0,0,0,0.22);
    backdrop-filter: blur(14px);
}

.app-title-block h1 {
    text-align: left;
    margin-bottom: 8px;
    font-size: 2.15em;
    letter-spacing: 1px;
}

.app-kicker {
    margin-bottom: 8px;
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(243,156,18,0.92);
    font-weight: 700;
}

.app-subtitle {
    color: rgba(224,224,224,0.72);
    font-size: 14px;
    line-height: 1.6;
}

.app-header-tips {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    min-width: 260px;
}

.tip-pill,
.count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(243,156,18,0.14);
    border: 1px solid rgba(243,156,18,0.28);
    color: #ffd18a;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.container {
    max-width: 1680px;
}

.workbench-grid {
    display: grid;
    grid-template-columns: minmax(420px, 0.95fr) minmax(480px, 1.05fr);
    gap: 20px;
    align-items: stretch;
}

.panel-card {
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.035));
    box-shadow: 0 16px 34px rgba(0,0,0,0.16);
}

.panel-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(243,156,18,0.65), transparent);
    opacity: 0.8;
}

.panel-header,
.schedule-header,
.substitute-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 14px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.25;
}

.section-desc {
    margin-top: 6px;
    color: rgba(224,224,224,0.55);
    font-size: 12px;
    line-height: 1.5;
}

.input-panel .input-area {
    min-height: 230px;
    flex: 1;
}

.roster-panel .search-input {
    margin-bottom: 12px;
}

.chain-class-summary {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 5px 9px;
    min-width: 0;
    max-width: 58%;
    margin-left: auto;
    padding-top: 2px;
}

.chain-class-stat {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: rgba(255,255,255,0.78);
    font-size: 12px;
    line-height: 20px;
    white-space: nowrap;
}

.chain-class-stat img,
.chain-class-stat-placeholder {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    object-fit: contain;
}

.chain-class-stat-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(148,163,184,0.65);
    border-radius: 50%;
    color: #cbd5e1;
    font-size: 11px;
}

.chain-class-stat b {
    color: var(--class-color, #94a3b8);
    font-size: 14px;
    font-weight: 700;
}

.chain-class-stat-unknown b {
    color: #94a3b8;
}

@media (max-width: 760px) {
    .chain-class-summary {
        justify-content: flex-start;
        max-width: 100%;
        width: 100%;
        margin: 8px 0 0;
    }
}

.chain-list {
    max-height: 530px;
    min-height: 300px;
    border: 1px solid rgba(255,255,255,0.08);
}

.schedule-section {
    padding: 22px;
}

.schedule-header {
    align-items: center;
    margin-bottom: 16px;
}

.schedule-summary {
    padding: 9px 14px;
    border-radius: 12px;
    background: rgba(0,0,0,0.24);
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.86);
    font-weight: 700;
    white-space: nowrap;
}

.schedule-summary span {
    color: #f39c12;
    font-size: 18px;
}

.toolbar-card {
    position: relative;
    z-index: 50;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    margin-bottom: 16px;
    padding: 10px;
    border-radius: 14px;
    background: rgba(0,0,0,0.22);
    border: 1px solid rgba(255,255,255,0.09);
    overflow: visible;
    white-space: nowrap;
}

.toolbar-group {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

.toolbar-group .btn {
    margin: 0;
    height: 38px;
    padding: 0 11px;
    white-space: nowrap;
}

.toolbar-label {
    display: inline-flex;
    align-items: center;
    height: 32px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.62);
    font-size: 12px;
    font-weight: 700;
}

.toolbar-group-right {
    margin-left: 0;
}

.toolbar-style-group,
.toolbar-export-image-group {
    padding-left: 10px;
    border-left: 1px solid rgba(255,255,255,0.1);
}

.toolbar-material-group {
    padding-left: 2px;
}

.toolbar-export-image-group {
    margin-left: auto;
}

.btn {
    box-shadow: 0 8px 18px rgba(0,0,0,0.14);
}

.grid-wrapper {
    padding: 18px;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.025), 0 20px 40px rgba(0,0,0,0.18);
}

.grid-container {
    min-height: 450px;
    padding-top: 86px;
}

.grid-cell {
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 5px 14px rgba(0,0,0,0.14);
}

.grid-cell:hover {
    transform: translateY(-1px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 8px 20px rgba(0,0,0,0.2);
}

/* 关闭时移除成员标签的基础卡片投影；后续的悬浮发光规则仍可单独生效。 */
.grid-container.member-card-shadow-disabled .grid-cell,
.grid-container.member-card-shadow-disabled .grid-cell:hover {
    box-shadow: none !important;
}

.snapshot-history-modal {
    width: min(460px, calc(100vw - 32px));
}

.snapshot-history-picker { position: relative; }

.snapshot-history-select {
    height: 34px;
    min-width: 148px;
    padding: 0 30px 0 10px;
    border: 1px solid rgba(162, 189, 220, 0.34);
    border-radius: 4px;
    outline: none;
    background: #132331;
    color: #dbeaf8;
    cursor: pointer;
    font-size: 12px;
    text-align: left;
}

.snapshot-history-label {
    color: #aebfd2;
    font-size: 12px;
    white-space: nowrap;
}

.roster-plan-picker { position: relative; min-width: 170px; }
.roster-plan-select {
    width: 100%; height: 34px; padding: 0 28px 0 10px; border: 1px solid rgba(162,189,220,.34); border-radius: 4px;
    background: #132331; color: #dbeaf8; cursor: pointer; font-size: 12px; text-align: left;
}
.roster-plan-select:hover,.roster-plan-picker.open .roster-plan-select { border-color: #5bd6bd; }
.roster-plan-menu {
    position: absolute; top: calc(100% + 5px); left: 0; z-index: 220; display: none; width: min(280px, 50vw);
    max-height: 280px; overflow: auto; padding: 5px; border: 1px solid rgba(162,189,220,.28); border-radius: 5px;
    background: #0d1824; box-shadow: 0 14px 32px rgba(0,0,0,.38);
}
.roster-plan-picker.open .roster-plan-menu { display: grid; gap: 2px; }
.roster-plan-row { display: grid; grid-template-columns: minmax(0,1fr) 26px; align-items: center; border-radius: 3px; }
.roster-plan-apply { min-width: 0; padding: 9px 8px; border: 0; background: transparent; color: #d8e5f2; cursor: pointer; overflow: hidden; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.roster-plan-row:hover { background: rgba(91,214,189,.11); }
.roster-plan-apply:hover { color: #eafff8; }
.roster-plan-delete { display: grid; width: 23px; height: 23px; place-items: center; border: 0; border-radius: 3px; background: transparent; color: #ff8da7; cursor: pointer; font-size: 18px; line-height: 1; opacity: 0; }
.roster-plan-row:hover .roster-plan-delete { opacity: 1; }
.roster-plan-delete:hover { background: rgba(255,111,142,.16); color: #ffd8e1; }
.roster-plan-empty { padding: 12px 9px; color: #8298af; font-size: 12px; }
.roster-plan-dialog { width: min(400px, calc(100vw - 32px)); }
.roster-plan-name-input { width: 100%; box-sizing: border-box; margin: 14px 0; padding: 10px 11px; border: 1px solid rgba(162,189,220,.34); border-radius: 4px; outline: none; background: #101c2a; color: #edf6ff; }
.roster-plan-name-input:focus { border-color: #5bd6bd; }

.snapshot-history-select:hover,
.snapshot-history-select:focus { border-color: #5bd6bd; }
.snapshot-history-select option { background: #132331; color: #dbeaf8; }

.snapshot-history-menu {
    position: absolute;
    top: calc(100% + 5px);
    right: 0;
    z-index: 220;
    display: none;
    width: min(320px, calc(100vw - 28px));
    max-height: min(420px, 62vh);
    overflow: auto;
    padding: 5px;
    border: 1px solid rgba(162, 189, 220, .28);
    border-radius: 5px;
    background: #0d1824;
    box-shadow: 0 14px 32px rgba(0,0,0,.38);
}

.snapshot-history-picker.open .snapshot-history-menu { display: grid; gap: 2px; }
.snapshot-history-picker.open .snapshot-history-select { border-color: #5bd6bd; }
.snapshot-history-row {
    display: grid;
    gap: 3px;
    width: 100%;
    padding: 9px 10px;
    border: 0;
    border-radius: 3px;
    background: transparent;
    color: #dce9f6;
    cursor: pointer;
    text-align: left;
    transition: background .18s ease, color .18s ease;
}
.snapshot-history-row:hover { background: rgba(91,214,189,.11); color: #f1fffa; }
.snapshot-history-row strong { font-size: 13px; font-weight: 600; }
.snapshot-history-row span { color: #71869d; font-size: 10px; line-height: 1.2; }

.snapshot-history-list {
    display: grid;
    max-height: min(56vh, 520px);
    gap: 8px;
    overflow: auto;
    padding: 14px 0 2px;
}

.snapshot-history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    padding: 13px 14px;
    border: 1px solid rgba(148, 176, 211, 0.25);
    border-radius: 5px;
    background: rgba(13, 27, 42, 0.82);
    color: #edf5ff;
    cursor: pointer;
    text-align: left;
    transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.snapshot-history-item:hover {
    border-color: rgba(91, 214, 189, 0.82);
    background: rgba(26, 57, 72, 0.78);
    transform: translateY(-1px);
}

.snapshot-history-item strong { font-size: 14px; }
.snapshot-history-item span { color: #91a5bd; font-size: 11px; white-space: nowrap; }
.snapshot-history-empty { padding: 28px 12px; color: #8ca0b6; text-align: center; }

.team-box {
    backdrop-filter: blur(8px);
}

.substitute-panel {
    margin-top: 18px;
    padding: 16px;
    border-radius: 14px;
    background: rgba(0,0,0,0.18) !important;
    border: 1px solid rgba(255,255,255,0.08) !important;
}

#substituteSection .section-title {
    margin-bottom: 0;
}

.substitute-list {
    margin-top: 12px;
    border: 1px dashed rgba(255,255,255,0.12);
}

.empty-state {
    width: 100%;
    text-align: center;
    color: rgba(224,224,224,0.42);
    padding: 14px 10px;
}

.status-bar {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(0,0,0,0.22);
    border: 1px solid rgba(255,255,255,0.08);
    color: rgba(224,224,224,0.68);
}

.modal {
    border-radius: 16px;
    box-shadow: 0 24px 70px rgba(0,0,0,0.45);
}

@media (max-width: 1180px) {
    .app-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .app-header-tips {
        justify-content: flex-start;
        min-width: 0;
    }

    .workbench-grid {
        grid-template-columns: 1fr;
    }

    .toolbar-card {
        align-items: center;
    }

    .toolbar-group,
    .toolbar-group-right {
        width: auto;
        margin-left: 0;
    }

    .toolbar-export-image-group {
        margin-left: 0;
    }
}

@media (max-width: 700px) {
    body {
        padding: 12px;
    }

    .app-header {
        padding: 18px;
        border-radius: 14px;
    }

    .app-title-block h1 {
        font-size: 1.65em;
    }

    .section,
    .schedule-section {
        padding: 16px;
    }

    .schedule-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .toolbar-group .btn {
        flex: 0 0 auto;
    }

    .grid-wrapper {
        padding: 12px;
    }
}

/* ==============================
   Export text transparency fix
   导出时强制文字层透明，避免成员标签中文字区域出现色块
   ============================== */
.exporting-image .export-name-text,
.exporting-image .cell-class {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    border: none !important;
}

.exporting-image .cell-input {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    border: none !important;
}

/* ==============================
   Export text block final fix
   导出时隐藏原 input/职业文本，使用纯净文字层，避免半透明标签内出现二次叠色块
   ============================== */
.exporting-image .grid-cell {
    background-clip: padding-box !important;
}

.exporting-image .cell-input,
.exporting-image .cell-class {
    display: none !important;
}

.exporting-image .export-cell-text-wrap {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.2;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    filter: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    opacity: 1 !important;
    mix-blend-mode: normal !important;
    position: relative;
    z-index: 2;
    pointer-events: none;
}

.exporting-image .export-name-text,
.exporting-image .export-class-text {
    display: block;
    width: 95%;
    max-width: 95%;
    text-align: center;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
    filter: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    opacity: 1 !important;
    mix-blend-mode: normal !important;
    padding: 0;
    margin: 0;
}

.exporting-image .export-name-text {
    line-height: 1.3;
    padding-bottom: 1px;
}

.exporting-image .export-class-text {
    line-height: 1.25;
    margin-top: 1px;
}

/* ==============================
   Pure roster export stage fix
   导出时只截取排表主体，避免页面框架/替补席/状态栏进入导出图。
   同时在克隆节点里使用纯文本层，彻底避免半透明文字色块。
   ============================== */
.pure-export-stage,
.pure-export-stage * {
    box-sizing: border-box;
}

.pure-export-stage {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    filter: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.pure-export-stage .export-grid-clone {
    position: relative !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

.pure-export-stage .grid-cell .cell-input,
.pure-export-stage .grid-cell .cell-class,
.pure-export-stage .cell-controls,
.pure-export-stage .team-box-controls {
    display: none !important;
}

.pure-export-stage .export-cell-text-wrap {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.2;
    position: relative;
    z-index: 2;
    pointer-events: none;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    filter: none !important;
    opacity: 1 !important;
    mix-blend-mode: normal !important;
}

.pure-export-stage .export-name-text,
.pure-export-stage .export-class-text {
    display: block;
    width: 95%;
    max-width: 95%;
    text-align: center;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    padding: 0;
    margin: 0;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
    filter: none !important;
    opacity: 1 !important;
    mix-blend-mode: normal !important;
}

.pure-export-stage .export-name-text {
    line-height: 1.3;
    padding-bottom: 1px;
}

.pure-export-stage .export-class-text {
    line-height: 1.25;
    margin-top: 1px;
}

/* ==============================
   Export Fix v3
   导出保留排表外框 + 替补席，隐藏底部状态提示；成员格子文字使用绝对定位纯文本，避免半透明文字色块。
   ============================== */
.export-stage,
.export-stage * {
    box-sizing: border-box;
}

.export-stage {
    background: transparent !important;
}

.export-stage .export-wrapper-clone {
    position: relative !important;
    margin: 0 !important;
    overflow: visible !important;
}

.export-stage #statusBar,
.export-stage .status-bar,
.export-stage .cell-controls,
.export-stage .team-box-controls,
.export-stage .substitute-actions {
    display: none !important;
}

.export-stage .grid-cell.export-cell-clean-text {
    display: block !important;
    position: relative !important;
    overflow: visible !important;
    text-align: center !important;
}

.export-stage .grid-cell.export-cell-clean-text .cell-input,
.export-stage .grid-cell.export-cell-clean-text .cell-class,
.export-stage .grid-cell.export-cell-clean-text .export-cell-text-wrap,
.export-stage .grid-cell.export-cell-clean-text .export-name-text,
.export-stage .grid-cell.export-cell-clean-text .export-class-text {
    display: none !important;
}

.export-stage .export-direct-name,
.export-stage .export-direct-class {
    position: absolute !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    display: inline-block !important;
    width: auto !important;
    max-width: 92% !important;
    min-width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    text-align: center !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
    line-height: 1.25 !important;
    background: none !important;
    background-color: transparent !important;
    background-image: none !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    filter: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    opacity: 1 !important;
    mix-blend-mode: normal !important;
    z-index: 3 !important;
    pointer-events: none !important;
}

.export-stage .export-direct-name {
    top: 45% !important;
}

.export-stage .export-direct-class {
    top: 62% !important;
}

.export-stage .grid-cell.export-cell-clean-text:not(.export-has-class) .export-direct-name {
    top: 50% !important;
}

.export-stage .grid-cell.export-cell-clean-text:not(.export-has-name) .export-direct-class {
    top: 50% !important;
}

.export-stage .substitute-panel {
    margin-bottom: 0 !important;
}

/* ==============================
   Export Fix v4
   导出时成员格子底图不带 UI 阴影/滤镜，文字改由 Canvas 手动画上去，避免半透明标签出现文字色块和格子状叠色。
   ============================== */
.grid-cell.bg-image-mode {
    box-shadow: none !important;
    filter: none !important;
    -webkit-filter: none !important;
}

.grid-cell.bg-image-mode .cell-bg-img {
    box-shadow: none !important;
    filter: none !important;
    -webkit-filter: none !important;
    text-shadow: none !important;
}

.export-canvas-text-stage .grid-cell,
.export-canvas-text-stage .grid-cell:hover {
    box-shadow: none !important;
    filter: none !important;
    -webkit-filter: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    transform: none !important;
    transition: none !important;
}

.export-canvas-text-stage .grid-cell .cell-input,
.export-canvas-text-stage .grid-cell .cell-class,
.export-canvas-text-stage .grid-cell .export-direct-name,
.export-canvas-text-stage .grid-cell .export-direct-class,
.export-canvas-text-stage .grid-cell .export-name-text,
.export-canvas-text-stage .grid-cell .export-class-text,
.export-canvas-text-stage .grid-cell .export-cell-text-wrap {
    display: none !important;
    visibility: hidden !important;
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
    filter: none !important;
    -webkit-filter: none !important;
}

.export-canvas-text-stage .cell-bg-img {
    box-shadow: none !important;
    filter: none !important;
    -webkit-filter: none !important;
    text-shadow: none !important;
}

/* ==============================
   Export Fix v6
   导出时用克隆 DOM 文字层 + 不透明预合成格子背景，避免半透明文字色块，同时保证文字不丢失。
   ============================== */
.nsh-clean-export-stage,
.nsh-clean-export-stage * {
    box-sizing: border-box;
}

.nsh-clean-export-stage {
    background: transparent !important;
}

.nsh-clean-export-stage .nsh-clean-export-wrapper {
    position: relative !important;
    margin: 0 !important;
    overflow: visible !important;
}

.nsh-clean-export-stage #statusBar,
.nsh-clean-export-stage .status-bar,
.nsh-clean-export-stage .cell-controls,
.nsh-clean-export-stage .team-box-controls,
.nsh-clean-export-stage .substitute-actions {
    display: none !important;
}

.nsh-clean-export-stage .grid-cell.export-dom-text-cell {
    box-shadow: none !important;
    filter: none !important;
    -webkit-filter: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    transform: none !important;
    transition: none !important;
}

.nsh-clean-export-stage .grid-cell.export-dom-text-cell .cell-input,
.nsh-clean-export-stage .grid-cell.export-dom-text-cell .cell-class,
.nsh-clean-export-stage .grid-cell.export-dom-text-cell .export-direct-name,
.nsh-clean-export-stage .grid-cell.export-dom-text-cell .export-direct-class {
    display: none !important;
}

.nsh-clean-export-stage .export-cell-text-wrap,
.nsh-clean-export-stage .export-name-text,
.nsh-clean-export-stage .export-class-text {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    filter: none !important;
    -webkit-filter: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    mix-blend-mode: normal !important;
    opacity: 1 !important;
}

.nsh-clean-export-stage .custom-asset-item {
    outline: none !important;
    filter: none !important;
    cursor: default !important;
}

.nsh-clean-export-stage .custom-asset-handle {
    display: none !important;
}

/* ==============================
   Header Title & Avatar Settings
   标题 + 双层头像/头像框
   ============================== */
.app-brand {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
    flex: 1;
}

.app-avatar-frame {
    width: 94px;
    height: 94px;
    flex: 0 0 auto;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
    transition: all 0.25s ease;
}

.app-avatar-frame-image {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 94px;
    height: 94px;
    z-index: 3;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    pointer-events: none;
    transform: translate(-50%, -50%);
}

.app-avatar-image {
    position: relative;
    z-index: 2;
    width: 74px;
    height: 74px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    background: rgba(0,0,0,0.18);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
}

.app-avatar-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 34px;
    line-height: 1;
    color: #ffd18a;
    text-shadow: 0 3px 10px rgba(0,0,0,0.35);
    user-select: none;
}

.app-avatar-image.has-avatar-image .app-avatar-placeholder {
    display: none;
}

#appTitleText {
    cursor: default;
    outline: none;
    border-radius: 8px;
    padding: 2px 4px;
    margin-left: -4px;
}

.global-text-input {
    flex: 1;
    min-width: 0;
    padding: 9px 12px;
    background: rgba(0,0,0,0.35);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 13px;
    outline: none;
}

.global-text-input:focus {
    border-color: #f39c12;
    box-shadow: 0 0 0 2px rgba(243,156,18,0.12);
}

@media (max-width: 700px) {
    .app-brand {
        align-items: flex-start;
        gap: 12px;
    }

    .app-avatar-placeholder {
        font-size: 26px;
    }
}

/* ✅ 全局样式弹窗优化：更舒适的两列卡片布局，不压暗背景 */
.modal-overlay.global-style-preview-overlay {
    background: transparent !important;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.modal-overlay.global-style-preview-overlay .modal {
    pointer-events: auto;
    width: min(1080px, calc(100vw - 48px));
    max-width: 1080px;
    max-height: 88vh;
    padding: 22px 24px;
    border-radius: 16px;
    box-shadow: 0 26px 80px rgba(0,0,0,0.58);
}

.modal-overlay.global-style-preview-overlay .modal-title {
    margin-bottom: 16px;
    font-size: 1.35em;
}

.global-style-panel .global-style-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.global-style-panel .global-style-section {
    margin: 0;
    padding: 14px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    background: rgba(0,0,0,0.18);
}

.global-style-panel .global-style-section.is-wide {
    grid-column: 1 / -1;
}

.global-style-panel .global-style-section-title {
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    font-size: 14px;
}

.global-style-panel .global-subtitle {
    margin: 10px 0 8px;
    color: #f39c12;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.global-style-panel .global-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 14px;
    margin-bottom: 10px;
}

.global-style-panel .global-field-grid.four-cols {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.global-style-panel .global-field-grid.color-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: center;
}

.global-style-panel .global-style-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    justify-content: start;
    gap: 8px;
    margin: 0;
    min-width: 0;
}

.global-style-panel .global-style-row-file {
    grid-template-columns: 72px minmax(0, 1fr);
}

.global-style-panel .global-style-label {
    font-size: 13px;
    line-height: 1.2;
    color: #cfcfcf;
}

.global-style-panel .global-color-field {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-width: 0;
}

.global-style-panel .global-color-picker-wrap {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
}

.global-style-panel .global-color-preview {
    border-radius: 7px;
}

.global-style-panel .global-select,
.global-style-panel .global-text-input {
    width: 100%;
    min-width: 0;
    height: 36px;
    padding: 7px 10px;
    font-size: 13px;
}

.global-style-panel .global-control-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(260px, 1fr));
    gap: 10px 14px;
    margin: 10px 0;
    padding: 12px;
    border-radius: 10px;
    background: rgba(0,0,0,0.18);
}

.global-style-panel .global-control-grid.compact-controls {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.global-style-panel .font-size-row {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr) 50px;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.global-style-panel .font-size-row label {
    width: auto;
    font-size: 12px;
    color: #cfcfcf;
}

.global-style-panel .font-size-row .size-value {
    width: auto;
    min-width: 46px;
    font-size: 12px;
}

.global-style-panel .checkbox-row.compact-check {
    margin: 0;
    padding: 8px 10px;
    min-height: 36px;
}

.global-style-panel .checkbox-row.compact-check label {
    font-size: 12px;
    line-height: 1.25;
}

.global-style-panel .compact-upload {
    gap: 8px;
}

.global-style-panel .global-bg-file {
    min-width: 0;
    height: 36px;
    padding: 7px 10px;
}

.global-style-panel .mini-btn {
    flex: 0 0 auto;
    margin: 0;
    padding: 7px 12px !important;
    font-size: 12px !important;
    line-height: 1;
}

.global-style-panel .global-style-tip {
    margin-top: 8px;
    color: #888;
    font-size: 12px;
    line-height: 1.55;
}

.global-style-panel .compact-modal-actions {
    position: sticky;
    bottom: -22px;
    z-index: 20;
    margin: 16px -24px -22px;
    padding: 12px 24px;
    background: linear-gradient(180deg, rgba(26,26,46,0.78), #1a1a2e 35%);
    border-top: 1px solid rgba(255,255,255,0.1);
}

.global-style-panel .compact-modal-actions .btn {
    padding: 10px 30px;
    font-size: 14px;
}

/* ✅ 左右边缘间距同步影响替补席模块，并与队伍列保持对齐 */
#substituteSection {
    padding-left: var(--grid-side-padding, 0px) !important;
    padding-right: var(--grid-side-padding, 0px) !important;
}

@media (max-width: 980px) {
    .global-style-panel .global-style-form,
    .global-style-panel .global-field-grid,
    .global-style-panel .global-field-grid.four-cols,
    .global-style-panel .global-field-grid.color-grid,
    .global-style-panel .global-control-grid,
    .global-style-panel .global-control-grid.compact-controls {
        grid-template-columns: 1fr;
    }

    .modal-overlay.global-style-preview-overlay .modal {
        width: calc(100vw - 24px);
        max-height: 90vh;
    }
}

/* 透明遮罩只是不变暗，仍保留弹窗遮罩交互，避免误点页面内容 */
.modal-overlay.global-style-preview-overlay {
    pointer-events: auto;
}

/* ✅ 2026-06 全局样式面板二次优化：更小窗口、对齐上传框、排表/成员/团队合并为一个大类 */
.modal-overlay.global-style-preview-overlay .modal {
    width: min(980px, calc(100vw - 56px)) !important;
    max-width: 980px !important;
    max-height: 84vh !important;
    padding: 18px 22px !important;
    border-radius: 14px !important;
}

.modal-overlay.global-style-preview-overlay .modal-title {
    margin-bottom: 14px !important;
    font-size: 1.25em !important;
}

.global-style-panel .optimized-style-form {
    display: block !important;
}

.global-style-panel .global-style-section {
    margin: 0 0 12px !important;
    padding: 12px 14px !important;
    border-radius: 12px !important;
    background: rgba(0,0,0,0.16) !important;
}

.global-style-panel .global-style-section-title {
    margin-bottom: 10px !important;
    padding-bottom: 8px !important;
    font-size: 14px !important;
}

.global-style-panel .global-subsection {
    margin-top: 10px;
    padding: 11px 12px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    background: rgba(0,0,0,0.13);
}

.global-style-panel .global-subsection:first-of-type {
    margin-top: 0;
}

.global-style-panel .global-subsection-title {
    margin-bottom: 9px;
    color: #f39c12;
    font-size: 13px;
    font-weight: 800;
}

.global-style-panel .global-subtitle {
    margin: 8px 0 7px !important;
    font-size: 12px !important;
}

.global-style-panel .global-field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px 12px !important;
    margin-bottom: 8px !important;
    align-items: center;
}

.global-style-panel .global-field-grid.compact-two-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.global-style-panel .global-field-grid.four-cols {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.global-style-panel .global-field-grid.color-grid,
.global-style-panel .global-field-grid.member-color-grid,
.global-style-panel .global-field-grid.member-cell-color-grid,
.global-style-panel .global-field-grid.team-color-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.global-style-panel .global-style-row {
    display: grid !important;
    grid-template-columns: 78px minmax(0, 1fr) !important;
    gap: 8px !important;
    align-items: center !important;
    min-width: 0;
}

.global-style-panel .global-style-row-file,
.global-style-panel .upload-row-tight {
    grid-template-columns: 78px minmax(0, 1fr) !important;
}

.global-style-panel .global-style-label {
    width: 78px;
    min-width: 78px;
    text-align: left;
    font-size: 13px !important;
    line-height: 1.25;
    color: #d6d6d6 !important;
}

.global-style-panel .color-row-tight {
    grid-template-columns: 78px 38px !important;
    justify-content: start !important;
}

.global-style-panel .color-row-tight .global-style-label {
    width: 78px;
}

.global-style-panel .global-color-field {
    width: 38px;
    justify-content: flex-start !important;
}

.global-style-panel .global-color-picker-wrap {
    width: 32px !important;
    height: 32px !important;
    flex: 0 0 32px !important;
}

.global-style-panel .global-color-preview {
    border-radius: 6px !important;
}

.global-style-panel .compact-upload,
.global-style-panel .global-bg-upload {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px !important;
    align-items: center !important;
    width: 100%;
    min-width: 0;
}

.global-style-panel .global-bg-file {
    width: 100% !important;
    min-width: 0 !important;
    height: 34px !important;
    padding: 6px 10px !important;
    box-sizing: border-box;
}

.global-style-panel .mini-btn {
    height: 34px;
    padding: 6px 12px !important;
    white-space: nowrap;
}

.global-style-panel .global-select,
.global-style-panel .global-text-input {
    height: 34px !important;
    padding: 6px 9px !important;
}

.global-style-panel .global-control-grid {
    grid-template-columns: repeat(2, minmax(250px, 1fr)) !important;
    gap: 9px 12px !important;
    margin: 8px 0 !important;
    padding: 10px 11px !important;
    border-radius: 9px !important;
}

.global-style-panel .global-control-grid.compact-controls,
.global-style-panel .global-control-grid.member-cell-controls,
.global-style-panel .global-control-grid.team-controls,
.global-style-panel .global-control-grid.avatar-controls {
    grid-template-columns: repeat(2, minmax(250px, 1fr)) !important;
}

.global-style-panel .font-size-row {
    grid-template-columns: 72px minmax(0, 1fr) 48px !important;
    gap: 9px !important;
}

.global-style-panel .font-size-row label {
    font-size: 12px !important;
}

.global-style-panel .checkbox-row.compact-check {
    min-height: 34px !important;
    padding: 7px 9px !important;
    justify-content: flex-start;
}

.global-style-panel .compact-modal-actions {
    margin: 14px -22px -18px !important;
    padding: 10px 22px !important;
}

.global-style-panel .compact-modal-actions .btn {
    padding: 9px 28px !important;
}

@media (max-width: 1040px) {
    .global-style-panel .global-field-grid,
    .global-style-panel .global-field-grid.compact-two-cols,
    .global-style-panel .global-field-grid.four-cols,
    .global-style-panel .global-field-grid.color-grid,
    .global-style-panel .global-field-grid.member-color-grid,
    .global-style-panel .global-field-grid.member-cell-color-grid,
    .global-style-panel .global-field-grid.team-color-grid,
    .global-style-panel .global-control-grid,
    .global-style-panel .global-control-grid.compact-controls,
    .global-style-panel .global-control-grid.member-cell-controls,
    .global-style-panel .global-control-grid.team-controls,
    .global-style-panel .global-control-grid.avatar-controls {
        grid-template-columns: 1fr !important;
    }

    .modal-overlay.global-style-preview-overlay .modal {
        width: calc(100vw - 24px) !important;
        max-height: 90vh !important;
    }
}

/* ✅ 职业颜色修改小窗口：左侧颜色展示，右侧内置拾色器，整体左对齐并严格对齐 */
.color-picker-modal.inline-class-color-picker {
    width: 342px !important;
    padding: 16px 18px 18px !important;
    gap: 14px !important;
    background: #17172a !important;
    border: 1px solid rgba(255,255,255,0.18) !important;
    border-radius: 16px !important;
    box-shadow: 0 18px 50px rgba(0,0,0,0.72) !important;
}

.inline-class-color-picker .picker-title {
    width: 100%;
    margin: 0;
    padding: 0 0 2px;
    color: #f39c12;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.25;
    text-align: left;
    letter-spacing: 0.5px;
}

.inline-class-color-picker .picker-color-row {
    display: grid;
    grid-template-columns: 112px 176px;
    gap: 14px;
    align-items: start;
}

.inline-class-color-picker .color-preview-square {
    width: 112px;
    height: 112px;
    border-radius: 10px;
    border: 2px solid rgba(255,255,255,0.32);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08) !important;
    flex-shrink: 0;
}

.inline-class-color-picker .picker-inline-control {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    min-width: 0;
}

.inline-class-color-picker .picker-label {
    display: none !important;
}

.inline-class-color-picker .picker-sv {
    position: relative;
    width: 100%;
    height: 96px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.28);
    overflow: hidden;
    cursor: crosshair;
    touch-action: none;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.25);
}

.inline-class-color-picker .picker-sv-cursor {
    position: absolute;
    width: 16px;
    height: 16px;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.72);
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.inline-class-color-picker .picker-hue-range {
    width: 100%;
    height: 14px;
    margin: 0;
    padding: 0;
    border-radius: 999px;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    background: linear-gradient(to right, red, yellow, lime, cyan, blue, magenta, red);
}

.inline-class-color-picker .picker-hue-range::-webkit-slider-runnable-track {
    height: 14px;
    border-radius: 999px;
    background: transparent;
}

.inline-class-color-picker .picker-hue-range::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
    margin-top: -3px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid rgba(0,0,0,0.65);
    box-shadow: 0 0 0 1px rgba(255,255,255,0.55);
    appearance: none;
    -webkit-appearance: none;
}

.inline-class-color-picker .picker-hue-range::-moz-range-track {
    height: 14px;
    border-radius: 999px;
    background: linear-gradient(to right, red, yellow, lime, cyan, blue, magenta, red);
}

.inline-class-color-picker .picker-hue-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid rgba(0,0,0,0.65);
    box-shadow: 0 0 0 1px rgba(255,255,255,0.55);
}

.inline-class-color-picker .picker-hex {
    height: 30px;
    line-height: 30px;
    text-align: center;
    border-radius: 10px;
    background: rgba(0,0,0,0.28);
    color: #f2f2f2;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.8px;
}

.inline-class-color-picker .picker-hex-input {
    width: 100%;
    border: 1px solid rgba(255,255,255,0.16);
    outline: 0;
    box-sizing: border-box;
    font-family: Consolas, "Courier New", monospace;
}

.inline-class-color-picker .picker-hex-input:focus {
    border-color: #f39c12;
}

.inline-class-color-picker .picker-hex-input.invalid {
    border-color: #e74c3c;
    color: #ffb7b0;
}

.inline-class-color-picker .picker-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 0;
}

.inline-class-color-picker .picker-actions button {
    height: 40px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 800;
}


.global-style-panel .bg-image-opacity-row,
.global-style-panel .bg-image-blur-row {
    grid-column: auto;
    margin-top: 2px;
}

.global-style-panel .bg-image-opacity-row,
.global-style-panel .bg-image-blur-row {
    grid-template-columns: 62px minmax(0, 1fr) 42px !important;
}

.single-cell-border-section {
    margin-top: 14px;
    margin-bottom: 10px;
}

/* ✅ 接龙表删除按钮 */
.quick-join-delete {
    width: 24px;
    min-width: 24px;
    height: 24px;
    padding: 0;
    background: #c0392b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.quick-join-delete:hover {
    background: #e74c3c;
}

/* ✅ 弹窗标题按住拖动 */
.modal-title-draggable {
    cursor: move;
    user-select: none;
}

body.modal-dragging {
    user-select: none;
    cursor: move;
}

/* ✅ 排表背景图片透明度/模糊：只影响背景图片层，不影响成员标签和团队标签 */
.grid-bg-layer {
    filter: blur(var(--board-bg-image-blur, 0px));
    transform-origin: center center;
    transition: opacity 0.2s ease, filter 0.2s ease, transform 0.2s ease;
}

/* ✅ 成员标签鼠标滑过效果：只在 hover 时生效，导出图片不触发 */
.grid-cell.cell-hover-enabled {
    transition: transform var(--cell-hover-speed, 220ms) ease,
        box-shadow var(--cell-hover-speed, 220ms) ease,
        border-color var(--cell-hover-speed, 220ms) ease,
        background var(--cell-hover-speed, 220ms) ease;
}

.grid-cell.cell-hover-enabled:hover {
    z-index: 8;
}

.grid-cell.cell-hover-glow:hover {
    box-shadow: 0 0 var(--cell-hover-glow-range, 18px) var(--cell-hover-color, rgba(243,156,18,0.65)),
        0 0 var(--cell-hover-glow-range, 18px) var(--cell-hover-color, rgba(243,156,18,0.35)) !important;
}

.grid-cell.cell-hover-lift:hover {
    transform: translateY(var(--cell-hover-translate-y, -4px));
}

.grid-cell.cell-hover-scale:hover {
    transform: scale(var(--cell-hover-scale, 1.04));
}

.grid-cell.cell-hover-lift-glow:hover {
    transform: translateY(var(--cell-hover-translate-y, -4px)) scale(var(--cell-hover-scale, 1.04));
    box-shadow: 0 0 var(--cell-hover-glow-range, 18px) var(--cell-hover-color, rgba(243,156,18,0.65)),
        0 0 var(--cell-hover-glow-range, 18px) var(--cell-hover-color, rgba(243,156,18,0.35)) !important;
}

.grid-cell.cell-hover-scale-glow:hover {
    transform: scale(var(--cell-hover-scale, 1.04));
    box-shadow: 0 0 var(--cell-hover-glow-range, 18px) var(--cell-hover-color, rgba(243,156,18,0.65)),
        0 0 var(--cell-hover-glow-range, 18px) var(--cell-hover-color, rgba(243,156,18,0.35)) !important;
}

.global-style-panel .hover-effect-grid {
    grid-template-columns: minmax(160px, 1.1fr) repeat(3, minmax(170px, 1fr));
    align-items: stretch;
}

.global-style-panel .hover-effect-grid .font-size-row {
    background: rgba(0,0,0,0.18);
    border-radius: 8px;
    padding: 9px 10px;
    margin-bottom: 0;
}

.global-style-panel .hover-effect-type-row {
    background: rgba(0,0,0,0.18);
    border-radius: 8px;
    padding: 9px 10px;
}

.global-style-panel .hover-tip {
    display: flex;
    align-items: center;
    min-height: 38px;
    margin: 0;
}
.author-signature {
    display: block !important;
	font-size: 13px;
	font-weight: 200;
	color: rgba(120, 120, 120, 0.78);
    width: 100% !important;
    text-align: right !important;
    padding: 6px 20px 13px 0 !important;
    position: static !important;
}

.tip-pill {
    font-size: 13px;
    font-weight: 500;
    color: rgba(210, 210, 210, 0.78);
}

.app-link-pill {
    text-decoration: none;
    padding: 6px 10px;
    border: 1px solid rgba(120,225,207,0.22);
    border-radius: 999px;
    background: rgba(61,204,180,0.08);
    color: rgba(223,255,249,0.86);
}

.app-link-pill:hover {
    border-color: rgba(120,225,207,0.48);
    background: rgba(61,204,180,0.16);
}

/* ==============================
   首页 / 统计分析
   ============================== */
.portal-body,
.stats-body {
    min-height: 100vh;
    padding: 0;
    background: #070a10;
    color: #eef4ff;
}

.portal-bg,
.stats-wallpaper {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 18% 18%, rgba(48, 174, 168, 0.24), transparent 28%),
        radial-gradient(circle at 80% 28%, rgba(196, 119, 61, 0.18), transparent 26%),
        radial-gradient(circle at 48% 78%, rgba(83, 97, 201, 0.22), transparent 30%),
        linear-gradient(150deg, #06080d 0%, #10141c 48%, #080b12 100%);
}

.portal-bg::after,
.stats-wallpaper::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(0,0,0,0.64), transparent 24%, transparent 76%, rgba(0,0,0,0.64)),
        radial-gradient(circle at 50% 46%, transparent 0 36%, rgba(0,0,0,0.5) 78%);
}

.portal-page {
    position: relative;
    z-index: 1;
    width: min(980px, calc(100% - 36px));
    min-height: calc(100vh - 52px);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 52px 0;
}

.portal-hero {
    margin-bottom: 34px;
    text-align: center;
}

.portal-mark {
    font-size: clamp(34px, 6vw, 58px);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: 0;
    color: #f8fbff;
    text-shadow: 0 20px 70px rgba(0,0,0,0.78);
}

.portal-line,
.tool-hero-line {
    width: min(360px, 54vw);
    height: 2px;
    margin: 16px auto 0;
    background: linear-gradient(90deg, transparent, rgba(61, 204, 180, 0.7), rgba(240, 180, 88, 0.72), transparent);
}

.portal-intro {
    max-width: 620px;
    margin: 18px auto 0;
    color: rgba(238,244,255,0.72);
    font-size: 15px;
    line-height: 1.75;
}

.portal-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.portal-card {
    position: relative;
    min-height: 172px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 112px;
    grid-template-rows: auto auto 1fr auto;
    gap: 6px 18px;
    padding: 24px;
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.1);
    background: linear-gradient(145deg, rgba(31,35,45,0.86), rgba(14,17,24,0.94));
    box-shadow: inset 0 1px rgba(255,255,255,0.08), 0 18px 48px rgba(0,0,0,0.42);
    transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}

.portal-card:hover,
.portal-card:focus-visible {
    transform: translateY(-3px);
    border-color: rgba(102, 218, 194, 0.42);
    box-shadow: inset 0 1px rgba(255,255,255,0.1), 0 22px 54px rgba(0,0,0,0.52), 0 0 38px rgba(61,204,180,0.1);
    outline: none;
}

.portal-card-tag {
    color: rgba(159,174,198,0.78);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.16em;
}

.portal-card-title {
    color: #fff;
    font-size: 26px;
    font-weight: 850;
    line-height: 1.2;
}

.portal-card-desc {
    max-width: 26em;
    color: rgba(213,224,239,0.66);
    font-size: 13px;
    line-height: 1.55;
}

.portal-card-action {
    color: #78e1cf;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.portal-card-cover {
    grid-column: 2;
    grid-row: 1 / -1;
    align-self: center;
    justify-self: end;
    width: 108px;
    height: 108px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: linear-gradient(145deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
    box-shadow: inset 0 1px rgba(255,255,255,0.14), 0 10px 30px rgba(0,0,0,0.32);
}

.portal-card-cover img {
    width: 92px;
    height: 92px;
    object-fit: contain;
    filter: drop-shadow(0 12px 20px rgba(0,0,0,0.32));
}

.tool-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
}

.tool-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 12px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    background: rgba(7,10,16,0.72);
    backdrop-filter: blur(16px);
}

.tool-brand {
    color: #bdeee4;
    font-size: 17px;
    font-weight: 850;
    letter-spacing: 0.08em;
}

.tool-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tool-nav a {
    padding: 8px 12px;
    border-radius: 999px;
    color: rgba(228,236,248,0.72);
    font-size: 13px;
    font-weight: 700;
}

.tool-nav a:hover,
.tool-nav a.active {
    background: rgba(61,204,180,0.13);
    color: #d7fff7;
}

.stats-page {
    width: min(1380px, calc(100% - 32px));
    margin: 0 auto;
    padding: 30px 0 52px;
}

.stats-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.tool-kicker {
    margin-bottom: 8px;
    color: rgba(120,225,207,0.72);
    font-size: 12px;
    font-weight: 850;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.stats-hero h1 {
    margin: 0;
    text-align: left;
    font-size: clamp(28px, 4vw, 42px);
    letter-spacing: 0;
    background: linear-gradient(94deg, #ffffff, #78e1cf 36%, #f1b665 70%, #ffffff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stats-hero p {
    max-width: 720px;
    margin: 12px 0 0;
    color: rgba(224,235,249,0.72);
    line-height: 1.68;
}

.stats-tabs,
.rank-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.stats-tab,
.rank-tab {
    height: 38px;
    padding: 0 14px;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    color: rgba(230,238,250,0.76);
    cursor: pointer;
    font-weight: 800;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.stats-tab.active,
.rank-tab.active,
.stats-tab:hover,
.rank-tab:hover {
    border-color: rgba(120,225,207,0.48);
    background: rgba(61,204,180,0.16);
    color: #eafffb;
}

.stats-upload-panel,
.stats-panel,
.stats-empty,
.summary-tile,
.stat-card,
.league-team,
.league-vs {
    border: 1px solid rgba(255,255,255,0.09);
    background: linear-gradient(145deg, rgba(28,32,42,0.82), rgba(11,14,21,0.9));
    box-shadow: inset 0 1px rgba(255,255,255,0.08), 0 12px 34px rgba(0,0,0,0.34);
    backdrop-filter: blur(18px);
}

.stats-upload-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    margin-bottom: 18px;
    padding: 16px;
    border-radius: 18px;
}

.stats-upload-box {
    min-height: 104px;
    display: grid;
    align-content: center;
    gap: 8px;
    padding: 20px;
    border: 1px dashed rgba(120,225,207,0.38);
    border-radius: 14px;
    background: rgba(61,204,180,0.06);
    cursor: pointer;
}

.stats-upload-box input {
    display: none;
}

.upload-title {
    color: #fff;
    font-size: 18px;
    font-weight: 850;
}

.upload-desc,
.upload-file {
    color: rgba(220,232,246,0.66);
    font-size: 13px;
}

.upload-file {
    color: #f3c679;
    font-weight: 800;
}

.stats-toolbar {
    display: grid;
    gap: 10px;
    min-width: 240px;
}

.stats-select {
    height: 40px;
    padding: 0 12px;
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 8px;
    background: rgba(0,0,0,0.3);
    color: #eef4ff;
    outline: none;
}

.stats-empty {
    padding: 54px 24px;
    border-radius: 18px;
    text-align: center;
    color: rgba(226,236,248,0.66);
}

.stats-empty.compact {
    padding: 22px;
}

.stats-view {
    display: none;
}

.stats-view.active,
.stats-view:not([hidden]) {
    display: block;
}

.stats-summary-grid,
.stats-card-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 14px;
}

.stats-card-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.summary-tile,
.stat-card {
    min-height: 112px;
    display: grid;
    gap: 7px;
    align-content: center;
    padding: 18px;
    border-radius: 14px;
}

.summary-tile span,
.stat-card span {
    color: rgba(174,190,214,0.78);
    font-size: 12px;
    font-weight: 800;
}

.summary-tile strong,
.stat-card strong {
    min-width: 0;
    color: #fff;
    font-size: clamp(20px, 2vw, 28px);
    line-height: 1.1;
    word-break: break-word;
}

.summary-tile em,
.stat-card em {
    color: rgba(120,225,207,0.8);
    font-size: 12px;
    font-style: normal;
}

.stats-panel {
    margin-bottom: 14px;
    padding: 18px;
    border-radius: 18px;
}

.stats-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.stats-panel h2 {
    margin: 0 0 6px;
    color: #fff;
    font-size: 19px;
    line-height: 1.3;
}

.stats-panel p {
    margin: 0;
    color: rgba(211,224,241,0.62);
    font-size: 13px;
}

.stats-two-col {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
}

.stats-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

.stats-table th,
.stats-table td {
    padding: 12px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    text-align: left;
    font-size: 13px;
}

.stats-table th {
    color: rgba(180,197,219,0.74);
    font-weight: 850;
}

.stats-table td {
    color: rgba(241,246,255,0.9);
}

.rank-wide-table {
    min-width: 1180px;
    background: #111827;
    border: 1px solid rgba(74,120,190,0.32);
    border-collapse: separate;
    border-spacing: 0;
}

.rank-wide-table th,
.rank-wide-table td {
    height: 46px;
    border-bottom: 1px solid rgba(148,163,184,0.16);
    padding: 0 12px;
    white-space: nowrap;
}

.rank-wide-table th {
    background: rgba(10,16,27,0.72);
    color: #e8ecf4;
    font-size: 14px;
}

.rank-wide-table tbody tr {
    transition: background 0.16s ease;
}

.rank-wide-table tbody tr:hover {
    background: rgba(56,189,248,0.06);
}

.rank-index {
    color: #67e8f9 !important;
    font-weight: 900;
}

.rank-guild {
    color: #f8fafc !important;
    font-weight: 900;
}

.rank-role {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(250,204,21,0.12);
    color: #fef3c7;
    font-weight: 900;
}

.class-chip {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(243,198,121,0.12);
    color: #f5cf8e;
    font-size: 12px;
    font-weight: 800;
}

.class-distribution,
.role-insights,
.league-insights {
    display: grid;
    gap: 12px;
}

.class-row {
    display: grid;
    gap: 6px;
}

.class-row-head,
.compare-head,
.league-class-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.class-row-head span,
.compare-head span {
    color: #f8fbff;
    font-weight: 850;
}

.class-row-head strong,
.compare-head strong {
    color: #f3c679;
    font-size: 13px;
}

.class-bar,
.compare-track {
    height: 9px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255,255,255,0.08);
}

.class-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #3dccb4, #f3c679);
}

.class-row-meta {
    color: rgba(210,222,238,0.58);
    font-size: 12px;
}

.insight-item {
    display: grid;
    gap: 5px;
    padding: 13px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.045);
}

.insight-item span {
    color: rgba(174,190,214,0.76);
    font-size: 12px;
    font-weight: 800;
}

.insight-item strong {
    color: #f9fbff;
    font-size: 15px;
    line-height: 1.42;
}

.league-scoreboard {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 96px minmax(0, 1fr);
    gap: 14px;
    margin-bottom: 14px;
}

.league-team,
.league-vs {
    min-height: 128px;
    display: grid;
    place-items: center;
    text-align: center;
    border-radius: 18px;
    padding: 18px;
}

.league-team span {
    color: rgba(174,190,214,0.78);
    font-size: 12px;
    font-weight: 850;
}

.league-team strong {
    color: #fff;
    font-size: clamp(24px, 4vw, 40px);
    line-height: 1.1;
}

.league-team em {
    color: #78e1cf;
    font-style: normal;
    font-weight: 850;
}

.league-team.enemy em {
    color: #f3c679;
}

.league-vs {
    color: rgba(255,255,255,0.72);
    font-size: 20px;
    font-weight: 900;
}

.metric-compare {
    display: grid;
    gap: 14px;
}

.compare-row {
    display: grid;
    gap: 8px;
}

.compare-track {
    display: flex;
}

.compare-track .ally {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #3dccb4, #78e1cf);
}

.compare-track .enemy {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #f3c679, #d66f6f);
}

.league-classes {
    display: grid;
    gap: 8px;
}

.league-class-row {
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255,255,255,0.045);
}

.league-class-row span {
    color: #fff;
    font-weight: 850;
}

.league-class-row strong,
.league-class-row em {
    min-width: 54px;
    text-align: right;
    font-style: normal;
    font-weight: 850;
}

.league-class-row strong {
    color: #78e1cf;
}

.league-class-row em {
    color: #f3c679;
}

@media (max-width: 1120px) {
    .stats-summary-grid,
    .stats-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stats-hero,
    .stats-panel-head,
    .stats-upload-panel {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 760px) {
    .portal-page {
        justify-content: flex-start;
        padding-top: 42px;
    }

    .portal-grid,
    .stats-two-col,
    .league-scoreboard {
        grid-template-columns: 1fr;
    }

    .portal-card {
        grid-template-columns: minmax(0, 1fr) 82px;
        min-height: 150px;
        padding: 18px;
        border-radius: 16px;
    }

    .portal-card-title {
        font-size: 22px;
    }

    .portal-card-cover {
        width: 78px;
        height: 78px;
        border-radius: 12px;
    }

    .portal-card-cover img {
        width: 68px;
        height: 68px;
    }

    .tool-topbar {
        position: static;
        flex-direction: column;
        align-items: flex-start;
        padding: 12px 16px;
    }

    .tool-nav {
        width: 100%;
        overflow-x: auto;
        padding-bottom: 2px;
    }

    .stats-page {
        width: min(100% - 20px, 1380px);
        padding-top: 18px;
    }

    .stats-summary-grid,
    .stats-card-grid {
        grid-template-columns: 1fr;
    }

    .league-vs {
        min-height: 64px;
    }
}

/* ==============================
   联赛分析仪表盘
   ============================== */
.league-dashboard-page {
    width: min(1720px, calc(100% - 18px));
}

.stats-controls {
    display: flex;
    align-items: center;
    gap: 18px;
    min-height: 82px;
    margin-bottom: 18px;
    padding: 16px 22px;
    border: 1px solid rgba(74,120,190,0.38);
    border-radius: 14px;
    background: #101725;
    box-shadow: inset 0 1px rgba(255,255,255,0.08), 0 12px 34px rgba(0,0,0,0.32);
}

.league-file-control {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: rgba(218,230,246,0.72);
    cursor: pointer;
}

.league-file-control input {
    display: none;
}

.league-file-control strong {
    max-width: 360px;
    overflow: hidden;
    color: #f4f8ff;
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.league-file-control em {
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(20,184,166,0.16);
    color: #49e1ca;
    font-size: 12px;
    font-style: normal;
    font-weight: 800;
}

.league-force-picker {
    display: inline-grid;
    grid-template-columns: auto 140px;
    gap: 8px;
    align-items: center;
    color: rgba(218,230,246,0.72);
}

.league-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(218,230,246,0.72);
    font-size: 14px;
    white-space: nowrap;
}

.league-check input {
    width: 16px;
    height: 16px;
    accent-color: #4aa3ff;
}

.league-control-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.league-metric-cards {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 18px;
}

.league-top-card,
.league-chart-panel,
.league-bar-panel {
    border: 1px solid rgba(74,120,190,0.38);
    border-radius: 14px;
    background: #101725;
    box-shadow: inset 0 1px rgba(255,255,255,0.07), 0 12px 34px rgba(0,0,0,0.3);
}

.league-top-card {
    min-height: 162px;
    display: grid;
    align-content: center;
    gap: 14px;
    padding: 22px;
}

.league-top-title {
    text-align: center;
    color: rgba(218,230,246,0.72);
    font-size: 16px;
}

.league-top-values {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: end;
    gap: 14px;
}

.league-top-values strong {
    font-size: clamp(22px, 2vw, 28px);
    line-height: 1;
}

.league-top-values .ally {
    color: #4aa3ff;
}

.league-top-values .enemy {
    color: #ff5f8f;
    text-align: right;
}

.league-top-values span {
    color: rgba(218,230,246,0.66);
    font-size: 13px;
    text-align: center;
}

.league-top-labels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    color: rgba(218,230,246,0.58);
    font-size: 12px;
    text-align: center;
}

.league-top-track {
    position: relative;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(4,8,16,0.52);
}

.league-top-track i {
    position: absolute;
    top: 0;
    bottom: 0;
}

.league-top-track .ally {
    left: 0;
    background: #4aa3ff;
}

.league-top-track .enemy {
    right: 0;
    background: #ff5f8f;
}

.league-primary-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px;
    margin-bottom: 18px;
}

.league-chart-panel {
    min-height: 500px;
    padding: 18px 20px;
}

.league-chart-panel h2,
.league-bar-panel h2 {
    margin: 0;
    color: rgba(238,244,255,0.9);
    font-size: 16px;
    text-align: center;
}

.league-radar-host {
    display: grid;
    place-items: center;
    min-height: 440px;
}

.league-radar-svg {
    width: min(620px, 100%);
    height: 360px;
}

.league-radar-ring {
    fill: rgba(255,255,255,0.018);
    stroke: rgba(148,163,184,0.18);
}

.league-radar-axis {
    stroke: rgba(148,163,184,0.22);
}

.league-radar-label {
    fill: rgba(218,230,246,0.72);
    font-size: 14px;
    text-anchor: middle;
    dominant-baseline: middle;
}

.league-radar-poly {
    cursor: crosshair;
    stroke-width: 3;
    transform-origin: 260px 166px;
    animation: chart-fade-scale 0.36s ease both;
    transition: opacity 0.24s ease, transform 0.24s ease;
}

.league-radar-poly.is-hidden {
    opacity: 0;
    transform: scale(0.88);
    pointer-events: none;
}

.league-radar-poly.ally {
    fill: rgba(74,163,255,0.24);
    stroke: #4aa3ff;
}

.league-radar-poly.enemy {
    fill: rgba(255,95,143,0.24);
    stroke: #ff5f8f;
}

.league-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.league-toggle {
    height: 28px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: rgba(238,244,255,0.86);
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
}

.league-toggle i {
    width: 24px;
    height: 16px;
    border-radius: 4px;
    box-shadow: inset 0 1px rgba(255,255,255,0.22);
}

.league-toggle.muted i {
    background: #f8fafc !important;
}

.league-toggle.muted span {
    color: rgba(238,244,255,0.52);
}

.league-donut-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: center;
    min-height: 440px;
}

.league-donut-card h3 {
    margin: 8px 0 6px;
    text-align: center;
    color: rgba(218,230,246,0.72);
    font-size: 14px;
}

.league-donut-svg {
    width: 100%;
    height: auto;
    overflow: visible;
}

.donut-segment {
    cursor: crosshair;
    transform-origin: center;
    animation: donut-draw 0.46s ease both;
    transition: opacity 0.22s ease, stroke-width 0.22s ease;
}

.donut-segment:hover {
    opacity: 0.82;
    stroke-width: 38;
}

.donut-hole {
    fill: #101725;
}

.donut-label {
    font-size: 12px;
    font-weight: 800;
    paint-order: stroke;
    stroke: rgba(16,23,37,0.92);
    stroke-width: 3px;
    stroke-linejoin: round;
    animation: chart-fade-up 0.36s ease both;
}

.donut-label-line {
    opacity: 0.72;
    stroke-width: 1;
    animation: chart-fade-scale 0.36s ease both;
}

.league-bar-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.league-bar-panel {
    min-height: 338px;
    padding: 16px;
}

.league-chart-head {
    display: grid;
    gap: 6px;
}

.league-chart-head .league-legend {
    justify-content: flex-end;
}

.league-chart-head .league-toggle {
    height: 22px;
    padding: 0 4px;
    font-size: 12px;
}

.league-chart-head .league-toggle i {
    width: 14px;
    height: 14px;
}

.league-bar-svg {
    width: 100%;
    height: 270px;
    overflow: visible;
}

.league-grid-line {
    stroke: rgba(148,163,184,0.17);
}

.league-y-label,
.league-bar-label {
    fill: rgba(218,230,246,0.68);
    font-size: 11px;
}

.league-bar {
    cursor: crosshair;
    transform-box: fill-box;
    transform-origin: bottom;
    animation: bar-grow 0.42s ease both;
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.league-bar.is-hidden {
    opacity: 0;
    transform: scaleY(0.05);
    pointer-events: none;
}

.league-bar:hover {
    opacity: 0.75;
}

.league-bar.ally {
    fill: #4aa3ff;
}

.league-bar.enemy {
    fill: #ff5f8f;
}

.league-chart-tooltip {
    position: fixed;
    z-index: 5000;
    max-width: 320px;
    padding: 8px 10px;
    border: 1px solid rgba(148,163,184,0.3);
    border-radius: 8px;
    background: rgba(8,13,22,0.96);
    color: #f8fbff;
    box-shadow: 0 12px 30px rgba(0,0,0,0.45);
    font-size: 12px;
    line-height: 1.45;
    opacity: 0;
    pointer-events: none;
    transform: translateY(4px);
    transition: opacity 0.12s ease, transform 0.12s ease;
}

.league-chart-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes chart-fade-scale {
    from {
        opacity: 0;
        transform: scale(0.92);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes chart-fade-up {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes donut-draw {
    from {
        opacity: 0;
        stroke-dashoffset: 490;
    }
    to {
        opacity: 1;
    }
}

@keyframes bar-grow {
    from {
        opacity: 0;
        transform: scaleY(0.05);
    }
    to {
        opacity: 1;
        transform: scaleY(1);
    }
}

@media (max-width: 1320px) {
    .league-metric-cards,
    .league-bar-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .league-primary-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .stats-controls {
        align-items: stretch;
        flex-direction: column;
    }

    .league-control-actions {
        margin-left: 0;
    }

    .league-metric-cards,
    .league-bar-grid,
    .league-donut-grid {
        grid-template-columns: 1fr;
    }
}

/* ==============================
   2026-07 统一工具页视觉与统计详情
   ============================== */
body:not(.portal-body):not(.stats-body) {
    background:
        radial-gradient(circle at 12% 12%, rgba(61,204,180,0.14), transparent 28%),
        radial-gradient(circle at 82% 18%, rgba(243,198,121,0.12), transparent 26%),
        linear-gradient(150deg, #070a10 0%, #10141c 48%, #080b12 100%) !important;
    color: #e8ecf4;
}

.app-header,
.section,
.toolbar-card,
.grid-wrapper,
.chain-list,
.substitute-list,
.custom-asset-panel {
    border-color: rgba(255,255,255,0.08) !important;
    background: linear-gradient(145deg, rgba(28,32,42,0.82), rgba(11,14,21,0.9)) !important;
    box-shadow: inset 0 1px rgba(255,255,255,0.08), 0 12px 34px rgba(0,0,0,0.34);
    backdrop-filter: blur(18px);
}

.app-header {
    border-radius: 18px;
}

.app-kicker,
.tool-kicker,
.section-title {
    color: #78e1cf !important;
}

.section-title {
    border-left-color: #78e1cf !important;
}

.app-subtitle,
.section-desc,
.toolbar-label,
.status-bar,
.custom-asset-subtitle {
    color: rgba(218,230,246,0.62) !important;
}

.btn-primary,
.btn-info,
.btn-import-data {
    background: linear-gradient(135deg, #267ec4, #2bb9a4) !important;
}

.btn-success {
    background: linear-gradient(135deg, #20966f, #4fc18d) !important;
}

.btn-danger {
    background: linear-gradient(135deg, #a6444d, #d76f6f) !important;
}

.btn-export-data,
.btn-material,
.btn-style-save {
    background: linear-gradient(135deg, #b77a32, #f0bf70) !important;
    color: #16110a !important;
}

.chain-item,
.substitute-item,
.toolbar-group {
    border-color: rgba(255,255,255,0.1) !important;
    background: rgba(255,255,255,0.045) !important;
}

.portal-card {
    grid-template-columns: minmax(0, 1fr) !important;
    text-decoration: none !important;
}

.portal-card *,
.portal-card:hover,
.portal-card:focus-visible {
    text-decoration: none !important;
}

.portal-card-cover {
    display: none !important;
}

.stats-body .app-shell {
    position: relative;
    z-index: 1;
    padding: 24px;
}

.stats-body .shared-tool-header {
    margin-bottom: 22px;
}

.stats-body .shared-tool-header h1 {
    margin: 0;
    text-align: left;
    font-size: clamp(28px, 3.4vw, 42px);
    letter-spacing: 0;
    background: linear-gradient(94deg, #ffffff, #78e1cf 36%, #f1b665 70%, #ffffff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stats-body .app-avatar-placeholder {
    font-size: 27px;
    font-weight: 900;
}

.app-link-pill.active,
.stats-side-link {
    border-color: rgba(120,225,207,0.54);
    background: rgba(61,204,180,0.18);
    color: #eafffb;
}

.stats-side-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid rgba(120,225,207,0.28);
    border-radius: 999px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 800;
}

.player-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.player-list.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.player-list.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.player-list.cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.player-column-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.player-column-controls button {
    height: 32px;
    padding: 0 12px;
    border: 1px solid rgba(148,163,184,0.22);
    border-radius: 999px;
    background: rgba(255,255,255,0.05);
    color: rgba(226,236,248,0.72);
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
}

.player-column-controls button.active,
.player-column-controls button:hover {
    border-color: rgba(56,189,248,0.7);
    background: #38bdf8;
    color: #07111d;
}

.player-card {
    min-width: 0;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) repeat(3, minmax(64px, auto));
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    background: rgba(255,255,255,0.045);
    color: #eef4ff;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.player-list.cols-3 .player-card,
.player-list.cols-4 .player-card {
    grid-template-columns: 38px minmax(0, 1fr);
}

.player-list.cols-3 .player-mini,
.player-list.cols-4 .player-mini {
    display: none;
}

.player-card:hover,
.player-card:focus-visible {
    border-color: rgba(120,225,207,0.45);
    background: rgba(61,204,180,0.09);
    transform: translateY(-1px);
    outline: none;
}

.player-class-icon {
    width: 34px;
    height: 34px;
    object-fit: contain;
    filter: drop-shadow(0 6px 10px rgba(0,0,0,0.35));
}

.player-class-icon.large {
    width: 40px;
    height: 40px;
}

.player-main {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.player-main strong {
    overflow: hidden;
    color: #fff;
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-main em,
.player-mini small {
    color: rgba(174,190,214,0.72);
    font-size: 12px;
    font-style: normal;
}

.player-mini {
    display: grid;
    justify-items: end;
    gap: 2px;
}

.player-mini b {
    color: #f3c679;
    font-size: 13px;
}

.class-chip {
    gap: 6px;
}

.class-chip img,
.inline-class-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    vertical-align: middle;
}

.inline-class-icon {
    margin-right: 7px;
}

.player-modal[hidden] {
    display: none;
}

.player-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.player-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.68);
    backdrop-filter: blur(8px);
}

.player-modal-card {
    position: relative;
    z-index: 1;
    width: min(760px, calc(100vw - 28px));
    max-height: min(820px, calc(100vh - 28px));
    overflow: auto;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 16px;
    background: #090e17;
    box-shadow: 0 28px 90px rgba(0,0,0,0.72), inset 0 1px rgba(255,255,255,0.08);
}

.player-modal-head {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    background: rgba(9,14,23,0.94);
    backdrop-filter: blur(14px);
}

.player-modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.player-modal-title h2 {
    margin: 0;
    color: #fff;
    font-size: 18px;
}

.player-modal-title p {
    margin: 4px 0 0;
    color: rgba(174,190,214,0.76);
    font-size: 12px;
}

.player-modal-title span {
    display: inline-flex;
    margin-left: 6px;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(37,99,235,0.28);
    color: #93c5fd;
    font-weight: 800;
}

.player-modal-close {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: rgba(220,232,246,0.72);
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
}

.player-modal-close:hover {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.player-detail-tabs {
    display: flex;
    gap: 10px;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.player-detail-tabs button {
    height: 34px;
    padding: 0 14px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: rgba(218,230,246,0.72);
    cursor: pointer;
    font-weight: 800;
}

.player-detail-tabs button.active,
.player-detail-tabs button:hover {
    background: rgba(37,99,235,0.36);
    color: #dbeafe;
}

.player-modal-body {
    display: grid;
    gap: 16px;
    padding: 16px 20px 22px;
}

.player-radar-panel {
    min-height: 292px;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 8px;
    border: 1px solid rgba(74,120,190,0.36);
    border-radius: 12px;
    background: #0f1728;
}

.radar-title {
    color: #e8ecf4;
    font-size: 13px;
    font-weight: 900;
}

.player-radar {
    width: min(360px, 100%);
    height: 240px;
}

.radar-ring {
    fill: none;
    stroke: rgba(148,163,184,0.18);
}

.radar-axis {
    stroke: rgba(148,163,184,0.18);
}

.radar-label {
    fill: #aebed6;
    font-size: 12px;
    text-anchor: middle;
    dominant-baseline: middle;
}

.radar-self {
    fill: rgba(74, 163, 255, 0.32);
    stroke: #4aa3ff;
    stroke-width: 2.4;
}

.radar-avg {
    fill: none;
    stroke: rgba(148,163,184,0.65);
    stroke-width: 2;
    stroke-dasharray: 6 4;
}

.radar-legend {
    display: flex;
    gap: 16px;
    color: rgba(218,230,246,0.72);
    font-size: 12px;
}

.radar-legend i {
    display: inline-block;
    width: 24px;
    height: 12px;
    margin-right: 6px;
    border-radius: 3px;
    vertical-align: -2px;
}

.radar-legend .self {
    background: #4aa3ff;
}

.radar-legend .avg {
    background: #64748b;
}

.player-detail-table {
    width: 100%;
    border-collapse: collapse;
}

.player-detail-table th,
.player-detail-table td {
    padding: 10px 12px;
    border: 1px solid rgba(255,255,255,0.08);
    text-align: left;
    color: rgba(232,236,244,0.92);
}

.player-detail-table th {
    background: rgba(255,255,255,0.035);
    color: rgba(174,190,214,0.82);
    font-weight: 800;
}

.player-detail-table td:nth-child(2),
.value-good {
    color: #6ee7b7 !important;
    font-weight: 900;
}

.value-warn {
    color: #fb8aa2 !important;
    font-weight: 900;
}

.league-class-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 64px 64px;
    gap: 8px;
    padding: 0 12px 10px;
    color: rgba(174,190,214,0.7);
    font-size: 12px;
    font-weight: 900;
}

.league-class-head strong,
.league-class-head em {
    text-align: right;
    font-style: normal;
}

.league-class-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 64px 64px;
}

.league-class-row span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 1120px) {
    .player-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    body:not(.portal-body):not(.stats-body),
    .stats-body .app-shell {
        padding: 12px;
    }

    .player-card {
        grid-template-columns: 36px minmax(0, 1fr);
    }

    .player-mini {
        grid-column: 2;
        display: inline-grid;
        justify-items: start;
        margin-right: 12px;
    }

    .player-modal {
        padding: 8px;
        align-items: stretch;
    }

    .player-modal-card {
        width: 100%;
        max-height: calc(100vh - 16px);
    }
}

/* The roster workspace should use the full desktop canvas instead of inheriting
   the shared dashboard width cap. This also leaves the action bar enough room. */
.roster-body .app-header,
.roster-body .container {
    width: 100%;
    max-width: none;
}

@media (min-width: 1280px) {
    .roster-body .schedule-section .toolbar-card {
        flex-wrap: nowrap;
        align-items: center;
        gap: 6px;
    }

    .roster-body .schedule-section .toolbar-group {
        flex-wrap: nowrap;
        gap: 5px;
    }

    .roster-body .schedule-section .toolbar-group .btn,
    .roster-body .schedule-section .toolbar-label {
        padding-inline: 9px;
    }

    .roster-body .schedule-section .roster-plan-picker {
        min-width: 148px;
    }
}
