@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --primary-color: #4ebac7;
    --primary-dark: #2f93a3;
    --surface-main: rgba(255, 255, 255, 0.86);
    --surface-soft: rgba(255, 255, 255, 0.65);
    --border-soft: rgba(255, 255, 255, 0.35);
    --text-primary: #1f2b33;
    --text-secondary: #51616e;
    --text-muted: #7b8a96;
    --danger-color: #e74c3c;
    --accent-shadow: rgba(78, 186, 199, 0.26);
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background:
        radial-gradient(circle at 12% 12%, rgba(78, 186, 199, 0.18), transparent 45%),
        linear-gradient(180deg, #f2f6f8 0%, #e6edf2 100%);
    color: var(--text-primary);
    min-height: 100vh;
}

.container {
    max-width: 1100px;
    padding-bottom: 64px;
}

header h1 {
    font-weight: 700;
    letter-spacing: 0.4px;
}

header .text-muted,
header a {
    color: var(--text-muted) !important;
}

/* 上传区域 */
.upload-area {
    position: relative;
    border-radius: 18px;
    padding: 52px 44px;
    text-align: center;
    background: var(--surface-main);
    border: 1px solid transparent;
    box-shadow:
        0 24px 48px rgba(30, 65, 78, 0.14),
        0 12px 28px rgba(78, 186, 199, 0.12);
    backdrop-filter: blur(18px);
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border 0.25s ease;
    overflow: hidden;
}

.upload-area::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top, rgba(78, 186, 199, 0.16), transparent 60%);
    opacity: 0;
    transition: opacity 0.35s ease;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: rgba(78, 186, 199, 0.35);
    transform: translateY(-4px);
    box-shadow:
        0 28px 58px rgba(30, 65, 78, 0.16),
        0 14px 32px rgba(78, 186, 199, 0.16);
}

.upload-area:hover::before,
.upload-area.dragover::before {
    opacity: 1;
}

.upload-icon {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    margin-inline: auto;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    background: rgba(78, 186, 199, 0.16);
}

.upload-area h3 {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.upload-area p {
    color: var(--text-secondary);
    margin-bottom: 18px;
}

/* 基础卡片 */
.card {
    border: none;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(18px);
    box-shadow:
        0 26px 60px rgba(29, 61, 73, 0.16),
        0 10px 24px rgba(78, 186, 199, 0.12);
}

.card-header {
    background: rgba(78, 186, 199, 0.18);
    border-radius: 20px 20px 0 0;
    border: none;
}

/* 数据展示 */
.data-item {
    margin-bottom: 18px;
    padding: 18px;
    border-radius: 16px;
    background: var(--surface-main);
    border: 1px solid var(--border-soft);
    box-shadow: 0 16px 38px rgba(31, 68, 82, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.data-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 22px 42px rgba(31, 68, 82, 0.16);
}

.data-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.data-value {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--text-primary);
}

.data-unit {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-left: 6px;
}

/* Tab */
.nav-tabs {
    border: none;
    margin-bottom: 12px;
}

.nav-tabs .nav-link {
    color: var(--text-secondary);
    border: none;
    padding: 12px 24px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    border-radius: 14px 14px 0 0;
    transition: all 0.2s ease;
}

.nav-tabs .nav-link.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    background: rgba(78, 186, 199, 0.12);
}

/* 图表与表格容器 */
.chart-container {
    position: relative;
    height: 380px;
    width: 100%;
    background: var(--surface-main);
    border-radius: 16px;
    padding: 12px;
    border: 1px solid var(--border-soft);
    box-shadow: 0 16px 40px rgba(33, 70, 83, 0.12);
}

