* {
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb; /* 更深邃的蓝 */
    --primary-hover: #1d4ed8;
    --bg-color: #f8fafc; /* 纯净灰白 */
    --card-bg: rgba(255, 255, 255, 0.85);
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --danger-color: #ef4444;
    --success-color: #22c55e;
    --header-height: 64px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-color);
    /* 更加细腻的网格背景 */
    background-image: 
        radial-gradient(at 0% 0%, rgba(37, 99, 235, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(239, 68, 68, 0.05) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 顶部导航 */
.app-header {
    height: var(--header-height);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255,255,255,0.3);
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    justify-content: center;
    padding: 0 20px;
    box-shadow: var(--shadow-sm);
}

.header-content {
    width: 100%;
    max-width: 1000px; /* 宽屏适配 */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--primary-color);
}

.brand i {
    font-size: 1.4rem;
}

.app-header h1 {
    font-size: 1.2rem;
    margin: 0;
    font-weight: 700;
    color: var(--text-primary);
}

.add-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 122, 255, 0.3);
    transition: transform 0.1s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.add-btn:active {
    transform: scale(0.96);
}

.settings-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    transition: color 0.2s;
    margin-left: 10px;
}

.settings-btn:hover {
    color: var(--text-primary);
}

/* 布局容器 */
.layout-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    gap: 24px;
    padding: 24px;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
}

/* 主内容区 */
.app-main {
    flex: 1;
    min-width: 0; /* 防止Flex子项溢出 */
}

.list-container {
    width: 100%;
}

.empty-tip {
    text-align: center;
    color: var(--text-secondary);
    margin-top: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.empty-tip i {
    font-size: 3rem;
    color: rgba(0,0,0,0.1);
}

/* 侧边栏 */
.app-sidebar {
    width: 300px;
    flex-shrink: 0;
}

.sidebar-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 84px; /* header + gap */
    border: 1px solid rgba(255,255,255,0.5);
}

.total-info {
    margin-bottom: 24px;
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.total-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.total-amount {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    font-family: "SF Mono", "Roboto Mono", monospace;
}

.sidebar-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sidebar-divider {
    height: 1px;
    background: rgba(0,0,0,0.05);
    margin: 20px 0;
}

.sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.action-btn {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: none;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: flex-start; /* 改为左对齐 */
    padding-left: 20px;
    gap: 12px;
    transition: all 0.2s;
}

.secondary-action {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid transparent;
}

.secondary-action:hover {
    background: #f1f2f6;
    color: var(--text-primary);
}

.primary-action {
    background: #eef2f7;
    color: var(--primary-color);
}

.primary-action:hover {
    background: #dbe4ef;
}

.success-action {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success-color);
}

.success-action:hover {
    background: rgba(34, 197, 94, 0.2);
}

.danger-action {
    background: rgba(255, 71, 87, 0.1);
    color: var(--danger-color);
}

.danger-action:hover {
    background: rgba(255, 71, 87, 0.2);
}


/* 列表样式 - 表格化 */
.date-group {
    margin-bottom: 24px;
    animation: slideUp 0.4s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.date-header {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 10px;
    padding-left: 12px; /* 增加左边距，为伪元素留空间 */
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative; /* 确保伪元素定位相对于此元素 */
}

.date-header::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 14px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

.date-header::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(0,0,0,0.05);
}

.expense-card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.02);
}

/* 表格布局 */
.expense-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.expense-table tr {
    border-bottom: 1px solid #f1f2f6;
    transition: background 0.1s;
}

.expense-table tr:last-child {
    border-bottom: none;
}

.expense-table tr:hover {
    background-color: #f0fdf4; /* 浅绿色高亮 */
    transition: background-color 0.2s ease;
}

.expense-table td {
    padding: 7px 16px; /* 调整为 7px */
    vertical-align: middle;
    font-size: 0.95rem;
    line-height: 1.4; /* 稍微控制行高 */
}

