/* 自定义样式 */

:root {
    --primary-color: #2563eb;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --bg-color: #f8fafc;
    --text-color: #1e293b;
    --text-secondary: #64748b;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

/* 卡片样式 */
.card {
    border: none;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* 密码记录卡片 */
.password-card {
    cursor: pointer;
    margin-bottom: 1rem;
}

.password-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid #e5e7eb;
}

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

.password-item-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}

.password-item-value {
    color: var(--text-color);
    font-size: 1rem;
    word-break: break-all;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.password-item-value:hover {
    background-color: #f3f4f6;
}

.copy-btn {
    opacity: 0;
    transition: opacity 0.2s;
}

.password-item:hover .copy-btn {
    opacity: 1;
}

/* 统计卡片 */
.stat-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, #3b82f6 100%);
    color: white;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.stat-card.success {
    background: linear-gradient(135deg, var(--success-color) 0%, #34d399 100%);
}

.stat-card.danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #f87171 100%);
}

.stat-card.warning {
    background: linear-gradient(135deg, var(--warning-color) 0%, #fbbf24 100%);
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    margin: 0.5rem 0;
}

.stat-label {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* 分类标签 */
.category-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    background-color: #e0e7ff;
    color: var(--primary-color);
}

/* 按钮样式 */
.btn {
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-weight: 500;
    transition: all 0.2s;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 表单样式 */
.form-control, .form-select {
    border-radius: 6px;
    border: 1px solid #d1d5db;
    padding: 0.5rem 0.75rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* 表格样式 */
.table {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
}

.table thead {
    background-color: #f9fafb;
}

.table tbody tr:hover {
    background-color: #f9fafb;
}

/* 加载动画 */
.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); }
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* 底部导航栏（APP风格）- 优化版 */
.bottom-navbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    padding: 0;
    z-index: 1000;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
    max-width: 100%;
    overflow: hidden;
    height: 60px;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.25rem;
    text-decoration: none;
    color: #94a3b8;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex: 1;
    min-width: 0;
    max-width: 100%;
    position: relative;
    border: none;
    background: transparent;
}

.bottom-nav-item i {
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
    transition: transform 0.2s;
}

.bottom-nav-item span {
    font-size: 0.7rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    font-weight: 500;
}

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

.bottom-nav-item.active i {
    transform: scale(1.1);
}

.bottom-nav-item:hover {
    color: var(--primary-color);
    text-decoration: none;
    background: rgba(37, 99, 235, 0.05);
}

.bottom-nav-item:active {
    transform: scale(0.95);
}

/* 底部导航栏活动指示器 */
.bottom-nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40%;
    height: 3px;
    background: var(--primary-color);
    border-radius: 0 0 3px 3px;
}

/* 平台图标（首个文字）- 圆形设计，像手机通讯录 */
.platform-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
    margin-right: 0.75rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    letter-spacing: 0;
    line-height: 1;
}

.platform-icon-small {
    width: 40px;
    height: 40px;
    font-size: 1rem;
    border-radius: 50%;
    margin-right: 0.75rem;
}

/* 快捷选项按钮 */
.quick-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.quick-option-btn {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid #e5e7eb;
    background: white;
    color: var(--text-color);
    font-size: 0.875rem;
    transition: all 0.2s;
    cursor: pointer;
    display: inline-block;
    white-space: nowrap;
    flex-shrink: 0;
}

.quick-option-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.quick-option-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* 备注卡片样式 */
.border-left-primary {
    border-left: 4px solid var(--primary-color) !important;
}

.note-content {
    color: var(--text-color);
    line-height: 1.6;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.note-type-btn.active {
    background: var(--primary-color) !important;
    color: white !important;
    border-color: var(--primary-color) !important;
}

/* 记账表格优化 */
.accounting-table {
    font-size: 0.9rem;
}

.accounting-table th {
    font-weight: 600;
    white-space: nowrap;
    vertical-align: middle;
}

.accounting-table td {
    vertical-align: middle;
}

.accounting-table .badge {
    font-size: 0.75rem;
    padding: 0.35em 0.65em;
}

.accounting-table .text-break {
    max-width: 250px;
    word-wrap: break-word;
    word-break: break-word;
}

/* 记账列表 - 卡片式布局（按日期分组） */
.expense-list-grouped {
    padding: 0;
}

.expense-day-group {
    border-bottom: 1px solid #e5e7eb;
}

.expense-day-group:last-child {
    border-bottom: none;
}

.expense-day-header {
    background: #f9fafb;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.expense-day-items {
    padding: 0.5rem 0;
}

.expense-item-card {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.2s;
}

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

.expense-item-card:hover {
    background-color: #f9fafb;
}

.expense-item-left {
    flex: 1;
    min-width: 0;
    padding-right: 1rem;
}

.expense-item-right {
    flex-shrink: 0;
    text-align: right;
}

.expense-item-desc {
    margin-top: 0.25rem;
    line-height: 1.4;
    word-break: break-word;
}

.expense-item-amount {
    white-space: nowrap;
}

.expense-item-actions {
    margin-top: 0.5rem;
}

.badge-sm {
    font-size: 0.7rem;
    padding: 0.25em 0.5em;
}

/* 移动端优化 */
@media (max-width: 768px) {
    .expense-item-card {
        padding: 0.75rem;
    }
    
    .expense-item-left {
        padding-right: 0.75rem;
    }
    
    .expense-item-amount {
        font-size: 1rem !important;
    }
    
    .expense-item-actions .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.875rem;
    }
    
    .expense-day-header {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
}

/* 货币换算显示 */
.currency-conversion {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    font-size: 0.75rem;
}

.stat-card .currency-conversion {
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
}

.currency-conversion-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    white-space: nowrap;
}

