/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 20px;
    padding-bottom: 40px;
}

/* 头部 */
.header {
    text-align: center;
    padding: 20px 0 30px;
}

.header h1 {
    color: #fff;
    font-size: 24px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 表单样式 */
.form {
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}

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

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
}

.form-label.required::after {
    content: '*';
    color: #ff4d4f;
    margin-left: 4px;
}

.form-input,
.form-select {
    width: 100%;
    height: 48px;
    padding: 0 16px;
    font-size: 16px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    outline: none;
    transition: all 0.3s;
    background: #fafafa;
}

.form-input:focus,
.form-select:focus {
    border-color: #667eea;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-input::placeholder {
    color: #999;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

/* 刷新按钮 */
.btn-refresh {
    margin-top: 8px;
    padding: 6px 12px;
    font-size: 12px;
    color: #667eea;
    background: none;
    border: 1px solid #667eea;
    border-radius: 4px;
    cursor: pointer;
}

.btn-refresh:active {
    background: #667eea;
    color: #fff;
}

/* 输入提示 */
.input-tip {
    margin-top: 6px;
    font-size: 12px;
    color: #999;
}

/* 图片上传 */
.upload-area {
    position: relative;
    width: 100%;
    height: 200px;
    border: 2px dashed #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
    overflow: hidden;
    cursor: pointer;
}

.upload-input {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-placeholder {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #999;
}

.upload-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 8px;
}

.preview-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* 提交按钮 */
.btn-submit {
    width: 100%;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 18px;
    font-weight: 500;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
}

.btn-submit:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.btn-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 付款二维码区域 */
.payment-qr {
    margin-top: 30px;
    text-align: center;
    padding: 24px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}

.payment-qr h3 {
    font-size: 18px;
    color: #333;
    margin-bottom: 8px;
}

.payment-tip {
    font-size: 14px;
    color: #666;
    margin-bottom: 16px;
}

/* 二维码包装器 */
.qr-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

.qr-wrapper .qr-image {
    width: 260px;
    height: 260px;
    display: block;
    border: 1px solid #f0f0f0;
    border-radius: 4px;
    /* 确保长按可以识别 */
    -webkit-touch-callout: default;
    -webkit-user-select: none;
    user-select: none;
    pointer-events: auto;
    touch-action: manipulation;
    draggable: false;
    -webkit-drag-preview: true;
}

/* 付款链接样式 */
.payment-link {
    display: inline-block;
    padding: 16px 32px;
    background: linear-gradient(135deg, #07c160 0%, #06ad56 100%);
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    border-radius: 50px;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(7, 193, 96, 0.3);
    transition: all 0.3s ease;
}

.payment-link:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(7, 193, 96, 0.3);
}

.payment-link-text {
    margin-top: 16px;
    padding: 12px 16px;
    background: #f5f5f5;
    border-radius: 8px;
    font-size: 14px;
    color: #666;
    word-break: break-all;
    cursor: pointer;
    border: 1px dashed #ccc;
}

.qr-hint {
    font-size: 14px;
    color: #666;
    text-align: center;
    line-height: 1.8;
    background: #f9f9f9;
    padding: 16px;
    border-radius: 8px;
}

.qr-hint .highlight {
    color: #07c160;
    font-weight: 600;
}

/* 操作按钮组 */
.qr-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.btn-save-qr,
.btn-open-scan {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    font-size: 14px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-save-qr {
    background: #f5f5f5;
    color: #333;
}

.btn-save-qr svg,
.btn-open-scan svg {
    width: 18px;
    height: 18px;
}

.btn-save-qr:active,
.btn-open-scan:active {
    transform: scale(0.98);
}

.btn-open-scan {
    background: #07c160;
    color: #fff;
}

.hint-divider {
    display: block;
    margin: 8px 0;
    color: #999;
}

/* 二维码错误提示 */
.qr-error-tip {
    margin-top: 16px;
    padding: 16px;
    background: #fff3cd;
    border-radius: 8px;
    text-align: center;
}

.qr-error-tip p {
    color: #856404;
    font-size: 14px;
}

.qr-error-desc {
    font-size: 12px !important;
    color: #a05a00 !important;
    margin-top: 8px;
}

/* 图片预览弹窗 */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.image-modal.show {
    display: flex;
}

.image-modal-content {
    text-align: center;
}

.image-modal-content img {
    max-width: 90vw;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    -webkit-touch-callout: default;
}

.image-modal-tip {
    margin-top: 16px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

/* 提示框 */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 16px 32px;
    border-radius: 8px;
    font-size: 14px;
    opacity: 0;
    transition: all 0.3s;
    z-index: 9999;
    text-align: center;
    max-width: 80%;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* 登录页面 */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-box {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 16px;
    padding: 40px 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}

.login-box h1 {
    text-align: center;
    font-size: 24px;
    color: #333;
    margin-bottom: 30px;
}

/* 管理后台 */
.admin-container {
    max-width: 100%;
    padding: 20px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: #fff;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.admin-header h1 {
    font-size: 20px;
    color: #333;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-logout {
    padding: 8px 16px;
    background: #ff4d4f;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.stats-bar {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.stat-item {
    background: #fff;
    padding: 20px 24px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.stat-value {
    display: block;
    font-size: 28px;
    font-weight: 600;
    color: #667eea;
}

.stat-label {
    font-size: 14px;
    color: #666;
}

.filter-bar {
    margin-bottom: 20px;
}

.btn-refresh-data {
    padding: 10px 20px;
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

/* 表格样式 */
.table-container {
    background: #fff;
    border-radius: 8px;
    overflow-x: auto;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1000px;
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.data-table th {
    background: #f5f5f5;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
}

.data-table tr:hover {
    background: #fafafa;
}

.data-table .loading {
    text-align: center;
    color: #999;
    padding: 40px;
}

/* 表格中的图片 */
.table-screenshot {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
}

.table-screenshot:hover {
    opacity: 0.8;
}

/* 操作按钮 */
.btn-view,
.btn-delete {
    padding: 6px 12px;
    font-size: 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 8px;
}

.btn-view {
    background: #1890ff;
    color: #fff;
}

.btn-delete {
    background: #ff4d4f;
    color: #fff;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
}

.btn-page {
    padding: 8px 20px;
    background: #667eea;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.btn-page:disabled {
    background: #ccc;
    cursor: not-allowed;
}

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

.modal.show {
    display: flex;
}

.modal-content {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid #eee;
}

.modal-header h2 {
    font-size: 18px;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.modal-body {
    padding: 24px;
}

.detail-item {
    margin-bottom: 16px;
}

.detail-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 4px;
}

.detail-value {
    font-size: 16px;
    color: #333;
}

.detail-image {
    width: 100%;
    max-width: 300px;
    border-radius: 8px;
    margin-top: 8px;
}

/* 响应式适配 */
@media (max-width: 768px) {
    .admin-header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .stats-bar {
        flex-direction: column;
    }

    .data-table th,
    .data-table td {
        padding: 10px 12px;
        font-size: 12px;
    }

    .pagination {
        flex-wrap: wrap;
    }
}

/* 自愿缴费标签 */
.tag-yes {
    display: inline-block;
    padding: 2px 8px;
    background: #52c41a;
    color: #fff;
    border-radius: 4px;
    font-size: 12px;
}

.tag-no {
    display: inline-block;
    padding: 2px 8px;
    background: #ff4d4f;
    color: #fff;
    border-radius: 4px;
    font-size: 12px;
}

/* 图片选择器样式 */
.item-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.item-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    background: #fafafa;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

.item-option:hover {
    border-color: #667eea;
    background: #f0f0ff;
}

.item-option.selected {
    border-color: #667eea;
    background: #f0f0ff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
}

.item-option img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-bottom: 8px;
    border-radius: 8px;
    background: #fff;
}

.item-option span {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    text-align: center;
}

/* 金额输入样式 */
.amount-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.amount-symbol {
    position: absolute;
    left: 16px;
    font-size: 20px;
    color: #333;
    font-weight: 600;
}

.amount-input {
    padding-left: 36px !important;
    font-size: 24px !important;
    font-weight: 600;
    text-align: left;
}

/* 支付区域样式 */
.payment-section {
    margin-top: 30px;
    text-align: center;
    padding: 24px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}

.payment-title {
    font-size: 20px;
    color: #333;
    margin-bottom: 20px;
}

.payment-info {
    margin-bottom: 24px;
}

.payment-amount-display {
    font-size: 16px;
    color: #666;
    margin-bottom: 12px;
}

.payment-amount-display .amount {
    font-size: 32px;
    font-weight: 700;
    color: #ff6b00;
}

.payment-status {
    padding: 12px;
    border-radius: 8px;
    background: #f5f5f5;
}

.status-pending {
    color: #999;
    font-size: 14px;
}

.status-success {
    color: #52c41a;
    font-size: 16px;
    font-weight: 600;
}

.status-failed {
    color: #ff4d4f;
    font-size: 16px;
    font-weight: 600;
}

/* 微信支付按钮 */
.btn-wechat-pay {
    width: 100%;
    height: 56px;
    background: linear-gradient(135deg, #07c160 0%, #06ad56 100%);
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    border: none;
    border-radius: 28px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(7, 193, 96, 0.4);
}

.btn-wechat-pay svg {
    width: 28px;
    height: 28px;
}

.btn-wechat-pay:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(7, 193, 96, 0.4);
}

.btn-wechat-pay:disabled {
    background: #ccc;
    box-shadow: none;
    cursor: not-allowed;
}

.payment-hint {
    margin-top: 16px;
    font-size: 14px;
    color: #999;
}

.payment-check {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.btn-check-status {
    padding: 10px 24px;
    background: #f5f5f5;
    color: #666;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-check-status:hover {
    background: #eee;
    color: #333;
}

/* 支付状态标签 */
.payment-status-tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.payment-status-pending {
    background: #fff7e6;
    color: #fa8c16;
}

.payment-status-success {
    background: #f6ffed;
    color: #52c41a;
}

.payment-status-failed {
    background: #fff1f0;
    color: #ff4d4f;
}
