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

:root {
    --bg: #f5f5f7;
    --surface: #ffffff;
    --surface-secondary: #fafafa;
    --text: #1d1d1f;
    --text-secondary: #6e6e73;
    --text-muted: #86868b;
    --accent: #0071e3;
    --accent-hover: #0077ed;
    --success: #34c759;
    --warning: #ff9500;
    --danger: #ff3b30;
    --border: #d2d2d7;
    --border-light: #e8e8ed;
    --radius: 18px;
    --radius-lg: 24px;
    --radius-sm: 12px;
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.08);
    --max-width: 1100px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Inter", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.47059;
    -webkit-font-smoothing: antialiased;
    letter-spacing: -0.022em;
}

.container {
    width: 92%;
    max-width: var(--max-width);
    margin: 0 auto;
}

/* Navbar - Apple style */
.navbar {
    background: rgba(251, 251, 253, 0.8);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    height: 52px;
    display: flex;
    align-items: center;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.03em;
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--accent);
}

/* Main */
main.container {
    min-height: calc(100vh - 160px);
    padding-top: 60px;
    padding-bottom: 100px;
}

/* Hero - Apple style */
.hero {
    text-align: center;
    padding: 100px 0 90px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    margin-bottom: 60px;
    box-shadow: var(--shadow);
}

.hero-badge {
    display: inline-block;
    color: var(--accent);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 16px;
    letter-spacing: 0.02em;
}

.hero h1 {
    font-size: clamp(2.2rem, 5vw, 3.6rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.03em;
    margin-bottom: 20px;
    color: var(--text);
}

.hero p {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: var(--text-secondary);
    max-width: 620px;
    margin: 0 auto 40px;
    line-height: 1.5;
}

.actions {
    display: flex;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 24px;
    border-radius: 980px;
    text-decoration: none;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.05rem;
}

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

.btn-primary:hover {
    background: var(--accent-hover);
    transform: scale(1.02);
}

.btn-secondary {
    background: transparent;
    color: var(--accent);
    border: 1.5px solid var(--accent);
}

.btn-secondary:hover {
    background: rgba(0, 113, 227, 0.05);
}

/* Section title */
.section-head {
    text-align: center;
    margin-bottom: 48px;
}

.section-head h2 {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 12px;
}

.section-head p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 560px;
    margin: 0 auto;
}

/* Cards - Apple style */
.cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 70px;
}

.card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 40px 32px;
    box-shadow: var(--shadow);
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

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

.card-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    background: var(--surface-secondary);
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
}

.card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
}

.card ul {
    list-style: none;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.card li {
    margin-bottom: 10px;
    padding-left: 18px;
    position: relative;
}

.card li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: bold;
}

/* Data section */
.data-section {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 48px;
    text-align: center;
    box-shadow: var(--shadow);
    margin-bottom: 70px;
}

.data-section h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 28px;
    letter-spacing: -0.02em;
}

.data-tags {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.data-tag {
    background: var(--surface-secondary);
    color: var(--text);
    padding: 14px 28px;
    border-radius: 980px;
    font-weight: 600;
    font-size: 0.95rem;
    border: 1px solid var(--border-light);
}

/* Page header */
.page-header {
    text-align: center;
    margin-bottom: 48px;
    padding-top: 20px;
}

.page-header h2 {
    font-size: clamp(1.9rem, 4vw, 2.8rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 10px;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Upload */
.upload-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 64px 48px;
    max-width: 580px;
    margin: 0 auto;
    box-shadow: var(--shadow-md);
    text-align: center;
}

.upload-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
}

.file-input-wrap {
    width: 100%;
}

.file-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 56px 32px;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--surface-secondary);
}

.file-label:hover {
    border-color: var(--accent);
    background: rgba(0, 113, 227, 0.03);
}

.file-icon {
    font-size: 2.6rem;
}

.file-text {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text);
}

