/* 
 * 押车信息提醒系统样式
 */

:root {
    --primary-color: #4a6cf7;
    --primary-hover: #3a5ce5;
    --danger-color: #dc3545;
    --warning-color: #fd7e14;
    --success-color: #28a745;
    --info-color: #17a2b8;
    --bg-color: #f4f7fc;
    --card-bg: #ffffff;
    --text-color: #333333;
    --text-muted: #6c757d;
    --border-color: #e0e6ed;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* 布局 */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* 导航栏 */
.navbar {
    background: var(--card-bg);
    box-shadow: var(--shadow);
    padding: 15px 30px;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.navbar-nav {
    display: flex;
    gap: 10px;
    list-style: none;
}

.navbar-nav a {
    padding: 10px 20px;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    font-weight: 500;
}

.navbar-nav a:hover,
.navbar-nav a.active {
    background: var(--primary-color);
    color: #fff;
}

/* 卡片 */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    gap: 15px;
    flex-wrap: wrap;
}

/* 状态筛选 Nav */
.status-nav {
    display: inline-flex;
    gap: 0;
    margin-bottom: 20px;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.status-nav-item {
    padding: 12px 28px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    border-right: 2px solid var(--primary-color);
    transition: all 0.2s;
    background: #fff;
}

.status-nav-item:last-child {
    border-right: none;
}

.status-nav-item:hover {
    background: rgba(74, 108, 247, 0.1);
}

.status-nav-item.active {
    background: var(--primary-color);
    color: #fff;
}

.card-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-color);
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 24px;
    text-align: center;
    border-left: 4px solid var(--primary-color);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    display: block;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.stat-card.danger { border-left-color: var(--danger-color); }
.stat-card.warning { border-left-color: var(--warning-color); }
.stat-card.success { border-left-color: var(--success-color); }
.stat-card.info { border-left-color: var(--info-color); }

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-card.danger .stat-number { color: var(--danger-color); }
.stat-card.warning .stat-number { color: var(--warning-color); }
.stat-card.success .stat-number { color: var(--success-color); }
.stat-card.info .stat-number { color: var(--info-color); }

.stat-label {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: 2px solid transparent;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-color);
    color: #fff;
}

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

.btn-danger {
    background: var(--danger-color);
    color: #fff;
}

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

.btn-success {
    background: var(--success-color);
    color: #fff;
}

.btn-success:hover {
    background: #218838;
}

.btn-outline {
    background: #fff;
    border: 2px solid var(--border-color);
    color: var(--text-color);
}

.btn-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(74, 108, 247, 0.05);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

/* 表单 */
.form-group {
    margin-bottom: 20px;
}

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

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 108, 247, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

/* 表格 */
.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.table th {
    background: var(--bg-color);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 可排序列 */
.table th.sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.table th.sortable:hover {
    background: #e8eef5;
    color: var(--primary-color);
}

.sort-icon {
    margin-left: 4px;
    font-size: 0.75rem;
    color: #aaa;
    transition: color 0.2s;
}

.sort-icon.active {
    color: var(--primary-color);
    font-weight: bold;
}

.table tr:hover {
    background: var(--bg-color);
}

/* 逾期行高亮 - 还款已逾期的用户整行标红 */
.table tr.row-overdue {
    background: #fff5f5;
    border-left: 3px solid var(--danger-color);
}
.table tr.row-overdue:hover {
    background: #ffebee;
}

/* 状态标签 */
.badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* 备注列表 */
.notes-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.note-item {
    background: #fff;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 16px 20px;
    border-left: 4px solid var(--primary-color);
}

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.note-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.note-author {
    font-weight: 600;
    color: var(--primary-color);
    background: rgba(74, 108, 247, 0.1);
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.9rem;
}

.note-time {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.note-content {
    color: var(--text-color);
    line-height: 1.7;
    font-size: 1rem;
    white-space: pre-wrap;
    word-break: break-word;
    padding: 12px 0;
    border-top: 1px dashed var(--border-color);
}

/* 短信余额显示 */
.balance-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 25px 30px;
    border-radius: 12px;
    color: #fff;
}

.balance-info {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.balance-label {
    font-size: 1rem;
    opacity: 0.9;
}

.balance-value {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
}

.balance-unit {
    font-size: 1rem;
    opacity: 0.9;
}

.balance-display .btn {
    background: rgba(255,255,255,0.2);
    border: 2px solid #fff;
    color: #fff;
    padding: 10px 30px;
}

.balance-display .btn:hover {
    background: #fff;
    color: #667eea;
}

/* 表单区块标题 */
.form-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 20px 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-color);
}

.form-section-title:first-child {
    margin-top: 0;
}

