/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

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

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.header h1 i {
    margin-right: 15px;
    color: #ffd700;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 300;
}

.user-bar {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    font-size: 0.95rem;
}

.user-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #fff;
    padding: 6px 12px;
    border-radius: 12px;
    cursor: pointer;
}

.user-btn.danger {
    background: rgba(231, 76, 60, 0.8);
    border-color: rgba(231, 76, 60, 0.8);
}

/* 计算器主体 */
.calculator {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

/* 目标设置区域 */
.target-section {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid #f0f0f0;
}

.target-section h2 {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.target-section h2 i {
    margin-right: 10px;
    color: #e74c3c;
}

.input-group {
    max-width: 400px;
}

.input-group label {
    display: block;
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.input-group input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    background: #fafafa;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-hint {
    display: block;
    color: #95a5a6;
    font-size: 0.9rem;
    margin-top: 5px;
    font-style: italic;
}

/* 资产区域 */
.assets-section h2 {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
}

.assets-section h2 i {
    margin-right: 10px;
    color: #27ae60;
}

.assets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.asset-item {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 15px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.asset-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border-color: #667eea;
}

.asset-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    flex-shrink: 0;
}

.asset-icon i {
    font-size: 1.5rem;
    color: white;
}

.asset-info {
    flex: 1;
}

.asset-info label {
    display: block;
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
    font-size: 1rem;
}

.asset-info input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.asset-info input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 计算按钮 */
.calculation-section {
    text-align: center;
    margin: 40px 0;
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* 自定义资产 */
.custom-assets-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0 10px;
}

.custom-assets-header h3 {
    font-size: 1.2rem;
    color: #2c3e50;
}

.add-asset-btn {
    padding: 10px 16px;
    border: none;
    border-radius: 10px;
    background: #667eea;
    color: white;
    cursor: pointer;
    font-weight: 600;
}

.add-asset-btn:hover {
    background: #5a67d8;
}

.asset-item {
    position: relative;
}

.delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: #e74c3c;
    color: white;
    cursor: pointer;
    line-height: 1;
}

.delete-btn:hover {
    background: #c0392b;
}

.asset-icon {
    font-size: 1.5rem;
}

.card-hint {
    display: block;
    font-size: 0.85rem;
    color: #95a5a6;
    margin-top: 4px;
}

.result-card.cash-flow {
    cursor: pointer;
    border: 2px dashed #667eea;
}

/* 模态框 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 520px;
    padding: 20px;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

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

.modal-close {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 15px;
}

.btn-primary,
.btn-secondary {
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-secondary {
    background: #ecf0f1;
    color: #2c3e50;
}

.modal-hint {
    color: #7f8c8d;
    margin-bottom: 10px;
}

.cash-flow-options {
    display: grid;
    gap: 10px;
    margin-top: 10px;
}

.cash-flow-option {
    display: grid;
    grid-template-columns: 24px 30px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #ecf0f1;
    cursor: pointer;
}

.cash-flow-option.selected {
    border-color: #667eea;
    background: #f1f4ff;
}

.option-check {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1px solid #bdc3c7;
    text-align: center;
    line-height: 18px;
    color: #2ecc71;
    font-weight: 700;
}

.cash-flow-preview {
    margin-top: 10px;
    font-weight: 600;
    color: #2c3e50;
}

.import-textarea {
    width: 100%;
    min-height: 120px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 10px;
    resize: vertical;
}

.format-example {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 10px;
    font-family: monospace;
    font-size: 0.9rem;
}

.custom-types-list {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.type-tag {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f1f4ff;
    border-radius: 12px;
    padding: 6px 10px;
}

.type-tag-delete {
    background: transparent;
    border: none;
    cursor: pointer;
    color: #e74c3c;
}

.empty-tip {
    color: #95a5a6;
}

.auth-modal .auth-hint {
    margin-top: 10px;
    color: #7f8c8d;
    font-size: 0.9rem;
}

.auth-modal .remember-row {
    margin-top: 8px;
    margin-bottom: 0;
}

.auth-modal .remember-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #2c3e50;
    user-select: none;
}

.auth-modal .remember-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.auth-actions {
    justify-content: space-between;
}

/* 支出统计表 */
.monthly-detail {
    margin-top: 20px;
}