.currency-conversion-label {
    color: var(--text-secondary);
    font-weight: 500;
}

.stat-card .currency-conversion-label {
    color: rgba(255, 255, 255, 0.8);
}

.currency-conversion-value {
    color: var(--text-color);
    font-weight: 600;
}

.stat-card .currency-conversion-value {
    color: rgba(255, 255, 255, 0.95);
}

/* 世界旅行功能样式 */
.world-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 0;
    margin-bottom: 2rem;
    border-radius: 0 0 20px 20px;
}

.country-card {
    transition: all 0.3s;
    border: 2px solid transparent;
    cursor: pointer;
    position: relative;
}

.country-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.country-card.visited {
    border-color: #fbbf24;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
}

.country-flag {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.visited-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #fbbf24;
    color: white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.stats-card {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.2s;
}

.stats-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.stats-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #667eea;
    line-height: 1;
}

.stats-label {
    color: #6b7280;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* 底部导航栏 - 6个选项时的样式调整 */
.bottom-navbar {
    display: flex;
    justify-content: space-around;
    align-items: stretch;
}

.bottom-nav-item {
    flex: 1;
    min-width: 0;
    font-size: 0.75rem;
}

.bottom-nav-item i {
    font-size: 1.1rem;
}

@media (max-width: 576px) {
    .bottom-nav-item {
        font-size: 0.7rem;
    }
    
    .bottom-nav-item i {
        font-size: 1rem;
    }
    
    .bottom-nav-item span {
        display: block;
        margin-top: 0.25rem;
    }
}

/* 网站LOGO样式 */
.site-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 4px;
}

@media (max-width: 576px) {
    .site-logo {
        width: 32px;
        height: 32px;
    }
}

/* 货币选择器 */
.currency-selector {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.currency-option {
    padding: 0.5rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.currency-option:hover {
    border-color: var(--primary-color);
    background: #f0f4ff;
}

.currency-option.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* 支出比例进度条 */
.expense-ratio-item {
    margin-bottom: 1rem;
}

.expense-ratio-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.expense-ratio-bar {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
}

.expense-ratio-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s;
    border-radius: 4px;
}

/* 一键复制所有按钮 */
.copy-all-btn {
    position: sticky;
    top: 1rem;
    z-index: 100;
    margin-bottom: 1rem;
}

/* 响应式 */
@media (max-width: 768px) {
    .stat-value {
        font-size: 1.5rem;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .bottom-nav-item span {
        font-size: 0.65rem;
    }
    
    .bottom-nav-item i {
        font-size: 1rem;
    }
    
    .bottom-navbar {
        height: 58px;
    }
}

@media (max-width: 480px) {
    .bottom-nav-item {
        padding: 0.4rem 0.15rem;
    }
    
    .bottom-nav-item span {
        font-size: 0.6rem;
    }
    
    .bottom-nav-item i {
        font-size: 0.95rem;
    }
    
    .bottom-navbar {
        height: 56px;
    }
}

/* 桌面端隐藏底部导航 */
@media (min-width: 992px) {
    .bottom-navbar {
        display: none;
    }
    
    main {
        padding-bottom: 2rem !important;
    }
}

/* 确保内容不被底部导航遮挡 */
@media (max-width: 991px) {
    body {
        padding-bottom: 60px;
    }
    
    main {
        padding-bottom: 1rem !important;
        margin-bottom: 0 !important;
    }
}

/* 管理后台样式 */
.sidebar {
    background-color: #f8f9fa;
    border-right: 1px solid #dee2e6;
}

.sidebar .nav-link {
    color: #495057;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 0.25rem;
}

.sidebar .nav-link:hover {
    background-color: #e9ecef;
    color: var(--primary-color);
}

.sidebar .nav-link.active {
    background-color: var(--primary-color);
    color: white;
}

.sidebar .nav-link i {
    width: 20px;
}

/* 暗黑模式（可选） */
@media (prefers-color-scheme: dark) {
    /* 可以在这里添加暗黑模式样式 */
}

