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

:root {
    --primary: #2962ff;
    --primary-dark: #1a4fd0;
    --success: #2e7d32;
    --success-dark: #1b5e20;
    --danger: #c62828;
    --gray-50: #f8f9fa;
    --gray-100: #f0f0f0;
    --gray-200: #e0e0e0;
    --gray-300: #c0c0c0;
    --gray-500: #888;
    --gray-700: #555;
    --gray-900: #222;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.5;
    min-height: 100vh;
}

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

.header {
    text-align: center;
    padding: 32px 0 24px;
}

.header h1 {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.header p {
    color: var(--gray-500);
    font-size: 14px;
    margin-top: 4px;
}

.upload-area {
    margin: 16px 0;
}

.upload-box {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #fff;
}

.upload-box:hover,
.upload-box.drag-over {
    border-color: var(--primary);
    background: #f0f4ff;
}

.upload-icon { margin-bottom: 12px; }

.upload-text {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 4px;
}

.upload-hint {
    font-size: 13px;
    color: var(--gray-500);
    margin-bottom: 16px;
}

.upload-progress {
    text-align: center;
    padding: 32px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.progress-bar {
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    width: 0;
    transition: width 0.3s;
    animation: progressAnim 1.5s ease-in-out infinite;
}

@keyframes progressAnim {
    0% { width: 10%; }
    50% { width: 60%; }
    100% { width: 90%; }
}

.progress-text { color: var(--gray-500); font-size: 14px; }

.result-area { margin-top: 24px; }

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.file-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
    word-break: break-all;
}

.result-actions {
    display: flex;
    gap: 8px;
}

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

.card {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--gray-700);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.meta-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.meta-table td {
    padding: 4px 0;
    border-bottom: 1px solid var(--gray-100);
}

.meta-table td:first-child {
    color: var(--gray-700);
    font-weight: 600;
    width: 130px;
    padding-right: 8px;
}

.meta-table td:last-child {
    color: var(--gray-900);
}

.chart-card {
    margin-bottom: 16px;
}

.chart-container {
    position: relative;
    width: 100%;
    height: 400px;
}

.table-wrapper {
    overflow-x: auto;
}

.events-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.events-table th {
    background: var(--gray-900);
    color: #fff;
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.events-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--gray-200);
}

.events-table tr:hover td {
    background: var(--gray-50);
}

.events-table tr:nth-child(even) td {
    background: #fafafa;
}

.events-table tr:hover td {
    background: #f0f4ff;
}

.error-area { margin-top: 16px; }

.error-box {
    background: #ffebee;
    border: 1px solid #ffcdd2;
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
}

.error-text {
    color: var(--danger);
    font-weight: 500;
    margin-bottom: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}
.btn-primary:hover { background: var(--primary-dark); }

.btn-success {
    background: var(--success);
    color: #fff;
}
.btn-success:hover { background: var(--success-dark); }

.btn-outline {
    background: transparent;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}
.btn-outline:hover {
    background: var(--gray-100);
    border-color: var(--gray-500);
}

.footer {
    text-align: center;
    padding: 32px 0;
    color: var(--gray-500);
    font-size: 13px;
}

@media (max-width: 640px) {
    .grid-2 { grid-template-columns: 1fr; }
    .result-header { flex-direction: column; align-items: flex-start; }
    .chart-container { height: 280px; }
}
