/* 记账本 - 移动端优先样式 */

/* 基础变量 */
:root {
    --primary: #4A90D9;
    --success: #22C55E;
    --danger: #EF4444;
    --warning: #F59E0B;
    --bg: #F5F7FA;
    --card-bg: #FFFFFF;
    --text: #1F2937;
    --text-secondary: #6B7280;
    --border: #E5E7EB;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    padding-bottom: 70px;
    -webkit-font-smoothing: antialiased;
}

/* ==================== 底部导航栏 ==================== */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card-bg);
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 60px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom);
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 10px;
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.tab-item.active {
    color: var(--primary);
}

.tab-item i {
    font-size: 22px;
    margin-bottom: 2px;
}

.tab-item span {
    font-weight: 500;
}

/* ==================== 头部区域 ==================== */
.header {
    background: linear-gradient(135deg, var(--primary), #6366F1);
    color: white;
    padding: 20px 16px 24px;
    position: relative;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.user-info {
    display: flex;
    align-items: center;
}

.user-greeting {
    font-size: 14px;
    opacity: 0.9;
}

.logout-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    color: white;
    text-decoration: none;
    font-size: 12px;
    transition: background 0.2s;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.logout-btn i {
    font-size: 14px;
}

.header-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

/* 收支汇总卡片 */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.summary-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 12px;
    text-align: center;
}

.summary-card .label {
    font-size: 11px;
    opacity: 0.9;
    margin-bottom: 4px;
}

.summary-card .amount {
    font-size: 18px;
    font-weight: 700;
}

.summary-card .amount.income {
    color: #86EFAC;
}

.summary-card .amount.expense {
    color: #FCA5A5;
}

/* ==================== 通用卡片 ==================== */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    margin: 12px 16px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 14px 16px;
    font-weight: 600;
    font-size: 15px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-body {
    padding: 16px;
}

/* ==================== 交易记录列表 ==================== */
.transaction-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.05);
}

.transaction-item:last-child {
    border-bottom: none;
}

.transaction-item:active {
    background: var(--bg);
}

.transaction-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 20px;
}

.transaction-icon.expense {
    background: #FEE2E2;
    color: var(--danger);
}

.transaction-icon.income {
    background: #DCFCE7;
    color: var(--success);
}

.transaction-info {
    flex: 1;
    min-width: 0;
}