/* 列宽定义 */
.col-content {
    width: 40%;
    color: var(--text-primary);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.col-quantity {
    width: 25%;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.col-amount {
    width: 20%;
    text-align: left;
    font-weight: 700;
    color: var(--text-primary);
    font-family: "SF Mono", "Roboto Mono", monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.col-action {
    width: 15%;
    text-align: center;
    white-space: nowrap; /* 强制单行显示 */
}

.action-icon-btn {
    background: none;
    border: none;
    color: #94a3b8; /* 默认深一点的灰 */
    font-size: 0.8rem; /* 稍微缩小字体 */
    cursor: pointer;
    padding: 4px; /* 进一步减小内边距 */
    border-radius: 6px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 2px;
    width: 26px; /* 缩小按钮尺寸 32->26 */
    height: 26px; /* 缩小按钮尺寸 32->26 */
}

.expense-table tr:hover .action-icon-btn {
    color: #64748b;
}

.edit-btn {
    color: var(--primary-color) !important;
    background: rgba(37, 99, 235, 0.1) !important;
}

.delete-btn {
    color: var(--danger-color) !important;
    background: rgba(239, 68, 68, 0.1) !important;
}

.edit-btn:hover {
    background: rgba(37, 99, 235, 0.2) !important;
}

.delete-btn:hover {
    background: rgba(239, 68, 68, 0.2) !important;
}

/* 文件预览列表 */
.file-preview-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}

.file-preview-item {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 12px;
    gap: 12px;
    transition: background 0.2s;
}

.file-preview-item:hover {
    background: #f1f5f9;
}

.file-preview-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e0e7ff;
    color: var(--primary-color);
    border-radius: 6px;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.file-preview-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.file-name {
    font-size: 0.9rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.file-remove-btn {
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: all 0.2s;
    font-size: 1rem;
    flex-shrink: 0;
}

.file-remove-btn:hover {
    color: var(--danger-color);
    background: rgba(239, 68, 68, 0.1);
}

/* 进度条 */
.progress-bar-bg {
    width: 100%;
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.2s linear;
}

/* 弹窗 (Modal) */
.modal {
    display: none; 
    position: fixed; 
    z-index: 100; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    background-color: rgba(0,0,0,0.4); 
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.modal.show {
    display: flex;
    opacity: 1;
}

.modal-content {
    background-color: #fff;
    border-radius: 20px;
    width: 90%;
    max-width: 600px; /* 增加宽度 */
    box-shadow: var(--shadow-lg);
    animation: zoomIn 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    display: flex;
    flex-direction: column;
    max-height: 85vh; /* 稍微减小高度，留出空间 */
    position: relative; /* 确保定位上下文 */
}

/* 登录弹窗特殊样式 */
.modal.no-close .close-modal,
.modal.no-close .modal-header .close-settings {
    display: none;
}
.modal.no-close {
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    background-color: rgba(0,0,0,0.7);
    z-index: 2000; /* 确保在最上层 */
}

@keyframes zoomIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-header {
    padding: 20px 32px;
    border-bottom: 1px solid #f1f2f6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    background: #fff; /* 防止透明穿透 */
    border-radius: 20px 20px 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.close-modal, .close-settings {
    font-size: 1.2rem;
    color: #b2bec3;
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s;
}

.close-modal:hover, .close-settings:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 24px 32px;
    overflow-y: auto;
    flex: 1;
    overscroll-behavior: contain; /* 防止滚动穿透 */
}

/* 滚动条美化 */
.modal-body::-webkit-scrollbar {
    width: 6px;
}

.modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.modal-body::-webkit-scrollbar-thumb {
    background-color: rgba(0,0,0,0.1);
    border-radius: 3px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background-color: rgba(0,0,0,0.2);
}

.form-group {
    margin-bottom: 20px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #f1f2f6;
    border-radius: 12px;
    font-size: 1rem;
    background: #f8f9fa;
    transition: border-color 0.2s, background 0.2s;
    color: var(--text-primary);
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #fff;
}

.date-input-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quick-tags {
    display: flex;
    gap: 8px;
}

.tag {
    background: #eef2f7;
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 16px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.tag:hover {
    background: #dfe6e9;
    color: var(--text-primary);
}

.modal-footer {
    padding: 16px 32px;
    border-top: 1px solid #f1f2f6;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-shrink: 0;
    background: #fff;
    border-radius: 0 0 20px 20px;
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 10px 16px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 8px;
}

.btn-text:hover {
    background: #f1f2f6;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 122, 255, 0.2);
    transition: background 0.2s;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-success {
    background: var(--success-color);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(34, 197, 94, 0.3);
    transition: background 0.2s;
}

.btn-success:hover {
    background: #16a34a;
}

.btn-danger {
    background: #ef4444;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.2);
    transition: background 0.2s;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-secondary {
    background: #f1f2f6;
    color: var(--text-primary);
    border: none;
    padding: 10px 24px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.login-alert {
    background: #fef2f2; /* 更柔和的红背景 */
    color: #ef4444; /* 稍微深一点的红色文字 */
    padding: 10px 14px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid #fee2e2;
}

.login-alert i {
    font-size: 1rem;
}

/* 密码设置弹窗中的备案号设置样式 */
#passwordSettingsModal .form-group h3 {
    font-size: 1rem;
    margin-bottom: 15px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

#passwordSettingsModal .form-group h3 i {
    color: var(--primary-color);
}

/* 备案号输入框样式 */
#icpNumber, #policeBeianNumber, #copyrightInfo {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #f1f2f6;
    border-radius: 12px;
    font-size: 0.95rem;
    background: #f8f9fa;
    transition: border-color 0.2s, background 0.2s;
    color: var(--text-primary);
}

#icpNumber:focus, #policeBeianNumber:focus, #copyrightInfo:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #fff;
}

/* 备案号设置区域样式 */
#passwordSettingsModal .form-group:last-child {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #f1f2f6;
}

#passwordSettingsModal .form-group:last-child .form-group {
    margin-bottom: 15px;
}

#passwordSettingsModal .form-group:last-child .form-group:last-child {
    margin-bottom: 0;
}

/* 备案号设置说明文字 */
#passwordSettingsModal .form-group:last-child .form-group div {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 4px;
    line-height: 1.4;
}

/* 登录弹窗备案信息样式 */
.login-beian-info {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f1f2f6;
    text-align: center;
    width: 100%;
}

.login-beian-info .beian-info {
    font-size: 0.75rem;
    gap: 8px;
}

.login-beian-info .beian-info a {
    font-size: 0.75rem;
}

/* Toast */
.toast {
    visibility: hidden;
    min-width: 120px;
    background-color: rgba(45, 52, 54, 0.9);
    color: #fff;
    text-align: center;
    border-radius: 12px;
    padding: 14px 24px;
    position: fixed;
    z-index: 200;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    opacity: 0;
    transition: opacity 0.3s;
    backdrop-filter: blur(4px);
}

.toast.show {
    visibility: visible;
    opacity: 1;
}

/* 数量输入组合 */
.quantity-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.qty-part {
    flex: 0 0 auto;
}

.qty-part input {
    width: 100%;
    padding: 10px;
    border: 2px solid #f1f2f6;
    border-radius: 12px;
    font-size: 0.95rem;
    text-align: center;
}

.qty-part input:focus {
    border-color: var(--primary-color);
    outline: none;
}

.qty-part:nth-child(1) input,
.qty-part:nth-child(3) input {
    width: 80px; /* 前缀和单位宽度 */
    background: #f8f9fa;
    color: var(--text-secondary);
}

.qty-part.main {
    flex: 1;
}

.qty-part.main input {
    font-weight: 600;
    color: var(--primary-color);
}

/* 步骤控制 */
.email-step {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 邮件预览列表头部 */
.email-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding: 0 4px;
}

/* 邮件选择列表样式 */
.email-list-container {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 10px;
    background: #f8f9fa;
}

.email-list-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: #fff;
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid #f1f2f6;
    cursor: pointer;
    transition: all 0.2s;
}

