/* ==================== 全局APP化设置 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* 禁止双击缩放 */
    touch-action: manipulation;
    /* 禁止选择文本 */
    -webkit-user-select: none;
    user-select: none;
    /* 禁止iOS长按菜单 */
    -webkit-touch-callout: none;
    /* 去除点击高亮 */
    -webkit-tap-highlight-color: transparent;
}

/* 允许输入框选择文本 */
input, textarea {
    -webkit-user-select: text;
    user-select: text;
}

:root {
    --primary-color: #2196F3;
    --secondary-color: #ffffff;
    --text-color: #333333;
    --text-muted: #999999;
    --border-color: #e0e0e0;
    --bg-color: #f5f5f5;
    --success-color: #4CAF50;
    --warning-color: #FF9800;
    --danger-color: #F44336;
    --bottom-nav-height: 60px;
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

html {
    /* 防止橡皮筋效果 */
    overscroll-behavior: none;
    /* 平滑滚动 */
    scroll-behavior: smooth;
    /* 固定字体大小，防止横屏放大 */
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-color);
    background: var(--bg-color);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* 防止页面被拉动 */
    overscroll-behavior-y: none;
    /* 修复iOS Safari的100vh问题 */
    min-height: 100vh;
    min-height: -webkit-fill-available;
    position: relative;
    /* 底部留出导航栏空间 */
    padding-bottom: calc(var(--bottom-nav-height) + var(--safe-area-bottom));
}

a {
    text-decoration: none;
    color: inherit;
    /* 去除链接点击延迟 */
    -webkit-tap-highlight-color: transparent;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
    /* 防止按钮文字被选中 */
    -webkit-user-select: none;
    user-select: none;
}

input, textarea, select {
    font-family: inherit;
    outline: none;
    /* iOS圆角和阴影移除 */
    -webkit-appearance: none;
    appearance: none;
    border-radius: 0;
}

img {
    /* 防止图片被拖动 */
    -webkit-user-drag: none;
    user-drag: none;
    pointer-events: none;
}

/* ==================== 顶部导航 ==================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
    /* 适配刘海屏 */
    padding-top: env(safe-area-inset-top, 0);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    height: 56px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Logo图标（方形） */
.logo-icon {
    width: 46px;
    height: 46px;
    min-width: 46px;
    min-height: 46px;
    max-width: 46px;
    max-height: 46px;
    flex-shrink: 0;
    overflow: hidden;
}

.logo-icon img {
    width: 46px !important;
    height: 46px !important;
    max-width: 46px;
    max-height: 46px;
    object-fit: cover;
    border-radius: 10px;
    display: block;
}

.default-logo {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), #1976D2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 22px;
    font-weight: bold;
}

/* 搜索框 */
.search-box {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    height: 36px;
    background: var(--bg-color);
    border-radius: 18px;
    padding: 0 16px 0 40px;
}

.search-box .search-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
}

.search-input-home {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    font-size: 14px;
    color: var(--text-color);
    outline: none;
}

.search-input-home::placeholder {
    color: var(--text-muted);
}

/* ==================== 轮播图 ==================== */
.banner-container {
    margin-top: calc(56px + env(safe-area-inset-top, 0));
    margin: calc(56px + env(safe-area-inset-top, 0)) 12px 0;
    height: 180px;
    background: #f0f0f0;
    overflow: hidden;
    position: relative;
    border-radius: 12px;
}

.banner-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-muted);
}

.banner-slider {
    display: flex;
    height: 100%;
    transition: transform 0.3s ease;
}

.banner-item {
    min-width: 100%;
    height: 100%;
}

.banner-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

/* ==================== 分类导航 ==================== */
.category-nav {
    position: sticky;
    top: calc(56px + env(safe-area-inset-top, 0));
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    z-index: 99;
}

