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

:root {
    --primary-color: #007AFF;
    --primary-dark: #0051D5;
    --secondary-color: #34C759;
    --danger-color: #FF3B30;
    --text-primary: #000000;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    --background: #F5F5F7;
    --card-background: #FFFFFF;
    --border-color: #E5E5EA;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
    --border-radius: 12px;
    --spacing: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: var(--spacing);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 头部 */
.header {
    text-align: center;
    padding: 32px var(--spacing);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing);
    box-shadow: var(--shadow);
}

.header h1 {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
}

.subtitle {
    font-size: 16px;
    opacity: 0.9;
}

/* 主要内容 */
.main-content {
    flex: 1;
}

.section {
    background: var(--card-background);
    border-radius: var(--border-radius);
    padding: 24px;
    margin-bottom: var(--spacing);
    box-shadow: var(--shadow);
}

.section h2,
.section h3 {
    margin-bottom: 20px;
    color: var(--text-primary);
    font-size: 20px;
}

.hidden {
    display: none !important;
}

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

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

.hint {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 8px;
}

.input-field {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s;
    background: white;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

/* 按钮 */
.btn {
    padding: 14px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    margin-top: 8px;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #28A745;
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

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

.button-group {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.button-group .btn {
    flex: 1;
    margin-top: 0;
}

/* 支付信息 */
.payment-info {
    background: var(--background);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.info-row:last-child {
    border-bottom: none;
}

.info-row span:first-child {
    color: var(--text-secondary);
}

.info-row span:last-child {
    font-weight: 500;
    color: var(--text-primary);
}

.amount {
    color: var(--primary-color);
    font-size: 18px;
    font-weight: 600;
}

/* 二维码 */
.qr-code-container {
    text-align: center;
    padding: 24px;
    background: var(--background);
    border-radius: 8px;
    margin-bottom: 20px;
}

.qr-code-container h3 {
    margin-bottom: 20px;
    color: var(--text-primary);
}

.qr-code {
    width: 250px;
    height: 250px;
    margin: 0 auto 16px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.qr-code img {
    max-width: 100%;
    max-height: 100%;
}

.qr-hint {
    color: var(--text-secondary);
    font-size: 14px;
}

.loading {
    color: var(--text-tertiary);
    font-size: 14px;
}

/* 支付状态 */
.payment-status {
    text-align: center;
    padding: 20px;
    background: var(--background);
    border-radius: 8px;
    margin-bottom: 20px;
}

.status-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.status-text {
    color: var(--text-secondary);
    font-size: 16px;
}

/* 成功界面 */
.success-content {
    text-align: center;
    padding: 20px;
}

.success-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.success-content h2 {
    color: var(--secondary-color);
    margin-bottom: 24px;
}

.success-info {
    background: var(--background);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    text-align: left;
}

.success-note {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
    padding: 12px;
    background: rgba(52, 199, 89, 0.1);
    border-radius: 8px;
}

/* 查询结果 */
.query-result {
    margin-top: 20px;
    padding: 16px;
    background: var(--background);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.query-result.error {
    border-left-color: var(--danger-color);
    background: rgba(255, 59, 48, 0.1);
}

/* 联系信息 */
.contact-info {
    background: var(--background);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
}

.contact-info p {
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.contact-info strong {
    color: var(--primary-color);
}

/* 消息提示 */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    z-index: 1000;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* 底部 */
.footer {
    text-align: center;
    padding: 24px;
    color: var(--text-tertiary);
    font-size: 12px;
}

/* 导航链接 */
.nav-link {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    background: rgba(255,255,255,0.2);
    border-radius: 6px;
    font-size: 14px;
    display: inline-block;
    transition: all 0.3s;
    margin: 0 4px;
}

.nav-link:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-1px);
}

/* 卡片悬停效果 */
.section {
    transition: transform 0.2s, box-shadow 0.2s;
}

.section:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* 输入框动画 */
.input-field {
    transition: all 0.3s ease;
}

.input-field:hover {
    border-color: var(--primary-color);
}

/* 按钮禁用状态 */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* 加载动画 */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .container {
        padding: 12px;
    }

    .section {
        padding: 16px;
    }

    .header h1 {
        font-size: 24px;
    }

    .qr-code {
        width: 200px;
        height: 200px;
    }
    
    .nav-link {
        font-size: 12px;
        padding: 6px 12px;
    }
}

/* 优化：更好的视觉反馈 */
.btn:active {
    transform: translateY(0) !important;
}

/* 优化：输入框错误状态 */
.input-field:invalid:not(:placeholder-shown) {
    border-color: var(--danger-color);
}

.input-field:valid:not(:placeholder-shown) {
    border-color: var(--secondary-color);
}

/* 优化：加载状态 */
.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* 优化：卡片阴影效果 */
.section {
    transition: all 0.3s ease;
}

.section:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

/* 优化：按钮组间距 */
.button-group {
    gap: 12px;
}

/* 优化：表单组间距 */
.form-group + .form-group {
    margin-top: 20px;
}

/* 菜单按钮 */
.menu-toggle-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1001;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    width: 48px;
    height: 48px;
    font-size: 24px;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-toggle-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.menu-toggle-btn:active {
    transform: scale(0.95);
}

/* 导航面板 */
.navigation-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    color: white;
    z-index: 1002;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 2px 0 16px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.navigation-panel.panel-open {
    transform: translateX(0);
}

.nav-panel-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-panel-header h3 {
    margin: 0;
    font-size: 20px;
    color: white;
}

.close-nav-btn {
    background: none;
    border: none;
    color: white;
    font-size: 32px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background 0.2s;
}

.close-nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.nav-panel-menu {
    flex: 1;
    padding: 16px 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.nav-panel-menu::-webkit-scrollbar {
    width: 4px;
}

.nav-panel-menu::-webkit-scrollbar-track {
    background: transparent;
}

.nav-panel-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.nav-menu-item {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    margin: 4px 8px;
    border-radius: 6px;
}

.nav-menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-left-color: var(--primary-color);
}

.nav-menu-item.active {
    background: rgba(0, 122, 255, 0.2);
    border-left-color: #007AFF;
    color: white;
    font-weight: 500;
}

.nav-icon {
    font-size: 20px;
    margin-right: 12px;
    width: 24px;
    text-align: center;
}

.nav-text {
    font-size: 14px;
    white-space: nowrap;
}

/* 导航面板遮罩 */
.nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.nav-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .navigation-panel {
        width: 260px;
    }
}