.required {
    color: #dc3545;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.badge-danger {
    background: rgba(220, 53, 69, 0.1);
    color: var(--danger-color);
}

.badge-warning {
    background: rgba(253, 126, 20, 0.1);
    color: var(--warning-color);
}

.badge-success {
    background: rgba(40, 167, 69, 0.1);
    color: var(--success-color);
}

.badge-info {
    background: rgba(23, 162, 184, 0.1);
    color: var(--info-color);
}

/* 日历样式 */
#calendar {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
}

.fc {
    font-family: inherit;
}

.fc .fc-toolbar-title {
    font-size: 1.4rem;
    font-weight: 600;
}

.fc .fc-button {
    background: var(--primary-color);
    border: none;
    padding: 8px 16px;
}

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

.fc .fc-button:disabled {
    background: var(--border-color);
}

.fc .fc-daygrid-day-number {
    padding: 8px;
    color: var(--text-color);
}

.fc .fc-event {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    cursor: pointer;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalShow 0.3s ease;
}

@keyframes modalShow {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 1.2rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    line-height: 1;
}

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

.modal-body {
    padding: 24px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
}

/* 详情页 */
.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
}

.detail-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
    margin: 24px 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #4361ee;
    display: inline-block;
}

.section-title:first-of-type {
    margin-top: 0;
}

