:root {
    --primary-color: #3b82f6;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-color: #f8fafc;
    --surface-color: #ffffff;
    --text-color: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft JhengHei", 
                 "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

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

header {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--primary-color), #2563eb);
    color: white;
    border-radius: 16px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-lg);
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
}

main {
    display: grid;
    gap: 30px;
}

.upload-section,
.status-section,
.results-section {
    background: var(--surface-color);
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-secondary);
}

.input-group input[type="number"] {
    width: 100%;
    max-width: 300px;
    padding: 10px 15px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.input-group input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-color);
}

.upload-area {
    border: 3px dashed var(--border-color);
    border-radius: 12px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 20px;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.05);
}

.upload-area.drag-over {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.1);
    transform: scale(1.02);
}

.upload-area svg {
    color: var(--primary-color);
    margin-bottom: 20px;
}

.upload-area p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin: 10px 0;
}

.upload-area .hint {
    font-size: 0.9rem;
    color: var(--text-secondary);
    opacity: 0.7;
}

.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 32px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: var(--shadow);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #2563eb;
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #475569;
}

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

.status-bar {
    padding: 15px 20px;
    background: var(--bg-color);
    border-left: 4px solid var(--primary-color);
    border-radius: 8px;
    font-weight: 500;
}

.status-bar.success {
    border-left-color: var(--success-color);
    background: rgba(16, 185, 129, 0.1);
}

.status-bar.error {
    border-left-color: var(--danger-color);
    background: rgba(239, 68, 68, 0.1);
}

.progress-bar {
    position: relative;
    height: 40px;
    background: var(--bg-color);
    border-radius: 20px;
    overflow: hidden;
    margin-top: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), #2563eb);
    transition: width 0.3s;
    border-radius: 20px;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 600;
    color: var(--text-color);
}

.results-section h2 {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.count-badge {
    background: var(--primary-color);
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--bg-color);
}

th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
}

tbody tr:hover {
    background: rgba(59, 130, 246, 0.05);
}

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    font-style: italic;
}

.total-row {
    background: var(--bg-color);
}

.total-row td {
    border-bottom: none;
    padding: 15px;
}

footer {
    text-align: center;
    padding: 40px 20px;
    margin-top: 40px;
    color: var(--text-secondary);
}

footer p {
    margin: 5px 0;
}

.note {
    font-size: 0.9rem;
    opacity: 0.8;
}

@media (max-width: 768px) {
    h1 {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .upload-section,
    .results-section {
        padding: 20px;
    }
    
    .upload-area {
        padding: 40px 15px;
    }
    
    th, td {
        padding: 10px;
        font-size: 0.9rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}


