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

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --danger-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --bg-color: #f5f7fa;
    --card-bg: #ffffff;
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --success-color: #48bb78;
    --danger-color: #f56565;
    --primary-color: #667eea;
}

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

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

/* Header Styles */
.header {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    margin-bottom: -5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    font-size: 28px;
    font-weight: bold;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav {
    display: flex;
    gap: 0px;               /* 缩小导航间距 */
    flex-wrap: wrap;
    font-weight: bold;      /* 加粗字体 */
    font-size: 16px;        /* 新增：设置字体大小，可调 */
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--primary-color);
    background: rgba(102, 126, 234, 0.1);
}

.nav-link.active {
    color: var(--primary-color);
    background: rgba(102, 126, 234, 0.1);
}

/* Stats Cards */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

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

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

.stat-card.income {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.stat-card.expense {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: white;
}

.stat-card.balance {
    background: var(--primary-gradient);
    color: white;
}

.stat-icon {
    font-size: 48px;
    opacity: 0.9;
}

.stat-content h3 {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 5px;
    opacity: 0.9;
}

.stat-amount {
    font-size: 28px;
    font-weight: bold;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

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

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

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

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

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

/* Quick Add */
.quick-add {
    text-align: center;
    margin-bottom: 40px;
}

/* Records List */
.recent-records {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.section-title {
    font-size: 20px;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.records-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.record-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-radius: 10px;
    background: var(--bg-color);
    transition: all 0.3s ease;
    cursor: pointer;
}

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

.record-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.record-icon {
    font-size: 32px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 10px;
}

.record-info h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
}

.record-meta {
    font-size: 14px;
    color: var(--text-secondary);
}

.record-amount {
    font-size: 18px;
    font-weight: bold;
}

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

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

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: var(--card-bg);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 18px;
}

/* View All */
.view-all {
    text-align: center;
    margin-top: 20px;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: rgba(72, 187, 120, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(72, 187, 120, 0.3);
}

.alert-danger {
    background: rgba(245, 101, 101, 0.1);
    color: var(--danger-color);
    border: 1px solid rgba(245, 101, 101, 0.3);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 15px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

.modal-title {
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: var(--bg-color);
}

/* Responsive */
@media (max-width: 100%) {
    .container {
        padding: 15px;
    }
    
    .header {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav {
        width: 100%;
        justify-content: center;
    }
    
    .stats-cards {
        grid-template-columns: 1fr;
    }
    
    .record-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .record-amount {
        align-self: flex-end;
    }
}

/* Loading Animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Icon Picker */
.icon-picker {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 10px;
    padding: 15px;
    background: var(--bg-color);
    border-radius: 10px;
    max-height: 200px;
    overflow-y: auto;
}

.icon-option {
    width: 50px;
    height: 50px;
    border: 2px solid transparent;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.icon-option:hover {
    background: var(--card-bg);
    border-color: var(--primary-color);
}

.icon-option.selected {
    background: rgba(102, 126, 234, 0.1);
    border-color: var(--primary-color);
}

/*财务概率*/
.card.plain {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
    text-align: center;
}

.card .label {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
}

.card .amount {
    font-size: 28px;
    font-weight: bold;
}

.card .percent {
    color: #999;
    margin-top: 4px;
}

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

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

.finance-overview-card {
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 6px 32px 0 rgba(122,132,160,0.08);
    padding: 32px 32px 30px 32px;
    max-width: 100%; /* 这里与你最近记录卡片保持一致 */
    margin: -10px auto 22px auto;
    text-align: center;
    position: relative;
    width: 100%;
}

.overview-title {
    color: #000;
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 0px;
    letter-spacing: 8px;
}

.overview-net {
    font-size: 50px;
    font-weight: 800;
    color: #6C49F4;
    margin-bottom: -10px;
    letter-spacing: 2px;
}

.overview-row {
    display: flex;
    gap: 36px;
    justify-content: center;
    align-items: stretch;
}

.overview-item {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 10px 0 rgba(122,132,160,0.04);
    padding: 24px 20px 16px 0;
    flex: 1 1 0;
    min-width: 0;
    max-width: 260px;
    min-width: 160px;
    display: flex;
    align-items: center;
    position: relative;
    transition: box-shadow .3s;
}

.overview-item .color-bar {
    width: 3px;
    height: 90px;
    border-radius: 6px;
    margin-right: 0px;
}

.overview-item.income .color-bar {
    background: linear-gradient(180deg,#22c55e 80%,#86efac 100%);
}
.overview-item.expense .color-bar {
    background: linear-gradient(180deg,#ef4444 80%,#fecaca 100%);
}

.item-content {
    flex: 1;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.item-title {
    color: #888;
    font-size: 15px;
    margin-bottom: 6px;
    font-weight: 500;
}

.item-value {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.15;
    word-break: break-all;
    /* 默认较大，在窄屏下会缩小 */
}
.item-value.income-value { color: #22c55e; }
.item-value.expense-value { color: #ef4444; }

.item-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    justify-content: center;
}

.progress-bar {
    width: 90px;
    height: 3px;
    background: #e7e7e7;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.progress-inner {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s cubic-bezier(.4,2,.6,1);
}
.income-bar { background: #22c55e; }
.expense-bar { background: #ef4444; }

.item-percent {
    font-size: 15px;
    color: #999;
    min-width: 38px;
}

/* 移动端自适应，两卡片始终一行，字体自动缩放 */
@media (max-width: 480px) {
    .finance-overview-card {
        max-width: 100%;
        padding: 18px 4px 10px 4px;
    }
    .overview-row {
        gap: 0px;
    }
    .overview-item {
        min-width: 0;
        max-width: 48vw;
        padding: 18px 4px 10px 0;
    }
    .item-value {
        font-size: clamp(1.2rem, 5vw, 1.9rem);
    }
    .overview-title { font-size: 22px; }
    .overview-net { font-size: 2.4rem; }
}

/* 防止极窄屏下溢出：进一步压缩字号 */
@media (max-width: 400px) {
    .overview-item { max-width: 49vw; }
    .item-value { font-size: clamp(1rem, 6vw, 1.3rem);}
    .overview-net { font-size: 1.08rem; }
}

/*记账记录*/

