/* 首助记账本 - 自定义样式 */

:root {
    --primary-color: #4a90e2;
    --primary-hover: #357abd;
    --secondary-color: #50c878;
    --warning-color: #f5a623;
    --danger-color: #e74c3c;
    --success-color: #2ecc71;
    --info-color: #3498db;
    --light-bg: #f8f9fa;
    --dark-bg: #343a40;
    --border-color: #dee2e6;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-bg);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    padding-bottom: 70px;
}

/* 顶部导航 */
.top-navbar {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    padding: 15px 20px;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.top-navbar .navbar-brand {
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
    color: white;
}

.top-navbar .navbar-brand i {
    margin-right: 10px;
}

.top-navbar .user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.top-navbar .avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
}

.top-navbar .notification-badge {
    position: relative;
    cursor: pointer;
}

.top-navbar .notification-badge .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--danger-color);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 底部导航 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    z-index: 1000;
}

.bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #6c757d;
    padding: 5px 15px;
    transition: var(--transition);
    border: none;
    background: none;
    cursor: pointer;
}

.bottom-nav .nav-item:hover,
.bottom-nav .nav-item.active {
    color: var(--primary-color);
}

.bottom-nav .nav-item i {
    font-size: 24px;
    margin-bottom: 5px;
}

.bottom-nav .nav-item span {
    font-size: 12px;
}

/* 主内容区域 */
.main-content {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    overflow: hidden;
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    background: white;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    background: #f8f9fa;
}

/* 账本图标 */
.ledger-icon {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 10px;
}

