/* 电子礼簿系统 - 基础样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: "KaiTi", "STKaiti", "楷体", "Microsoft YaHei", sans-serif;
    background: #f0f2f5;
    color: #333;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ===== 登录页 ===== */
.login-container {
    max-width: 640px;
    margin: 60px auto;
    background: #fff;
    border-radius: 16px;
    padding: 48px 44px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
    font-family: "Microsoft YaHei", "微软雅黑", sans-serif;
}

.admin-login-container {
    max-width: 420px;
    margin: 120px auto;
    background: #fff;
    border-radius: 16px;
    padding: 48px 40px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.08);
    text-align: center;
    font-family: "Microsoft YaHei", "微软雅黑", sans-serif;
}

.admin-login-container h1 {
    font-size: 30px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #1a1a1a;
    font-family: "Microsoft YaHei", "微软雅黑", sans-serif;
}

.admin-login-container p {
    font-family: "Microsoft YaHei", "微软雅黑", sans-serif;
    color: #888;
}

.admin-login-container .form-control {
    margin-bottom: 16px;
}

.main-title {
    text-align: center;
    font-size: 34px;
    font-weight: 700;
    margin-bottom: 36px;
    color: #1a1a1a;
    font-family: "Microsoft YaHei", "微软雅黑", sans-serif;
    letter-spacing: 4px;
}

.section { margin-bottom: 24px; }
.section h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 14px;
    color: #1a1a1a;
    font-family: "Microsoft YaHei", "微软雅黑", sans-serif;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    font-family: "Microsoft YaHei", "微软雅黑", sans-serif;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
    margin-bottom: 12px;
    background: #fafafa;
    color: #333;
}
.form-control:focus {
    border-color: #d32f2f;
    box-shadow: 0 0 0 3px rgba(211,47,47,0.08);
    background: #fff;
}
.form-control::placeholder {
    color: #bbb;
}

.form-row { display: flex; gap: 14px; align-items: flex-end; }
.form-row .form-control { margin-bottom: 0; }
.form-group { flex: 1; }
.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #555;
    margin-bottom: 6px;
    font-family: "Microsoft YaHei", "微软雅黑", sans-serif;
}

.datetime-row { display: flex; gap: 10px; }
.datetime-row .form-control { flex: 1; }
.time-input { max-width: 130px; }

.divider {
    text-align: center;
    margin: 28px 0;
    position: relative;
}
.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e8e8e8;
}
.divider span {
    background: #fff;
    padding: 0 18px;
    position: relative;
    color: #999;
    font-size: 14px;
    font-family: "Microsoft YaHei", "微软雅黑", sans-serif;
}

.more-settings-toggle {
    cursor: pointer;
    color: #666;
    font-size: 14px;
    margin-bottom: 12px;
    user-select: none;
    font-family: "Microsoft YaHei", "微软雅黑", sans-serif;
}
.more-settings-toggle:hover { color: #333; }

.more-settings {
    background: #fafafa;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 16px;
}

.setting-group { margin-bottom: 16px; }
.setting-group:last-child { margin-bottom: 0; }
.setting-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    font-family: "Microsoft YaHei", "微软雅黑", sans-serif;
    color: #444;
}
.setting-hint {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
    font-family: "Microsoft YaHei", "微软雅黑", sans-serif;
}

/* ===== 按钮 ===== */
.btn {
    display: inline-block;
    padding: 12px 28px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    text-decoration: none;
    font-family: "Microsoft YaHei", "微软雅黑", sans-serif;
    letter-spacing: 1px;
}
.btn-primary {
    background: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(211,47,47,0.25);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #b71c1c 0%, #8e0000 100%);
    box-shadow: 0 6px 16px rgba(211,47,47,0.35);
    transform: translateY(-1px);
}
.btn-outline {
    background: #fff;
    color: #d32f2f;
    border: 1.5px solid #d32f2f;
    font-weight: 600;
}
.btn-outline:hover {
    background: #ffebee;
    border-color: #b71c1c;
}
.btn-block {
    display: block;
    width: 100%;
    padding: 12px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1px;
}
.btn-link {
    color: #d32f2f;
    text-decoration: none;
    font-size: 14px;
    font-family: "Microsoft YaHei", "微软雅黑", sans-serif;
}
.btn-link:hover {
    text-decoration: underline;
    color: #b71c1c;
}

/* 选择事项行样式优化 */
.form-row .btn {
    padding: 12px 32px;
    min-width: 100px;
    font-size: 16px;
}