.file-name {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.hint {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.center {
    text-align: center;
}

/* Visualization section */
.viz-section {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 48px;
    margin-bottom: 40px;
    box-shadow: var(--shadow);
}

.viz-section h3 {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.viz-section .viz-desc {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.chart-wrap {
    text-align: center;
    padding: 24px;
    background: var(--surface-secondary);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
}

.chart-wrap img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
}

/* Result section */
.result-section {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 40px;
    margin-bottom: 36px;
    box-shadow: var(--shadow);
}

.section-title {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin-bottom: 28px;
}

.section-title h3 {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.badge {
    display: inline-flex;
    padding: 5px 12px;
    border-radius: 980px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--surface-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 32px;
}

.stat-box {
    background: var(--surface-secondary);
    border-radius: var(--radius-sm);
    padding: 22px 14px;
    text-align: center;
    border: 1px solid var(--border-light);
    transition: transform 0.25s ease;
}

.stat-box:hover {
    transform: translateY(-3px);
}

.stat-box.positive {
    border-top: 3px solid var(--success);
}

.stat-box.neutral {
    border-top: 3px solid var(--warning);
}

.stat-box.negative {
    border-top: 3px solid var(--danger);
}

.stat-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.stat-value {
    display: block;
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.03em;
}

/* Single chart in result */
.result-chart {
    text-align: center;
    margin: 28px 0;
}

.result-chart img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
}

/* Table - responsive */
.table-wrap {
    overflow-x: auto;
    margin-bottom: 28px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    -webkit-overflow-scrolling: touch;
}

.result-table {
    width: 100%;
    min-width: 600px;
    border-collapse: collapse;
    font-size: 0.9rem;
    background: var(--surface);
}

.result-table th,
.result-table td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
}

.result-table th {
    background: var(--surface-secondary);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.result-table tr:last-child td {
    border-bottom: none;
}

.result-table tr:hover {
    background: rgba(0, 0, 0, 0.01);
}

/* Alerts */
.alert {
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 28px;
    font-weight: 500;
    font-size: 0.95rem;
}

.alert-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.alert-danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

/* Footer */
.footer {
    text-align: center;
    padding: 36px 0;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border-light);
    background: var(--surface);
}

code {
    background: var(--surface-secondary);
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 0.9em;
    font-family: "SF Mono", Consolas, monospace;
}

/* Code block */
.code-block {
    background: #1e1e1e;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin-bottom: 8px;
}

.code-block pre {
    margin: 0;
    padding: 24px;
    color: #d4d4d4;
    font-family: "SF Mono", Consolas, Monaco, "Noto Sans Mono", monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    white-space: pre;
}

.code-block code {
    background: transparent;
    padding: 0;
    font-family: inherit;
    color: inherit;
}

/* Sentiment tags & badges */
.tag-positive,
.tag-neutral,
.tag-negative {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.85rem;
}

.tag-positive {
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
}

.tag-neutral {
    background: rgba(245, 158, 11, 0.12);
    color: #b45309;
}

.tag-negative {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}

.sentiment-badge {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}

.sentiment-正面 {
    background: rgba(16, 185, 129, 0.12);
    color: #047857;
}

.sentiment-中性 {
    background: rgba(245, 158, 11, 0.12);
    color: #b45309;
}

.sentiment-负面 {
    background: rgba(239, 68, 68, 0.12);
    color: #b91c1c;
}

/* Sample table */
.sample-table .comment-cell {
    white-space: normal;
    line-height: 1.6;
    max-width: 600px;
}

/* Responsive */
@media (max-width: 1024px) {
    .cards {
        grid-template-columns: 1fr;
    }
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .viz-section {
        padding: 32px;
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 70px 24px;
    }
    .actions {
        flex-direction: column;
    }
    .btn-lg {
        width: 100%;
    }
    .nav-links {
        gap: 18px;
    }
    .nav-links a {
        font-size: 0.75rem;
    }
    .upload-card {
        padding: 40px 24px;
    }
    .result-section {
        padding: 28px;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .stat-value {
        font-size: 1.4rem;
    }
    .viz-section {
        padding: 24px;
    }
    .data-section {
        padding: 32px 24px;
    }
    .result-table {
        font-size: 0.8rem;
    }
    .result-table th,
    .result-table td {
        padding: 10px 12px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    .stat-box:nth-child(1),
    .stat-box:nth-child(2) {
        grid-column: span 1;
    }
    .result-table {
        min-width: 480px;
    }
}
