/**
 * 回忆相册 - 公共样式
 * 包含全局样式、Toast组件、响应式基础等
 */

/* ========== 全局重置 ========== */
* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
    -webkit-tap-highlight-color: transparent;
}

/* ========== 滚动条美化 ========== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

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

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e0e0e0;
    border-top: 2px solid #0d6efd;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ========== 卡片通用样式 ========== */
.card-hover {
    transition: transform 0.2s, box-shadow 0.2s;
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

/* ========== Toast 提示（由JS动态生成） ========== */
#toastContainer {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    max-width: 90%;
    text-align: center;
    pointer-events: none;
    transition: opacity 0.3s;
    opacity: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

/* ========== 工具类 ========== */
.text-ellipsis {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========== 图片模糊保护（防截图时使用） ========== */
.blur-protect {
    filter: blur(30px);
    transition: filter 0.5s ease;
}

.blur-protect.clear {
    filter: blur(0);
}

/* ========== 响应式辅助 ========== */
@media (max-width: 768px) {
    .hide-on-mobile {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .hide-on-phone {
        display: none !important;
    }
}

/* ========== 图片占位 ========== */
.image-placeholder {
    background: linear-gradient(135deg, #f5f5f5 25%, #e0e0e0 50%, #f5f5f5 75%);
    background-size: 200% 200%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ========== 权限提示 ========== */
.auth-error {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.auth-error i {
    font-size: 4rem;
    display: block;
    margin-bottom: 20px;
    color: #ddd;
}

/* ========== 管理端卡片统计 ========== */
.stat-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-4px);
}

.stat-card .stat-icon {
    font-size: 2.5rem;
    opacity: 0.3;
    float: right;
}

.stat-card .stat-number {
    font-size: 2rem;
    font-weight: bold;
    margin: 0;
}

.stat-card .stat-label {
    color: #888;
    font-size: 0.9rem;
    margin: 0;
}

/* ========== 模态框内图片查看 ========== */
.modal-fullscreen .modal-content {
    background: rgba(0,0,0,0.95);
}

.modal-fullscreen .modal-header {
    border: none;
    padding: 16px;
}

.modal-fullscreen .modal-body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.modal-fullscreen .modal-body img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

/* ========== 上传进度条 ========== */
.upload-progress {
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
    transition: width 0.3s;
}

.upload-progress .progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #0d6efd, #0dcaf0);
    border-radius: 2px;
    transition: width 0.3s;
}

/* ========== 封禁页面样式 ========== */
.block-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    padding: 20px;
}

.block-card {
    background: white;
    border-radius: 16px;
    padding: 40px;
    max-width: 500px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
}

.block-card .block-icon {
    font-size: 5rem;
    color: #dc3545;
    margin-bottom: 20px;
}

.block-card .block-name {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.block-card .block-reason {
    color: #666;
    margin-bottom: 20px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
}

.block-card .block-until {
    color: #999;
    font-size: 0.9rem;
}