/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

/* 页面容器 */
.page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transition: opacity 0.3s ease;
}

.page.hidden {
    opacity: 0;
    pointer-events: none;
    z-index: -1;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* 加载页面样式 */
.loading-container {
    text-align: center;
    color: white;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-left: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 微信授权页面样式 */
.logo {
    text-align: center;
    margin-bottom: 40px;
}

.logo img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin-bottom: 20px;
}

.logo h1 {
    color: white;
    font-size: 28px;
    font-weight: 300;
}

.auth-content {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px 30px;
    border-radius: 20px;
    text-align: center;
    margin-bottom: 30px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.auth-content p {
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
}

.tips {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    text-align: center;
}

.tips p {
    margin-bottom: 5px;
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(45deg, #1aad19, #2dc653);
    color: white;
    box-shadow: 0 4px 15px rgba(29, 173, 25, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(29, 173, 25, 0.4);
}

.btn-secondary {
    background: #f5f5f5;
    color: #666;
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background: #e8e8e8;
}

.btn-large {
    padding: 16px 32px;
    font-size: 18px;
    width: 100%;
    margin-top: 20px;
}

.icon-wechat {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    background: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTEwIDIwQzE1LjUyMjggMjAgMjAgMTUuNTIyOCAyMCAxMEMyMCA0LjQ3NzE1IDE1LjUyMjggMCAxMCAwQzQuNDc3MTUgMCAwIDQuNDc3MTUgMCAxMEMwIDE1LjUyMjggNC40NzcxNSAyMCAxMCAyMFoiIGZpbGw9IndoaXRlIi8+CjxwYXRoIGQ9Ik03Ljc4MTI1IDcuODEyNUM4LjIxODc1IDcuODEyNSA4LjU5Mzc1IDcuNDM3NSA4LjU5Mzc1IDdDOC41OTM3NSA2LjU2MjUgOC4yMTg3NSA2LjE4NzUgNy43ODEyNSA2LjE4NzVDNy4zNDM3NSA2LjE4NzUgNi45Njg3NSA2LjU2MjUgNi45Njg3NSA3QzYuOTY4NzUgNy40Mzc1IDcuMzQzNzUgNy44MTI1IDcuNzgxMjUgNy44MTI1WiIgZmlsbD0iIzFFQUY0RSIvPgo8L3N2Zz4K') no-repeat center;
    background-size: contain;
}

/* 表单页面样式 */
.header {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 15px 15px 0 0;
    text-align: center;
    position: relative;
    backdrop-filter: blur(10px);
}

.header h2 {
    color: #333;
    font-size: 22px;
    margin-bottom: 15px;
}

.user-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.back-btn {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    font-size: 16px;
    cursor: pointer;
    padding: 5px;
}

.form {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px 20px;
    border-radius: 0 0 15px 15px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

/* 表单分组样式 */
.form-section {
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(248, 249, 250, 0.8);
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.form-section h3 {
    color: #333;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #1aad19;
    position: relative;
}

.form-section h3::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 30px;
    height: 2px;
    background: #1aad19;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e1e1;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #1aad19;
    box-shadow: 0 0 0 3px rgba(26, 173, 25, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #999;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* 复选框样式 */
.checkbox {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
}

.checkbox input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    width: 0;
    height: 0;
}

.checkmark {
    width: 18px;
    height: 18px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 4px;
    margin-right: 10px;
    flex-shrink: 0;
    position: relative;
    transition: all 0.3s ease;
}

.checkbox input:checked ~ .checkmark {
    background: #1aad19;
    border-color: #1aad19;
}

.checkbox input:checked ~ .checkmark::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.agreement {
    margin: 30px 0;
}

.link {
    color: #1aad19;
    text-decoration: none;
}

.link:hover {
    text-decoration: underline;
}

/* 支付页面样式 */
.payment-info {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px 20px;
    border-radius: 15px;
    text-align: center;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.amount-display {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    background: rgba(26, 173, 25, 0.1);
    border-radius: 10px;
    border: 2px solid rgba(26, 173, 25, 0.2);
}

.amount-display .currency {
    font-size: 24px;
    color: #1aad19;
    margin-right: 5px;
    font-weight: bold;
}

.amount-display .amount {
    font-size: 32px;
    font-weight: bold;
    color: #1aad19;
    min-width: 80px;
}

.order-desc {
    color: #666;
    font-size: 16px;
}

/* 支付区域样式 */
.payment-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px 20px;
    border-radius: 15px;
    text-align: center;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.payment-status {
    margin-bottom: 30px;
}

.payment-icon {
    font-size: 64px;
    margin-bottom: 20px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.payment-status h3 {
    color: #333;
    font-size: 20px;
    margin-bottom: 10px;
    font-weight: 600;
}

.payment-status p {
    color: #666;
    font-size: 16px;
    margin-bottom: 0;
}

.payment-tips {
    background: rgba(26, 173, 25, 0.1);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid rgba(26, 173, 25, 0.2);
}

.payment-tips p {
    color: #1aad19;
    font-size: 14px;
    margin-bottom: 8px;
    text-align: left;
}

.payment-tips p:last-child {
    margin-bottom: 0;
}

.btn-success {
    background: #07c160;
    color: white;
    border: none;
    transition: background-color 0.3s ease;
}

.btn-success:hover {
    background: #06ad56;
}

.btn-success:active {
    background: #059c4f;
}

/* 用户主页样式 */
.home-content {
    padding: 20px;
}

.home-menu {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item:hover {
    background: rgba(26, 173, 25, 0.05);
}

.menu-item:active {
    background: rgba(26, 173, 25, 0.1);
}

.menu-icon {
    font-size: 32px;
    margin-right: 15px;
    width: 50px;
    text-align: center;
}

.menu-info {
    flex: 1;
}

.menu-info h3 {
    margin: 0 0 5px 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.menu-info p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.menu-arrow {
    color: #999;
    font-size: 18px;
    font-weight: bold;
}

/* 缴费记录页面样式 */
.records-content {
    padding: 20px;
}

.records-list {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.record-item {
    padding: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.record-item:last-child {
    border-bottom: none;
}

.record-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.record-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.record-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.record-status.success {
    background: #e8f5e8;
    color: #1aad19;
}

.record-status.pending {
    background: #fff3e0;
    color: #ff9800;
}

.record-details {
    margin-top: 10px;
}

.record-detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 14px;
}

.record-detail-row:last-child {
    margin-bottom: 0;
}

.record-detail-label {
    color: #666;
}

.record-detail-value {
    color: #333;
    font-weight: 500;
}

.record-amount {
    color: #1aad19;
    font-weight: 600;
    font-size: 16px;
}

/* 无记录状态 */
.no-records {
    text-align: center;
    padding: 60px 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.no-records-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.6;
}

.no-records p {
    color: #666;
    font-size: 16px;
    margin-bottom: 30px;
}
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

#qr-image {
    display: block;
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
}

.qr-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
}

.qr-tips p {
    color: #666;
    font-size: 14px;
    margin-bottom: 5px;
}

.payment-status {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.status-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.countdown {
    margin-top: 15px;
    font-size: 16px;
    color: #ff6b35;
}

#countdown-timer {
    font-weight: bold;
    font-size: 18px;
}

.payment-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.payment-actions .btn {
    flex: 1;
}

.order-info {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.order-info h3 {
    color: #333;
    font-size: 18px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
}

.info-row:not(:last-child) {
    border-bottom: 1px solid #f5f5f5;
}

.highlight {
    color: #1aad19;
    font-weight: bold;
}

/* 成功页面样式 */
.success-content {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px 30px;
    border-radius: 20px;
    text-align: center;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.success-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.success-content h2 {
    color: #1aad19;
    font-size: 28px;
    margin-bottom: 10px;
}

.success-content > p {
    color: #666;
    font-size: 16px;
    margin-bottom: 30px;
}

.success-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.success-actions {
    display: flex;
    gap: 15px;
}

.success-actions .btn {
    flex: 1;
}

/* Toast 提示样式 */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 15px 25px;
    border-radius: 25px;
    font-size: 16px;
    z-index: 9999;
    max-width: 80%;
    text-align: center;
    transition: opacity 0.3s ease;
}

.toast.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Modal 弹窗样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    padding: 20px;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    max-width: 400px;
    width: 100%;
    text-align: center;
}

.modal-content h3 {
    color: #333;
    font-size: 20px;
    margin-bottom: 15px;
}

.modal-content p {
    color: #666;
    font-size: 16px;
    margin-bottom: 25px;
    line-height: 1.5;
}

.modal-actions {
    display: flex;
    gap: 15px;
}

.modal-actions .btn {
    flex: 1;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    .auth-content {
        padding: 30px 20px;
    }
    
    .form {
        padding: 25px 15px;
    }
    
    .amount {
        font-size: 36px;
    }
    
    .success-content {
        padding: 30px 20px;
    }
    
    .success-actions {
        flex-direction: column;
    }
    
    .payment-actions {
        flex-direction: column;
    }
}

/* 调试面板样式 */
.debug-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    z-index: 10000;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

.debug-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #333;
    border-bottom: 1px solid #555;
}

.debug-header h3 {
    margin: 0;
    color: #fff;
}

.debug-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.debug-content {
    padding: 10px;
}

.debug-section {
    margin-bottom: 20px;
    border: 1px solid #555;
    border-radius: 4px;
    padding: 10px;
}

.debug-section h4 {
    margin: 0 0 10px 0;
    color: #4CAF50;
    font-size: 14px;
}

.debug-section p {
    margin: 5px 0;
    font-size: 11px;
    line-height: 1.4;
}

.debug-actions {
    margin-bottom: 10px;
}

.debug-btn {
    background: #2196F3;
    color: white;
    border: none;
    padding: 5px 10px;
    margin: 2px;
    border-radius: 3px;
    font-size: 11px;
    cursor: pointer;
}

.debug-btn:hover {
    background: #1976D2;
}

.debug-log {
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 3px;
    padding: 10px;
    max-height: 200px;
    overflow-y: auto;
    font-size: 10px;
    line-height: 1.3;
}

.debug-log .log-entry {
    margin-bottom: 5px;
    padding: 2px 0;
    border-bottom: 1px solid #333;
}

.debug-log .log-entry.error {
    color: #ff6b6b;
}

.debug-log .log-entry.warn {
    color: #ffa726;
}

.debug-log .log-entry.info {
    color: #4fc3f7;
}

.debug-log .log-entry.debug {
    color: #81c784;
}

.debug-toggle {
    position: fixed;
    top: 50px;
    right: 10px;
    width: 40px;
    height: 40px;
    background: rgba(255, 152, 0, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    z-index: 9999;
    user-select: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.debug-toggle:hover {
    background: rgba(255, 152, 0, 1);
    transform: scale(1.1);
}

/* 错误边框 */
.debug-error {
    border: 2px solid #ff6b6b !important;
    animation: errorShake 0.5s ease-in-out;
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* 隐藏类 */
.hidden {
    display: none !important;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* 微信浏览器特殊处理 */
body.wechat-browser {
    padding-bottom: env(safe-area-inset-bottom);
}

/* 开发模式样式 */
body.dev-mode {
    position: relative;
}

body.dev-mode::before {
    content: "开发模式";
    position: fixed;
    top: 10px;
    right: 10px;
    background: rgba(255, 193, 7, 0.9);
    color: #333;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 10000;
    font-weight: bold;
}

/* iOS Safari 安全区域适配 */
@supports (padding: max(0px)) {
    .container {
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }
}