.category-scroll {
    display: flex;
    overflow-x: auto;
    padding: 12px 16px;
    gap: 12px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.category-scroll::-webkit-scrollbar {
    display: none;
}

.category-item {
    flex-shrink: 0;
    padding: 8px 16px;
    border-radius: 20px;
    background: transparent;
    color: var(--text-color);
    font-size: 14px;
    white-space: nowrap;
    transition: all 0.3s;
}

.category-item.active {
    background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
    color: #2196F3;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.2);
}

.category-item:active {
    background: rgba(33, 150, 243, 0.1);
    color: #2196F3;
}

.category-filter-btn {
    flex-shrink: 0;
    padding: 8px 16px;
    border-radius: 20px;
    background: transparent;
    color: var(--text-color);
    font-size: 14px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ==================== 筛选弹窗 ==================== */
.filter-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: fadeIn 0.3s;
}

.filter-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    animation: slideUp 0.3s;
}

.filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.filter-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: transparent;
    font-size: 24px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.close-btn:active {
    background: var(--bg-color);
}

.filter-body {
    padding: 20px;
    max-height: calc(80vh - 70px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.filter-section {
    margin-bottom: 24px;
}

.filter-section:last-child {
    margin-bottom: 0;
}

.filter-section h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-tag {
    padding: 6px 12px;
    border-radius: 16px;
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 13px;
    border: 1px solid transparent;
    transition: all 0.3s;
}

.filter-tag:active,
.filter-tag.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* ==================== 视频列表 ==================== */
.video-list {
    padding: 12px;
    padding-bottom: calc(16px + var(--bottom-nav-height) + var(--safe-area-bottom));
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.video-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
}

.video-card:active {
    transform: scale(0.98);
}

.video-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: #f0f0f0;
}

.video-info {
    padding: 8px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.video-info h3 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.3;
    height: 2.6em;
    word-break: break-word;
}

.video-info p {
    font-size: 11px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    line-height: 1.3;
    margin-top: auto;
}

/* ==================== 底部导航（始终显示）==================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--bottom-nav-height) + var(--safe-area-bottom));
    background: #fff;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    padding-top: 8px;
    padding-bottom: var(--safe-area-bottom);
    z-index: 100;
    /* 防止被软键盘挤上去 */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 12px;
    gap: 4px;
    transition: color 0.3s;
    padding: 4px 0;
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-item svg {
    width: 24px;
    height: 24px;
}

/* ==================== 加载和空状态 ==================== */
.loading,
.no-data,
.error {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 15px;
    grid-column: 1 / -1; /* 跨越所有列 */
}

.loading::before,
.no-data::before {
    content: '';
    display: block;
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: var(--bg-color);
    border-radius: 50%;
}

.loading::before {
    border: 3px solid var(--bg-color);
    border-top-color: var(--primary-color);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.no-data {
    color: var(--text-muted);
    font-size: 14px;
}

.no-data::before {
    content: '📦';
    font-size: 48px;
    background: none;
    width: auto;
    height: auto;
    margin-bottom: 16px;
}

.error {
    color: var(--danger-color);
}

.error::before {
    content: '⚠️';
    display: block;
    font-size: 48px;
    margin-bottom: 16px;
}

/* ==================== 公告弹窗 ==================== */
.notice-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.notice-content {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    animation: slideUp 0.3s;
}

.notice-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.notice-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.notice-body {
    padding: 20px;
    max-height: 300px;
    overflow-y: auto;
    line-height: 1.6;
    -webkit-overflow-scrolling: touch;
}

/* ==================== 搜索页面 ==================== */
.search-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: calc(56px + env(safe-area-inset-top, 0));
    padding-top: env(safe-area-inset-top, 0);
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding-left: 16px;
    padding-right: 16px;
    gap: 12px;
    z-index: 100;
}

.back-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    transition: background 0.3s;
}

.back-btn:active {
    background: var(--bg-color);
}

.search-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
}

.search-input {
    width: 100%;
    height: 40px;
    padding: 0 40px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 14px;
    background: var(--bg-color);
}

