* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: #f8f9fa;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    padding: 80px 1.5rem 2rem;
    margin: 0;
}
.navbar {
    height: 80px !important;
}
.container-main {
    max-width: 1400px;
    width: 100%;
    background: #ffffff;
    border-radius: 2rem;
    padding: 2rem;
    box-shadow: 0 5px 15px 2px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.05);
	margin-top: 20px;
	
}

.header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e9edf4;
}


h1 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    background-clip: text;
    color: #333;
    text-align: center;
	margin-bottom:10px;
	margin-top:-0px;
}


.subtitle {
    color: #6c757d;
    font-size: 0.9rem;
    margin-left: auto;
}

.tool-intro {
    margin-bottom: 1.5rem;
    padding: 0.8rem 1.2rem;
    background: #f0f7ff;
    border-radius: 10px;
    border-left: 4px solid #0D6EFD;
}

.tool-intro p {
    margin: 0;
    color: #475569;
    font-size: 0.95rem;
}

.tool-intro strong {
    color: #0b1a33;
}

.main-layout {
    display: flex;
    gap: 2rem;
    align-items: stretch;
}

/* ===== 左侧输入面板 ===== */
.input-panel {
    flex: 0 0 380px;
    background: #f8f9fa;
    border-radius: 1.5rem;
    padding: 1.5rem;
    border: 1px solid #e9edf4;
}

.panel-title {
    font-weight: 600;
    color: #0b1a33;
    font-size: 1rem;
    margin-bottom: 0.8rem;
    border-bottom: 2px solid #0D6EFD;
    padding-bottom: 0.3rem;
    display: inline-block;
}

.data-table-wrap {
    max-height: 500px;
    overflow-y: auto;
    background: #ffffff;
    border-radius: 0.8rem;
    border: 1px solid #e2e8f0;
}

.data-table-wrap::-webkit-scrollbar {
    width: 4px;
}

.data-table-wrap::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 2px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.data-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.data-table th {
    background: #f1f4f9;
    padding: 0.4rem 0.5rem;
    text-align: left;
    font-weight: 600;
    color: #475569;
    border-bottom: 1px solid #e2e8f0;
}

.data-table td {
    padding: 0.3rem 0.4rem;
    border-bottom: 1px solid #f1f4f9;
    vertical-align: middle;
}

.data-table .row-index {
    text-align: center;
    color: #94a3b8;
    font-size: 0.75rem;
    width: 28px;
}

.name-input,
.value-input {
    width: 100%;
    padding: 0.3rem 0.5rem;
    border: 1px solid #dce2ec;
    border-radius: 4px;
    font-size: 0.85rem;
    outline: none;
    background: #ffffff;
    color: #0b1a33;
    transition: border 0.15s;
}

.name-input:focus,
.value-input:focus {
    border-color: #0D6EFD;
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.1);
}

.btn-delete-row {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    transition: 0.15s;
}

.btn-delete-row:hover {
    color: #ef4444;
    background: #fef2f2;
}

.table-actions {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.6rem;
    flex-wrap: wrap;
}

.btn-add-row {
    padding: 0.3rem 0.8rem;
    background: #0D6EFD;
    color: white;
    border: none;
    border-radius: 0.4rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: 0.15s;
}

.btn-add-row:hover {
    background: #0b5ed7;
}

.btn-clear-data {
    padding: 0.3rem 0.8rem;
    background: #e9edf4;
    color: #475569;
    border: none;
    border-radius: 0.4rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: 0.15s;
}

.btn-clear-data:hover {
    background: #dce2ec;
}

.btn-sample {
    padding: 0.3rem 0.8rem;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 0.4rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: 0.15s;
}

.btn-sample:hover {
    background: #059669;
}

.ranking-options {
    margin-top: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: #475569;
    cursor: pointer;
}

.radio-label input[type="radio"] {
    accent-color: #0D6EFD;
    width: 15px;
    height: 15px;
    cursor: pointer;
}