.ledger-icon.family {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.ledger-icon.roommate {
    background: linear-gradient(135deg, #3498db, #2980b9);
}

.ledger-icon.aa {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
}

.ledger-icon.general {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
}

/* 账本列表 */
.ledger-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.ledger-item {
    cursor: pointer;
    transition: var(--transition);
}

.ledger-item:hover {
    transform: translateY(-5px);
}

/* 统计卡片 */
.stat-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: var(--primary-color);
}

.stat-card.income::before {
    background: var(--success-color);
}

.stat-card.expense::before {
    background: var(--danger-color);
}

.stat-card.balance::before {
    background: var(--primary-color);
}

.stat-value {
    font-size: 28px;
    font-weight: bold;
    margin: 10px 0;
}

.stat-label {
    color: #6c757d;
    font-size: 14px;
}

/* 会员等级 */
.member-level {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    color: white;
}

.level-0 { background: linear-gradient(135deg, #cd7f32, #b87333); } /* 青铜 */
.level-1 { background: linear-gradient(135deg, #c0c0c0, #a8a8a8); } /* 白银 */
.level-2 { background: linear-gradient(135deg, #ffd700, #ffb700); } /* 黄金 */
.level-3 { background: linear-gradient(135deg, #e5e4e2, #d4d4d4); color: #333; } /* 白金 */
.level-4 { background: linear-gradient(135deg, #b9f2ff, #00bfff); } /* 钻石 */
.level-5 { background: linear-gradient(135deg, #ffd700, #ff6b6b); } /* 星耀 */

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

/* 按钮 */
.btn {
    display: inline-block;
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover), #2c5d8a);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #27ae60;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-warning:hover {
    background: #f39c12;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-block {
    width: 100%;
}

.btn-group {
    display: flex;
    gap: 10px;
}

/* 表格 */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.table thead {
    background: var(--light-bg);
}

.table th,
.table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    font-weight: 600;
    color: #495057;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

/* 提示信息 */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left-color: var(--success-color);
}

.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border-left-color: var(--danger-color);
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-left-color: var(--warning-color);
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left-color: var(--info-color);
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 10px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6c757d;
}

.modal-close:hover {
    color: var(--danger-color);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid var(--border-color);
    background: #f8f9fa;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(74, 144, 226, 0.3);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 20px;
}

.pagination a,
.pagination span {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    text-decoration: none;
    color: var(--primary-color);
    transition: var(--transition);
}

.pagination a:hover,
.pagination span.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* 徽章 */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.badge-primary {
    background: var(--primary-color);
    color: white;
}

.badge-secondary {
    background:#333;
    color: white;
}

.badge-success {
    background: var(--success-color);
    color: white;
}

.badge-danger {
    background: var(--danger-color);
    color: white;
}

.badge-warning {
    background: var(--warning-color);
    color: white;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .main-content {
        padding: 15px;
    }

    .ledger-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }

    .stat-value {
        font-size: 24px;
    }

    .card-body {
        padding: 15px;
    }

    .btn-group {
        flex-direction: column;
    }

    .table-responsive {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .ledger-grid {
        grid-template-columns: 1fr;
    }

    .top-navbar {
        padding: 10px 15px;
    }

    .top-navbar .navbar-brand {
        font-size: 1.2rem;
    }
}

/* 浮动按钮 */
.fab {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    transition: var(--transition);
    border: none;
    z-index: 999;
}

.fab:hover {
    background: var(--primary-hover);
    transform: scale(1.1);
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h4 {
    margin-bottom: 10px;
}

.empty-state p {
    margin-bottom: 20px;
}

/* 下拉菜单 */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-md);
    min-width: 200px;
    z-index: 100;
    display: none;
}

.dropdown.show .dropdown-menu {
    display: block;
}

.dropdown-item {
    padding: 10px 15px;
    display: block;
    text-decoration: none;
    color: #333;
    transition: var(--transition);
}

.dropdown-item:hover {
    background: #f8f9fa;
}

/* 通知列表 */
.notification-list {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

.notification-item:hover {
    background: #f8f9fa;
}

.notification-item.unread {
    background: #e3f2fd;
}

.notification-item .time {
    font-size: 12px;
    color: #6c757d;
    margin-top: 5px;
}

/* 支付页面样式 */
.payment-page {
    padding: 30px 20px;
}

.payment-method-card {
    border: 2px solid transparent;
    transition: all 0.3s ease;
    cursor: pointer;
}

.payment-method-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.payment-method-card.alipay {
    border-color: #1677ff;
}

.payment-method-card.wechat {
    border-color: #09bb07;
}

.qr-container {
    width: 240px;
    height: 240px;
    background: #fff;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 0 auto;
}

.qr-container img {
    max-width: 220px;
    max-height: 220px;
    border-radius: 4px;
}

.payment-info-card {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.payment-info-card .info-row {
    margin-bottom: 12px;
}

.payment-info-card .info-row:last-child {
    margin-bottom: 0;
}

.payment-amount {
    font-size: 28px;
    font-weight: bold;
    color: #e74c3c;
}

.payment-notice {
    display: inline-block;
    padding: 12px 20px;
    background: #d1ecf1;
    color: #0c5460;
    border-radius: 8px;
    margin-bottom: 20px;
}

.payment-title {
    text-align: center;
    margin-bottom: 30px;
}

.payment-title.alipay {
    color: #1677ff;
}

.payment-title.wechat {
    color: #09bb07;
}

.icon-selector {
    border: 2px solid #dee2e6;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.icon-selector:hover {
    border-color: #4a90e2;
    background: #f8f9fa;
}

.icon-selector.border-primary {
    border-color: #4a90e2;
    background: #e3f2fd;
}

.hover-shadow {
    transition: all 0.3s ease;
}

.hover-shadow:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.fs-4 {
    font-size: 1.5rem !important;
}

.fs-5 {
    font-size: 1.25rem !important;
}

.font-weight-bold {
    font-weight: bold;
}

.me-2 {
    margin-right: 0.5rem;
}

/* 会员规则页面样式 */
.fw-bold {
    font-weight: bold;
}

.fw-bolder {
    font-weight: 700;
}

.display-6 {
    font-size: 3rem;
    font-weight: 700;
}

.display-1 {
    font-size: 2.5rem;
    font-weight: 700;
}

.table-primary {
    background-color: #e3f2fd !important;
}

.accordion-button {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

.accordion-button:not(.collapsed) {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.accordion-button:hover {
    background-color: #e9ecef;
    border-color: #dee2e6;
}

.accordion-button:not(.collapsed):hover {
    background-color: #0069d9;
    color: white;
}

.accordion-body {
    padding: 20px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-top: none;
}

/* 用户下拉菜单样式 */
.user-dropdown-wrapper {
    position: relative;
}

/* 可编辑文本样式 */
.editable-text {
    cursor: pointer;
    position: relative;
    transition: background-color 0.2s ease;
    padding: 2px 6px;
    border-radius: 4px;
}

.editable-text:hover {
    background-color: #e3f2fd;
}

.editable-name {
    cursor: pointer;
    transition: color 0.2s ease;
}

.editable-name:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

