/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
}

.app-container {
    max-width: 500px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    position: relative;
}

/* 主内容区域 */
#main-content {
    flex: 1;
    padding: 16px;
    padding-bottom: 70px; /* 为底部导航留出空间 */
}

/* 底部导航 */
.bottom-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
    position: fixed;
    bottom: 0;
    width: 100%;
    max-width: 500px;
    height: 60px;
    background-color: white;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 0;
    width: 25%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-item.active {
    color: #1976d2;
}

.nav-item i {
    font-size: 1.2rem;
    margin-bottom: 4px;
}

.nav-item span {
    font-size: 0.8rem;
}

/* 卡片样式 */
.card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 16px;
    margin-bottom: 16px;
}

.card-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: #333;
}

/* 表单样式 */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-input:focus {
    outline: none;
    border-color: #1976d2;
}

.btn {
    padding: 10px 16px;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-primary {
    background-color: #1976d2;
    color: white;
}

.btn-primary:hover {
    background-color: #1565c0;
}

.btn-block {
    display: block;
    width: 100%;
}

/* 类别选择 */
.category-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.category-chip {
    padding: 6px 12px;
    background-color: #f1f1f1;
    border-radius: 16px;
    font-size: 0.9rem;
    cursor: pointer;
}

.category-chip.selected {
    background-color: #1976d2;
    color: white;
}

/* 首页样式 */
.summary-card {
    margin-top: 16px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
}

.divider {
    height: 1px;
    background-color: #eee;
    margin: 8px 0;
}

.balance-row {
    font-weight: 600;
    font-size: 1.1rem;
}

/* 页面标题 */
.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 24px;
    color: #333;
}

/* 切换按钮 */
.toggle-buttons {
    display: flex;
    margin-bottom: 16px;
}

.toggle-btn {
    padding: 8px 16px;
    background-color: #f1f1f1;
    border: none;
    cursor: pointer;
}

.toggle-btn:first-child {
    border-radius: 4px 0 0 4px;
}

/* 内联编辑样式 */
[data-editable="true"] {
    cursor: pointer;
    position: relative;
    z-index: 1;
}

[data-editable="true"]:hover {
    background-color: rgba(25, 118, 210, 0.1);
    border-radius: 4px;
    padding: 2px 4px;
    margin: -2px -4px;
}

[data-editing="true"] {
    position: relative;
    z-index: 100;
}

.category-edit-select {
    padding: 4px;
    border: 1px solid #1976d2;
    border-radius: 4px;
    font-size: 0.9rem;
    width: 100%;
    position: relative;
    z-index: 10;
    background-color: white;
}

.amount-edit-input {
    width: 80px;
    padding: 4px;
    border: 1px solid #1976d2;
    border-radius: 4px;
    font-size: 0.9rem;
    text-align: right;
}

.inline-edit-actions {
    display: inline-flex;
    margin-left: 8px;
}

.inline-save-btn, .inline-cancel-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 4px;
    font-size: 0.8rem;
}

.inline-save-btn {
    color: #4caf50;
}

.inline-cancel-btn {
    color: #f44336;
}

.toggle-btn:last-child {
    border-radius: 0 4px 4px 0;
}

.toggle-btn.active {
    background-color: #1976d2;
    color: white;
}

/* 响应式设计 */
@media (max-width: 600px) {
    .app-container {
        box-shadow: none;
    }
}