.clear-btn {
    position: absolute;
    right: 12px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--text-muted);
    color: #fff;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn {
    padding: 8px 16px;
    border-radius: 20px;
    background: var(--primary-color);
    color: #fff;
    font-size: 14px;
}

.search-history,
.hot-search,
.search-results {
    margin-top: calc(56px + env(safe-area-inset-top, 0));
    padding: 16px;
}

.history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.history-header h3,
.hot-search h3,
.results-header h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

.clear-history-btn {
    padding: 4px 12px;
    border-radius: 12px;
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
}

.history-tags,
.hot-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.history-tag,
.hot-tag {
    padding: 6px 12px;
    border-radius: 16px;
    background: var(--bg-color);
    color: var(--text-color);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
}

.history-tag:active,
.hot-tag:active {
    background: var(--primary-color);
    color: #fff;
}

/* ==================== 详情页 ==================== */
.fixed-back-btn {
    position: fixed;
    top: calc(16px + env(safe-area-inset-top, 0));
    left: 16px;
    width: 44px;
    height: 44px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.8);
    transition: all 0.3s;
}

.fixed-back-btn:active {
    transform: scale(0.9);
}

.fixed-back-btn svg {
    color: #333;
}

.detail-cover {
    height: 340px;
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
}

.detail-cover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.3) 50%, rgba(0,0,0,0.7) 100%);
}

.cover-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 150px;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, transparent 100%);
}

.detail-content {
    margin-top: -60px;
    position: relative;
    background: #fff;
    border-radius: 24px 24px 0 0;
    padding: 24px 20px;
    min-height: calc(100vh - 280px);
    padding-bottom: calc(20px + var(--bottom-nav-height) + var(--safe-area-bottom));
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
}

.detail-header {
    margin-bottom: 24px;
}

.detail-title {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 10px;
    word-break: break-word;
    line-height: 1.3;
    color: #1a1a1a;
}

.detail-meta {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.detail-desc-container {
    position: relative;
}

.detail-desc {
    font-size: 14px;
    line-height: 1.8;
    color: #666;
    word-break: break-word;
    transition: all 0.3s;
}

.detail-desc.collapsed {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.expand-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 500;
    margin-top: 8px;
    padding: 4px 8px;
    background: transparent;
    transition: all 0.3s;
}

.expand-btn:active {
    opacity: 0.7;
}

.expand-btn svg {
    transition: transform 0.3s;
}

.expand-btn.expanded svg {
    transform: rotate(180deg);
}

.detail-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
}

.detail-primary-btn {
    flex: 1;
    height: 52px;
    border-radius: 26px;
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: #fff;
    font-size: 17px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.35);
    transition: all 0.3s;
}

