/**
 * 一人一册（一人一册）专用样式
 * @author  云蓝图科技
 * @date    2024年12月25日
 * @version 1.0.1
 * 
 * 设计规范：
 * - 字体：正文 14px-16px
 * - 间距：8px 网格系统
 * - 适配：320px - 750px
 */

/* ================================
   CSS 变量定义
================================ */
:root {
    /* 主题色 */
    --wrce-primary: #6366f1;
    --wrce-primary-light: #818cf8;
    --wrce-primary-dark: #4f46e5;
    --wrce-primary-rgb: 99, 102, 241;
    
    /* 背景色 */
    --wrce-bg: #f8fafc;
    --wrce-bg-card: #ffffff;
    --wrce-bg-dark: #1e293b;
    
    /* 文字色 */
    --wrce-text: #334155;
    --wrce-text-light: #64748b;
    --wrce-text-muted: #94a3b8;
    
    /* 边框色 */
    --wrce-border: #e2e8f0;
    --wrce-border-light: #f1f5f9;
    
    /* 功能色 */
    --wrce-success: #10b981;
    --wrce-warning: #f59e0b;
    --wrce-danger: #ef4444;
    --wrce-info: #3b82f6;
    
    /* 间距（8px 网格系统）*/
    --wrce-spacing-xs: 4px;
    --wrce-spacing-sm: 8px;
    --wrce-spacing: 16px;
    --wrce-spacing-lg: 24px;
    --wrce-spacing-xl: 32px;
    
    /* 圆角 */
    --wrce-radius-sm: 8px;
    --wrce-radius: 12px;
    --wrce-radius-lg: 16px;
    --wrce-radius-xl: 20px;
    
    /* 阴影 */
    --wrce-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --wrce-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --wrce-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    /* 底部导航高度 */
    --wrce-tabbar-height: 56px;
    --wrce-header-height: 50px;
    
    /* 安全区域 */
    --wrce-safe-area-top: env(safe-area-inset-top, 0px);
    --wrce-safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --wrce-safe-area-left: env(safe-area-inset-left, 0px);
    --wrce-safe-area-right: env(safe-area-inset-right, 0px);
}

/* ================================
   基础样式
================================ */
.wrce-body {
    background: var(--wrce-bg);
    color: var(--wrce-text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

.wrce-html {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.wrce-main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.wrce-content {
    flex: 1;
    padding: var(--wrce-spacing);
    padding-bottom: calc(var(--wrce-tabbar-height) + var(--wrce-spacing));
}

.wrce-content-home {
    padding-top: 0;
}

.wrce-content-full {
    padding: 0;
    padding-bottom: 0;
}

/* ================================
   顶部导航
================================ */
.wrce-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--wrce-header-height);
    padding: 0 var(--wrce-spacing);
    background: var(--wrce-bg-card);
    border-bottom: 1px solid var(--wrce-border-light);
    position: sticky;
    top: 0;
    z-index: 100;
}

.wrce-header-back .wrce-header-left,
.wrce-header-back .wrce-header-right {
    width: 40px;
}

.wrce-header-back .wrce-header-title {
    flex: 1;
    text-align: center;
}

.wrce-header-title h1 {
    font-size: 17px;
    font-weight: 600;
    color: var(--wrce-text);
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wrce-back-btn,
.wrce-home-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    color: var(--wrce-text);
    font-size: 24px;
    text-decoration: none;
}

/* 首页顶部导航 */
.wrce-header-home {
    background: linear-gradient(135deg, var(--wrce-primary) 0%, var(--wrce-primary-dark) 100%);
    border-bottom: none;
}

.wrce-header-logo a {
    display: flex;
    align-items: center;
    color: #fff;
    text-decoration: none;
}

.wrce-logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    margin-right: 8px;
    font-size: 18px;
}

.wrce-logo-text {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 1px;
}

.wrce-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.wrce-search-btn,
.wrce-notify-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: #fff;
    font-size: 20px;
    text-decoration: none;
    position: relative;
}

.wrce-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: var(--wrce-danger);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    line-height: 16px;
    text-align: center;
    border-radius: 8px;
}

/* ================================
   底部导航栏
================================ */
.wrce-tabbar {
    position: fixed;
    bottom: 0;
    height: var(--wrce-tabbar-height);
    background: var(--wrce-bg-card);
    border-top: 1px solid var(--wrce-border-light);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 200;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
}

.wrce-tabbar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    color: var(--wrce-text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.wrce-tabbar-item i {
    font-size: 22px;
    margin-bottom: 2px;
}

.wrce-tabbar-item span {
    font-size: 10px;
}

.wrce-tabbar-item.active {
    color: var(--wrce-primary);
}

/* 上传按钮特殊样式 */
.wrce-tabbar-upload {
    position: relative;
}

.wrce-tabbar-upload i {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--wrce-primary) 0%, var(--wrce-primary-dark) 100%);
    color: #fff;
    border-radius: 50%;
    font-size: 20px;
    margin-bottom: 0;
    margin-top: -20px;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.wrce-tabbar-upload span {
    margin-top: 4px;
}