.transaction-info .category {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.transaction-info .desc {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.transaction-amount {
    font-size: 16px;
    font-weight: 600;
    margin-left: 12px;
    white-space: nowrap;
}

.transaction-amount.expense {
    color: var(--danger);
}

.transaction-amount.income {
    color: var(--success);
}

.transaction-date {
    font-size: 11px;
    color: var(--text-secondary);
    margin-left: 8px;
    white-space: nowrap;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state p {
    margin-bottom: 16px;
}

/* ==================== 筛选栏 ==================== */
.filter-bar {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.filter-bar::-webkit-scrollbar {
    display: none;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 13px;
    color: var(--text);
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
    text-decoration: none;
}

.filter-chip.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.filter-chip:active {
    transform: scale(0.95);
}

/* ==================== 表单样式 ==================== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card-bg);
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.15);
}

.form-input::placeholder {
    color: #9CA3AF;
}

textarea.form-input {
    min-height: 100px;
    resize: vertical;
}

select.form-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

/* 类型选择器 */
.type-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.type-btn {
    padding: 14px;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: var(--card-bg);
    font-size: 15px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.type-btn.expense.active {
    border-color: var(--danger);
    background: #FEF2F2;
    color: var(--danger);
}

.type-btn.income.active {
    border-color: var(--success);
    background: #F0FDF4;
    color: var(--success);
}

.type-btn:active {
    transform: scale(0.98);
}

/* 分类网格 */
.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    border: 2px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.category-item.selected {
    border-color: var(--primary);
    background: #EFF6FF;
}

.category-item:active {
    transform: scale(0.95);
}

.category-item i {
    font-size: 24px;
    margin-bottom: 4px;
}

.category-item span {
    font-size: 11px;
    text-align: center;
}

/* ==================== 按钮样式 ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
    text-decoration: none;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--primary);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: #3B82F6;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}

/* 浮动操作按钮 */
.fab {
    position: fixed;
    right: 20px;
    bottom: 80px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(74, 144, 217, 0.4);
    cursor: pointer;
    z-index: 100;
    transition: transform 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.fab:active {
    transform: scale(0.9);
}

/* ==================== 分类管理页面 ==================== */
.category-card {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

.category-card:last-child {
    border-bottom: none;
}

.category-card .icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 18px;
}

.category-card .info {
    flex: 1;
}

.category-card .info .name {
    font-size: 15px;
    font-weight: 500;
}

.category-card .info .type {
    font-size: 12px;
    color: var(--text-secondary);
}

.category-card .actions {
    display: flex;
    gap: 8px;
}

.category-card .actions button {
    padding: 8px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.category-card .actions button:active {
    color: var(--text);
}

/* ==================== 统计页面 ==================== */
.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px;
    margin: 12px 16px;
    box-shadow: var(--shadow);
}

.chart-container {
    position: relative;
    height: 250px;
    margin: 16px 0;
}

.stat-list {
    margin-top: 16px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-item .name {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-item .name .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.stat-item .value {
    font-weight: 600;
}

/* ==================== 日期选择器 ==================== */
.date-range {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.date-input {
    flex: 1;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card-bg);
    -webkit-appearance: none;
}

/* ==================== 提示消息 ==================== */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    background: var(--text);
    color: white;
    border-radius: 8px;
    font-size: 14px;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s;
}

.toast.show {
    opacity: 1;
}

/* ==================== 加载状态 ==================== */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.loading::after {
    content: '';
    display: block;
    width: 32px;
    height: 32px;
    margin: 12px auto;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== 统计视图切换 ==================== */
.scope-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    padding: 4px;
    background: var(--bg);
    border-radius: 10px;
}

.scope-tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
}

.scope-tab.active {
    background: var(--card-bg);
    color: var(--primary);
    box-shadow: var(--shadow);
}

/* ==================== 辅助类 ==================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.p-4 { padding: 16px; }

/* 隐藏元素 */
.hidden { display: none !important; }
/* 记账本 - 移动端优先样式 */

/* 基础变量 */
:root {
    --primary: #4A90D9;
    --success: #22C55E;
    --danger: #EF4444;
    --warning: #F59E0B;
    --bg: #F5F7FA;
    --card-bg: #FFFFFF;
    --text: #1F2937;
    --text-secondary: #6B7280;
    --border: #E5E7EB;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    padding-bottom: 70px;
    -webkit-font-smoothing: antialiased;
}

/* ==================== 底部导航栏 ==================== */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card-bg);
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 60px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    padding-bottom: env(safe-area-inset-bottom);
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 10px;
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.tab-item.active {
    color: var(--primary);
}

.tab-item i {
    font-size: 22px;
    margin-bottom: 2px;
}

.tab-item span {
    font-weight: 500;
}

/* ==================== 头部区域 ==================== */
.header {
    background: linear-gradient(135deg, var(--primary), #6366F1);
    color: white;
    padding: 20px 16px 24px;
    position: relative;
}

.header-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
}

/* 收支汇总卡片 */
.summary-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.summary-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    padding: 12px;
    text-align: center;
}

.summary-card .label {
    font-size: 11px;
    opacity: 0.9;
    margin-bottom: 4px;
}

.summary-card .amount {
    font-size: 18px;
    font-weight: 700;
}

.summary-card .amount.income {
    color: #86EFAC;
}

.summary-card .amount.expense {
    color: #FCA5A5;
}

/* ==================== 通用卡片 ==================== */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    margin: 12px 16px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 14px 16px;
    font-weight: 600;
    font-size: 15px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-body {
    padding: 16px;
}

/* ==================== 交易记录列表 ==================== */
.transaction-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.05);
}

.transaction-item:last-child {
    border-bottom: none;
}

.transaction-item:active {
    background: var(--bg);
}

.transaction-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 20px;
}

.transaction-icon.expense {
    background: #FEE2E2;
    color: var(--danger);
}

.transaction-icon.income {
    background: #DCFCE7;
    color: var(--success);
}

.transaction-info {
    flex: 1;
    min-width: 0;
}

.transaction-info .category {
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.transaction-info .desc {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.transaction-amount {
    font-size: 16px;
    font-weight: 600;
    margin-left: 12px;
    white-space: nowrap;
}

.transaction-amount.expense {
    color: var(--danger);
}

.transaction-amount.income {
    color: var(--success);
}

.transaction-date {
    font-size: 11px;
    color: var(--text-secondary);
    margin-left: 8px;
    white-space: nowrap;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-state p {
    margin-bottom: 16px;
}

/* ==================== 筛选栏 ==================== */
.filter-bar {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.filter-bar::-webkit-scrollbar {
    display: none;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 13px;
    color: var(--text);
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.filter-chip.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.filter-chip:active {
    transform: scale(0.95);
}

/* ==================== 表单样式 ==================== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--card-bg);
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.15);
}

.form-input::placeholder {
    color: #9CA3AF;
}

textarea.form-input {
    min-height: 100px;
    resize: vertical;
}

select.form-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

/* 类型选择器 */
.type-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.type-btn {
    padding: 14px;
    border: 2px solid var(--border);
    border-radius: 10px;
    background: var(--card-bg);
    font-size: 15px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.type-btn.expense.active {
    border-color: var(--danger);
    background: #FEF2F2;
    color: var(--danger);
}

.type-btn.income.active {
    border-color: var(--success);
    background: #F0FDF4;
    color: var(--success);
}

.type-btn:active {
    transform: scale(0.98);
}

/* 分类网格 */
.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    border: 2px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.category-item.selected {
    border-color: var(--primary);
    background: #EFF6FF;
}

.category-item:active {
    transform: scale(0.95);
}

.category-item i {
    font-size: 24px;
    margin-bottom: 4px;
}

.category-item span {
    font-size: 11px;
    text-align: center;
}

/* ==================== 按钮样式 ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
    text-decoration: none;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--primary);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: #3B82F6;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}

/* 浮动操作按钮 */
.fab {
    position: fixed;
    right: 20px;
    bottom: 80px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 12px rgba(74, 144, 217, 0.4);
    cursor: pointer;
    z-index: 100;
    transition: transform 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.fab:active {
    transform: scale(0.9);
}

/* ==================== 分类管理页面 ==================== */
.category-card {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

.category-card:last-child {
    border-bottom: none;
}

.category-card .icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 18px;
}

.category-card .info {
    flex: 1;
}

.category-card .info .name {
    font-size: 15px;
    font-weight: 500;
}

.category-card .info .type {
    font-size: 12px;
    color: var(--text-secondary);
}

.category-card .actions {
    display: flex;
    gap: 8px;
}

.category-card .actions button {
    padding: 8px;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.category-card .actions button:active {
    color: var(--text);
}

/* ==================== 统计页面 ==================== */
.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px;
    margin: 12px 16px;
    box-shadow: var(--shadow);
}

.chart-container {
    position: relative;
    height: 250px;
    margin: 16px 0;
}

.stat-list {
    margin-top: 16px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-item .name {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-item .name .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.stat-item .value {
    font-weight: 600;
}

/* ==================== 日期选择器 ==================== */
.date-range {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.date-input {
    flex: 1;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card-bg);
    -webkit-appearance: none;
}

/* ==================== 提示消息 ==================== */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    background: var(--text);
    color: white;
    border-radius: 8px;
    font-size: 14px;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s;
}

.toast.show {
    opacity: 1;
}

/* ==================== 加载状态 ==================== */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

.loading::after {
    content: '';
    display: block;
    width: 32px;
    height: 32px;
    margin: 12px auto;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== 辅助类 ==================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.p-4 { padding: 16px; }

/* 隐藏元素 */
.hidden { display: none !important; }
/* 自定义样式 */

/* 页脚固定在底部 */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    flex: 1;
}

/* 卡片样式 */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* 统计卡片样式 */
.card.bg-success,
.card.bg-danger,
.card.bg-primary {
    border: none;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.15);
}

/* 表格样式 */
.table th {
    font-weight: 600;
    color: #495057;
}

.table td {
    vertical-align: middle;
}

/* 金额显示 */
.text-success {
    color: #198754 !important;
}

.text-danger {
    color: #dc3545 !important;
}

/* 徽章样式 */
.badge {
    font-weight: 500;
    padding: 0.4em 0.8em;
}

/* 表单样式 */
.form-label {
    font-weight: 500;
    color: #495057;
}

.form-control:focus,
.form-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* 按钮样式 */
.btn {
    font-weight: 500;
}

/* 导航栏样式 */
.navbar-brand {
    font-weight: 600;
}

.nav-link {
    font-weight: 500;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
}

/* 动画效果 */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* 空状态样式 */
.empty-state {
    padding: 3rem;
    text-align: center;
}

.empty-state i {
    font-size: 4rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

/* 图表容器 */
.chart-container {
    position: relative;
    height: 300px;
}
