/* ========================================
   维吾尔影视会员管理系统 - 前台样式
   Uyghur Film Member System - Frontend CSS
   ======================================== */

/* 字体引入 */
@font-face {
    font-family: 'Ukij Tuz Tom';
    src: url('../fonts/ukij-tuz-tom.woff2') format('woff2');
    font-display: swap;
}

/* CSS变量 - 浅色主题 */
:root {
    --bg: #f8f9fa;
    --bg-secondary: #ffffff;
    --card: #ffffff;
    --text: #1a1a2e;
    --text-secondary: #666666;
    --text-muted: #888888;
    --border: #e9ecef;
    --primary: #e74c3c;
    --primary-dark: #c0392b;
    --primary-light: #ff6b6b;
    --success: #27ae60;
    --warning: #f39c12;
    --danger: #e74c3c;
    --info: #3498db;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.12);
    --transition: all 0.3s ease;
}

/* CSS变量 - 深色主题 */
[data-theme="dark"] {
    --bg: #121212;
    --bg-secondary: #1e1e2e;
    --card: #1e1e2e;
    --text: #e0e0e0;
    --text-secondary: #a0a0a0;
    --text-muted: #707070;
    --border: #2a2a3a;
    --shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* 重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Ukij Tuz Tom', 'Segoe UI', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    direction: rtl;
    line-height: 1.6;
    font-size: 14px;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

img {
    max-width: 100%;
    display: block;
}

/* 容器 */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========================================
   头部导航
   ======================================== */
.header {
    background: var(--card);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.logo {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.logo:hover {
    opacity: 0.8;
}

.nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav a {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: var(--transition);
}

.nav a:hover {
    background: var(--bg);
    color: var(--primary);
}

.search-box {
    display: flex;
    background: var(--bg);
    border-radius: 30px;
    overflow: hidden;
    transition: var(--transition);
}

.search-box input {
    border: none;
    background: transparent;
    padding: 8px 16px;
    font-family: inherit;
    font-size: 13px;
    width: 180px;
    outline: none;
    color: var(--text);
}

.search-box button {
    border: none;
    background: var(--primary);
    color: white;
    padding: 8px 18px;
    cursor: pointer;
    transition: var(--transition);
}

.search-box button:hover {
    background: var(--primary-dark);
}

.theme-toggle {
    background: var(--bg);
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.theme-toggle:hover {
    background: var(--border);
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text);
}

/* ========================================
   Hero 区域
   ======================================== */
.hero {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 60px 0;
    text-align: center;
    margin-bottom: 40px;
}

.hero h1 {
    font-size: 42px;
    margin-bottom: 12px;
    font-weight: 700;
}

.hero p {
    font-size: 16px;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* ========================================
   区块
   ======================================== */
.section {
    margin-bottom: 48px;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 600;
}

.section-title a {
    font-size: 13px;
    color: var(--text-muted);
}

.section-title a:hover {
    color: var(--primary);
}

/* ========================================
   分类网格
   ======================================== */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
}

.cat-card {
    background: var(--card);
    padding: 18px 12px;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    font-size: 15px;
    font-weight: 500;
    border: 1px solid var(--border);
}

.cat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary);
    color: var(--primary);
}

/* ========================================
   视频网格
   ======================================== */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.video-card {
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.cover-wrap {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/9;
    background: #2a2a2a;
}

.cover-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.video-card:hover .cover-wrap img {
    transform: scale(1.05);
}

.badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    color: white;
}

.badge.vip {
    background: var(--primary);
}

.badge.new {
    background: var(--success);
}

.video-card .info {
    padding: 12px;
}

.video-card .info h3 {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 6px;
}

.video-card .meta {
    display: flex;
    gap: 12px;
    font-size: 11px;
    color: var(--text-muted);
}

/* ========================================
   播放页
   ======================================== */
.play-wrap {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 25px;
    margin: 30px 0;
}

.player-box {
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 16/9;
}

.player-box video {
    width: 100%;
    height: 100%;
}

.video-info {
    background: var(--card);
    padding: 25px;
    border-radius: var(--radius);
    margin-top: 20px;
    box-shadow: var(--shadow);
}

.video-info h1 {
    font-size: 22px;
    margin-bottom: 12px;
}

.video-info .meta {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.vip-tag {
    background: var(--primary);
    color: white;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
}

.video-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
}

.favorite-btn {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 20px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    transition: var(--transition);
    margin-top: 10px;
}

.favorite-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.vip-alert {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 60px 40px;
    text-align: center;
    border-radius: var(--radius);
}

.vip-alert .vip-icon {
    font-size: 60px;
    margin-bottom: 20px;
}

.vip-alert h3 {
    font-size: 24px;
    margin-bottom: 10px;
}

.vip-alert p {
    margin-bottom: 25px;
    opacity: 0.9;
}

.vip-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.vip-buttons .btn {
    background: white;
    color: var(--primary);
}

/* 侧边栏 */
.sidebar .side-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.sidebar .side-card h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.related-list {
    list-style: none;
}

.related-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.related-list li:last-child {
    border: none;
}

.related-list li a {
    display: block;
    font-size: 13px;
    transition: var(--transition);
}

.related-list li a:hover {
    color: var(--primary);
}

.related-list .vip-badge {
    background: var(--primary);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    margin-right: 6px;
}

/* ========================================
   评论区
   ======================================== */
.comments-section {
    background: var(--card);
    border-radius: var(--radius);
    padding: 25px;
    margin-top: 20px;
    box-shadow: var(--shadow);
}

.comments-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.comments-header h3 {
    font-size: 16px;
}

.comment-form {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
}

.comment-form textarea {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    min-height: 80px;
}

.comment-form textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.comment-login-tip {
    text-align: center;
    padding: 20px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
}

.comment-login-tip a {
    color: var(--primary);
}

.comments-list .comment-item {
    padding: 15px 0;
    border-bottom: 1px solid var(--border);
}

.comment-item:last-child {
    border: none;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.comment-header strong {
    font-size: 14px;
}

.comment-header span {
    font-size: 11px;
    color: var(--text-muted);
}

.comment-body {
    font-size: 14px;
    line-height: 1.6;
    padding-right: 48px;
}

.no-comments {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
}

/* ========================================
   表单
   ======================================== */
.form-group {
    margin-bottom: 20px;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    background: var(--bg);
    color: var(--text);
    outline: none;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* ========================================
   按钮
   ======================================== */
.btn {
    display: inline-block;
    padding: 12px 28px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-sm {
    padding: 8px 18px;
    font-size: 12px;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

/* ========================================
   卡片
   ======================================== */
.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h2 {
    font-size: 16px;
    font-weight: 600;
}

.card-body {
    padding: 24px;
}

/* ========================================
   表格
   ======================================== */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px 15px;
    text-align: right;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.data-table th {
    background: var(--bg);
    font-weight: 600;
    color: var(--text-secondary);
}

.data-table tr:hover {
    background: var(--bg);
}

/* ========================================
   分页
   ======================================== */
.pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

.pagination a {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    background: var(--bg);
    border: 1px solid var(--border);
    font-size: 13px;
    transition: var(--transition);
}

.pagination a:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination a.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ========================================
   提示消息
   ======================================== */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 13px;
}

.alert-success {
    background: rgba(39, 174, 96, 0.1);
    color: var(--success);
    border: 1px solid var(--success);
}

.alert-error {
    background: rgba(231, 76, 60, 0.1);
    color: var(--danger);
    border: 1px solid var(--danger);
}

.alert-info {
    background: rgba(52, 152, 219, 0.1);
    color: var(--info);
    border: 1px solid var(--info);
}

/* ========================================
   空状态
   ======================================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state p {
    margin-bottom: 10px;
}

/* ========================================
   套餐卡片
   ======================================== */
.package-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 25px 20px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 2px solid transparent;
}

.package-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
}

.package-card .pkg-name {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
}

.package-card .pkg-level {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.package-card .pkg-price {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    margin: 15px 0;
}

.package-card .pkg-price .original-price {
    font-size: 14px;
    color: var(--text-muted);
    text-decoration: line-through;
    font-weight: normal;
    margin-left: 8px;
}

.package-card .pkg-days {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* ========================================
   用户中心
   ======================================== */
.user-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 25px;
    margin: 30px 0;
}

.user-menu-card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
}

.user-menu-card a {
    display: block;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 5px;
    transition: var(--transition);
}

.user-menu-card a:hover {
    background: var(--bg);
    color: var(--primary);
}

.user-menu-card a.active {
    background: var(--primary);
    color: white;
}

.user-content {
    background: var(--card);
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow);
}

.user-content h3 {
    font-size: 18px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.vip-card {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.vip-card h4 {
    font-size: 16px;
    margin-bottom: 8px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-item {
    display: flex;
    gap: 15px;
    padding: 12px;
    background: var(--bg);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.history-item:hover {
    background: var(--border);
}

.history-item img {
    width: 80px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
}

.history-info h4 {
    font-size: 14px;
    margin-bottom: 5px;
}

.history-info span {
    font-size: 11px;
    color: var(--text-muted);
}

/* ========================================
   页脚
   ======================================== */
.footer {
    background: var(--card);
    padding: 40px 0;
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 60px;
    border-top: 1px solid var(--border);
}

/* ========================================
   响应式设计
   ======================================== */
@media (max-width: 992px) {
    .play-wrap {
        grid-template-columns: 1fr;
    }
    
    .user-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .mobile-toggle {
        display: block;
    }
    
    .nav {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--card);
        flex-direction: column;
        padding: 20px;
        box-shadow: var(--shadow);
        gap: 12px;
    }
    
    .nav.open {
        display: flex;
    }
    
    .nav a {
        width: 100%;
        text-align: center;
    }
    
    .search-box {
        width: 100%;
    }
    
    .search-box input {
        width: 100%;
    }
    
    .hero h1 {
        font-size: 28px;
    }
    
    .video-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .cat-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .video-grid {
        grid-template-columns: 1fr;
    }
    
    .cat-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .vip-buttons {
        flex-direction: column;
    }
}