/* =============================================================
   蓝果吧 · 基础样式（变量 + 重置 + 通用组件）
   ============================================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

:root {
    --primary: #4a6cf7;
    --primary-dark: #3a5ae0;
    --primary-light: #eef2ff;
    --primary-light-2: #e0e7ff;
    --text-primary: #1a202c;
    --text-secondary: #718096;
    --border: #e2e8f0;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);
    --card-radius: 16px;
    --container-padding: 16px;
    --transition: all 0.3s ease;
    --bg-white-transparent: rgba(255, 255, 255, 0.75);
    --danger: #e74c3c;
    --success: #27ae60;
    --warning: #f39c12;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    background: url('/api/bg.php') no-repeat center center fixed;
    background-size: cover;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding-top: 20px;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
}

button {
    cursor: pointer;
    border: none;
    background: none;
}

ul, ol {
    list-style: none;
}

h1, h2, h3, h4 {
    font-weight: 700;
}

/* ---------------- 工具类 ---------------- */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt10 { margin-top: 10px; }
.mt20 { margin-top: 20px; }
.mb20 { margin-bottom: 20px; }

/* 页面淡入 */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ---------------- 加载遮罩 ---------------- */
.loading-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.92);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}
.loading-overlay.show { display: flex; }
.loading-content {
    text-align: center;
    background: #fff;
    padding: 34px 44px;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    position: relative;
    max-width: 90vw;
}
.loading-close {
    position: absolute;
    top: 12px; right: 16px;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    line-height: 1;
}
.loading-spinner {
    width: 44px; height: 44px;
    margin: 0 auto 16px;
    border: 4px solid var(--primary-light);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { color: var(--text-secondary); font-size: 15px; }

/* ---------------- 模态框（图片） ---------------- */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 9000;
    background: rgba(0, 0, 0, 0.8);
    align-items: center;
    justify-content: center;
}
.modal.show { display: flex; }
.modal-content {
    position: relative;
    max-width: 92vw;
    max-height: 92vh;
    padding: 0;
    background: transparent;
}
.modal-content img {
    max-width: 92vw;
    max-height: 88vh;
    border-radius: 12px;
    display: block;
    margin: 0 auto;
}
.modal .close {
    position: absolute;
    top: 10px; right: 10px;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 20px;
    line-height: 36px;
    text-align: center;
    cursor: pointer;
    z-index: 3;
    border: 2px solid rgba(255,255,255,0.4);
    transition: background .2s, transform .2s;
}
.modal .close:hover { background: rgba(220, 40, 40, 0.9); transform: scale(1.1); }

/* ---------------- 确认对话框 ---------------- */
.confirm-modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 9500;
    background: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
}
.confirm-modal.show { display: flex; }
.confirm-content {
    background: #fff;
    border-radius: 20px;
    padding: 28px 26px;
    max-width: 320px;
    width: 90%;
    text-align: center;
    box-shadow: var(--shadow-lg);
}
.confirm-content h3 { margin-bottom: 12px; color: var(--text-primary); }
.confirm-content p { color: var(--text-secondary); margin-bottom: 20px; font-size: 15px; word-break: break-all; }
.confirm-buttons { display: flex; gap: 12px; justify-content: center; }
.confirm-btn {
    padding: 10px 26px;
    border-radius: 40px;
    font-size: 15px;
    font-weight: 600;
    transition: var(--transition);
    border: 1px solid var(--border);
    background: #f4f6f8;
    color: var(--text-primary);
}
.confirm-btn:hover { background: #eaecef; }
.confirm-btn.confirm {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.confirm-btn.confirm:hover { background: var(--primary-dark); }

/* ---------------- Toast 提示 ---------------- */
.toast {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: rgba(0, 0, 0, 0.82);
    color: #fff;
    padding: 14px 26px;
    border-radius: 40px;
    font-size: 15px;
    z-index: 20000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s ease;
    max-width: 80vw;
    text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
