/* 所有CSS样式都放在这里 */
:root {
    --primary-color: #1890ff;
    --primary-light: #40a9ff;
    --primary-dark: #096dd9;
    --danger-color: #ff4d4f;
    --warning-color: #faad14;
    --success-color: #52c41a;
    --text-main: #333;
    --text-sub: #666;
    --bg-light: #f5f7fa;
    --border-color: #eee;
    --card-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    --hover-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif; }
body { background-color: var(--bg-light); color: var(--text-main); height: 100vh; display: flex; flex-direction: column; overflow-x: hidden; }

/* 通用组件 */
.btn { padding: 10px 20px; border-radius: 8px; border: none; cursor: pointer; font-size: 14px; transition: all 0.3s; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn-primary { background: linear-gradient(135deg, var(--primary-color), var(--primary-dark)); color: white; box-shadow: 0 4px 12px rgba(24, 144, 255, 0.3); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(24, 144, 255, 0.4); opacity: 0.95; }
.btn-success { background: linear-gradient(135deg, var(--success-color), #389e0d); color: white; box-shadow: 0 4px 12px rgba(82, 196, 26, 0.3); }
.btn-outline { background-color: white; border: 2px solid var(--primary-color); color: var(--primary-color); }
.btn-outline:hover { background-color: rgba(24, 144, 255, 0.05); }
.btn-text { background: none; color: var(--primary-color); padding: 0; }
.btn-text:hover { color: var(--primary-dark); }

/* 表单样式 */
.form-item { margin-bottom: 20px; }
.form-item label { display: block; margin-bottom: 8px; font-weight: 600; color: var(--text-main); font-size: 14px; }
.form-item .required::after { content: " *"; color: var(--danger-color); }
.form-item input, .form-item select { 
    width: 100%; 
    padding: 12px 16px; 
    border: 2px solid #e8e8e8; 
    border-radius: 8px; 
    font-size: 15px;
    transition: all 0.3s;
    background-color: white;
}
.form-item input:focus, .form-item select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.1);
}
.form-item input::placeholder {
    color: #bfbfbf;
}

.password-strength { height: 6px; margin-top: 8px; border-radius: 3px; background: #f0f0f0; overflow: hidden; position: relative; }
.password-strength-bar { height: 100%; width: 0; transition: width 0.3s ease; position: absolute; left: 0; top: 0; }
.strength-weak { background: linear-gradient(to right, #ff4d4f, #ff7875); }
.strength-medium { background: linear-gradient(to right, #faad14, #ffc53d); }
.strength-strong { background: linear-gradient(to right, #52c41a, #73d13d); }

.error-message { color: var(--danger-color); font-size: 13px; margin-top: 6px; display: none; align-items: center; gap: 5px; }
.success-message { color: var(--success-color); font-size: 13px; margin-top: 6px; display: none; align-items: center; gap: 5px; }

/* 模态框样式 */
.modal-overlay { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(0,0,0,0.5); 
    z-index: 2000; 
    display: none; 
    align-items: center; 
    justify-content: center; 
}

.modal { 
    background: white; 
    padding: 32px; 
    border-radius: 16px; 
    width: 480px; 
    max-width: 90%; 
    max-height: 80vh; 
    overflow-y: auto; 
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* 布局控制 */
.page { display: none; flex: 1; flex-direction: column; }
.page.active { display: flex; }

/* 头部样式 */
.header { background: white; padding: 0 24px; height: 68px; display: flex; align-items: center; justify-content: space-between; box-shadow: 0 2px 12px rgba(0,0,0,0.06); position: sticky; top: 0; z-index: 100; }
.header-left { font-size: 18px; font-weight: bold; display: flex; align-items: center; gap: 12px; }
.header-left .platform-name { color: var(--primary-color); font-size: 22px; font-weight: 700; background: linear-gradient(135deg, var(--primary-color), #722ed1); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.header-right { display: flex; align-items: center; gap: 20px; }
.user-info { display: flex; align-items: center; gap: 12px; padding: 4px 12px; border-radius: 20px; transition: background 0.3s; }
.user-info:hover { background-color: rgba(0, 0, 0, 0.02); }
.avatar { width: 40px; height: 40px; background: linear-gradient(135deg, var(--primary-color), #722ed1); border-radius: 50%; display: flex; align-items: center; justify-content: center; overflow: hidden; color: white; font-weight: bold; font-size: 16px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); }

/* --- 登录页面 --- */
.login-container { 
    display: flex; 
    flex: 1; 
    align-items: center; 
    justify-content: center; 
    background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(24, 144, 255, 0.05) 0%, transparent 70%);
    z-index: 0;
}

.login-card { 
    background: white; 
    padding: 48px; 
    border-radius: 20px; 
    width: 480px; 
    max-width: 90%; 
    box-shadow: var(--card-shadow);
    position: relative;
    z-index: 1;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.login-card h2 { 
    margin-bottom: 12px; 
    color: var(--text-main); 
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    background: linear-gradient(135deg, var(--primary-color), #722ed1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-card p { 
    color: var(--text-sub); 
    margin-bottom: 36px; 
    text-align: center;
    font-size: 15px;
}

.role-selector { display: flex; gap: 16px; margin-bottom: 30px; }
.role-option { 
    flex: 1; 
    padding: 24px 16px; 
    border: 2px solid #f0f0f0; 
    border-radius: 12px; 
    cursor: pointer; 
    transition: all 0.3s; 
    text-align: center;
    background: white;
}
.role-option:hover { 
    border-color: var(--primary-light); 
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(24, 144, 255, 0.15);
}
.role-option.selected { 
    border-color: var(--primary-color); 
    background-color: rgba(24, 144, 255, 0.04);
    box-shadow: 0 6px 16px rgba(24, 144, 255, 0.15);
}
.role-option i { 
    font-size: 40px; 
    margin-bottom: 12px; 
    background: linear-gradient(135deg, var(--primary-color), #722ed1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.role-option h3 { 
    margin-bottom: 8px; 
    font-size: 16px;
    color: var(--text-main);
}
.role-option p { 
    font-size: 13px; 
    margin: 0; 
    color: var(--text-sub); 
    line-height: 1.5;
}

/* --- 注册页面 --- */
.register-container { 
    display: flex; 
    flex: 1; 
    align-items: center; 
    justify-content: center; 
    background: linear-gradient(135deg, #f0f7ff 0%, #e6f7ff 100%);
    position: relative;
    overflow: hidden;
}

.register-container::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(114, 46, 209, 0.05) 0%, transparent 70%);
    z-index: 0;
}

.register-card { 
    background: white; 
    padding: 48px; 
    border-radius: 20px; 
    width: 520px; 
    max-width: 90%; 
    box-shadow: var(--card-shadow);
    position: relative;
    z-index: 1;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.register-card h2 { 
    margin-bottom: 12px; 
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    background: linear-gradient(135deg, #722ed1, var(--primary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.register-card p { 
    color: var(--text-sub); 
    margin-bottom: 36px; 
    text-align: center;
    font-size: 15px;
}

/* --- 页面1: 我的俱乐部 --- */
.club-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); 
    gap: 24px; 
    padding: 32px; 
}

.club-card { 
    background: white; 
    border-radius: 16px; 
    padding: 24px; 
    box-shadow: var(--card-shadow); 
    transition: all 0.4s;
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.club-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), #722ed1);
}

.club-card:hover { 
    transform: translateY(-8px); 
    box-shadow: var(--hover-shadow);
}

.club-card h3 { 
    margin-bottom: 12px; 
    font-size: 20px;
    color: var(--text-main);
    font-weight: 700;
}

.club-tags { margin-bottom: 20px; display: flex; flex-wrap: wrap; gap: 8px; }
.tag { 
    background: linear-gradient(135deg, #e6f7ff, #bae7ff); 
    color: var(--primary-dark); 
    padding: 4px 12px; 
    border-radius: 20px; 
    font-size: 13px; 
    font-weight: 500;
}

.club-actions { display: flex; gap: 12px; margin-top: 20px; }

.empty-state { 
    text-align: center; 
    padding: 80px 20px; 
    color: var(--text-sub);
    grid-column: 1 / -1;
}

.empty-state i { 
    font-size: 64px; 
    margin-bottom: 20px; 
    color: #e8e8e8;
    opacity: 0.7;
}

.empty-state h3 {
    font-size: 20px;
    margin-bottom: 12px;
    color: var(--text-sub);
}

/* --- 页面2: 视频列表 --- */
.video-list { 
    padding: 32px; 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); 
    gap: 24px; 
}

.video-card { 
    background: white; 
    border-radius: 16px; 
    overflow: hidden; 
    position: relative; 
    cursor: pointer; 
    box-shadow: var(--card-shadow);
    transition: all 0.4s;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.video-card:hover { 
    transform: translateY(-6px); 
    box-shadow: var(--hover-shadow);
}

.video-cover { 
    height: 160px; 
    background: linear-gradient(135deg, #333, #555); 
    position: relative; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    color: white; 
    overflow: hidden;
}

.video-cover::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(24, 144, 255, 0.2), rgba(114, 46, 209, 0.2));
}

.video-cover i { 
    font-size: 48px; 
    z-index: 1;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.video-info { padding: 20px; }
.video-title { 
    font-weight: 600; 
    margin-bottom: 8px; 
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis;
    font-size: 16px;
    color: var(--text-main);
}

.video-meta { 
    font-size: 13px; 
    color: var(--text-sub); 
    display: flex; 
    justify-content: space-between;
}

/* --- 页面3: 任务页 --- */
.task-page-container { padding: 32px; }

/* 任务页头部样式 */
.task-page-header {
    background: white;
    padding: 28px;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    margin-bottom: 32px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.task-page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), #722ed1);
}

.task-header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.task-header-left {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.task-video-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.task-video-info {
    font-size: 15px;
    color: var(--text-sub);
    display: flex;
    align-items: center;
    gap: 12px;
}

.task-permission-tag {
    display: inline-block;
    background: linear-gradient(135deg, #f6ffed, #d9f7be);
    color: #389e0d;
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 20px;
    white-space: nowrap;
    width: fit-content;
    font-weight: 500;
}

.task-list-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

.task-card-item {
    background: white;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
    padding: 24px;
    transition: all 0.4s ease;
    position: relative;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 240px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.task-card-item:hover {
    transform: translateY(-8px);
    box-shadow: var(--hover-shadow);
}

.task-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.task-card-title {
    font-weight: 700;
    font-size: 18px;
    color: var(--text-main);
}

.task-card-status {
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 500;
}

.task-status-incomplete {
    background: linear-gradient(135deg, #fafafa, #f0f0f0);
    color: var(--text-sub);
}

.task-status-complete {
    background: linear-gradient(135deg, #f6ffed, #d9f7be);
    color: #389e0d;
}

.task-card-description {
    font-size: 15px;
    color: var(--text-sub);
    margin-bottom: 20px;
    flex-grow: 1;
    line-height: 1.6;
}

.task-card-actions {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.action-buttons {
    display: flex;
    gap: 12px;
    width: 100%;
}

.action-buttons .btn {
    flex: 1;
    padding: 12px 16px;
}

/* 通知消息 */
.task-notification {
    position: fixed;
    top: 24px;
    right: 24px;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 1100;
    max-width: 400px;
    display: none;
    animation: slideIn 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.task-notification.success {
    background: linear-gradient(135deg, rgba(82, 196, 26, 0.95), rgba(56, 158, 13, 0.95));
    color: white;
    border: 1px solid rgba(82, 196, 26, 0.3);
}

.task-notification.info {
    background: linear-gradient(135deg, rgba(24, 144, 255, 0.95), rgba(9, 109, 217, 0.95));
    color: white;
    border: 1px solid rgba(24, 144, 255, 0.3);
}

.task-notification.error {
    background: linear-gradient(135deg, rgba(255, 77, 79, 0.95), rgba(207, 19, 34, 0.95));
    color: white;
    border: 1px solid rgba(255, 77, 79, 0.3);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .task-header-content {
        flex-direction: column;
        gap: 20px;
    }
    
    .task-video-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .task-list-container {
        grid-template-columns: 1fr;
    }
    
    .task-card-actions {
        flex-direction: column;
        gap: 12px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .role-selector {
        flex-direction: column;
    }
    
    .login-card, .register-card {
        padding: 32px 24px;
    }
    
    .club-grid, .video-list {
        padding: 20px;
    }
}

/* 装饰元素 */
.floating-shape {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(24, 144, 255, 0.1), rgba(114, 46, 209, 0.1));
    z-index: 0;
}

.shape-1 {
    width: 200px;
    height: 200px;
    top: -100px;
    left: -100px;
}

.shape-2 {
    width: 150px;
    height: 150px;
    bottom: -75px;
    right: -75px;
}

/* 小按钮样式 */
.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

/* 加载动画 */
.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 错误页面 */
.error-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    text-align: center;
    padding: 20px;
}

.error-page i {
    font-size: 80px;
    color: #ff4d4f;
    margin-bottom: 20px;
}

.error-page h1 {
    font-size: 32px;
    margin-bottom: 10px;
    color: var(--text-main);
}

.error-page p {
    font-size: 16px;
    color: var(--text-sub);
    margin-bottom: 30px;
}