.detail-primary-btn:active {
    transform: scale(0.97);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.detail-action-btn {
    width: 52px;
    height: 52px;
    border-radius: 26px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.detail-action-btn:active {
    transform: scale(0.95);
}

.detail-action-btn.active {
    background: linear-gradient(135deg, #FF6B9D 0%, #C2185B 100%);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 6px 20px rgba(255, 107, 157, 0.35);
}

.detail-action-btn.active svg {
    stroke: #fff;
    fill: #fff;
}

.episodes-section {
    margin-top: 8px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;
}

.section-header h3 {
    font-size: 19px;
    font-weight: 700;
    color: #1a1a1a;
}

.episode-count {
    font-size: 13px;
    color: var(--text-muted);
    background: #f5f5f5;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 500;
}

.episodes-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.episode-btn {
    height: 44px;
    border-radius: 12px;
    background: #f8f8f8;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.episode-btn:active {
    transform: scale(0.95);
}

.episode-btn.active,
.episode-btn:active:not(.active) {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

/* ==================== 个人中心 ==================== */
.user-header {
    background: linear-gradient(180deg, #5B9FED 0%, #4A8FE7 100%);
    padding: calc(50px + env(safe-area-inset-top, 0)) 20px 50px;
    color: #fff;
    text-align: center;
    position: relative;
}

.user-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 100%);
    pointer-events: none;
}

.user-avatar {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    border: 3px solid rgba(255, 255, 255, 0.3);
    position: relative;
    z-index: 1;
}

.username {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 6px;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.user-id {
    font-size: 14px;
    opacity: 0.85;
    position: relative;
    z-index: 1;
}

.user-tabs {
    display: flex;
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
    position: sticky;
    top: calc(env(safe-area-inset-top, 0));
    z-index: 99;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.tab-btn {
    flex: 1;
    height: 50px;
    background: transparent;
    color: var(--text-color);
    font-size: 15px;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    position: relative;
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    font-weight: 600;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px 2px 0 0;
}

.tab-content {
    padding-bottom: calc(var(--bottom-nav-height) + var(--safe-area-bottom));
    background: var(--bg-color);
    min-height: calc(100vh - 50px - var(--bottom-nav-height));
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

/* 收藏页面视频列表 */
#favoritesPane .video-list {
    background: var(--bg-color);
    padding-top: 12px;
}

#favoritesPane .video-card {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s, box-shadow 0.2s;
}

#favoritesPane .video-card:active {
    transform: scale(0.98);
    box-shadow: 0 1px 8px rgba(0, 0, 0, 0.08);
}

.wallet-card {
    margin: 16px;
    padding: 28px;
    background: linear-gradient(135deg, #5B9FED 0%, #4A8FE7 100%);
    border-radius: 20px;
    color: #fff;
    box-shadow: 0 8px 24px rgba(74, 143, 231, 0.35);
    position: relative;
    overflow: hidden;
}

.wallet-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
    border-radius: 50%;
}

.wallet-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 24px;
    opacity: 0.95;
    font-size: 15px;
    position: relative;
    z-index: 1;
}

.wallet-balance {
    position: relative;
    z-index: 1;
}

.wallet-balance h3 {
    font-size: 40px;
    font-weight: 700;
    margin-bottom: 6px;
    letter-spacing: 1px;
}

.wallet-balance p {
    font-size: 14px;
    opacity: 0.85;
}

.wallet-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    position: relative;
    z-index: 1;
}

.wallet-btn {
    flex: 1;
    height: 44px;
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    backdrop-filter: blur(10px);
    transition: all 0.3s;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.wallet-btn:active {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(0.98);
}

.menu-list {
    background: #fff;
    margin: 16px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.menu-item {
    display: flex;
    align-items: center;
    padding: 18px 16px;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    transition: all 0.3s;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item:active {
    background: #fafafa;
}

.menu-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #E3F2FD 0%, #BBDEFB 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 14px;
    color: var(--primary-color);
    transition: transform 0.3s;
}

.menu-item:active .menu-icon {
    transform: scale(0.95);
}

.menu-item span {
    flex: 1;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-color);
}

.menu-arrow {
    color: #c0c0c0;
    transition: transform 0.3s;
}

.menu-item:active .menu-arrow {
    transform: translateX(3px);
}

.tasks-list {
    padding: 16px;
    background: var(--bg-color);
}

.tasks-list .loading,
.tasks-list .no-data,
.tasks-list .error {
    grid-column: auto; /* 重置grid-column */
}

.task-card {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s;
}

.task-card:active {
    transform: scale(0.98);
}

.task-info h3 {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-color);
}

.task-info p {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.task-reward {
    font-size: 14px;
    color: var(--primary-color);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.reward-amount {
    font-size: 20px;
    font-weight: 700;
}

.task-progress {
    font-size: 13px;
    color: var(--text-muted);
    background: var(--bg-color);
    padding: 4px 10px;
    border-radius: 12px;
    display: inline-block;
}

.task-action {
    margin-left: 16px;
}

.claim-btn,
.go-btn,
.completed-btn {
    padding: 10px 24px;
    border-radius: 22px;
    font-size: 15px;
    white-space: nowrap;
    transition: all 0.3s;
    font-weight: 600;
}

.claim-btn {
    background: linear-gradient(135deg, var(--primary-color), #1976D2);
    color: #fff;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.claim-btn:active {
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.25);
}

.go-btn {
    background: linear-gradient(135deg, #E3F2FD, #BBDEFB);
    color: var(--primary-color);
    font-weight: 600;
}

.go-btn:active {
    transform: scale(0.95);
}

.completed-btn {
    background: var(--bg-color);
    color: var(--text-muted);
    cursor: not-allowed;
}

/* ==================== 弹窗 ==================== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 20px;
    overflow: hidden;
    animation: slideUp 0.3s;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    margin: auto;
}

@media (max-width: 480px) {
    .modal-content {
        max-width: calc(100% - 32px);
        border-radius: 16px;
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px;
    border-bottom: 1px solid #f0f0f0;
    background: linear-gradient(180deg, #fafafa 0%, #fff 100%);
}

.modal-header h3 {
    font-size: 19px;
    font-weight: 600;
    color: var(--text-color);
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 480px) {
    .modal-body {
        padding: 18px;
    }
}

.form-group {
    margin-bottom: 18px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-color);
}

@media (max-width: 480px) {
    .form-group {
        margin-bottom: 16px;
    }
    
    .form-group label {
        font-size: 13px;
        margin-bottom: 6px;
    }
}

.form-input {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: 1.5px solid #e8e8e8;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s;
    background: #fafafa;
    outline: none;
}

.form-input:focus {
    border-color: var(--primary-color);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.form-input::placeholder {
    color: #999;
    font-size: 13px;
}

@media (max-width: 480px) {
    .form-input {
        height: 44px;
        font-size: 14px;
        padding: 0 12px;
    }
    
    .form-input::placeholder {
        font-size: 13px;
    }
}

.form-hint {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 8px;
}

.full-width {
    width: 100%;
}

.withdraw-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px;
    border-bottom: 1px solid #f5f5f5;
    background: #fafafa;
    margin-bottom: 8px;
    border-radius: 12px;
}

.withdraw-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.withdraw-amount {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 4px;
}

.withdraw-detail {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.withdraw-time {
    font-size: 12px;
    color: var(--text-muted);
}

.withdraw-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    white-space: nowrap;
}

.status-pending {
    background: #FFF3E0;
    color: #F57C00;
}

.status-success {
    background: #E8F5E9;
    color: #388E3C;
}

.status-error {
    background: #FFEBEE;
    color: #D32F2F;
}

/* ==================== 登录注册页面 ==================== */
.auth-page {
    background: linear-gradient(180deg, #5B9FED 0%, #4A8FE7 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    padding-bottom: max(20px, env(safe-area-inset-bottom));
    position: relative;
    overflow-x: hidden;
    overflow-y: auto;
}

/* 登录页有logo时的特殊样式 - 从顶部开始布局 */
.auth-page:has(.auth-logo-container) {
    justify-content: flex-start;
    padding-top: max(100px, calc(100px + env(safe-area-inset-top)));
}

@media (max-width: 480px) {
    .auth-page:has(.auth-logo-container) {
        padding-top: max(80px, calc(80px + env(safe-area-inset-top)));
    }
}

.auth-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 30%, rgba(255,255,255,0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255,255,255,0.1) 0%, transparent 50%);
    pointer-events: none;
}

/* Logo容器 - 仅登录页显示 */
.auth-logo-container {
    margin-top: 40px;
    margin-bottom: 32px;
    position: relative;
    z-index: 1;
}

.auth-logo {
    width: 120px;
    height: 120px;
    object-fit: contain;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.15));
}

@media (max-width: 480px) {
    .auth-logo-container {
        margin-top: 30px;
        margin-bottom: 24px;
    }
    
    .auth-logo {
        width: 100px;
        height: 100px;
    }
}

.auth-container {
    width: 100%;
    max-width: 420px;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 24px;
    padding: 32px 24px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(20px);
    position: relative;
    z-index: 1;
}

@media (max-width: 480px) {
    .auth-container {
        padding: 28px 20px;
        border-radius: 20px;
    }
}

.auth-header {
    text-align: center;
    margin-bottom: 28px;
}

.auth-header h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-color);
}

