/* ===== 全局重置 & 字体 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
    background: linear-gradient(145deg, #e8f0fe 0%, #d9e6f2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
}

.page-wrapper {
    width: 100%;
    max-width: 620px;
}

.container {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 32px;
    padding: 40px 36px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), inset 0 1px 2px rgba(255, 255, 255, 0.6);
    transition: all 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

/* ===== 头部品牌 ===== */
.header-brand {
    text-align: center;
    margin-bottom: 32px;
}

.store-badge {
    display: inline-block;
    background: #1a3a5c;
    color: #ffd966;
    font-size: 28px;          /* 与 h1 字号一致 */
    font-weight: 700;
    padding: 8px 32px;        /* 加宽内边距，适应大字 */
    border-radius: 40px;
    letter-spacing: 2px;
    margin-bottom: 12px;
    box-shadow: 0 4px 8px rgba(26, 58, 92, 0.2);
}

.header-brand h1 {
    font-size: 28px;
    font-weight: 700;
    color: #1a2a3a;
    letter-spacing: 2px;
    margin-bottom: 6px;
    background: linear-gradient(135deg, #1a3a5c, #2d5f7e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sub-title {
    color: #4a6a7e;
    font-size: 15px;
    font-weight: 400;
    letter-spacing: 0.5px;
}

/* ===== 表单卡片 ===== */
.form-card {
    background: #ffffff;
    border-radius: 24px;
    padding: 28px 24px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04);
}

.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #1a3a5c;
    font-size: 15px;
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
    transition: all 0.25s ease;
    outline: none;
    color: #1a2a3a;
}

.form-group input:focus {
    border-color: #2d5f7e;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(45, 95, 126, 0.15);
}

.form-group input::placeholder {
    color: #a0b8c9;
    font-weight: 300;
}

.field-hint {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    color: #7a9bb3;
    letter-spacing: 0.2px;
}

/* ===== 提交按钮 ===== */
.btn-submit {
    width: 100%;
    padding: 16px;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #1a3a5c, #2d5f7e);
    border: none;
    border-radius: 40px;
    cursor: pointer;
    transition: all 0.25s;
    box-shadow: 0 8px 18px rgba(26, 58, 92, 0.3);
    letter-spacing: 2px;
    margin-top: 6px;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(26, 58, 92, 0.4);
    background: linear-gradient(135deg, #142f4a, #1f4a66);
}

.btn-submit:active {
    transform: translateY(0px);
    box-shadow: 0 4px 10px rgba(26, 58, 92, 0.2);
}

/* ===== 表单底部 ===== */
.form-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
}

.footer-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px 12px;
    font-size: 14px;
    color: #6a8aa0;
    width: 100%;
}

.admin-link {
    color: #2d5f7e;
    font-weight: 500;
    text-decoration: none;
    border-bottom: 1px dashed #b0cbd9;
    transition: color 0.2s;
}

.admin-link:hover {
    color: #1a3a5c;
    border-bottom-color: #1a3a5c;
}

/* ===== 自行购买保险按钮 ===== */
.btn-qr-link {
    background: #f39c12;
    color: #fff;
    border: none;
    padding: 4px 16px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.5px;
    line-height: 1.8;
    white-space: nowrap;
    flex-shrink: 0;
}

.btn-qr-link:hover {
    background: #e08e0b;
    transform: scale(1.02);
}

.btn-qr-link:active {
    transform: scale(0.98);
}

/* ===== 二维码容器 ===== */
#qrContainer {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 12px;
}

.qr-card {
    display: inline-block;
    width: 92%;
    max-width: 340px;
    background: #ffffff;
    padding: 16px 12px 12px;
    border-radius: 20px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #f0f4f8;
    box-sizing: border-box;
    text-align: center;
}

#qrImage {
    width: 100%;
    max-width: 280px;
    max-height: 80vh;
    height: auto;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    display: block;
    margin: 0 auto;
}

.qr-tip {
    font-size: clamp(14px, 3.5vw, 17px);
    font-weight: 500;
    color: #1a3a5c;
    margin-top: 10px;
    margin-bottom: 2px;
}

.qr-subtip {
    font-size: clamp(11px, 2.5vw, 13px);
    color: #8aa9c0;
    margin-top: 2px;
}

/* ===== 小屏手机优化 ===== */
@media (max-width: 480px) {
    .qr-card {
        padding: 12px 8px 10px;
        border-radius: 16px;
        width: 96%;
    }
    #qrImage {
        max-width: 180px;
    }
    .footer-row {
        font-size: 13px;
        gap: 6px 10px;
    }
    .btn-qr-link {
        font-size: 13px;
        padding: 3px 12px;
    }
    .container {
        padding: 24px 18px;
        border-radius: 24px;
    }
    .header-brand h1 {
        font-size: 22px;
    }
    .form-card {
        padding: 20px 16px;
    }
}

/* ===== 底部门店信息 ===== */
.store-footer {
    text-align: center;
    margin-top: 28px;
    color: #3a5a6e;
    font-size: 14px;
    line-height: 1.6;
    opacity: 0.8;
}

.store-footer .small {
    font-size: 12px;
    color: #7a9bb3;
}

/* ===== 管理后台专用样式 ===== */
.admin-container {
    max-width: 1000px;
}

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

.admin-header h2 {
    margin: 0;
    color: #1a3a5c;
}

.toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-export, .btn-back {
    display: inline-block;
    padding: 8px 20px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
}

.btn-export {
    background: #2d5f7e;
    color: #fff;
}
.btn-export:hover {
    background: #1a3a5c;
    transform: translateY(-1px);
}

.btn-back {
    background: #e2e8f0;
    color: #1a2a3a;
}
.btn-back:hover {
    background: #cbd5e0;
}

/* 消息提示 */
.alert {
    padding: 12px 18px;
    border-radius: 12px;
    margin-bottom: 18px;
    font-weight: 500;
}
.alert.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.alert.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 表格工具栏 */
.table-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
    padding: 8px 0;
}

.table-toolbar .left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #1a3a5c;
    cursor: pointer;
}

.btn-danger {
    background: #e53e3e;
    color: #fff;
    border: none;
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-danger:hover:not(:disabled) {
    background: #c53030;
    transform: scale(1.02);
}
.btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.table-toolbar .right {
    font-size: 14px;
    color: #6a8aa0;
}

/* 表格容器 */
.table-wrapper {
    overflow-x: auto;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    background: #fff;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.admin-table th {
    background: #f7fafc;
    color: #1a3a5c;
    font-weight: 600;
    padding: 12px 10px;
    text-align: left;
    border-bottom: 2px solid #e2e8f0;
}

.admin-table td {
    padding: 10px;
    border-bottom: 1px solid #edf2f7;
}

.admin-table tbody tr:hover {
    background: #f7fafc;
}

.admin-table .btn-delete {
    color: #e53e3e;
    text-decoration: none;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid #e53e3e;
    transition: all 0.2s;
    font-size: 13px;
}
.admin-table .btn-delete:hover {
    background: #e53e3e;
    color: #fff;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #7a9bb3;
    font-size: 16px;
}

/* 响应式 */
@media (max-width: 640px) {
    .admin-header {
        flex-direction: column;
        align-items: stretch;
    }
    .admin-header h2 {
        text-align: center;
    }
    .toolbar {
        justify-content: center;
    }
    .table-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .table-toolbar .left {
        justify-content: center;
    }
    .table-toolbar .right {
        text-align: center;
    }
    .admin-table {
        font-size: 13px;
    }
    .admin-table th, .admin-table td {
        padding: 8px 6px;
    }
}