/* SVG 线性图标 */
.icon {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.icon-sm {
    width: 20px;
    height: 20px;
}

.icon-lg {
    width: 28px;
    height: 28px;
}

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

:root {
    --bg-page: #FFF9F5;
    --bg-card: #FFFFFF;
    --bg-grouped: #F8F0E8;
    --text-primary: #332A22;
    --text-secondary: #6D5A4B;
    --text-tertiary: #9E8A7A;
    --color-primary: #F59E0B;
    --color-primary-light: #FFFBEB;
    --color-ai: #D97706;
    --bg-ai: #FEF3C7;
    --border-light: #F3E8D2;
    --border-base: #E5D8C5;
}

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

.phone-frame {
    max-width: 390px;
    margin: 20px auto;
    background: var(--bg-page);
    min-height: 844px;
    position: relative;
    overflow: hidden;
}

.page {
    display: none;
    padding-bottom: 80px;
}

.page.active {
    display: block;
}

/* 导航栏 */
.nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-page);
}

.nav-title {
    font-size: 17px;
    font-weight: 600;
}

/* Logo 设计 */
.logo {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-primary);
}

.logo-acronym {
    font-size: 10px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--color-primary-light);
    padding: 3px 8px;
    border-radius: 6px;
}

.nav-back {
    font-size: 20px;
    color: var(--text-primary);
    cursor: pointer;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-grouped);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
}

/* 卡片 */
.card {
    background: var(--bg-card);
    border-radius: 14px;
    margin: 0 16px 12px;
    padding: 16px;
}

.card-title {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 4px;
}

.card-amount {
    font-size: 28px;
    font-weight: 600;
    margin: 12px 0;
    letter-spacing: -0.5px;
}

.card-meta {
    font-size: 12px;
    color: var(--text-tertiary);
}

/* 列表项 */
.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: all 0.3s ease;
}

.list-item:hover {
    background-color: var(--color-primary-light);
}

.list-item:last-child {
    border-bottom: none;
}

.list-item-content {
    flex: 1;
}

.list-item-title {
    font-size: 14px;
    color: var(--text-primary);
}

.list-item-amount {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.list-item-arrow {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-left: 8px;
    transition: transform 0.3s ease;
}

.list-item-arrow.collapsed {
    transform: rotate(-90deg);
}

/* 分组标题 */
.section-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 16px 16px 8px;
}

/* 底部导航 */
.tab-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--bg-card);
    display: flex;
    justify-content: space-around;
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border-light);
    z-index: 100;
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4px 16px;
    cursor: pointer;
    color: var(--text-tertiary);
}

.tab-item.active {
    color: var(--color-primary);
}

.tab-icon {
    font-size: 22px;
    margin-bottom: 2px;
}

.tab-text {
    font-size: 10px;
}

/* AI 气泡 */
.ai-bubble {
    background: var(--bg-ai);
    border-radius: 14px;
    padding: 16px;
    margin: 12px 16px;
}

.ai-bubble-header {
    font-size: 13px;
    color: var(--color-ai);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ai-bubble-content {
    font-size: 14px;
    line-height: 1.6;
}

.ai-bubble-link {
    font-size: 14px;
    color: var(--color-ai);
    margin-top: 12px;
    display: inline-block;
}

/* 按钮 */
.btn-primary {
    background: var(--color-primary);
    color: white;
    font-size: 16px;
    font-weight: 500;
    padding: 12px 24px;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    border: none;
}

.btn-secondary {
    background: var(--bg-grouped);
    color: var(--text-primary);
    font-size: 14px;
    padding: 10px 16px;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    border: none;
}

/* Tab 切换 */
.tab-switch {
    display: flex;
    background: var(--bg-grouped);
    border-radius: 8px;
    margin: 0 16px 16px;
    padding: 4px;
}

.tab-switch-item {
    flex: 1;
    text-align: center;
    padding: 8px;
    font-size: 13px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-secondary);
}

.tab-switch-item.active {
    background: var(--bg-card);
    color: var(--text-primary);
    font-weight: 500;
}

/* 快捷选项 */
.quick-options {
    display: flex;
    gap: 12px;
    padding: 0 16px;
    margin: 12px 0;
}

.quick-option {
    flex: 1;
    background: var(--bg-card);
    border-radius: 10px;
    padding: 16px 8px;
    text-align: center;
    cursor: pointer;
}

.quick-option-icon {
    font-size: 28px;
    margin-bottom: 4px;
}

.quick-option-text {
    font-size: 12px;
    color: var(--text-secondary);
}

/* 输入框 */
.input-bar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 390px;
    background: var(--bg-card);
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border-light);
    display: flex;
    gap: 12px;
}

.input-field {
    flex: 1;
    background: var(--bg-grouped);
    border: none;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
}

.input-btn {
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 10px 20px;
    font-size: 14px;
    cursor: pointer;
}

/* 消息气泡 */
.message {
    margin: 8px 16px;
    max-width: 80%;
}

.message-ai {
    background: var(--bg-ai);
    border-radius: 14px;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.5;
}

.message-user {
    background: var(--bg-card);
    border-radius: 14px;
    padding: 12px 16px;
    font-size: 14px;
    margin-left: auto;
    text-align: right;
}

/* 时间轴 */
.timeline-month {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 16px 16px 8px;
}

.timeline-item {
    background: var(--bg-card);
    margin: 0 16px 8px;
    padding: 12px 16px;
    border-radius: 10px;
}

.timeline-date {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 4px;
}

.timeline-title {
    font-size: 14px;
    margin-bottom: 2px;
}

.timeline-amount {
    font-size: 14px;
    font-weight: 500;
}

/* 底部统计 */
.bottom-stats {
    background: var(--bg-card);
    padding: 12px 16px;
    margin: 16px;
    border-radius: 10px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 32px;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-title {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-desc {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-bottom: 24px;
}

/* 页面切换按钮 */
.page-switcher {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--bg-card);
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 1000;
}

.page-switcher-btn {
    display: block;
    padding: 8px 16px;
    margin: 4px 0;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 4px;
    font-size: 13px;
}

.page-switcher-btn:hover {
    background: var(--bg-grouped);
}

.page-switcher-btn.active {
    background: var(--color-primary);
    color: white;
}