.auth-header p {
    font-size: 14px;
    color: var(--text-muted);
}

@media (max-width: 480px) {
    .auth-header {
        margin-bottom: 24px;
    }
    
    .auth-header h1 {
        font-size: 22px;
    }
}

.auth-form {
    margin-bottom: 20px;
}

.auth-form .form-group {
    margin-bottom: 18px;
}

.auth-form .form-group:last-child {
    margin-bottom: 0;
}

.auth-form .form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-color);
}

@media (max-width: 480px) {
    .auth-form .form-group {
        margin-bottom: 16px;
    }
    
    .auth-form .form-group label {
        font-size: 13px;
        margin-bottom: 6px;
    }
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 8px;
    margin-bottom: 18px;
}

@media (max-width: 480px) {
    .form-actions {
        margin-top: 6px;
        margin-bottom: 16px;
    }
}

.link-text {
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 500;
    transition: color 0.3s;
}

.link-text:hover {
    color: #1976D2;
}

.primary-btn {
    height: 46px;
    border-radius: 23px;
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 16px rgba(33, 150, 243, 0.3);
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

.primary-btn:active {
    transform: scale(0.97);
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.25);
}

.primary-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

@media (max-width: 480px) {
    .primary-btn {
        height: 44px;
        font-size: 15px;
    }
}

