/* ============================================
   前台样式 (v2.0 增加压缩标签样式)
   ============================================ */

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; font-size: 14px; color: #333; background: #f5f5f5; }

/* 导航栏 */
.navbar { background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.08); position: sticky; top: 0; z-index: 100; }
.navbar .container { display: flex; justify-content: space-between; align-items: center; height: 60px; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.navbar-brand { font-size: 20px; font-weight: 700; color: #1890ff; text-decoration: none; }
.navbar-nav { display: flex; align-items: center; gap: 5px; }
.nav-link { padding: 8px 15px; color: #666; text-decoration: none; border-radius: 6px; font-size: 14px; transition: all 0.3s; }
.nav-link:hover, .nav-link.active { color: #1890ff; background: #e6f7ff; }

/* VIP徽章 */
.vip-badge { background: linear-gradient(135deg, #f7b731, #f5cd79); color: #fff; padding: 4px 12px; border-radius: 20px; font-size: 13px; font-weight: 600; }

/* 主内容 */
.main-content { min-height: calc(100vh - 60px - 60px); padding: 20px 0; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* 分类栏 */
.category-bar { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.cat-item { padding: 6px 16px; background: #fff; border-radius: 20px; color: #666; text-decoration: none; font-size: 14px; transition: all 0.3s; border: 1px solid #e8e8e8; }
.cat-item:hover, .cat-item.active { background: #1890ff; color: #fff; border-color: #1890ff; }

/* 试看提示 */
.trial-notice { background: #fffbe6; border: 1px solid #ffe58f; border-radius: 8px; padding: 12px 20px; margin-bottom: 20px; display: flex; align-items: center; gap: 10px; font-size: 14px; color: #8c6e00; }
.icon-info { font-size: 18px; }
.btn-vip { display: inline-block; background: linear-gradient(135deg, #f7b731, #f5cd79); color: #fff; padding: 4px 16px; border-radius: 20px; text-decoration: none; font-size: 13px; font-weight: 600; margin-left: 10px; }
.btn-vip:hover { opacity: 0.9; }

/* 视频网格 */
.video-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.video-card { background: #fff; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,0.06); transition: transform 0.3s, box-shadow 0.3s; }
.video-card:hover { transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,0.12); }
.video-card-link { text-decoration: none; color: inherit; display: block; }
.video-cover { position: relative; padding-top: 56.25%; background: #000; overflow: hidden; }
.video-cover img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; }
.cover-placeholder { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: #1a1a2e; color: #444; font-size: 36px; }
.video-duration { position: absolute; bottom: 8px; right: 8px; background: rgba(0,0,0,0.7); color: #fff; padding: 2px 6px; border-radius: 4px; font-size: 12px; }
.video-lock { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 16px; font-weight: 600; }
.icon-lock { margin-right: 5px; }
.video-info { padding: 12px; }
.video-title { font-size: 14px; font-weight: 500; margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.video-meta { display: flex; justify-content: space-between; font-size: 12px; color: #999; }

/* 按钮 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 5px; padding: 10px 20px; border-radius: 6px; font-size: 14px; cursor: pointer; border: none; text-decoration: none; transition: all 0.3s; }
.btn-primary { background: #1890ff; color: #fff; }
.btn-primary:hover { background: #40a9ff; }
.btn-default { background: #fff; color: #333; border: 1px solid #d9d9d9; }
.btn-default:hover { color: #1890ff; border-color: #1890ff; }
.btn-block { display: block; width: 100%; }

/* 表单 */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; }
.form-input { width: 100%; padding: 10px 12px; border: 1px solid #d9d9d9; border-radius: 6px; font-size: 14px; outline: none; transition: border-color 0.3s; }
.form-input:focus { border-color: #1890ff; box-shadow: 0 0 0 2px rgba(24,144,255,0.2); }

/* 提示框 */
.alert { padding: 10px 16px; border-radius: 6px; margin-bottom: 16px; font-size: 14px; }
.alert-success { background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; }
.alert-error { background: #fff2f0; color: #ff4d4f; border: 1px solid #ffccc7; }

/* 认证卡片 */
.auth-card { max-width: 420px; margin: 40px auto; background: #fff; border-radius: 12px; padding: 40px; box-shadow: 0 2px 12px rgba(0,0,0,0.08); }
.auth-card h2 { text-align: center; margin-bottom: 24px; font-size: 22px; }
.auth-footer { text-align: center; margin-top: 20px; font-size: 13px; color: #999; }
.auth-footer a { color: #1890ff; text-decoration: none; }

/* 播放器页面 */
.player-page { max-width: 900px; margin: 0 auto; }
.player-wrapper { background: #000; border-radius: 8px; overflow: hidden; margin-bottom: 16px; }
.video-player { width: 100%; display: block; max-height: 70vh; }
.player-error, .player-locked { background: #1a1a2e; color: #fff; text-align: center; padding: 80px 20px; }
.player-locked .lock-icon { font-size: 48px; margin-bottom: 16px; }
.player-locked h3 { margin-bottom: 10px; font-size: 20px; }
.player-locked p { color: #999; margin-bottom: 20px; }
.player-info { background: #fff; border-radius: 8px; padding: 20px; }
.player-title { font-size: 20px; margin-bottom: 10px; }
.player-meta { display: flex; gap: 20px; color: #999; font-size: 13px; margin-bottom: 12px; flex-wrap: wrap; }
.player-desc { color: #666; font-size: 14px; line-height: 1.6; }

/* 压缩标签 */
.compress-badge { background: #52c41a; color: #fff; padding: 2px 8px; border-radius: 4px; font-size: 12px; }

/* 同步视频标签 */
.sync-badge { background: #1890ff; color: #fff; padding: 2px 8px; border-radius: 4px; font-size: 11px; position: absolute; top: 8px; right: 8px; z-index: 2; }
.player-meta .sync-badge { position: static; }

/* 免费视频标签 */
.free-badge { background: #52c41a; color: #fff; padding: 2px 8px; border-radius: 4px; font-size: 11px; position: absolute; top: 8px; left: 8px; z-index: 2; }
.player-meta .free-badge { position: static; }

/* 互动按钮 */
.action-bar { display: flex; gap: 12px; margin-top: 16px; padding-top: 16px; border-top: 1px solid #eee; }
.action-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border: 1px solid #ddd; border-radius: 20px; background: #fff; cursor: pointer; font-size: 14px; color: #666; transition: all 0.2s; }
.action-btn:hover { border-color: #1890ff; color: #1890ff; }
.action-btn.active { border-color: #1890ff; color: #1890ff; background: #e6f7ff; }
.action-btn span:first-child { font-size: 18px; }

/* 评论区 */
.comment-section { background: #fff; border-radius: 8px; padding: 20px; margin-top: 16px; }
.comment-section h3 { font-size: 16px; margin-bottom: 16px; }
.comment-form { margin-bottom: 20px; }
.comment-list { max-height: 400px; overflow-y: auto; }
.comment-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f0f0f0; }
.comment-item:last-child { border-bottom: none; }
.comment-avatar img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.avatar-sm { width: 36px; height: 36px; border-radius: 50%; background: #1890ff; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.comment-body { flex: 1; }
.comment-header { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.comment-header strong { font-size: 14px; color: #333; }
.comment-time { font-size: 12px; color: #999; }
.comment-content { font-size: 14px; color: #555; line-height: 1.6; }

/* 用户中心头像 */
.user-avatar-box { text-align: center; margin-bottom: 16px; }
.user-avatar-lg { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; margin: 0 auto 8px; display: block; }
.user-avatar-placeholder { width: 80px; height: 80px; border-radius: 50%; background: #1890ff; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 32px; margin: 0 auto 8px; }
.user-avatar-upload { margin-top: 8px; }
.user-info-sidebar { text-align: center; margin-bottom: 16px; }
.user-info-sidebar h3 { font-size: 16px; margin-bottom: 4px; }
.vip-badge { background: linear-gradient(135deg, #ffd700, #ffaa00); color: #fff; padding: 2px 10px; border-radius: 10px; font-size: 12px; font-weight: bold; }
.user-nav a { display: flex; align-items: center; gap: 8px; padding: 10px 12px; color: #666; text-decoration: none; border-radius: 6px; font-size: 14px; transition: all 0.2s; }
.user-nav a:hover, .user-nav a.active { background: #e6f7ff; color: #1890ff; }

/* 试看进度条 */
.trial-bar { background: #fff; border-radius: 8px; padding: 16px 20px; margin-top: 16px; }
.trial-bar span { font-size: 14px; color: #666; }
.trial-progress { height: 8px; background: #f0f0f0; border-radius: 4px; margin: 10px 0; overflow: hidden; }
.trial-fill { height: 100%; background: linear-gradient(90deg, #1890ff, #36cfc9); border-radius: 4px; transition: width 0.3s; }

/* 用户中心 */
.user-page { max-width: 800px; margin: 0 auto; }
.user-card { background: #fff; border-radius: 12px; padding: 30px; display: flex; align-items: center; gap: 20px; margin-bottom: 20px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.user-avatar img { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; }
.avatar-default { width: 80px; height: 80px; border-radius: 50%; background: linear-gradient(135deg, #1890ff, #36cfc9); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 32px; font-weight: 600; }
.user-detail h2 { font-size: 20px; margin-bottom: 5px; }
.user-detail p { color: #999; font-size: 13px; margin-bottom: 5px; }
.vip-tag { display: inline-block; background: linear-gradient(135deg, #f7b731, #f5cd79); color: #fff; padding: 3px 12px; border-radius: 20px; font-size: 13px; font-weight: 600; }
.normal-tag { display: inline-block; background: #f0f0f0; color: #999; padding: 3px 12px; border-radius: 20px; font-size: 13px; }
.vip-expire { color: #f7b731 !important; font-weight: 500; }

/* 观看记录 */
.history-section { background: #fff; border-radius: 12px; padding: 24px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.history-section h3 { margin-bottom: 16px; font-size: 16px; }
.history-list { display: flex; flex-direction: column; gap: 10px; }
.history-item { display: flex; gap: 12px; padding: 10px; border-radius: 8px; text-decoration: none; color: inherit; transition: background 0.3s; }
.history-item:hover { background: #f5f5f5; }
.history-cover { width: 120px; height: 68px; border-radius: 6px; overflow: hidden; flex-shrink: 0; }
.history-cover img { width: 100%; height: 100%; object-fit: cover; }
.cover-placeholder-sm { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; background: #1a1a2e; color: #444; }
.history-info h4 { font-size: 14px; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-info p { font-size: 12px; color: #999; }

/* VIP页面 */
.vip-page { max-width: 800px; margin: 0 auto; }
.vip-status-card { background: linear-gradient(135deg, #f7b731, #f5cd79); border-radius: 12px; padding: 40px; text-align: center; color: #fff; margin-bottom: 24px; }
.vip-crown { font-size: 48px; margin-bottom: 10px; }
.vip-status-card h2 { margin-bottom: 10px; }
.vip-expire-big { font-size: 18px; opacity: 0.9; }
.vip-plans { background: #fff; border-radius: 12px; padding: 24px; margin-bottom: 24px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.vip-plans h3 { margin-bottom: 16px; font-size: 16px; }
.plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.plan-card { background: #f9f9f9; border-radius: 12px; padding: 24px; text-align: center; position: relative; border: 2px solid transparent; transition: all 0.3s; }
.plan-card:hover { border-color: #1890ff; }
.plan-card.featured { background: #e6f7ff; border-color: #1890ff; }
.plan-badge { position: absolute; top: -10px; right: 10px; background: #ff4d4f; color: #fff; padding: 2px 10px; border-radius: 10px; font-size: 11px; }
.plan-name { font-size: 16px; font-weight: 600; margin-bottom: 10px; color: #333; }
.plan-price { font-size: 36px; font-weight: 700; color: #1890ff; margin-bottom: 5px; }
.plan-price span { font-size: 16px; }
.plan-duration { color: #999; font-size: 14px; }

/* 联系方式 */
.contact-section { background: #fff; border-radius: 12px; padding: 24px; margin-bottom: 24px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.contact-section h3 { margin-bottom: 12px; font-size: 16px; }
.contact-list { display: flex; gap: 30px; }
.contact-item { font-size: 14px; }
.contact-label { color: #999; margin-right: 8px; }
.contact-value { font-weight: 600; }

/* 充值卡片 */
.recharge-card { background: #fff; border-radius: 12px; padding: 24px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.recharge-card h3 { margin-bottom: 16px; font-size: 16px; }
.card-input { font-family: monospace; font-size: 16px; letter-spacing: 2px; text-align: center; }

/* 空状态 */
.empty-state { text-align: center; padding: 60px 20px; color: #999; }
.empty-state p { margin-bottom: 16px; font-size: 16px; }

/* 分页 */
.pagination { display: flex; gap: 5px; margin-top: 24px; justify-content: center; }
.page-btn { padding: 8px 14px; border-radius: 6px; background: #fff; color: #666; text-decoration: none; border: 1px solid #e8e8e8; font-size: 14px; transition: all 0.3s; }
.page-btn:hover, .page-btn.active { background: #1890ff; color: #fff; border-color: #1890ff; }

/* 通用区块卡片 */
.section-card { background: #fff; border-radius: 12px; padding: 24px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.section-header h3 { font-size: 16px; margin: 0; }
.section-count { font-size: 13px; color: #999; }

/* 收藏列表 */
.fav-list { display: flex; flex-direction: column; gap: 12px; }
.fav-item { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 8px; transition: background 0.3s; }
.fav-item:hover { background: #f9f9f9; }
.fav-cover { width: 160px; height: 90px; border-radius: 6px; overflow: hidden; flex-shrink: 0; position: relative; display: block; text-decoration: none; }
.fav-cover img { width: 100%; height: 100%; object-fit: cover; }
.fav-duration { position: absolute; bottom: 4px; right: 4px; background: rgba(0,0,0,0.7); color: #fff; padding: 1px 5px; border-radius: 3px; font-size: 11px; }
.fav-cover .sync-badge { position: absolute; top: 4px; right: 4px; }
.fav-info { flex: 1; min-width: 0; }
.fav-title { font-size: 15px; font-weight: 500; color: #333; text-decoration: none; display: block; margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fav-title:hover { color: #1890ff; }
.fav-meta { display: flex; gap: 16px; font-size: 12px; color: #999; }
.btn-remove-fav { flex-shrink: 0; padding: 6px 14px; border: 1px solid #ff4d4f; background: #fff; color: #ff4d4f; border-radius: 6px; font-size: 13px; cursor: pointer; transition: all 0.3s; }
.btn-remove-fav:hover { background: #ff4d4f; color: #fff; }

/* 评论列表 */
.comment-list { display: flex; flex-direction: column; gap: 12px; }
.comment-item { display: flex; align-items: flex-start; gap: 14px; padding: 14px; border-radius: 8px; transition: background 0.3s; }
.comment-item:hover { background: #f9f9f9; }
.comment-body { flex: 1; min-width: 0; }
.comment-text { font-size: 14px; color: #333; line-height: 1.6; margin-bottom: 8px; word-break: break-all; }
.comment-meta { display: flex; gap: 16px; font-size: 12px; color: #999; align-items: center; flex-wrap: wrap; }
.comment-video-title { color: #1890ff; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 300px; }
.comment-video-title:hover { text-decoration: underline; }
.comment-time { color: #bbb; }
.btn-delete-comment { flex-shrink: 0; padding: 6px 14px; border: 1px solid #ff4d4f; background: #fff; color: #ff4d4f; border-radius: 6px; font-size: 13px; cursor: pointer; transition: all 0.3s; }
.btn-delete-comment:hover { background: #ff4d4f; color: #fff; }

/* 底部 */
.footer { background: #fff; padding: 20px 0; text-align: center; color: #999; font-size: 13px; border-top: 1px solid #f0f0f0; }

/* 顶部搜索栏 */
.navbar-search { display: flex; align-items: center; margin-right: 16px; }
.navbar-search-input { height: 32px; padding: 0 10px; border: 1px solid #ddd; border-radius: 4px 0 0 4px; width: 150px; font-size: 13px; outline: none; }
.navbar-search-input:focus { border-color: #1890ff; }
.navbar-search-btn { height: 32px; padding: 0 12px; background: #1890ff; color: #fff; border: none; border-radius: 0 4px 4px 0; font-size: 13px; cursor: pointer; }
.navbar-search-btn:hover { background: #40a9ff; }

/* 搜索页搜索栏 */
.search-bar .form-input { border-radius: 4px; border: 1px solid #ddd; padding: 0 16px; font-size: 15px; }

/* 响应式 */
@media (max-width: 1024px) {
    .video-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .video-grid { grid-template-columns: repeat(2, 1fr); }
    .plan-grid { grid-template-columns: 1fr; }
    .navbar-nav { gap: 2px; }
    .nav-link { padding: 6px 10px; font-size: 13px; }
    .user-card { flex-direction: column; text-align: center; }
    .fav-item { flex-direction: column; align-items: stretch; }
    .fav-cover { width: 100%; height: auto; padding-top: 56.25%; }
    .fav-cover img { position: absolute; top: 0; left: 0; }
    .comment-item { flex-direction: column; }
    .comment-video-title { max-width: 100%; }
}
@media (max-width: 480px) {
    .video-grid { grid-template-columns: 1fr; }
}
