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

:root {
    --primary: #1677ff;
    --primary-dark: #0958d9;
    --primary-light: #e6f4ff;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --pending: #8b5cf6;
    --text: #1e293b;
    --text-secondary: #64748b;
    --bg: #f0f5ff;
    --card-bg: #ffffff;
    --shadow: 0 2px 12px rgba(22, 119, 255, 0.08);
    --shadow-hover: 0 8px 30px rgba(22, 119, 255, 0.15);
    --radius: 16px;
    --radius-sm: 10px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* 头部导航 */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(22, 119, 255, 0.1);
    transition: all 0.3s ease;
}

.header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 20px rgba(22, 119, 255, 0.1);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.logo i {
    font-size: 28px;
    color: var(--primary);
}

.nav {
    display: flex;
    gap: 8px;
}

.nav a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav a:hover,
.nav a.active {
    background: var(--primary-light);
    color: var(--primary);
}

.mobile-menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 20px;
    color: var(--text);
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.mobile-nav {
    display: none;
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    padding: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    z-index: 999;
    flex-direction: column;
    gap: 4px;
}

.mobile-nav.open {
    display: flex;
}

.mobile-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.mobile-nav a:hover,
.mobile-nav a.active {
    background: var(--primary-light);
    color: var(--primary);
}

/* 消息提示 */
.message {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    animation: slideDown 0.3s ease;
    max-width: 90%;
}

.message button {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 16px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.message button:hover {
    opacity: 1;
}

.message-success {
    background: #ecfdf5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

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

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* 首页英雄区 */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 24px 60px;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #1677ff 0%, #0958d9 50%, #69b1ff 100%);
    opacity: 0.08;
    z-index: 0;
}

.hero-bg::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(22, 119, 255, 0.15), transparent);
    top: -200px;
    right: -200px;
}

.hero-bg::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(105, 177, 255, 0.12), transparent);
    bottom: -100px;
    left: -100px;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 500px;
    width: 100%;
    text-align: center;
}

.balance-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 36px 32px;
    box-shadow: var(--shadow);
    margin-bottom: 32px;
    border: 1px solid rgba(22, 119, 255, 0.08);
    transition: all 0.3s ease;
}

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

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

.balance-label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.balance-header i {
    font-size: 18px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.3s ease;
}

.balance-header i:hover {
    color: var(--primary);
}

.balance-amount {
    margin-bottom: 24px;
}

.balance-amount .currency {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-secondary);
    vertical-align: top;
    line-height: 1.2;
}

.balance-amount .amount {
    font-size: 52px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -2px;
}

.balance-details {
    display: flex;
    justify-content: space-around;
    padding: 16px 0;
    border-top: 1px solid #f1f5f9;
    margin-bottom: 12px;
}

.detail-item {
    text-align: center;
}

.detail-label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.detail-amount {
    font-size: 18px;
    font-weight: 700;
}

.detail-item.income .detail-amount {
    color: var(--success);
}

.detail-item.expense .detail-amount {
    color: var(--danger);
}

.balance-pending {
    font-size: 12px;
    color: var(--text-secondary);
    padding: 8px 12px;
    background: #f8fafc;
    border-radius: var(--radius-sm);
}

.hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 14px rgba(22, 119, 255, 0.3);
}

.btn-primary:hover {
    background: var(--primary-dark);
    box-shadow: 0 6px 20px rgba(22, 119, 255, 0.4);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-2px);
}

/* 最近交易 */
.recent {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 24px;
}

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

.section-header h2 {
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
}

.section-header h2 i {
    color: var(--primary);
}

.filter-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-group select,
.filter-group input {
    padding: 8px 14px;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: var(--card-bg);
    color: var(--text);
    outline: none;
    transition: all 0.3s ease;
    min-width: 120px;
}

.filter-group select:focus,
.filter-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.1);
}

.transaction-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.transaction-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    cursor: pointer;
}

.transaction-item:hover {
    box-shadow: var(--shadow-hover);
    transform: translateX(4px);
}

.transaction-icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.transaction-icon.income {
    background: #ecfdf5;
    color: var(--success);
}

.transaction-icon.expense {
    background: #fef2f2;
    color: var(--danger);
}

.transaction-info {
    flex: 1;
    min-width: 0;
}

.transaction-category {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}

.transaction-note {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.transaction-date {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.status-completed {
    background: #ecfdf5;
    color: #065f46;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.transaction-amount {
    font-size: 18px;
    font-weight: 700;
    white-space: nowrap;
}

.transaction-amount.income {
    color: var(--success);
}

.transaction-amount.expense {
    color: var(--danger);
}

/* 统计区域 */
.stats {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 24px;
}

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

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius-sm);
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
}

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

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.stat-icon.income {
    background: #ecfdf5;
    color: var(--success);
}

.stat-icon.expense {
    background: #fef2f2;
    color: var(--danger);
}

.stat-icon.balance {
    background: var(--primary-light);
    color: var(--primary);
}

.stat-icon.pending {
    background: #fef3c7;
    color: var(--warning);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}

.stats-chart {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}

.stats-chart h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stats-chart h3 i {
    color: var(--primary);
}

.chart-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.bar-label {
    width: 50px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: right;
}

.bar-track {
    flex: 1;
    height: 28px;
    background: #f1f5f9;
    border-radius: 14px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 14px;
    transition: width 1s ease;
}

.bar-fill.income {
    background: linear-gradient(90deg, var(--success), #34d399);
}

.bar-fill.expense {
    background: linear-gradient(90deg, var(--danger), #f87171);
}

.bar-value {
    width: 100px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    text-align: right;
}

/* 底部 */
.footer {
    background: var(--text);
    color: #94a3b8;
    padding: 40px 24px 24px;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    text-align: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    color: #fff;
}

.footer-brand i {
    color: var(--primary);
    font-size: 28px;
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #fff;
}

.footer-copy {
    font-size: 13px;
}

/* 响应式 */
@media (max-width: 768px) {
    .header-inner {
        padding: 0 16px;
    }

    .nav {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .hero {
        padding: 100px 16px 40px;
        min-height: auto;
    }

    .balance-card {
        padding: 24px 20px;
    }

    .balance-amount .amount {
        font-size: 36px;
    }

    .balance-details {
        flex-direction: row;
    }

    .hero-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .recent,
    .stats {
        padding: 40px 16px;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .filter-group {
        width: 100%;
    }

    .filter-group select,
    .filter-group input {
        flex: 1;
        min-width: 0;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .transaction-item {
        padding: 12px 16px;
    }

    .transaction-amount {
        font-size: 15px;
    }

    .chart-bar {
        flex-wrap: wrap;
    }

    .bar-label {
        width: 40px;
        font-size: 12px;
    }

    .bar-value {
        width: 80px;
        font-size: 12px;
    }

    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .balance-amount .amount {
        font-size: 28px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .stat-card {
        padding: 14px;
    }

    .stat-value {
        font-size: 16px;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }

    .transaction-category {
        font-size: 14px;
    }

    .transaction-note {
        font-size: 12px;
    }
}