/* ============================================
   common.css - 全局共享样式
   所有页面通用，不包含任何 body/背景/nav 等页面专属样式
   ============================================ */

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

/* 全局字体 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* 通用按钮样式 */
button {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ============================================
   通用 Badge
   ============================================ */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}
.badge-info    { background: #e3f2fd; color: #1565c0; }
.badge-success { background: #e8f5e9; color: #2e7d32; }
.badge-warning { background: #fff3e0; color: #ef6c00; }
.badge-error   { background: #ffebee; color: #c62828; }
.badge-purple  { background: #f3e5f5; color: #6a1b9a; }

/* ============================================
   通用状态样式
   ============================================ */
.loading {
    text-align: center;
    padding: 50px;
    color: #888;
}

.empty {
    text-align: center;
    padding: 50px;
    color: #999;
    font-size: 16px;
}

/* ============================================
   Modal 弹窗（二次验证等）
   ============================================ */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}
.modal-overlay.show { display: flex; }

.modal-box {
    background: white;
    border-radius: 12px;
    padding: 30px;
    width: 360px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal-box h3 { margin-bottom: 15px; color: #333; }
.modal-box p { font-size: 14px; color: #666; margin-bottom: 15px; }
.modal-box input {
    width: 100%; padding: 10px 12px;
    border: 2px solid #ddd; border-radius: 8px;
    font-size: 16px; box-sizing: border-box; margin-bottom: 15px;
}
.modal-box input:focus { border-color: #667eea; outline: none; }

.modal-error {
    color: #dc3545;
    font-size: 12px;
    margin-top: -10px;
    margin-bottom: 10px;
    display: none;
}
.modal-error.show { display: block; }

.modal-btns { display: flex; gap: 10px; }
.modal-btns button {
    flex: 1; padding: 10px; border: none; border-radius: 8px;
    cursor: pointer; font-size: 14px;
}
.modal-ok { background: #667eea; color: white; }
.modal-cancel { background: #eee; color: #333; }
.modal-ok:hover { background: #5a6fd6; }
.modal-cancel:hover { background: #ddd; }

/* ============================================
   Lightbox
   ============================================ */
.lightbox {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}
.lightbox.show,
.lightbox.active { display: flex; }

.lightbox img, .lightbox video {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 8px;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 20px;
    color: white;
    font-size: 32px;
    cursor: pointer;
    background: none;
    border: none;
    line-height: 1;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 50px;
    color: #fff;
    cursor: pointer;
    padding: 20px;
}
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

/* ============================================
   Toast 通知
   ============================================ */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(40, 167, 69, 0.95);
    color: white;
    padding: 12px 28px;
    border-radius: 24px;
    font-size: 15px;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ============================================
   响应式（仅通用部分）
   ============================================ */
@media (max-width: 600px) {
    .modal-box { padding: 20px; width: 90vw; }
}