.table {
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.table th {
    background: rgba(78, 186, 199, 0.08);
    border: none;
    font-weight: 600;
}

.table-striped tbody tr:nth-of-type(odd) {
    background: rgba(78, 186, 199, 0.05);
}

/* 原始文本 */
.raw-text-container {
    background: var(--surface-main);
    border-radius: 16px;
    border: 1px solid var(--border-soft);
    padding: 18px;
    max-height: 420px;
    overflow: auto;
    box-shadow: inset 0 1px 0 rgba(78, 186, 199, 0.08);
}

.raw-text-content {
    margin: 0;
    font-family: Consolas, Monaco, 'Courier New', monospace;
    font-size: 0.84rem;
    color: var(--text-secondary);
}

/* 按钮 */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: none;
    border-radius: 12px;
    font-weight: 600;
    padding: 10px 24px;
    box-shadow: 0 12px 26px var(--accent-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 32px rgba(78, 186, 199, 0.28);
}

.btn-outline-primary {
    border: 1px solid rgba(78, 186, 199, 0.4);
    color: var(--primary-color);
    border-radius: 12px;
    font-weight: 500;
}

.btn-outline-primary:hover {
    background: rgba(78, 186, 199, 0.12);
    color: var(--primary-dark);
}

.btn-outline-secondary {
    border-radius: 12px;
    border: 1px solid rgba(81, 97, 110, 0.26);
    color: var(--text-secondary);
}

.btn-outline-secondary:hover {
    background: rgba(78, 186, 199, 0.12);
    color: var(--text-primary);
}

/* 进度条 */
.progress {
    height: 10px;
    border-radius: 6px;
    background: rgba(78, 186, 199, 0.1);
}

.progress-bar {
    background: var(--primary-color);
    box-shadow: 0 4px 16px rgba(78, 186, 199, 0.32);
}

/* 错误提示 */
.alert-danger {
    background: rgba(231, 76, 60, 0.08);
    border: 1px solid rgba(231, 76, 60, 0.18);
    color: #b33a2d;
    border-radius: 14px;
}

/* 模态框 */
.modal-header {
    background: linear-gradient(135deg, rgba(78, 186, 199, 0.92), rgba(47, 147, 163, 0.92));
    border-radius: 0;
    border: none;
    color: #fff;
}

.modal-header .btn-close {
    filter: invert(1);
}

.modal-content {
    border-radius: 20px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    box-shadow: 0 28px 60px rgba(31, 68, 82, 0.18);
}

.about-content {
    line-height: 1.7;
    color: var(--text-secondary);
}

.about-content h5 {
    color: var(--primary-color);
    margin-top: 22px;
    margin-bottom: 12px;
    font-weight: 600;
}

.about-content .author-info {
    background: rgba(78, 186, 199, 0.1);
    padding: 18px;
    border-radius: 14px;
    border: 1px solid rgba(78, 186, 199, 0.18);
}

.about-content .thanks-section {
    border-left: 4px solid rgba(78, 186, 199, 0.7);
    padding-left: 16px;
    margin: 18px 0;
}

.about-content ul {
    padding-left: 18px;
}

.about-content ul li {
    margin-bottom: 6px;
}

/* 加载遮罩 */
.loading-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(17, 28, 35, 0.82);
    backdrop-filter: blur(18px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 18px;
    z-index: 1200;
    pointer-events: all;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 4px;
    color: var(--primary-color);
    box-shadow: 0 0 28px rgba(78, 186, 199, 0.38);
}

.loading-text {
    font-size: 1.1rem;
    letter-spacing: 0.6px;
    color: #f1f7f9;
    padding: 10px 18px;
    border-radius: 999px;
    background: rgba(78, 186, 199, 0.2);
    border: 1px solid rgba(78, 186, 199, 0.28);
    box-shadow: 0 12px 30px rgba(78, 186, 199, 0.22);
}

.analysis-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 24px 0;
    font-size: 0.96rem;
    color: var(--text-secondary);
}

.analysis-meta .meta-label {
    color: var(--text-muted);
    font-weight: 500;
}

/* 关于按钮 */
.about-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: none;
    color: #fff;
    font-size: 28px;
    box-shadow: 0 16px 40px var(--accent-shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    z-index: 999;
}

.about-btn:hover {
    transform: translateY(-4px) scale(1.04);
    box-shadow: 0 20px 48px rgba(78, 186, 199, 0.38);
}

/* 响应式 */
@media (max-width: 768px) {
    .upload-area {
        padding: 32px;
    }

    .data-item {
        padding: 14px;
    }

    .data-value {
        font-size: 1.3rem;
    }

    .chart-container {
        height: 300px;
    }

    .about-btn {
        width: 60px;
        height: 60px;
    }
}