.error-msg {
    color: #d32f2f;
    font-size: 13px;
    margin-top: 8px;
    font-family: "Microsoft YaHei", "微软雅黑", sans-serif;
}

/* ===== 仪表板布局 ===== */
.event-dropdown-top {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    min-width: 220px;
    z-index: 200;
    margin-top: 6px;
    overflow: hidden;
}
.event-dropdown-top.show { display: block; }
.dropdown-item {
    padding: 12px 18px;
    font-size: 14px;
    cursor: pointer;
    font-family: "Microsoft YaHei", "微软雅黑", sans-serif;
    color: #333;
    transition: background 0.2s;
}
.dropdown-item:hover { background: #f5f5f5; }
.dropdown-item.active { font-weight: 600; color: #d32f2f; background: #fff5f5; }

.dashboard-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    grid-template-rows: auto 1fr;
    gap: 10px;
    padding: 4px 24px 10px 24px;
    max-width: 1400px;
    margin: 0 auto;
    flex: 1;
    min-height: 0;
}

.left-column {
    display: flex;
    flex-direction: column;
    width: 300px;
    min-width: 300px;
}

.event-selector-outer {
    grid-column: 1;
    grid-row: 1;
    width: 300px;
    min-width: 300px;
    padding: 3px 0 0 0;
    position: relative;
    z-index: 50;
}

.event-selector-top {
    position: relative;
    cursor: pointer;
    user-select: none;
    font-family: "Microsoft YaHei", "微软雅黑", sans-serif;
    font-size: 20pt;
    font-weight: bold;
    color: #d32f2f;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    white-space: nowrap;
}

/* 左侧面板 - 微软雅黑字体 */
.left-panel {
    grid-column: 1;
    grid-row: 2;
    background: #fff;
    border-radius: 10px;
    padding: 12px 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    font-family: "Microsoft YaHei", "微软雅黑", sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow-y: auto;
}

/* 礼金录入区域 */
.record-entry-section {
    margin-bottom: 20px;
}

.record-entry-section h2 {
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.left-panel .form-control {
    font-family: "Microsoft YaHei", "微软雅黑", sans-serif;
    font-size: 14px;
    padding: 10px 14px;
    margin-bottom: 12px;
    border-radius: 8px;
}

.left-panel .payment-types {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px;
    font-family: "Microsoft YaHei", "微软雅黑", sans-serif;
}
.left-panel .payment-types label { cursor: pointer; }

.left-panel textarea.form-control {
    resize: vertical;
    min-height: 60px;
    margin-bottom: 12px;
}

.left-panel .more-notes-toggle {
    font-size: 14px;
    color: #666;
    cursor: pointer;
    margin-bottom: 10px;
    user-select: none;
    font-family: "Microsoft YaHei", "微软雅黑", sans-serif;
}
.left-panel .more-notes-panel { margin-bottom: 14px; }
.left-panel .note-field { margin-bottom: 10px; }
.left-panel .note-field label {
    font-size: 13px;
    color: #666;
    font-family: "Microsoft YaHei", "微软雅黑", sans-serif;
}
.left-panel .note-field .form-control {
    margin-bottom: 0;
    padding: 8px 10px;
    font-size: 13px;
}

.left-panel .note-tag {
    display: inline-block;
    padding: 4px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 16px;
    font-size: 13px;
    cursor: pointer;
    margin: 3px 2px;
    font-family: "Microsoft YaHei", "微软雅黑", sans-serif;
}
.left-panel .note-tag.active {
    background: #d32f2f;
    color: #fff;
    border-color: #d32f2f;
}

/* 功能区 */
.left-panel .function-area {
    margin-top: 10px;
    border-top: 1px solid #eee;
    padding-top: 8px;
}
.left-panel .function-area h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
    font-family: "Microsoft YaHei", "微软雅黑", sans-serif;
}

.left-panel .search-box {
    position: relative;
    margin-bottom: 8px;
}
.left-panel .search-box .form-control {
    margin-bottom: 0;
    padding-right: 40px;
    padding: 8px 14px;
}
.left-panel .search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: #999;
}

.func-links {
    display: flex;
    justify-content: flex-start;
    margin: 5px 0;
    gap: 16px;
}
.func-links .btn-link {
    font-size: 12px;
    color: #666;
    text-decoration: none;
    font-family: "Microsoft YaHei", "微软雅黑", sans-serif;
}
.func-links .btn-link:hover {
    color: #d32f2f;
}