.email-list-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
.email-list-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 12px;
}

/* 文件上传拖拽样式 */
.custom-file-input {
    position: relative;
    transition: all 0.2s;
}

.custom-file-input.drag-over button {
    background: #e0f2fe; /* 浅蓝色背景 */
    border: 2px dashed var(--primary-color);
    color: var(--primary-color);
}

.custom-file-input.drag-over button i {
    color: var(--primary-color);
    transform: scale(1.2);
}   cursor: pointer;
}

.email-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    gap: 4px;
}

.email-item-top {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.email-item-content {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 280px;
}

.email-item-amount {
    font-family: "SF Mono", "Roboto Mono", monospace;
    color: var(--primary-color);
}

.email-item-bottom {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 移动端专用样式 - 默认隐藏 */
.mobile-only {
    display: none !important; /* 强制 PC 端隐藏 */
}

/* 移动端适配 (断点：800px) */
@media (max-width: 800px) {
    .mobile-only {
        display: inline-block !important; /* 移动端显示 */
    }
    
    .layout-wrapper {
        flex-direction: column;
        padding: 16px;
    }

    .app-sidebar {
        width: 100%;
        position: fixed;
        bottom: 0;
        left: 0;
        z-index: 90;
        margin: 0;
        padding: 0;
    }

    .sidebar-card {
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
        padding: 12px 20px; /* 减少上下padding */
        display: flex;
        flex-direction: column; 
        gap: 0; /* JS控制 */
        align-items: stretch;
        border: none;
        top: auto; 
        max-height: 70vh; /* 降低最大高度限制 */
        overflow-y: hidden; /* 改为hidden，内容滚动由wrapper控制 */
        transition: transform 0.3s ease;
    }

    .sidebar-content-wrapper {
        overflow-y: auto;
        max-height: 50vh; /* 降低内容区最大高度 */
        padding-top: 7px; /* 调整为 7px */
        transition: all 0.3s ease;
        display: flex;
        flex-direction: column;
        gap: 10px; /* 减少间距 */
    }

    /* 折叠状态 */
    .sidebar-card.collapsed .sidebar-content-wrapper {
        max-height: 0;
        padding-top: 0;
        opacity: 0;
        overflow: hidden;
    }
    
    .sidebar-card.collapsed {
        padding-bottom: 0; /* 折叠时减少底部padding */
    }

    .total-info {
        margin: -12px -20px 0 -20px; /* 调整负边距匹配新的padding */
        padding: 14px 20px 8px 20px; /* 调整内部间距更紧凑 */
        border-radius: 20px 20px 0 0; /* 匹配卡片圆角 */
        border: none;
        text-align: center;
        margin-bottom: 0;
        cursor: pointer; /* 提示可点击 */
        background: transparent;
        z-index: 10;
        user-select: none; /* 防止点击时选中文字 */
        transition: background-color 0.2s;
    }
    
    .total-info:active {
        background-color: rgba(0,0,0,0.03); /* 点击反馈 */
    }
    
    .total-label {
        font-size: 0.8rem; /* 稍微调小 */
        margin-bottom: 0;
        color: var(--text-secondary);
    }
    
    .total-amount {
        font-size: 1.4rem; /* 稍微调小 */
        font-weight: 700;
    }

    .sidebar-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px; /* 减少间距 */
    }

    .action-btn {
        width: auto;
        padding: 8px 6px; /* 减少按钮内边距 */
        font-size: 0.8rem; /* 稍微调小字体 */
        justify-content: center; /* 移动端居中 */
        padding-left: 6px;
        min-height: 36px; /* 确保最小点击高度 */
    }
    
    /* 分隔线 */
    .sidebar-divider {
        display: none; /* 移动端隐藏分隔线 */
    }
    
    .sidebar-section-title {
        display: none;
    }

    /* 移动端列表底部留白，防止被固定底栏遮挡 */
    .list-container {
        padding-bottom: 160px; /* 增加留白以适应展开的底栏 */
    }
    
    /* 表格适配优化 - 双行模式 */
    .expense-table {
        display: block; /* 覆盖 table 布局 */
    }
    
    .expense-table tbody {
        display: block;
    }

    .expense-table tr {
        display: flex;
        flex-wrap: wrap;
        padding: 4px 4px; /* 进一步减少移动端行padding */
        border-bottom: 1px solid #f1f2f6;
        align-items: center;
    }

    .expense-table td {
        padding: 2px 4px;
        border: none; /* 去除单元格边框 */
        display: block;
    }
    
    /* 第一行：内容(左) + 金额(右) */
    .col-content { 
        width: 65%; 
        order: 1;
        font-size: 0.95rem;
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .col-amount { 
        width: 35%; 
        order: 2;
        text-align: right;
        font-size: 1rem;
        font-weight: 700;
    }

    /* 第二行：数量(左) + 操作(右) */
    .col-quantity { 
        width: 65%; 
        order: 3;
        font-size: 0.8rem;
        color: #64748b;
        margin-top: 2px; /* 减少间距 */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .col-action { 
        width: 35%; 
        order: 4;
        text-align: right;
        margin-top: 2px; /* 减少间距 */
    }
    
    .action-icon-btn {
        width: 30px;
        height: 30px;
        padding: 6px;
        background: #f8fafc; /* 增加背景色使其更容易点击 */
        border-radius: 6px;
    }

    .email-item-content {
        max-width: 180px;
    }

    /* 数量输入框移动端适配 */
    .qty-part:nth-child(1) input,
    .qty-part:nth-child(3) input {
        width: 60px; /* 缩小前缀后缀宽度 */
        padding: 10px 4px; /* 减少内边距 */
        font-size: 0.85rem;
    }

    /* 弹窗适配 */
    .modal-content {
        max-height: 90vh; /* 增加移动端高度利用率 */
        width: 95%;
    }

    .modal-body {
        padding: 16px 20px;
    }

    /* 强制覆盖 inline style 的高度设置 */
    #emailPreviewText {
        min-height: 250px !important; /* 移动端减小高度 */
    }
    
    #sendEmailModal .modal-body {
        min-height: auto !important; /* 允许高度自适应 */
    }
}

/* 备案信息显示样式 */
.site-footer {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding: 20px 0;
    margin-top: 40px;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.footer-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--primary-color);
}

.footer-separator {
    color: #cbd5e1;
    user-select: none;
}

.beian-info {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 0.8rem;
}

.beian-info a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.beian-info a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.beian-separator {
    color: #cbd5e1;
    user-select: none;
}

/* 登录弹窗备案信息样式 */
.login-beian-info {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f1f2f6;
    text-align: center;
    width: 100%;
}

.login-beian-info .beian-info {
    font-size: 0.75rem;
    gap: 8px;
}

.login-beian-info .beian-info a {
    font-size: 0.75rem;
}

/* 移动端适配 */
@media (max-width: 800px) {
    .site-footer {
        padding: 16px 0;
        margin-top: 20px;
    }
    
    .footer-content {
        padding: 0 16px;
        gap: 10px;
    }
    
    .footer-links {
        gap: 8px;
    }
    
    .footer-links a {
        font-size: 0.85rem;
    }
    
    .beian-info {
        flex-direction: column;
        gap: 8px;
    }
    
    .beian-separator {
        display: none;
    }
    
    .login-beian-info .beian-info {
        flex-direction: column;
        gap: 6px;
    }
    
    .login-beian-info .beian-separator {
        display: none;
    }
}