.auth-footer {
    text-align: center;
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 20px;
}

.auth-footer .link-text {
    margin-left: 6px;
    font-weight: 600;
}

@media (max-width: 480px) {
    .auth-footer {
        font-size: 13px;
        margin-top: 18px;
    }
}

/* ==================== Toast提示 ==================== */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 12px 24px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    border-radius: 8px;
    font-size: 14px;
    z-index: 10000;
    animation: fadeIn 0.3s;
    max-width: 80%;
    text-align: center;
    word-break: break-word;
}

/* ==================== 动画 ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* ==================== 响应式 - 平板 ==================== */
/* 响应式 - 平板 */
@media (min-width: 768px) {
    .video-list {
        grid-template-columns: repeat(5, 1fr);
        gap: 12px;
        padding: 16px;
    }
    
    .video-card img {
        height: 260px;
    }
    
    .video-info h3 {
        font-size: 15px;
    }
}

/* ==================== 响应式 - 电脑 ==================== */
/* 响应式 - 电脑 */
@media (min-width: 1024px) {
    .video-list {
        grid-template-columns: repeat(6, 1fr);
        gap: 16px;
        padding: 24px;
        max-width: 1400px;
        margin: 0 auto;
    }
    
    .video-card img {
        height: 280px;
    }
    
    .video-info {
        padding: 14px;
    }
    
    .video-info h3 {
        font-size: 15px;
    }
    
    .video-info p {
        font-size: 13px;
    }
}

/* ==================== 横屏适配 ==================== */
@media (orientation: landscape) and (max-height: 500px) {
    .user-header {
        padding: calc(40px + env(safe-area-inset-top, 0)) 20px 20px;
    }
    
    .user-avatar {
        width: 60px;
        height: 60px;
    }
}

/* ==================== 移动端强制3列 ==================== */
@media (max-width: 767px) {
    .video-list {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px !important;
        padding: 12px !important;
    }
    
    .video-card img {
        height: 160px !important;
    }
    
    .video-info {
        padding: 8px !important;
    }
    
    .video-info h3 {
        font-size: 13px !important;
    }
    
    .video-info p {
        font-size: 11px !important;
    }
}