/* 还款计划时间线 */
.repayment-timeline {
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.timeline-item {
    display: flex;
    gap: 12px;
    padding: 0;
    border-bottom: none;
    position: relative;
}

.timeline-item::before {
    display: none;
}

.timeline-marker {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    margin-top: 16px;
}

.timeline-checkbox {
    width: 22px;
    height: 22px;
    cursor: pointer;
    accent-color: #28a745;
}

.timeline-content {
    flex: 1;
    background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
    border-radius: 12px;
    padding: 16px 20px;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.timeline-content:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.timeline-item.paid .timeline-content {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border: 1px solid #a5d6a7;
    border-left: 4px solid #28a745;
}

.timeline-item.overdue .timeline-content {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    border: 1px solid #ef9a9a;
    border-left: 4px solid #dc3545;
}

.timeline-item.today .timeline-content {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border: 1px solid #ffcc80;
    border-left: 4px solid #fd7e14;
}

.timeline-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.timeline-period {
    font-weight: 700;
    font-size: 18px;
    color: #1a1a2e;
    background: linear-gradient(135deg, #4361ee, #3a0ca3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.timeline-date {
    color: #666;
    font-size: 13px;
    background: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
}

.timeline-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-left: auto;
}

.timeline-status.pending {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    color: #1565c0;
}

.timeline-status.paid {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    color: #2e7d32;
}

.timeline-status.overdue {
    background: linear-gradient(135deg, #ffebee, #ffcdd2);
    color: #c62828;
}

.timeline-status.today {
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
    color: #e65100;
}

.timeline-status.skipped {
    background: linear-gradient(135deg, #eceff1, #cfd8dc);
    color: #607d8b;
}

.timeline-status.merged {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    color: #1565c0;
}

/* 跳过/合并的还款计划样式 */
.timeline-item.skipped,
.timeline-item.merged {
    opacity: 0.7;
}

.timeline-item.skipped .timeline-content,
.timeline-item.merged .timeline-content {
    background: #f5f5f5;
}

.timeline-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.timeline-amount {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: rgba(255,255,255,0.7);
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px dashed #dee2e6;
}

.amount-label {
    color: #666;
    font-size: 13px;
}

.amount-value {
    font-size: 24px;
    font-weight: 800;
    color: #1a1a2e;
}

.amount-adjusted {
    font-size: 11px;
    color: #ff9800;
    background: #fff3e0;
    padding: 2px 6px;
    border-radius: 4px;
}

/* 违约金显示 */
.timeline-penalty {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    padding: 8px 12px;
    background: #fff5f5;
    border-radius: 6px;
    border-left: 3px solid #ff4d4f;
}

.penalty-label {
    font-size: 13px;
    color: #ff4d4f;
}

.penalty-value {
    font-size: 16px;
    font-weight: 600;
    color: #ff4d4f;
}

.timeline-total {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    padding: 8px 12px;
    background: #f0f7ff;
    border-radius: 6px;
    border-left: 3px solid #1890ff;
}

.total-label {
    font-size: 13px;
    color: #333;
    font-weight: 500;
}

.total-value {
    font-size: 18px;
    font-weight: 700;
    color: #1890ff;
}

.timeline-detail {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #777;
    flex-wrap: wrap;
    padding-top: 8px;
    border-top: 1px solid #eee;
}

.timeline-detail span {
    background: #f5f5f5;
    padding: 4px 8px;
    border-radius: 4px;
}

.timeline-meta {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
    padding: 6px 10px;
    background: #fafafa;
    border-radius: 4px;
    border-left: 2px solid #4361ee;
}

.btn-text {
    background: #4361ee;
    border: none;
    color: #fff;
    padding: 4px 12px;
    font-size: 12px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-text:hover {
    background: #3a0ca3;
    text-decoration: none;
}

.btn-group {
    display: flex;
    gap: 8px;
}

/* 日历类型切换按钮 */
.calendar-type-btn {
    background: #fff;
    color: #666;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    border: none !important;
}

.calendar-type-btn:hover {
    background: #f0f4ff;
    color: #4a6cf7;
}

.calendar-type-btn.active {
    background: #4a6cf7;
    color: #fff;
}

/* 切换按钮组容器 */
.calendar-switch-group {
    display: flex;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.calendar-switch-group .calendar-type-btn {
    border-right: 1px solid #e0e0e0 !important;
}

.calendar-switch-group .calendar-type-btn:last-child {
    border-right: none !important;
}

/* 下拉菜单 */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    cursor: pointer;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    min-width: 180px;
    padding: 8px 0;
    margin-top: 4px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.dropdown-menu.show {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 10px 16px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
}

.dropdown-menu a:hover {
    background: #f5f5f5;
    color: #1890ff;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.switch-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
}

.switch-label input[type="checkbox"] {
    width: 40px;
    height: 22px;
    appearance: none;
    -webkit-appearance: none;
    background: #ddd;
    border-radius: 11px;
    position: relative;
    cursor: pointer;
    transition: all 0.3s;
    flex-shrink: 0;
}

.switch-label input[type="checkbox"]::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.switch-label input[type="checkbox"]:checked {
    background: #28a745;
}

.switch-label input[type="checkbox"]:checked::before {
    left: 20px;
}

.switch-text {
    user-select: none;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

/* 弹窗内还款计划列表 */
.repayment-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.repayment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #1890ff;
}

.repayment-item.overdue {
    background: #fff5f5;
    border-left-color: #ff4d4f;
}

.repayment-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.repayment-period {
    font-weight: 600;
    color: #333;
}

.repayment-date {
    color: #666;
    font-size: 13px;
}

.repayment-amount {
    font-weight: 600;
    color: #1890ff;
    font-size: 15px;
}

.repayment-item.overdue .repayment-amount {
    color: #ff4d4f;
}

.repayment-amount .penalty {
    font-size: 12px;
    color: #ff4d4f;
    margin-left: 6px;
}

.repayment-list .no-data {
    text-align: center;
    color: #52c41a;
    padding: 12px;
    background: #f6ffed;
    border-radius: 6px;
}

.detail-item {
    padding: 16px;
    background: var(--bg-color);
    border-radius: 8px;
}

.detail-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.detail-value {
    font-size: 1.1rem;
    font-weight: 500;
}

/* 搜索和筛选 */
.filter-bar {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 250px;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 12px 16px 12px 45px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

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

.search-box::before {
    content: '🔍';
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
}

.filter-select {
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--card-bg);
    min-width: 150px;
}

/* 设置页面 */
.settings-section {
    margin-bottom: 30px;
}

.settings-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

/* 开关 */
.switch-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
}

/* 通知类型配置卡片 */
.notify-type-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid #e8e8e8;
}

.notify-type-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.notify-type-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 15px;
}

.notify-icon {
    font-size: 18px;
}

.notify-type-desc {
    color: #666;
    font-size: 13px;
    margin-bottom: 12px;
}

.notify-options {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #555;
    cursor: pointer;
}

.checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #1890ff;
}

.notify-preview {
    background: #fff;
    border-radius: 8px;
    padding: 12px;
    border: 1px solid #e0e0e0;
}

.preview-label {
    font-size: 12px;
    color: #999;
    margin-bottom: 8px;
}

.preview-content {
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    font-size: 12px;
    color: #333;
    line-height: 1.6;
    white-space: pre-line;
    background: #f5f5f5;
    padding: 10px;
    border-radius: 6px;
}

/* 消息样式预览 - 使用更高优先级防止被合同预览样式覆盖 */
.message-preview.preview-content {
    font-family: 'SF Mono', Monaco, 'Courier New', monospace !important;
    font-size: 12px !important;
    color: #333 !important;
    line-height: 1.6 !important;
    white-space: pre-line !important;
    background: #f5f5f5 !important;
    padding: 10px !important;
    border-radius: 6px !important;
    width: auto !important;
    min-height: auto !important;
    max-width: 400px;
    box-shadow: none !important;
}

/* 通知日志样式 */
.notify-stats {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.notify-stats .stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f8f9fa;
    padding: 12px 16px;
    border-radius: 8px;
    flex: 1;
    min-width: 120px;
}

.notify-stats .stat-icon {
    font-size: 20px;
}

.notify-stats .stat-info {
    display: flex;
    flex-direction: column;
}

.notify-stats .stat-label {
    font-size: 12px;
    color: #666;
}

.notify-stats .stat-value {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.notify-log-list {
    max-height: 400px;
    overflow-y: auto;
}

.notify-log-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.notify-log-item:hover {
    background: #f9f9f9;
}

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

.log-channel {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 18px;
    flex-shrink: 0;
}

.log-channel.wechat { background: #e6f7e6; }
.log-channel.bark { background: #fff3e6; }
.log-channel.sms { background: #e6f0ff; }

.log-content {
    flex: 1;
    min-width: 0;
}

.log-title {
    font-weight: 500;
    font-size: 14px;
    color: #333;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.log-title .status-badge {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: normal;
}

.log-title .status-badge.success {
    background: #d4edda;
    color: #155724;
}

.log-title .status-badge.failed {
    background: #f8d7da;
    color: #721c24;
}

.log-receiver {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}

.log-preview {
    font-size: 12px;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
}

.log-time {
    font-size: 11px;
    color: #999;
    white-space: nowrap;
    flex-shrink: 0;
}

.switch {
    position: relative;
    width: 50px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 26px;
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.switch input:checked + .switch-slider {
    background-color: var(--primary-color);
}

.switch input:checked + .switch-slider:before {
    transform: translateX(24px);
}

/* Toast 通知 */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 3000;
}

.toast {
    background: var(--card-bg);
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    margin-bottom: 10px;
    animation: toastIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.toast.success {
    border-left: 4px solid var(--success-color);
}

.toast.error {
    border-left: 4px solid var(--danger-color);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.empty-state-text {
    font-size: 1.1rem;
    margin-bottom: 20px;
}

/* ========================================
   移动端响应式设计
   ======================================== */

/* 移动端导航菜单按钮 */
.navbar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px;
    color: var(--text-color);
}

/* 移动端顶部导航菜单 */
.navbar-nav.show {
    display: flex !important;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    flex-direction: column;
    padding: 8px 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    border-top: 1px solid #eee;
}

.navbar-nav.show li {
    border-bottom: 1px solid #f0f0f0;
}

.navbar-nav.show li:last-child {
    border-bottom: none;
}

.navbar-nav.show a {
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    color: #333;
    display: flex;
    align-items: center;
    transition: background 0.2s;
}

.navbar-nav.show a:hover,
.navbar-nav.show a.active {
    background: rgba(74, 108, 247, 0.1);
    color: var(--primary-color);
}

.navbar-nav.show a.active {
    font-weight: 600;
}

/* 移动端底部导航 */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card-bg);
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 8px 0;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
}

.mobile-nav-list {
    display: flex;
    justify-content: space-around;
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-nav-item {
    flex: 1;
    text-align: center;
}

.mobile-nav-item a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 4px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.75rem;
    transition: color 0.2s;
}

.mobile-nav-item a.active,
.mobile-nav-item a:hover {
    color: var(--primary-color);
}

.mobile-nav-icon {
    font-size: 1.4rem;
}

/* 移动端表格卡片视图 */
.mobile-card-list {
    display: none;
}

.mobile-card-item {
    background: var(--card-bg);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 10px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    border-left: 4px solid var(--primary-color);
}

.mobile-card-item.status-danger {
    border-left-color: var(--danger-color);
}

.mobile-card-item.status-warning {
    border-left-color: var(--warning-color);
}

.mobile-card-item.status-success {
    border-left-color: var(--success-color);
}

/* 逾期卡片高亮 - 移动端逾期用户卡片标红 */
.mobile-card-item.card-overdue {
    background: #fff5f5;
    border-left: 4px solid var(--danger-color);
    box-shadow: 0 1px 6px rgba(220, 53, 69, 0.15);
}

.mobile-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.mobile-card-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-status-badges {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-end;
}

.mobile-status-badges .badge {
    font-size: 0.75rem;
    padding: 3px 8px;
}

.mobile-card-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
}

.mobile-card-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.mobile-card-field {
    font-size: 0.9rem;
}

.mobile-card-label {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.mobile-card-value {
    color: var(--text-color);
    margin-top: 2px;
}

.mobile-card-actions {
    display: flex;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.mobile-card-actions .btn {
    flex: 1;
    justify-content: center;
}

/* 平板端 (768px - 1024px) */
@media (max-width: 1024px) {
    .container {
        padding: 16px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-number {
        font-size: 2rem;
    }
}

/* 手机端 (小于768px) */
@media (max-width: 768px) {
    /* 隐藏桌面端导航 */
    .navbar-nav {
        display: none;
    }
    
    .navbar-toggle {
        display: block;
    }
    
    .navbar {
        padding: 10px 15px;
        position: relative;
    }
    
    .navbar-brand {
        font-size: 1rem;
    }
    
    /* 显示移动端底部导航 */
    .mobile-nav {
        display: block;
    }
    
    /* 底部留出导航空间 */
    body {
        padding-bottom: 70px;
    }
    
    /* 容器边距 */
    .container {
        padding: 12px;
    }
    
    /* 页面标题 */
    .page-header {
        margin-bottom: 10px;
    }
    
    .page-title {
        font-size: 1.1rem;
    }
    
    .page-subtitle {
        font-size: 0.8rem;
        display: none; /* 移动端隐藏副标题 */
    }
    
    /* 移动端状态筛选按钮 */
    .status-nav {
        display: flex;
        width: 100%;
        margin-bottom: 12px;
    }
    
    .status-nav-item {
        flex: 1;
        padding: 8px 5px;
        font-size: 0.85rem;
        text-align: center;
    }
    
    /* 统计卡片 - 2x2布局 */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .stat-card {
        padding: 14px 12px;
        border-radius: 10px;
    }
    
    .stat-number {
        font-size: 1.6rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
    
    /* 卡片样式 */
    .card {
        padding: 16px;
        border-radius: 10px;
        margin-bottom: 12px;
    }
    
    .card-header {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
        margin-bottom: 16px;
        padding-bottom: 12px;
    }
    
    .card-header .btn {
        width: 100%;
    }
    
    /* 日历卡片头部特殊处理 */
    .card-header > div:has(.calendar-switch-group) {
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
    
    /* 日历切换按钮组移动端 */
    .calendar-switch-group {
        width: 100%;
        display: flex;
    }
    
    .calendar-switch-group .calendar-type-btn {
        flex: 1;
        padding: 10px 8px;
        font-size: 13px;
    }
    
    .card-title {
        font-size: 1.1rem;
    }
    
    /* 搜索和筛选 */
    .filter-bar {
        flex-direction: column;
        gap: 10px;
    }
    
    .search-box {
        width: 100%;
        min-width: unset;
    }
    
    .search-box input {
        padding: 14px 16px 14px 45px;
        font-size: 16px; /* 防止iOS缩放 */
    }
    
    .filter-select {
        width: 100%;
        padding: 14px 16px;
        font-size: 16px;
    }
    
    /* 表格 - 隐藏桌面表格，显示卡片列表 */
    .table-container {
        display: none;
    }
    
    .mobile-card-list {
        display: block;
    }
    
    /* 按钮 */
    .btn {
        padding: 12px 20px;
        font-size: 1rem;
        min-height: 44px; /* 触摸友好 */
    }
    
    .btn-sm {
        padding: 10px 14px;
        font-size: 0.9rem;
        min-height: 40px;
    }
    
    /* 操作按钮组 */
    .action-btns {
        flex-wrap: wrap;
    }
    
    /* 表单 */
    .form-control {
        padding: 14px 16px;
        font-size: 16px; /* 防止iOS缩放 */
    }
    
    .form-group {
        margin-bottom: 16px;
    }
    
    /* 详情页 */
    .detail-header {
        flex-direction: column;
        gap: 12px;
    }
    
    .detail-title {
        font-size: 1.2rem;
    }
    
    /* 详情页按钮组 - 横向紧凑 */
    .detail-header .btn-group {
        width: 100%;
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .detail-header .btn-group .btn {
        width: auto;
        flex: 0 0 auto;
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    
    /* 卡片头部按钮组 */
    .card-header .btn-group {
        display: flex;
        flex-direction: row;
        gap: 6px;
    }
    
    .card-header .btn-group .btn {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    
    /* 详情页信息区块 - 紧凑布局 */
    .detail-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .detail-item {
        padding: 8px 10px;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }
    
    .detail-label {
        font-size: 0.75rem;
        margin-bottom: 0;
        white-space: nowrap;
        min-width: 50px;
    }
    
    .detail-value {
        font-size: 0.85rem;
        flex: 1;
        word-break: break-all;
    }
    
    .section-title {
        font-size: 14px;
        margin: 16px 0 8px 0;
    }
    
    /* 模态框 - 全屏显示 */
    .modal-content {
        width: 100%;
        max-width: 100%;
        min-height: 100vh;
        border-radius: 0;
        max-height: 100vh;
    }
    
    .modal-header {
        padding: 16px;
        position: sticky;
        top: 0;
        background: var(--card-bg);
        z-index: 10;
    }
    
    .modal-body {
        padding: 16px;
    }
    
    .modal-footer {
        padding: 16px;
        position: sticky;
        bottom: 0;
        background: var(--card-bg);
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
    
    .modal-close {
        font-size: 1.8rem;
        padding: 8px;
    }
    
    /* 日历 */
    #calendar {
        padding: 10px;
    }
    
    .fc .fc-toolbar {
        flex-direction: column;
        gap: 10px;
    }
    
    .fc .fc-toolbar-title {
        font-size: 1.1rem;
    }
    
    .fc .fc-button {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    .fc .fc-event {
        font-size: 0.75rem;
        padding: 2px 4px;
    }
    
    .fc .fc-daygrid-day-number {
        padding: 4px;
        font-size: 0.85rem;
    }
    
    /* 设置页面 */
    .settings-section {
        margin-bottom: 20px;
    }
    
    .settings-section-title {
        font-size: 1rem;
    }
    
    .switch-container {
        padding: 14px 0;
        gap: 12px;
    }
    
    .switch-container > div {
        flex: 1;
    }
    
    .switch-container strong {
        font-size: 0.95rem;
    }
    
    .switch-container p {
        font-size: 0.8rem !important;
    }
    
    /* Toast通知 */
    .toast-container {
        top: auto;
        bottom: 80px;
        left: 12px;
        right: 12px;
    }
    
    .toast {
        padding: 14px 16px;
    }
    
    /* 返回链接 */
    .back-link {
        margin-bottom: 16px;
        padding: 8px 0;
    }
    
    /* 空状态 */
    .empty-state {
        padding: 40px 20px;
    }
    
    .empty-state-icon {
        font-size: 3rem;
    }
}

/* 超小屏幕 (小于480px) */
@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .stat-card {
        padding: 12px 10px;
    }
    
    .stat-number {
        font-size: 1.4rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    .mobile-card-body {
        grid-template-columns: 1fr;
    }
    
    .mobile-card-actions {
        flex-direction: row; /* 横向排列 */
    }
    
    .mobile-card-actions .btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .page-title {
        font-size: 1.2rem;
    }
}

/* 操作按钮组 */
.action-btns {
    display: flex;
    gap: 8px;
}

/* 页面标题 */
.page-header {
    margin-bottom: 30px;
}

.page-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.page-subtitle {
    color: var(--text-muted);
}

/* 返回按钮 */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 20px;
    font-weight: 500;
}

.back-link:hover {
    color: var(--primary-color);
}

/* 导出数据弹窗样式 */
.export-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
}

.export-section-header {
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e9ecef;
}

.export-section-header strong {
    color: #333;
}

.export-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 16px;
    padding-left: 22px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #555;
}

.checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.btn-info {
    background: #17a2b8;
    color: white;
    border: none;
}

.btn-info:hover {
    background: #138496;
}

@media (max-width: 768px) {
    .export-options {
        grid-template-columns: 1fr;
    }
}

/* 首页统计模块优化 */
.stats-summary-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    color: white;
}

.summary-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.summary-icon {
    font-size: 24px;
}

.summary-title {
    font-size: 18px;
    font-weight: 600;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.summary-grid.eight-cols {
    grid-template-columns: repeat(4, 1fr);
}

.summary-item {
    background: rgba(255,255,255,0.15);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
}

.summary-label {
    font-size: 12px;
    opacity: 0.9;
    margin-bottom: 6px;
}

.summary-value {
    font-size: 20px;
    font-weight: 700;
}

.summary-value.warning {
    color: #ffc107;
}

.summary-value.danger {
    color: #ff6b6b;
}

.summary-value.success {
    color: #51cf66;
}

/* 统计行并排布局 */
.stats-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.stats-col {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.stats-section-title {
    margin: 0 0 12px 0;
    color: #333;
    font-size: 14px;
    font-weight: 600;
}

.stats-grid.compact {
    gap: 10px;
}

.stats-grid.compact .stat-card {
    padding: 12px;
}

.stats-grid.compact .stat-number {
    font-size: 24px;
}

.stats-grid.compact .stat-label {
    font-size: 11px;
}

@media (max-width: 768px) {
    .summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .summary-grid.eight-cols {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .summary-value {
        font-size: 16px;
    }
    
    .stats-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .stats-col {
        padding: 12px;
    }
    
    .stats-section-title {
        font-size: 13px;
        margin-bottom: 10px;
    }
    
    .stats-grid.compact {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
    
    .stats-grid.compact .stat-card {
        padding: 10px 6px;
    }
    
    .stats-grid.compact .stat-number {
        font-size: 18px;
    }
    
    .stats-grid.compact .stat-label {
        font-size: 10px;
    }
    
    /* 贷款统计卡片移动端 */
    .stats-summary-card {
        padding: 14px;
        margin-bottom: 12px;
    }
    
    .summary-header {
        margin-bottom: 12px;
    }
    
    .summary-icon {
        font-size: 18px;
    }
    
    .summary-title {
        font-size: 15px;
    }
    
    .summary-grid {
        gap: 8px;
    }
    
    .summary-item {
        padding: 10px 6px;
    }
    
    .summary-label {
        font-size: 10px;
    }
    
    .summary-value {
        font-size: 14px;
    }
}

/* 合同模板管理页面 */
.template-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
}

.template-list {
    max-height: 600px;
    overflow-y: auto;
}

.template-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
}

.template-item:hover {
    background: #f8f9fa;
}

.template-item.disabled {
    opacity: 0.6;
}

.template-info {
    flex: 1;
}

.template-name {
    font-weight: 600;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.template-meta {
    font-size: 12px;
    color: #999;
}

.template-actions {
    display: flex;
    gap: 8px;
}

.variable-panel .card {
    position: sticky;
    top: 80px;
}

.variable-list {
    max-height: 500px;
    overflow-y: auto;
}

.variable-category {
    margin-bottom: 15px;
}

.variable-category-title {
    font-weight: 600;
    font-size: 13px;
    color: #666;
    padding: 8px 12px;
    background: #f0f0f0;
    border-radius: 6px;
    margin-bottom: 8px;
}

.variable-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.variable-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s;
}

.variable-item:hover {
    background: #e9f5ff;
}

.variable-item code {
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    color: #d63384;
    font-family: monospace;
}

.variable-item span {
    font-size: 13px;
    color: #555;
}

.code-editor {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.5;
    tab-size: 4;
}

.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    margin-bottom: 8px;
}

.preview-content {
    background: white;
    padding: 40px;
    font-family: 宋体, SimSun, serif;
    line-height: 1.8;
}

.preview-content h1 {
    text-align: center;
    font-size: 22px;
    margin-bottom: 30px;
}

.preview-content h2 {
    font-size: 16px;
    margin-top: 20px;
}

.preview-content p {
    text-indent: 2em;
    margin: 10px 0;
}

.switch-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

/* 合同模板管理页面开关样式已在上方定义，此处不重复定义 */

.badge-secondary {
    background: #6c757d;
    color: white;
}

.badge-purple {
    background: #6f42c1;
    color: white;
}

/* 手机号搜索下拉框 */
.phone-search-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
}
.phone-search-dropdown .dropdown-header {
    padding: 8px 12px;
    background: var(--bg-color);
    font-size: 0.8rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
}
.phone-search-dropdown .dropdown-item {
    padding: 10px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}
.phone-search-dropdown .dropdown-item:hover {
    background: #f8f9fa;
}
.phone-search-dropdown .dropdown-item:last-child {
    border-bottom: none;
}
.phone-search-dropdown .item-name {
    font-weight: 600;
    margin-bottom: 4px;
}
.phone-search-dropdown .item-info {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.variable-select-list {
    max-height: 400px;
    overflow-y: auto;
}

@media (max-width: 992px) {
    .template-layout {
        grid-template-columns: 1fr;
    }
    
    .variable-panel .card {
        position: static;
    }
}

/* A4纸张编辑器样式 */
.a4-editor-wrapper {
    background: #e0e0e0;
    padding: 20px;
    border: 1px solid #ddd;
    border-top: none;
    max-height: 600px;
    overflow-y: auto;
}

.a4-editor {
    width: 210mm;
    min-height: 297mm;
    max-width: 100%;
    margin: 0 auto;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    padding: 20mm 15mm;
    box-sizing: border-box;
    font-family: 宋体, SimSun, serif;
    font-size: 14pt;
    line-height: 1.8;
}

.a4-editor h1 {
    text-align: center;
    font-size: 22pt;
    margin-bottom: 30px;
    font-weight: bold;
}

.a4-editor h2 {
    font-size: 14pt;
    margin-top: 20px;
    margin-bottom: 10px;
    font-weight: bold;
}

.a4-editor p {
    text-indent: 2em;
    margin: 8px 0;
}

.a4-editor table {
    width: 100%;
    border-collapse: collapse;
}

.a4-editor td {
    padding: 5px;
    vertical-align: top;
}

/* 合同预览样式 */
.preview-content {
    width: 210mm;
    min-height: 297mm;
    max-width: 100%;
    margin: 0 auto;
    background: #fff;
    padding: 20mm 15mm;
    box-sizing: border-box;
    font-family: 宋体, SimSun, serif;
    font-size: 14pt;
    line-height: 1.8;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.preview-content h1 {
    text-align: center;
    font-size: 22pt;
    margin-bottom: 30px;
}

.preview-content h2 {
    font-size: 14pt;
    margin-top: 20px;
}

.preview-content p {
    text-indent: 2em;
    margin: 8px 0;
}

@media (max-width: 768px) {
    .a4-editor-wrapper {
        padding: 10px;
    }
    
    .a4-editor,
    .preview-content {
        width: 100%;
        min-height: auto;
        padding: 15px;
        font-size: 12pt;
    }
}

/* ===================== */
/* 移动端表单优化 */
/* ===================== */

/* 可折叠表单分组 - PC端隐藏折叠功能 */
.form-section {
    margin-bottom: 20px;
}

/* PC端隐藏折叠头部 */
#customerModal .form-section-header {
    display: none !important;
}

#customerModal .form-section-body {
    padding: 0;
}

/* PC端显示传统标题 */
#customerModal .form-section h4.pc-title {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

#customerModal .form-section h4.pc-title .section-icon {
    margin-right: 8px;
}

/* PC端隐藏已填写标记 */
.form-section-filled {
    display: none !important;
}

.form-section-toggle {
    display: none;
}

/* 暂存提示条 */
.draft-notice {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: #fff7e6;
    border: 1px solid #ffd591;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 13px;
    color: #ad6800;
}

.draft-notice.show {
    display: flex;
}

.draft-notice .draft-icon {
    font-size: 16px;
}

.draft-notice .draft-text {
    flex: 1;
}

.draft-notice .draft-restore {
    color: #1890ff;
    cursor: pointer;
    font-weight: 500;
}

.draft-notice .draft-clear {
    color: #999;
    cursor: pointer;
    margin-left: 8px;
}

/* 固定底部操作栏 - PC端隐藏 */
.mobile-form-footer {
    display: none;
}

/* ===================== */
/* 移动端表单样式 */
/* ===================== */
@media (max-width: 768px) {
    /* 移动端弹窗优化 */
    #customerModal .modal-content {
        max-height: none;
        height: auto;
        min-height: auto;
    }
    
    #customerModal .modal-body {
        flex: none;
        padding: 10px;
        max-height: none;
        overflow-y: visible;
    }
    
    #customerModal .modal-footer {
        display: none;
    }
    
    /* 移动端底部操作栏 - 非固定，跟随内容滚动 */
    .mobile-form-footer {
        display: flex;
        padding: 15px 0;
        margin-top: 15px;
        gap: 10px;
        border-top: 1px solid #eee;
    }
    
    .mobile-form-footer .btn {
        flex: 1;
        padding: 12px;
        font-size: 15px;
        border-radius: 8px;
    }
    
    .btn-draft {
        background: #fff7e6;
        color: #fa8c16;
        border: 1px solid #fa8c16;
    }
    
    .btn-draft:hover {
        background: #fff1b8;
    }
    
    /* 移动端隐藏PC标题，显示折叠头 */
    #customerModal .form-section h4.pc-title {
        display: none !important;
    }
    
    #customerModal .form-section {
        margin-bottom: 10px;
        border: 1px solid #e8e8e8;
        border-radius: 8px;
        overflow: hidden;
    }
    
    #customerModal .form-section-header {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        padding: 14px 15px;
        background: #f8f9fa;
        cursor: pointer;
        user-select: none;
    }
    
    #customerModal .form-section-header:active {
        background: #f0f0f0;
    }
    
    #customerModal .form-section-header h4 {
        margin: 0;
        font-size: 14px;
        font-weight: 600;
        color: #333;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    #customerModal .form-section-toggle {
        display: inline;
        font-size: 12px;
        color: #999;
        transition: transform 0.3s;
    }
    
    #customerModal .form-section.collapsed .form-section-toggle {
        transform: rotate(-90deg);
    }
    
    #customerModal .form-section-body {
        padding: 12px;
        background: #fff;
        max-height: 2000px;
        overflow: hidden;
        transition: max-height 0.3s ease, padding 0.3s ease;
    }
    
    #customerModal .form-section.collapsed .form-section-body {
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
    
    /* 已填写标记 */
    #customerModal .form-section-filled {
        display: none !important;
        font-size: 11px;
        color: #52c41a;
        background: #f6ffed;
        padding: 2px 8px;
        border-radius: 10px;
        margin-right: 8px;
    }
    
    #customerModal .form-section.has-data .form-section-filled {
        display: inline-block !important;
    }
    
    /* 输入框优化 */
    .form-section .form-control {
        font-size: 16px;
        padding: 12px;
    }
    
    .form-section .form-label {
        font-size: 13px;
        margin-bottom: 6px;
    }
    
    .form-section .form-group {
        margin-bottom: 12px;
    }
    
    .form-section .form-row {
        gap: 10px;
    }
}
