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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans SC', sans-serif;
    background: #0f0f0f;
    min-height: 100vh;
    padding: 40px 20px;
    color: #e0e0e0;
}

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

header {
    position: relative;
    text-align: center;
    color: #ffffff;
    margin-bottom: 50px;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

header h1 {
    font-size: 2.8em;
    font-weight: 300;
    margin-bottom: 10px;
    letter-spacing: 2px;
    color: #ffffff;
}

header p {
    font-size: 1em;
    opacity: 0.6;
    font-weight: 300;
}

.settings-btn {
    position: absolute;
    top: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    width: 44px;
    height: 44px;
    border-radius: 2px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.settings-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.settings-btn svg {
    width: 20px;
    height: 20px;
}

.settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.settings-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.settings-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 400px;
    height: 100vh;
    background: rgba(20, 20, 20, 0.98);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.settings-panel.show {
    transform: translateX(0);
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.settings-header h3 {
    margin: 0;
    color: #ffffff;
    font-size: 1.4em;
    font-weight: 300;
    letter-spacing: 1px;
}

.close-btn {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 2em;
    width: 36px;
    height: 36px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    line-height: 1;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.settings-content {
    padding: 30px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 10px 0;
    user-select: none;
}

.section-header:hover {
    opacity: 0.8;
}

.section-header h3 {
    margin: 0;
    color: #ffffff;
    font-size: 1.1em;
    font-weight: 300;
    letter-spacing: 1px;
}

.toggle-icon {
    font-size: 1.5em;
    color: #ffffff;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.toggle-icon.open {
    transform: rotate(45deg);
}

.section-content {
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.section-content > div:first-child {
    padding-top: 20px;
}

.config-group {
    margin-bottom: 25px;
}

.config-group:last-child {
    margin-bottom: 0;
}

.config-group label {
    display: block;
    margin-bottom: 12px;
    font-weight: 400;
    color: #b0b0b0;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.help-text {
    display: block;
    margin-top: 8px;
    font-size: 0.8em;
    color: #666;
    font-style: italic;
}

.config-group input,
.config-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    font-size: 1em;
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    transition: all 0.3s ease;
}

.config-group input:focus,
.config-group select:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.08);
}

.config-group select option {
    background: #1a1a1a;
    color: #ffffff;
}

.file-list {
    background: rgba(255, 255, 255, 0.03);
    padding: 35px;
    border-radius: 2px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 40px;
    backdrop-filter: blur(10px);
}

.file-list h2 {
    margin-bottom: 30px;
    color: #ffffff;
    font-size: 1.4em;
    font-weight: 300;
    letter-spacing: 1px;
}

.file-item {
    background: rgba(255, 255, 255, 0.02);
    padding: 24px;
    border-radius: 2px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.file-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateX(4px);
}

.file-info {
    flex: 1;
    margin-right: 20px;
}

.file-name {
    font-weight: 400;
    font-size: 1em;
    color: #ffffff;
    margin-bottom: 12px;
    word-break: break-all;
}

.file-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.file-sources,
.file-size {
    font-size: 0.85em;
    color: #808080;
}

.file-sources span,
.file-size span {
    display: inline-block;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 12px;
    border-radius: 2px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.file-size.loading span {
    opacity: 0.5;
}

.download-section {
    background: rgba(255, 255, 255, 0.03);
    padding: 35px;
    border-radius: 2px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
}

.download-section h2 {
    margin-bottom: 30px;
    color: #ffffff;
    font-size: 1.4em;
    font-weight: 300;
    letter-spacing: 1px;
}

.download-info {
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.02);
    padding: 20px;
    border-radius: 2px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.info-row {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.info-row:last-child {
    border-bottom: none;
}

.info-row .label {
    font-weight: 400;
    color: #808080;
    width: 120px;
    font-size: 0.9em;
}

.info-row span:last-child {
    color: #ffffff;
    flex: 1;
    font-weight: 300;
}

.progress-container {
    margin: 30px 0;
}

.progress-bar {
    position: relative;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #ffffff;
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.progress-text {
    position: absolute;
    top: -30px;
    right: 0;
    font-weight: 300;
    font-size: 1.2em;
    color: #ffffff;
    letter-spacing: 2px;
}

.chart-container {
    margin: 30px 0;
    padding: 25px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 2px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.chart-container h3 {
    margin-bottom: 20px;
    color: #ffffff;
    font-size: 1.1em;
    font-weight: 300;
    letter-spacing: 1px;
}

#speedChart {
    width: 100%;
    height: 200px;
    display: block;
}

.chunks-container {
    margin: 30px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 2px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.chunk {
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 1px;
    position: relative;
    transition: all 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.chunk.downloading {
    background: rgba(255, 193, 7, 0.3);
    border-color: rgba(255, 193, 7, 0.6);
    animation: pulse 1.5s ease-in-out infinite;
}

.chunk.completed {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 1);
}

.chunk.error {
    background: rgba(244, 67, 54, 0.3);
    border-color: rgba(244, 67, 54, 0.6);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.controls {
    display: flex;
    gap: 12px;
    margin: 30px 0;
}

.btn {
    flex: 1;
    padding: 14px 30px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    font-size: 0.9em;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn > * {
    position: relative;
    z-index: 2;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active:not(:disabled)::after {
    width: 300px;
    height: 300px;
}

.btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.4);
}

.btn:active:not(:disabled) {
    transform: scale(0.98);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-clicked {
    animation: btnClick 0.3s ease;
}

@keyframes btnClick {
    0% { transform: scale(1); }
    50% { transform: scale(0.95); }
    100% { transform: scale(1); }
}

.btn-loading {
    position: relative;
    pointer-events: none;
}

.loading-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(15, 15, 15, 0.3);
    border-top-color: #0f0f0f;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

.btn-primary .loading-spinner {
    border-color: rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
}

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

.btn-primary {
    background: #ffffff;
    color: #0f0f0f;
    border-color: #ffffff;
}

.btn-primary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.9);
}

.btn-success {
    background: rgba(76, 175, 80, 0.2);
    border-color: rgba(76, 175, 80, 0.4);
}

.btn-success:hover:not(:disabled) {
    background: rgba(76, 175, 80, 0.3);
    border-color: rgba(76, 175, 80, 0.6);
}

.btn-warning {
    background: rgba(255, 152, 0, 0.2);
    border-color: rgba(255, 152, 0, 0.4);
}

.btn-warning:hover:not(:disabled) {
    background: rgba(255, 152, 0, 0.3);
    border-color: rgba(255, 152, 0, 0.6);
}

.btn-danger {
    background: rgba(244, 67, 54, 0.2);
    border-color: rgba(244, 67, 54, 0.4);
}

.btn-danger:hover:not(:disabled) {
    background: rgba(244, 67, 54, 0.3);
    border-color: rgba(244, 67, 54, 0.6);
}

.stats-container {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.log-container {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

#logContainer {
    max-height: 400px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 2px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.85em;
    line-height: 1.6;
}

.log-entry {
    padding: 4px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: #b0b0b0;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-entry.info {
    color: #4a9eff;
}

.log-entry.success {
    color: #4caf50;
}

.log-entry.warning {
    color: #ff9800;
}

.log-entry.error {
    color: #f44336;
}

.log-time {
    color: #666;
    margin-right: 10px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-label {
    color: #808080;
    font-size: 0.9em;
}

.stat-value {
    font-weight: 300;
    color: #ffffff;
    text-align: right;
    font-size: 0.9em;
}

.source-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 2px;
    font-size: 0.75em;
    margin-left: 8px;
    border: 1px solid;
}

.source-badge.active {
    background: rgba(76, 175, 80, 0.2);
    border-color: rgba(76, 175, 80, 0.4);
    color: #4caf50;
}

.source-badge.error {
    background: rgba(244, 67, 54, 0.2);
    border-color: rgba(244, 67, 54, 0.4);
    color: #f44336;
}

footer {
    margin-top: 60px;
    padding: 30px 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

footer p {
    color: #666;
    font-size: 0.9em;
    letter-spacing: 1px;
    margin: 0;
}

/* 自定义弹窗 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background: rgba(30, 30, 30, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    min-width: 400px;
    max-width: 600px;
    padding: 0;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.show .modal {
    transform: scale(1);
}

.modal-content {
    padding: 40px 40px 30px;
}

.modal-content p {
    margin: 0;
    color: #ffffff;
    font-size: 1.1em;
    line-height: 1.6;
    text-align: center;
}

.modal-buttons {
    display: flex;
    gap: 12px;
    padding: 0 40px 40px;
    justify-content: center;
}

.modal-buttons .btn {
    min-width: 100px;
    padding: 12px 24px;
}

@media (max-width: 768px) {
    body {
        padding: 20px 15px;
    }

    header h1 {
        font-size: 2em;
        letter-spacing: 1px;
    }

    .settings-btn {
        width: 40px;
        height: 40px;
    }

    .settings-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .settings-panel {
        width: 100%;
    }

    .settings-header {
        padding: 20px;
    }

    .settings-header h3 {
        font-size: 1.2em;
    }

    .settings-content {
        padding: 20px;
    }
    
    .file-list {
        padding: 20px;
    }
    
    .file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .controls {
        flex-direction: column;
    }
    
    .chunk {
        width: 18px;
        height: 18px;
    }

    .download-section {
        padding: 20px;
    }

    .chart-container {
        padding: 15px;
    }

    .chart-container h3 {
        font-size: 1em;
    }

    #speedChart {
        height: 150px;
    }

    .info-row {
        flex-direction: column;
        gap: 5px;
    }

    .info-row .label {
        width: 100%;
    }

    #logContainer {
        font-size: 0.75em;
    }

    .modal {
        min-width: 90%;
        max-width: 90%;
    }

    .modal-content {
        padding: 30px 20px 20px;
    }

    .modal-content p {
        font-size: 1em;
    }

    .modal-buttons {
        padding: 0 20px 30px;
        flex-direction: column;
    }

    .modal-buttons .btn {
        width: 100%;
    }
}

