/* 公共基础样式 - 从微信小程序 rpx 转换为 Web rem/vh */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #1677ff;
    --primary-gradient: linear-gradient(90deg, #3b82f6, #a855f7);
    --success: #10b981;
    --warning: #ff9500;
    --danger: #ef4444;
    --text-primary: #333;
    --text-secondary: #666;
    --text-muted: #999;
    --bg-page: #F5F7FA;
    --bg-card: #ffffff;
    --border-color: #e5e7eb;
    --radius: 16px;
    --radius-lg: 20px;
    --shadow: 0 2px 12px rgba(0,0,0,0.05);
}

html, body {
    font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

/* 通用返回导航 */
.nav-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

.nav-back {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    color: var(--primary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: background 0.2s;
}

.nav-back:hover {
    background: rgba(22, 119, 255, 0.08);
}

.nav-title {
    flex: 1;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.nav-placeholder {
    width: 60px;
}

/* Toast 提示 */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.75);
    color: #fff;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    z-index: 10000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.toast.show {
    opacity: 1;
}

/* Loading 遮罩 */
.loading-mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-box {
    background: #fff;
    padding: 24px 32px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--text-secondary);
    box-shadow: var(--shadow);
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #e5e7eb;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 淡入上移动画 */
.fade-in-up {
    animation: fadeInUp 0.4s ease forwards;
    opacity: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 确认对话框 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
}

.modal-box {
    background: #fff;
    border-radius: 20px;
    padding: 28px 24px 20px;
    width: 80%;
    max-width: 320px;
    text-align: center;
}

.modal-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.modal-msg {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.modal-btns {
    display: flex;
    gap: 12px;
}

.modal-btns button {
    flex: 1;
    padding: 10px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: opacity 0.2s;
}

.modal-btns button:hover { opacity: 0.85; }
.modal-btns .btn-cancel { background: #f0f0f0; color: var(--text-primary); }
.modal-btns .btn-confirm { background: var(--primary); color: #fff; }

/* 响应式 */
@media (min-width: 768px) {
    body {
        max-width: 480px;
        margin: 0 auto;
        box-shadow: 0 0 30px rgba(0,0,0,0.08);
    }
}