.btn-primary {
    width: 100%;
    margin-top: 0.8rem;
    padding: 0.6rem;
    background: #0D6EFD;
    color: white;
    border: none;
    border-radius: 0.6rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: 0.15s;
}

.btn-primary:hover {
    background: #0b5ed7;
}

/* ===== 右侧结果面板 ===== */
.result-panel {
    flex: 1;
    background: #f8f9fa;
    border-radius: 1.5rem;
    padding: 1.5rem;
    border: 1px solid #e9edf4;
}

.ranking-table-wrap {
    max-height: 200px;
    overflow-y: auto;
    background: #ffffff;
    border-radius: 0.8rem;
    border: 1px solid #e2e8f0;
    margin-bottom: 1rem;
}

.ranking-table-wrap::-webkit-scrollbar {
    width: 4px;
}

.ranking-table-wrap::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 2px;
}

.ranking-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.ranking-table th {
    background: #f1f4f9;
    padding: 0.4rem 0.8rem;
    text-align: left;
    font-weight: 600;
    color: #475569;
    border-bottom: 1px solid #e2e8f0;
}

.ranking-table td {
    padding: 0.3rem 0.8rem;
    border-bottom: 1px solid #f1f4f9;
}

.ranking-table .rank-1 {
    color: #f59e0b;
    font-weight: 700;
}

.ranking-table .rank-2 {
    color: #94a3b8;
    font-weight: 600;
}

.ranking-table .rank-3 {
    color: #d97706;
    font-weight: 600;
}

.rank-medal {
    font-size: 1.2rem;
}

/* 图表类型选择 */
.chart-type-bar {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 0.8rem;
}

.chart-type-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #475569;
}

.chart-type-btns {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
}

.chart-type-btn {
    padding: 0.25rem 0.7rem;
    background: #ffffff;
    border: 1px solid #dce2ec;
    border-radius: 1.2rem;
    font-size: 0.7rem;
    color: #64748b;
    cursor: pointer;
    transition: 0.15s;
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.chart-type-btn:hover {
    border-color: #0D6EFD;
    color: #0D6EFD;
}

.chart-type-btn.active {
    background: #0D6EFD;
    border-color: #0D6EFD;
    color: white;
}

.chart-container {
    background: #ffffff;
    border-radius: 1rem;
    border: 1px solid #e2e8f0;
    height: 500px;
    position: relative;
    overflow: hidden;
}

.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

.chart-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
}

.chart-placeholder i {
    font-size: 3rem;
    color: #cbd5e1;
    margin-bottom: 0.5rem;
}

.chart-actions {
    display: flex;
    gap: 0.6rem;
    margin-top: 0.8rem;
}

.btn-download {
    padding: 0.4rem 1.2rem;
    background: #0D6EFD;
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: 0.15s;
}

.btn-download:hover {
    background: #0b5ed7;
}

.btn-download:last-child {
    background: #10b981;
}

.btn-download:last-child:hover {
    background: #059669;
}


@media (max-width: 992px) { .d-lg-flex { display: none; } }

@media (max-width: 1024px) {
    .main-layout {
        flex-direction: column;
    }
    .input-panel {
        flex: 1;
    }
}

@media (max-width: 600px) {
    .container-main {
        padding: 1rem;
    }
    .input-panel,
    .result-panel {
        padding: 1rem;
    }
    .header h1 {
        font-size: 1.3rem;
    }
    .header .subtitle {
        display: none;
    }
    .chart-type-btns {
        gap: 0.2rem;
    }
    .chart-type-btn {
        font-size: 0.65rem;
        padding: 0.2rem 0.5rem;
    }
    .chart-container {
        height: 280px;
    }
}

/* 表格样式下载按钮禁用状态 */
.btn-download:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 表格样式容器 - 确保导出完整 */
.chart-table-style {
    background: #ffffff !important;
}

/* 前三名悬停效果 */
.chart-table-style table tr:hover {
    transition: all 0.2s;
}