/* =====================================================================
 * 老戏童记账机器人系统 - 公共样式文件
 * 统一管理前台页面样式，避免内联样式混乱
 * ===================================================================== */

/* CSS 变量定义 */
:root {
    --primary-color: #3a6fdd;
    --secondary-color: #f8f9fa;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --card-border-radius: 8px;
    --transition-speed: 0.25s;
    --text-muted: #6c757d;
}

/* ===================================================================== 
 * 基础样式
 * ===================================================================== */

body {
    font-family: 'Noto Sans SC', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fc;
    padding: 15px 0;
    color: #2c3e50;
    line-height: 1.4;
    font-size: 0.85rem;
}

/* 首页专用的 body 样式 */
.home-page body {
    background-color: #f8f9fa;
    padding-bottom: 60px;
}

/* ===================================================================== 
 * 卡片组件
 * ===================================================================== */

.card {
    border: none;
    border-radius: var(--card-border-radius);
    box-shadow: var(--card-shadow);
    margin-bottom: 15px;
    overflow: hidden;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    animation: fadeIn 0.3s ease;
}

.card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card-header {
    background-color: #ffffff;
    border-bottom: 1px solid #dee2e6;
    font-weight: 600;
    padding: 10px 15px;
    color: #2c3e50;
    letter-spacing: 0.3px;
    font-size: 0.95rem;
    border-radius: var(--card-border-radius) var(--card-border-radius) 0 0;
}

/* 首页专用的卡片样式 */
.home-page .card {
    border-radius: 10px;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    margin-bottom: 30px;
}

.home-page .card-header {
    background-color: #fff;
    border-bottom: 1px solid #edf2f9;
    padding: 1rem 1.5rem;
    font-weight: 600;
}

.card-body {
    padding: 12px 15px;
}

/* ===================================================================== 
 * 按钮组件
 * ===================================================================== */

.btn {
    border-radius: 4px;
    padding: 0.35rem 0.8rem;
    font-size: 0.82rem;
    font-weight: 500;
    border-width: 1px;
    transition: all var(--transition-speed);
}

.btn-sm {
    padding: 0.25rem 0.6rem;
    font-size: 0.8rem;
    border-radius: 3px;
}

.btn-primary {
    background: linear-gradient(135deg, #4e73df 0%, #224abe 100%);
    border-color: #4e73df;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #224abe 0%, #1e3a8a 100%);
    border-color: #224abe;
    transform: translateY(-1px);
}

.btn-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
}

.btn-link:hover {
    color: #2851b8;
}

.btn-link i {
    transition: transform 0.3s ease;
    margin-right: 8px;
}

.btn-link.collapsed i {
    transform: rotate(-90deg);
}

/* ===================================================================== 
 * 表格组件
 * ===================================================================== */

.table {
    border-radius: 4px;
    overflow: hidden;
    font-size: 0.82rem;
    table-layout: fixed;
    width: 100%;
    margin-bottom: 0;
}

.table thead th {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    color: #2c3e50;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.75rem;
}

.table tbody tr:hover {
    background-color: #f8f9fc;
}