.table-wrapper {
    overflow-x: auto;
    border: 1px solid #ecf0f1;
    border-radius: 12px;
}

.monthly-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

.monthly-table th,
.monthly-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #ecf0f1;
    text-align: center;
    font-size: 0.9rem;
}

.statistics-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.stat-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.stat-card.total {
    background: #eef2ff;
    border: 1px solid #667eea;
}

.stat-icon {
    font-size: 1.4rem;
}

.calculate-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 18px 40px;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.calculate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.4);
}

.calculate-btn:active {
    transform: translateY(-1px);
}

.clear-data-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    padding: 18px 30px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(231, 76, 60, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.clear-data-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(231, 76, 60, 0.4);
}

.clear-data-btn:active {
    transform: translateY(-1px);
}

/* 结果区域 */
.result-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #f0f0f0;
}

.result-section h2 {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
}

.result-section h2 i {
    margin-right: 10px;
    color: #f39c12;
}

.result-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.result-card {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.result-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.result-card.total-assets {
    border-color: #27ae60;
}

.result-card.target-amount {
    border-color: #e74c3c;
}

.result-card.difference {
    border-color: #f39c12;
}

.result-card.progress {
    border-color: #3498db;
}

.result-card.layoff-duration {
    border-color: #9b59b6;
}

.card-icon {
    width: 50px;
    height: 50px;
    margin: 0 auto 15px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.total-assets .card-icon {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
}

.target-amount .card-icon {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.difference .card-icon {
    background: linear-gradient(135deg, #f39c12, #e67e22);
}

.progress .card-icon {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.layoff-duration .card-icon {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
}

.card-icon i {
    color: white;
    font-size: 1.2rem;
}

.card-content h3 {
    font-size: 1rem;
    color: #555;
    margin-bottom: 10px;
    font-weight: 600;
}

.amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
}

/* 进度条 */
.progress-bar {
    width: 100%;
    height: 20px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin: 30px 0;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #27ae60, #2ecc71);
    border-radius: 10px;
    transition: width 1s ease;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* 指示器动画 */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* 激励信息 */
.motivation-message {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 15px;
    margin-top: 20px;
}

.motivation-message p {
    font-size: 1.1rem;
    color: #555;
    font-weight: 500;
}

/* 页脚 */
.footer {
    text-align: center;
    color: white;
    opacity: 0.8;
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .calculator {
        padding: 20px;
    }
    
    .assets-grid {
        grid-template-columns: 1fr;
    }
    
    .result-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .asset-item {
        flex-direction: column;
        text-align: center;
    }
    
    .asset-icon {
        margin-right: 0;
        margin-bottom: 15px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.3rem;
    }
    
    .subtitle {
        font-size: 0.8rem;
    }
    
    .result-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .assets-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .calculation-section {
        flex-direction: row;
    }
    
    .calculate-btn,
    .clear-data-btn {
        font-size: 0.9rem;
        padding: 10px 15px;
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-section {
    animation: fadeInUp 0.6s ease;
}

.result-card {
    animation: fadeInUp 0.6s ease;
    animation-fill-mode: both;
}

.result-card:nth-child(1) { animation-delay: 0.1s; }
.result-card:nth-child(2) { animation-delay: 0.2s; }
.result-card:nth-child(3) { animation-delay: 0.3s; }
.result-card:nth-child(4) { animation-delay: 0.4s; }
.result-card:nth-child(5) { animation-delay: 0.5s; }

/* 支出记录区域 */
.expense-section {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 2px solid #f0f0f0;
}

.expense-section h2 {
    font-size: 1.8rem;
    color: #2c3e50;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
}

.expense-section h2 i {
    margin-right: 10px;
    color: #e67e22;
}

.expense-form {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 25px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
    font-size: 1rem;
}

.expense-select {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    transition: all 0.3s ease;
    cursor: pointer;
}

.expense-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.expense-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.expense-input-group {
    display: flex;
    flex-direction: column;
}

.expense-input-group label {
    font-weight: 600;
    color: #555;
    margin-bottom: 8px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.expense-input-group label i {
    font-size: 1.2rem;
}

.expense-input-group input {
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.expense-input-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

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

.expense-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.save-btn {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
}

.save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.3);
}

.view-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.view-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.3);
}

/* 可视化面板 */
.visualization-panel {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 15px;
    margin-top: 30px;
    animation: fadeInUp 0.6s ease;
}

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

.panel-header h3 {
    font-size: 1.5rem;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-header h3 i {
    color: #e67e22;
}

.year-selector {
    display: flex;
    align-items: center;
    gap: 10px;
}

.year-selector label {
    font-weight: 600;
    color: #555;
}

.year-select {
    padding: 8px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.year-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.statistics-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.stat-card.total {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon.wechat {
    background: linear-gradient(135deg, #07c160, #06ad56);
}

.stat-icon.alipay {
    background: linear-gradient(135deg, #1677ff, #0958d9);
}

.stat-icon.cash {
    background: linear-gradient(135deg, #f39c12, #e67e22);
}

.stat-icon.total-icon {
    background: rgba(255,255,255,0.2);
}

.stat-icon i {
    color: white;
    font-size: 1.5rem;
}

.stat-content h4 {
    font-size: 0.9rem;
    margin-bottom: 5px;
    opacity: 0.9;
}

.stat-card.total .stat-content h4 {
    color: rgba(255,255,255,0.9);
}

.stat-amount {
    font-size: 1.3rem;
    font-weight: 700;
    color: #2c3e50;
}

.stat-card.total .stat-amount {
    color: white;
}

.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
}

.chart-wrapper {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.chart-wrapper h4 {
    font-size: 1.2rem;
    color: #2c3e50;
    margin-bottom: 20px;
    text-align: center;
}

.chart-wrapper canvas {
    max-height: 300px;
    height: 300px !important;
}

/* 响应式设计 - 支出记录 */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .expense-inputs {
        grid-template-columns: 1fr;
    }
    
    .statistics-summary {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .charts-container {
        grid-template-columns: 1fr;
    }
    
    .panel-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .statistics-summary {
        grid-template-columns: 1fr;
    }
    
    .expense-form {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 1.6rem;
    }
    
    .mobile-tabs .tab-btn {
        font-size: 0.75rem;
        padding: 10px 8px;
    }
    
    .result-card .amount,
    .stat-amount {
        font-size: 1.1rem;
    }
}

/* ========== 移动端标签导航 ========== */
.mobile-tabs {
    display: none;
    background: white;
    border-radius: 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
}

.mobile-tabs .tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 8px 4px;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: #999;
    font-size: 0.7rem;
    font-weight: 400;
}

.mobile-tabs .tab-btn i {
    font-size: 1.4rem;
    transition: all 0.2s ease;
}

.mobile-tabs .tab-btn.active {
    background: transparent;
    color: #667eea;
    box-shadow: none;
}

.mobile-tabs .tab-btn.active i {
    transform: scale(1.1);
}

.tab-content {
    display: block;
}

.tab-content.active {
    display: block;
}

/* ========== 平板优化 ========== */
@media (max-width: 1024px) and (min-width: 769px) {
    .container {
        padding: 15px;
    }
    
    .calculator {
        padding: 30px 25px;
    }
    
    .header h1 {
        font-size: 2.5rem;
    }
    
    .assets-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .result-cards {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .mobile-tabs {
        display: none;
    }
}

/* ========== 移动端增强(小程序风格) ========== */
@media (max-width: 768px) {
    .tab-content {
        display: none;
    }

    .mobile-tabs {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        border-radius: 0;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
        z-index: 1000;
        padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
        margin: 0;
    }
    
    body {
        font-size: 14px;
        background: linear-gradient(180deg, #667eea 0%, #764ba2 50%, #f5f5f5 50%, #f5f5f5 100%);
    }
    
    .container {
        padding: 0;
        padding-bottom: calc(70px + env(safe-area-inset-bottom));
        max-width: 100%;
    }
    
    /* 头部样式 - 小程序风格 */
    .header {
        margin-bottom: 0;
        padding: 15px 15px 20px;
        background: transparent;
        position: relative;
    }
    
    .header h1 {
        font-size: 1.5rem;
        margin-bottom: 5px;
        font-weight: 600;
    }
    
    .header h1 i {
        display: none;
    }
    
    .subtitle {
        font-size: 0.85rem;
        opacity: 0.8;
    }
    
    .user-bar {
        flex-direction: row;
        gap: 8px;
        margin-top: 10px;
        font-size: 0.8rem;
    }
    
    .user-btn {
        padding: 5px 12px;
        border-radius: 12px;
        font-size: 0.8rem;
    }
    
    /* 计算器主体 - 卡片风格 */
    .calculator {
        border-radius: 20px 20px 0 0;
        padding: 20px 15px;
        margin-bottom: 0;
        background: #f5f5f5;
        box-shadow: none;
    }
    
    /* 区块标题 */
    .target-section,
    .assets-section,
    .result-section {
        background: white;
        border-radius: 16px;
        padding: 20px 15px;
        margin-bottom: 12px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.04);
        border-bottom: none;
    }
    
    .target-section h2,
    .assets-section h2,
    .result-section h2 {
        font-size: 1.3rem;
        margin-bottom: 15px;
        font-weight: 600;
        color: #333;
    }
    
    .target-section h2 i,
    .assets-section h2 i,
    .result-section h2 i {
        font-size: 1.2rem;
    }
    
    /* 输入框 - 小程序风格 */
    .input-group {
        margin-bottom: 15px;
        max-width: 100%;
    }
    
    .input-group label {
        font-size: 0.95rem;
        margin-bottom: 8px;
        color: #333;
        font-weight: 600;
    }
    
    .input-group input {
        padding: 12px 15px;
        font-size: 0.95rem;
        border: 1px solid #e5e5e5;
        border-radius: 8px;
        background: #fafafa;
    }
    
    .input-group input:focus {
        border-color: #667eea;
        background: white;
    }
    
    .input-hint {
        font-size: 0.8rem;
        color: #999;
        margin-top: 4px;
    }
    
    /* 资产网格 - 两列布局 */
    .assets-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .asset-item {
        flex-direction: column;
        padding: 12px 10px;
        border-radius: 12px;
        background: #fafafa;
        border: 1px solid #f0f0f0;
        text-align: center;
    }
    
    .asset-item:hover {
        transform: none;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    }
    
    .asset-icon {
        width: 45px;
        height: 45px;
        margin: 0 auto 10px;
        font-size: 1.8rem;
        background: linear-gradient(135deg, #667eea, #764ba2);
    }
    
    .asset-info {
        width: 100%;
    }
    
    .asset-info label {
        font-size: 0.85rem;
        margin-bottom: 6px;
        color: #333;
        font-weight: 500;
    }
    
    .asset-info input {
        padding: 8px 10px;
        font-size: 0.9rem;
        text-align: center;
        border: 1px solid #e5e5e5;
        border-radius: 6px;
        background: white;
    }
    
    .delete-btn {
        top: 4px;
        right: 4px;
        width: 20px;
        height: 20px;
        font-size: 12px;
        line-height: 20px;
    }
    
    /* 自定义资产按钮 */
    .custom-assets-header {
        margin: 15px 0 10px;
    }
    
    .custom-assets-header h3 {
        font-size: 1rem;
        color: #666;
    }
    
    .add-asset-btn {
        padding: 6px 14px;
        font-size: 0.85rem;
        border-radius: 15px;
    }
    
    /* 计算按钮区域 */
    .calculation-section {
        background: white;
        border-radius: 16px;
        padding: 15px;
        margin: 0 0 12px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.04);
        flex-direction: row;
        gap: 10px;
    }
    
    .calculate-btn {
        flex: 1;
        padding: 12px 20px;
        font-size: 1rem;
        border-radius: 50px;
        background: linear-gradient(135deg, #667eea, #764ba2);
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    }
    
    .calculate-btn i {
        font-size: 1rem;
    }
    
    .clear-data-btn {
        flex: 1;
        padding: 12px 20px;
        font-size: 1rem;
        border-radius: 50px;
        background: linear-gradient(135deg, #f56c6c, #e74c3c);
        box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
    }
    
    .clear-data-btn i {
        font-size: 1rem;
    }
    
    /* 结果卡片 - 两列布局 */
    .result-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .result-card {
        padding: 15px 12px;
        border-radius: 12px;
        background: white;
        border-width: 1px;
    }
    
    .result-card.total-assets {
        background: #f0fdf4;
        border-color: #10b981;
    }
    
    .result-card.target-amount {
        background: #fef2f2;
        border-color: #ef4444;
    }
    
    .result-card.difference {
        background: #fffbeb;
        border-color: #f59e0b;
    }
    
    .result-card.progress {
        background: #eff6ff;
        border-color: #3b82f6;
    }
    
    .result-card.layoff-duration {
        background: #faf5ff;
        border-color: #a855f7;
    }
    
    .result-card.cash-flow {
        background: #f0fdf4;
        border-color: #10b981;
        border-style: dashed;
    }
    
    .card-icon {
        width: 40px;
        height: 40px;
        margin: 0 auto 10px;
        font-size: 1.5rem;
    }
    
    .card-content h3 {
        font-size: 0.85rem;
        margin-bottom: 6px;
        color: #666;
        font-weight: 500;
    }
    
    .amount {
        font-size: 1.2rem;
        font-weight: 700;
    }
    
    .card-hint {
        font-size: 0.75rem;
        color: #999;
        margin-top: 4px;
    }
    
    /* 进度条 */
    .progress-bar {
        height: 8px;
        border-radius: 4px;
        margin: 15px 0;
    }
    
    /* 激励信息 */
    .motivation-message {
        padding: 12px 15px;
        border-radius: 12px;
        margin-top: 15px;
        background: linear-gradient(135deg, #fef3c7, #fde68a);
    }
    
    .motivation-message p {
        font-size: 0.95rem;
        color: #92400e;
        font-weight: 500;
    }
    
    /* 支出记录区域 */
    .expense-section {
        margin-top: 0;
        padding-top: 0;
        border-top: none;
    }
    
    .expense-section h2 {
        font-size: 1.3rem;
        margin-bottom: 15px;
    }
    
    .expense-form {
        background: white;
        padding: 20px 15px;
        border-radius: 16px;
        margin-bottom: 12px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    }
    
    .form-row {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin-bottom: 15px;
    }
    
    .form-group label {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }
    
    .expense-select {
        padding: 10px 12px;
        font-size: 0.9rem;
        border: 1px solid #e5e5e5;
        border-radius: 8px;
    }
    
    .expense-inputs {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 15px;
    }
    
    .expense-input-group label {
        font-size: 0.9rem;
        margin-bottom: 6px;
    }
    
    .expense-input-group input {
        padding: 10px 12px;
        font-size: 0.9rem;
        border: 1px solid #e5e5e5;
        border-radius: 8px;
    }
    
    .expense-actions {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .expense-btn {
        padding: 10px 15px;
        font-size: 0.85rem;
        border-radius: 20px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    }
    
    .import-btn {
        background: linear-gradient(135deg, #f39c12, #e67e22);
        color: white;
    }
    
    .import-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3);
    }
    
    .manage-btn {
        background: linear-gradient(135deg, #9b59b6, #8e44ad);
        color: white;
    }
    
    .manage-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(155, 89, 182, 0.3);
    }
    
    /* 统计面板 */
    .visualization-panel {
        background: transparent;
        padding: 0;
        border-radius: 0;
        margin-top: 0;
        box-shadow: none;
    }
    
    .visualization-panel > * {
        background: white;
        padding: 20px 15px;
        border-radius: 16px;
        margin-bottom: 12px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    }
    
    .panel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        margin-bottom: 0;
        padding: 20px 15px;
    }
    
    .panel-header h3 {
        font-size: 1.2rem;
        color: #333;
        font-weight: 600;
    }
    
    .year-selector {
        width: 100%;
        justify-content: space-between;
    }
    
    .year-selector label {
        font-size: 0.9rem;
    }
    
    .year-select {
        padding: 8px 12px;
        font-size: 0.9rem;
        border: 1px solid #e5e5e5;
        border-radius: 6px;
    }
    
    .statistics-summary {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-bottom: 20px;
    }
    
    .stat-card {
        flex-direction: column;
        padding: 12px 10px;
        border-radius: 12px;
        gap: 8px;
        text-align: center;
        box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .stat-content h4 {
        font-size: 0.8rem;
        margin-bottom: 4px;
    }
    
    .stat-amount {
        font-size: 1.1rem;
        font-weight: 700;
    }
    
    .charts-container {
        grid-template-columns: 1fr;
        gap: 15px;
        margin: 0;
    }
    
    .chart-wrapper {
        padding: 15px;
        border-radius: 12px;
    }
    
    .chart-wrapper h4 {
        font-size: 1rem;
        margin-bottom: 15px;
    }
    
    /* 月度明细表格移动端优化 */
    .monthly-detail {
        margin: 0;
    }
    
    .monthly-detail h4 {
        font-size: 1rem;
        margin-bottom: 10px;
        color: #333;
        font-weight: 600;
    }
    
    .table-wrapper {
        border-radius: 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .monthly-table {
        font-size: 0.8rem;
        min-width: 600px;
    }
    
    .monthly-table th,
    .monthly-table td {
        padding: 8px 6px;
        font-size: 0.8rem;
    }
    
    /* 模态框移动端优化 */
    .modal-content {
        width: 90%;
        max-width: 90%;
        margin: 0;
        padding: 20px 15px;
        border-radius: 16px;
        max-height: 80vh;
        overflow-y: auto;
    }
    
    .modal-header h3 {
        font-size: 1.2rem;
    }
    
    .modal-footer {
        flex-direction: row;
        gap: 10px;
    }
    
    .modal-footer button {
        flex: 1;
        padding: 10px;
        border-radius: 20px;
    }
    
    /* 页脚 */
    .footer {
        display: none;
    }
}

/* ========== 横屏优化 ========== */
@media (max-width: 768px) and (orientation: landscape) {
    .header {
        margin-bottom: 0;
        padding: 10px 15px 15px;
    }
    
    .header h1 {
        font-size: 1.2rem;
    }
    
    .subtitle {
        font-size: 0.75rem;
    }
    
    .user-bar {
        flex-direction: row;
        margin-top: 8px;
    }
    
    .result-cards {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .statistics-summary {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .assets-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .target-section,
    .assets-section,
    .result-section {
        padding: 15px 12px;
        margin-bottom: 10px;
    }
}

/* ========== 触摸设备优化 ========== */
@media (hover: none) and (pointer: coarse) {
    button,
    input,
    select {
        min-height: 44px;
    }
    
    .asset-item:hover,
    .result-card:hover,
    .stat-card:hover {
        transform: none;
    }
    
    .asset-item:active,
    .result-card:active {
        transform: scale(0.98);
        opacity: 0.9;
    }
}