.wrce-tabbar-upload.active i {
    background: linear-gradient(135deg, var(--wrce-primary-dark) 0%, var(--wrce-primary) 100%);
}

/* ================================
   轮播图
================================ */
.wrce-banner {
    margin: 0 var(--wrce-spacing);
    margin-top: var(--wrce-spacing);
    border-radius: var(--wrce-radius);
    overflow: hidden;
}

.wrce-swiper {
    border-radius: var(--wrce-radius);
}

.wrce-swiper img {
    width: 100%;
    height: auto;
    display: block;
}

.wrce-pagination .swiper-pagination-bullet {
    background: #fff;
    opacity: 0.5;
}

.wrce-pagination .swiper-pagination-bullet-active {
    opacity: 1;
    background: var(--wrce-primary);
}

/* ================================
   卡片样式
================================ */
.wrce-card {
    background: var(--wrce-bg-card);
    border-radius: var(--wrce-radius);
    padding: var(--wrce-spacing);
    margin-bottom: var(--wrce-spacing);
    box-shadow: var(--wrce-shadow);
}

.wrce-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--wrce-text);
    margin-bottom: var(--wrce-spacing-sm);
}

/* ================================
   网格布局
================================ */
.wrce-grid {
    display: grid;
    gap: var(--wrce-spacing-sm);
}

.wrce-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.wrce-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.wrce-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* ================================
   照片网格
================================ */
.wrce-photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

.wrce-photo-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: var(--wrce-radius-sm);
}

.wrce-photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ================================
   相册卡片
================================ */
.wrce-album-card {
    background: var(--wrce-bg-card);
    border-radius: var(--wrce-radius);
    overflow: hidden;
    box-shadow: var(--wrce-shadow);
}

.wrce-album-cover {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
}

.wrce-album-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wrce-album-count {
    position: absolute;
    bottom: 8px;
    right: 8px;
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 12px;
    border-radius: 4px;
}

.wrce-album-info {
    padding: 12px;
}

.wrce-album-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--wrce-text);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wrce-album-desc {
    font-size: 12px;
    color: var(--wrce-text-muted);
}

/* ================================
   人物头像
================================ */
.wrce-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--wrce-border-light);
}

.wrce-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wrce-avatar-sm {
    width: 40px;
    height: 40px;
}

.wrce-avatar-lg {
    width: 80px;
    height: 80px;
}

/* ================================
   按钮样式
================================ */
.wrce-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 24px;
    font-size: 15px;
    font-weight: 500;
    border-radius: var(--wrce-radius-sm);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.wrce-btn-primary {
    background: linear-gradient(135deg, var(--wrce-primary) 0%, var(--wrce-primary-dark) 100%);
    color: #fff;
}

.wrce-btn-primary:active {
    transform: scale(0.98);
}

.wrce-btn-block {
    display: flex;
    width: 100%;
}

/* ================================
   表单样式
================================ */
.wrce-form-group {
    margin-bottom: var(--wrce-spacing);
}

.wrce-form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--wrce-text);
    margin-bottom: var(--wrce-spacing-sm);
}

.wrce-form-input {
    width: 100%;
    height: 44px;
    padding: 0 var(--wrce-spacing);
    font-size: 15px;
    color: var(--wrce-text);
    background: var(--wrce-bg);
    border: 1px solid var(--wrce-border);
    border-radius: var(--wrce-radius-sm);
    outline: none;
    transition: border-color 0.2s;
}

.wrce-form-input:focus {
    border-color: var(--wrce-primary);
}

/* ================================
   空状态
================================ */
.wrce-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--wrce-text-muted);
}

.wrce-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.wrce-empty-text {
    font-size: 14px;
}

/* ================================
   加载状态
================================ */
.wrce-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.wrce-loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--wrce-border);
    border-top-color: var(--wrce-primary);
    border-radius: 50%;
    animation: wrce-spin 0.8s linear infinite;
}

@keyframes wrce-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ================================
   工具类
================================ */
.wrce-text-center { text-align: center; }
.wrce-text-right { text-align: right; }
.wrce-text-muted { color: var(--wrce-text-muted); }
.wrce-text-primary { color: var(--wrce-primary); }

.wrce-mt-sm { margin-top: var(--wrce-spacing-sm); }
.wrce-mt { margin-top: var(--wrce-spacing); }
.wrce-mt-lg { margin-top: var(--wrce-spacing-lg); }

.wrce-mb-sm { margin-bottom: var(--wrce-spacing-sm); }
.wrce-mb { margin-bottom: var(--wrce-spacing); }
.wrce-mb-lg { margin-bottom: var(--wrce-spacing-lg); }

.wrce-flex { display: flex; }
.wrce-flex-center { align-items: center; justify-content: center; }
.wrce-flex-between { justify-content: space-between; }