.table tbody td {
    padding: 0.4rem 0.5rem;
    vertical-align: middle;
    border-top: 1px solid #f3f3f3;
    color: #2c3e50;
    word-wrap: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===================================================================== 
 * 徽章组件
 * ===================================================================== */

.badge {
    border-radius: 3px;
    padding: 0.3em 0.6em;
    font-size: 0.75rem;
    font-weight: 500;
}

/* ===================================================================== 
 * 首页专用样式
 * ===================================================================== */

.hero {
    background-color: var(--primary-color);
    color: white;
    padding: 60px 0;
    margin-bottom: 40px;
}

.hero h1 {
    font-weight: 700;
    font-size: 2.8rem;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.feature-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.footer {
    padding: 20px 0;
    background-color: #f1f4f8;
    color: var(--text-muted);
}

/* ===================================================================== 
 * 账单页面专用样式
 * ===================================================================== */

/* 图片指示器 */
.photo-indicator {
    background-color: #f8f9fc;
    border: 1px solid #e3e6f0;
    border-radius: 3px;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    display: inline-block;
    transition: all 0.2s ease;
}

.photo-indicator:hover {
    background-color: #4e73df;
    color: white;
    border-color: #4e73df;
    cursor: pointer;
}

/* 筛选卡片 */
.filter-card {
    background-color: #fff;
    border-radius: var(--card-border-radius);
    box-shadow: var(--card-shadow);
    padding: 15px;
    margin-bottom: 20px;
}

/* 汇总卡片 */
.summary-card {
    background-color: #fff;
    border-radius: var(--card-border-radius);
    box-shadow: var(--card-shadow);
    padding: 15px;
    margin-bottom: 15px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    align-items: center;
}

.summary-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.summary-value {
    font-weight: 600;
    font-size: 0.85rem;
}

/* 表单控件样式 */
.form-control {
    border-radius: 4px;
    border: 1px solid #dee2e6;
    padding: 0.35rem 0.6rem;
    font-size: 0.85rem;
}

.form-label {
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
    font-weight: 500;
}

/* 页面布局样式 */
.classification-section {
    margin-top: 15px;
    margin-bottom: 15px;
}

/* 通用段落和标题样式 */
p {
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
}

h5.mb-0 {
    font-size: 0.95rem;
}

/* ===================================================================== 
 * 通用工具类
 * ===================================================================== */

/* 文本颜色类 - 统一定义 */
.text-success { 
    color: var(--success-color) !important; 
}

.text-danger { 
    color: var(--danger-color) !important; 
}

.text-warning { 
    color: var(--warning-color) !important; 
}

.text-info { 
    color: var(--info-color) !important; 
}

.text-muted { 
    color: var(--text-muted) !important; 
}

/* 工具类 - 指针样式 */
.cursor-pointer {
    cursor: pointer !important;
}

/* 页脚样式 */
.footer-info {
    color: #6c757d;
    font-size: 0.9rem;
}

.footer-small {
    font-size: 0.85rem;
    color: #6c757d;
}

/* 图片容器 */
.img-container {
    max-height: 500px;
}

/* 折叠动画 */
.collapse {
    transition: all 0.3s ease;
}

/* 淡入动画 */
@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* 响应式调整 */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .feature-icon {
        font-size: 2rem;
    }
    
    .table {
        font-size: 0.75rem;
    }
    
    .btn {
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
    }
}

/* ===================================================================== 
 * 特殊样式覆盖 - 已移除冲突的蓝色背景样式
 * ===================================================================== */

/* 确保卡片样式的一致性 */
.card {
    border-radius: 6px;
    border: 1px solid #e3e6f0;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.08);
}

/* =====================================================================
 * 账单页面特定样式
 * ===================================================================== */

/* 账单页面特定的表格列宽定义 */
.table th.col-date { width: 14%; }
.table th.col-serial { width: 25%; }
.table th.col-user { width: 10%; }
.table th.col-amount { width: 10%; }
.table th.col-reply { width: 10%; }
.table th.col-note { width: 23%; }
.table th.col-photo { width: 8%; }

/* 分类统计表格列宽 */
.table th.col-name { width: 25%; }
.table th.col-in { width: 25%; }
.table th.col-out { width: 25%; }
.table th.col-balance { width: 25%; }

/* 流水号列特殊处理 */
.table td:nth-child(2) {
    word-break: break-all;
    font-size: 0.8rem;
    line-height: 1.2;
    width: 25%;
    min-width: 200px; /* 确保最小宽度 */
}

/* 流水号显示样式 */
.serial-display {
    display: block;
    width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.serial-display .bi-list-ul {
    font-size: 0.7rem;
    cursor: help;
}

/* 交易详情样式 */
.transaction-details .detail-item {
    border-left: 3px solid #f8f9fa;
    padding-left: 12px;
}

.transaction-details .detail-item:hover {
    border-left-color: #dee2e6;
    background-color: #f8f9fa;
    transition: all 0.2s ease;
}

.transaction-details .form-label {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}