/* ============================================
   全局重置
============================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Microsoft YaHei", "PingFang SC", sans-serif; background: #f4f6f9; color: #333; padding: 20px; }
.container { max-width: 1500px; margin: 0 auto; background: #fff; padding: 20px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }

/* ============================================
   头部
============================================ */
.header { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #eee; padding-bottom: 15px; margin-bottom: 20px; }
.header h1 { font-size: 22px; }
.user-info { font-size: 14px; color: #666; }
.user-info a { color: #dc3545; text-decoration: none; }
.user-info a:hover { text-decoration: underline; }

/* ============================================
   数据统计卡片
============================================ */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}
.stat-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    padding: 18px 20px;
    border-left: 5px solid #007bff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.stat-card:nth-child(1) { border-left-color: #28a745; }
.stat-card:nth-child(2) { border-left-color: #007bff; }
.stat-card:nth-child(3) { border-left-color: #17a2b8; }
.stat-card:nth-child(4) { border-left-color: #ffc107; }

.stat-label { font-size: 13px; color: #666; margin-bottom: 6px; }
.stat-value { font-size: 22px; font-weight: bold; color: #333; }
.stat-value.today { color: #28a745; }
.stat-value.total { color: #007bff; }
.stat-value.settled { color: #17a2b8; font-size: 18px; }
.stat-value.unsettled { color: #e0a800; font-size: 18px; }

/* ============================================
   工具栏 & 按钮
============================================ */
.toolbar { margin-bottom: 15px; display: flex; justify-content: space-between; align-items: center; }
.btn { padding: 8px 16px; border: none; border-radius: 4px; cursor: pointer; font-size: 14px; transition: all 0.2s; }
.btn:hover { opacity: 0.9; }
.btn-primary { background: #007bff; color: #fff; }
.btn-primary:hover { background: #0056b3; }
.btn-refresh { background: #17a2b8; color: #fff; }
.btn-refresh:hover { background: #138496; }
.btn-members { background: #6f42c1; color: #fff; }
.btn-members:hover { background: #59359a; }

.btn-edit { background: #ffc107; color: #333; margin-right: 5px; padding: 4px 10px; font-size: 12px; }
.btn-edit:hover { background: #e0a800; }
.btn-delete { background: #dc3545; color: #fff; padding: 4px 10px; font-size: 12px; }
.btn-delete:hover { background: #c82333; }
.btn-settle { background: #28a745; color: #fff; padding: 4px 8px; font-size: 12px; margin-right: 5px; }
.btn-settle:hover { background: #218838; }
.btn-unsettle { background: #ffc107; color: #333; padding: 4px 8px; font-size: 12px; margin-right: 5px; }
.btn-unsettle:hover { background: #e0a800; }

/* 小按钮 */
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-danger-sm { background: #dc3545; color: #fff; border: none; border-radius: 4px; cursor: pointer; }
.btn-danger-sm:hover { background: #c82333; }

/* ============================================
   数据表格
============================================ */
.data-table { width: 100%; border-collapse: collapse; margin-top: 10px; table-layout: fixed; word-wrap: break-word; }
.data-table th, .data-table td { border: 1px solid #dee2e6; padding: 10px; text-align: left; vertical-align: top; font-size: 13px; }
.data-table th { background: #f8f9fa; font-weight: 600; }
.data-table tr:hover { background: #f1f3f5; }
.data-table a { color: #007bff; text-decoration: none; word-break: break-all; }
.data-table a:hover { text-decoration: underline; }

/* ============================================
   状态标签 & 会员标签
============================================ */
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}
.status-badge.settled { background: #d4edda; color: #155724; }
.status-badge.unsettled { background: #fff3cd; color: #856404; }

.member-tag {
    display: inline-block;
    padding: 2px 8px;
    background: #e7f3ff;
    color: #0056b3;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
}

/* ============================================
   复制按钮
============================================ */
.copy-btn {
    display: inline-block;
    padding: 2px 8px;
    margin-left: 5px;
    font-size: 12px;
    color: #007bff;
    background-color: #e9ecef;
    border: 1px solid #ced4da;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    vertical-align: middle;
}
.copy-btn:hover { background-color: #007bff; color: #fff; border-color: #007bff; }

/* ============================================
   模态框
============================================ */
.modal { display: none; position: fixed; z-index: 999; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); }
.modal-content { background: #fff; margin: 5% auto; padding: 20px; width: 500px; border-radius: 8px; position: relative; max-height: 85vh; overflow-y: auto; }
.close, .close-pwd, .close-member { position: absolute; right: 15px; top: 10px; font-size: 24px; cursor: pointer; color: #aaa; }
.close:hover, .close-pwd:hover, .close-member:hover { color: #000; }

/* ============================================
   表单
============================================ */
.form-group { margin-bottom: 15px; }
.form-group label { display: block; margin-bottom: 5px; font-size: 14px; font-weight: 600; }
.form-group input, .form-group select { width: 100%; padding: 8px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; }
.form-group input:focus, .form-group select:focus { outline: none; border-color: #007bff; box-shadow: 0 0 0 2px rgba(0,123,255,0.15); }

/* 修改密码弹窗特殊宽度 */
#pwd-modal .modal-content { width: 420px; }

/* ============================================
   响应式（小屏）
============================================ */
@media (max-width: 900px) {
    .stats-bar { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 500px) {
    .stats-bar { grid-template-columns: 1fr; }
    .modal-content { width: 90%; }
}

/* ============================================
   顶部导航栏
============================================ */
.nav-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 20px;
    padding-bottom: 0;
}
.nav-tab {
    display: inline-block;
    padding: 10px 20px;
    font-size: 14px;
    color: #666;
    text-decoration: none;
    border-radius: 6px 6px 0 0;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}
.nav-tab:hover {
    background: #f1f3f5;
    color: #007bff;
}
.nav-tab.active {
    color: #007bff;
    font-weight: 600;
    border-bottom-color: #007bff;
    background: #f8f9fa;
}