.btn-confirm {
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
    font-family: "Microsoft YaHei", "微软雅黑", sans-serif;
}

.left-panel .voice-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    font-size: 14px;
    font-family: "Microsoft YaHei", "微软雅黑", sans-serif;
}

.bottom-links {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #eee;
}
.bottom-links .btn-link {
    font-size: 12px;
    color: #666;
    text-decoration: none;
    font-family: "Microsoft YaHei", "微软雅黑", sans-serif;
}
.bottom-links .btn-link:hover {
    color: #d32f2f;
}

/* 开关 */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background: #ccc;
    border-radius: 24px;
    transition: 0.3s;
}
.slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: 0.3s;
}
input:checked + .slider { background: #d32f2f; }
input:checked + .slider::before { transform: translateX(20px); }

/* 右侧表格面板 */
.right-panel {
    grid-column: 2;
    grid-row: 2;
    background: #fff;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    position: relative;
    align-self: stretch;
    overflow: hidden;
}
.right-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url('../assets/image/minx_bg.jpg') center center / cover no-repeat;
    opacity: 0.12;
    pointer-events: none;
    z-index: 0;
}
.right-panel > * { position: relative; z-index: 1; }
.theme-gray .right-panel::before {
    filter: grayscale(100%);
    opacity: 0.08;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 8px;
    flex-shrink: 0;
    position: relative;
    z-index: 20;
    background: #fff;
    padding-bottom: 6px;
}
.table-stats { font-size: 14px; }
.table-stats span { margin-right: 16px; }

.table-pagination { display: flex; align-items: center; gap: 8px; font-size: 14px; position: relative; z-index: 10; }
.page-btn {
    background: none;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    padding: 4px 10px;
    cursor: pointer;
    font-size: 14px;
    font-family: "KaiTi", "STKaiti", "楷体", sans-serif;
    pointer-events: auto;
    z-index: 10;
}
.page-btn:hover { border-color: #d32f2f; color: #d32f2f; }

/* 礼金表格 */
.gift-table-wrapper {
    overflow-x: auto;
    overflow-y: hidden;
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
    min-height: 0;
}
.gift-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    flex: 1;
}
.gift-table td {
    border: 2px solid #e8e8e8;
    text-align: center;
    padding: 4px;
    font-size: 13px;
    vertical-align: middle;
    word-break: break-all;
    font-family: "LiSu", "隶书", "STLiti", serif;
}
.gift-table .row-name td {
    font-weight: 600;
    font-size: 24px;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-family: "FZXiaoBiaoSong-B05S", "方正小标宋简体", serif;
    height: 100px;
}
.gift-table .row-payment td {
    font-size: 12px;
    text-align: center;
    vertical-align: middle;
    font-family: "SimSun", "宋体", serif;
    color: #666;
    height: 24px;
}
.gift-table .row-label td {
    font-size: 24px;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    letter-spacing: 4px;
    font-family: "FZXiaoBiaoSong-B05S", "方正小标宋简体", serif;
    height: 50px;
}
.gift-table .row-chinese td {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 22px;
    font-family: "FZXiaoBiaoSong-B05S", "方正小标宋简体", serif;
    height: 180px;
}
.gift-table .row-amount td {
    font-size: 12px;
    color: #333;
    font-family: "Microsoft YaHei", "微软雅黑", sans-serif;
    height: 26px;
}

/* ===== 弹窗 ===== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}
.modal {
    background: #fff;
    border-radius: 12px;
    width: 400px;
    max-width: 90%;
    box-shadow: 0 12px 40px rgba(0,0,0,0.2);
    overflow: hidden;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    background: #fafafa;
}
.modal-header h3 {
    font-size: 16px;
    font-weight: 700;
    font-family: "Microsoft YaHei", "微软雅黑", sans-serif;
    color: #1a1a1a;
}
.modal-close { font-size: 22px; cursor: pointer; color: #999; }
.modal-close:hover { color: #333; }
.modal-body { padding: 20px; font-family: "SimHei", "黑体", sans-serif; }
.modal-body p { margin-bottom: 12px; font-size: 14px; }
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 14px 20px;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
}
.amount-highlight { color: #d32f2f; font-size: 16px; }

/* 统计表格 */
.stats-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
}
.stats-table th, .stats-table td {
    border: 1px solid #e8e8e8;
    padding: 8px 12px;
    text-align: center;
    font-size: 14px;
}
.stats-table th { background: #fafafa; font-weight: 600; }

/* ===== 通用管理后台样式 ===== */
.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 24px;
}
