/* ============================================
   自然风景视频网 - 全局样式 (PHP 5.5 兼容)
   移动端用户中心间距已修正
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    background: #f5f9f5;
    color: #2c3e2c;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* -------------------- 头部 -------------------- */
.site-header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 40, 0, 0.05);
    padding: 15px 0;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.logo {
    font-size: 1.8rem;
    font-weight: 600;
    color: #2e7d32;
    text-decoration: none;
}

.site-nav ul {
    display: flex;
    list-style: none;
    gap: 25px;
    align-items: center;
}

.site-nav a {
    color: #3e5e3e;
    text-decoration: none;
    font-weight: 500;
}

.site-nav a:hover {
    color: #1b5e20;
}

/* 用户头像菜单 */
.nav-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 5px;
    vertical-align: middle;
}

.dropdown {
    position: relative;
}

.site-nav .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    min-width: 150px;
    z-index: 100;
    list-style: none;
    padding: 8px 0;
    margin: 0;
}

.site-nav .dropdown:hover .dropdown-menu {
    display: block;
}

.site-nav .dropdown-menu li {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
}

.site-nav .dropdown-menu li a {
    display: block;
    padding: 8px 20px;
    color: #3e5e3e;
    text-decoration: none;
    white-space: nowrap;
}

.site-nav .dropdown-menu li a:hover {
    background: #e8f5e9;
}

/* -------------------- 首页英雄区 -------------------- */
.hero {
    background: linear-gradient(rgba(0, 40, 0, 0.3), rgba(0, 40, 0, 0.5)), url('../images/hero-bg.jpg') center/cover;
    padding: 80px 0;
    text-align: center;
    color: #fff;
    margin-bottom: 40px;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 15px;
}

.search-form {
    display: flex;
    max-width: 500px;
    margin: 30px auto 0;
}

.search-form input {
    flex: 1;
    padding: 15px 20px;
    border: none;
    border-radius: 30px 0 0 30px;
    font-size: 1rem;
}

.search-form button {
    padding: 15px 30px;
    background: #2e7d32;
    color: #fff;
    border: none;
    border-radius: 0 30px 30px 0;
    cursor: pointer;
    font-weight: bold;
}

/* -------------------- 视频网格 -------------------- */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.video-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 40, 0, 0.1);
}

/* 保留原有的 .video-thumb 和 img 样式 */
.video-thumb {
    position: relative;
    display: block;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #000;
}

.video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 积分标签改为右上角定位（基于原有 .price-badge 修改定位值） */
.price-badge {
    position: absolute;
    top: 10px;          /* 改 top 替代 bottom */
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #ffd700;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    z-index: 2;
}

/* 右下角信息容器 */
.video-info-right {
    position: absolute;
    bottom: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    z-index: 2;
}

/* 右下角标签样式 */
.info-tag {
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    line-height: 1.4;
    white-space: nowrap;
}

.video-info {
    padding: 15px;
}

.video-info h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.video-info h3 a {
    color: #2c3e2c;
    text-decoration: none;
}

.video-meta {
    color: #6b8c6b;
    font-size: 0.9rem;
    display: flex;
    gap: 15px;
}

/* 区块头部 */
.section {
    margin: 40px 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    color: #2e7d32;
}

.section-header a {
    color: #2e7d32;
    text-decoration: none;
}

/* 分类标签 */
.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
    border-bottom: 1px solid #c8e6c9; /* 新增下划线 */
    padding-bottom: 10px;             /* 给下划线留出间距 */
}

.category-tabs a {
    padding: 8px 18px;
    background: #e8f5e9;
    color: #2e7d32;
    border-radius: 30px;
    text-decoration: none;
    transition: all 0.3s;
}

.category-tabs a.active,
.category-tabs a:hover {
    background: #2e7d32;
    color: #fff;
}

/* 分类卡片网格 */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.category-card {
    background: linear-gradient(135deg, #a5d6a7, #81c784);
    padding: 25px 15px;
    text-align: center;
    border-radius: 12px;
    color: #1b5e20;
    text-decoration: none;
    font-weight: bold;
    transition: transform 0.3s;
}

.category-card:hover {
    transform: scale(1.03);
    color: #fff;
    background: #2e7d32;
}

/* -------------------- 视频播放器（简化自适应） -------------------- */
.video-player-container {
    background: #000;
    padding: 20px 0;
    width: 100%;
}

.video-player-container .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    width: 100%;
    overflow: hidden;
}

.video-player-container #player {
    width: 100%;
    height: auto;
    object-fit: cover;
    max-width: 100%;
    display: block;
    border-radius: 8px;
}

/* 视频详情 */
.video-detail {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    margin: 30px 0;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.05);
}

.video-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    color: #6b8c6b;
    margin: 15px 0;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.price-tag {
    background: #fff3e0;
    padding: 3px 12px;
    border-radius: 20px;
    color: #e65100;
}

.video-description {
    margin: 20px 0;
    line-height: 1.8;
}

.download-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.download-card {
    background: #f1f8e9;
    padding: 20px;
    border-radius: 12px;
}

.download-result {
    background: #e8f5e9;
    padding: 20px;
    border-radius: 12px;
    margin-top: 20px;
}

.download-result h3 {
    color: #2e7d32;
    margin-bottom: 10px;
}

/* -------------------- 认证表单 -------------------- */
.auth-container {
    max-width: 450px;
    margin: 50px auto;
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}

.auth-container h2 {
    text-align: center;
    margin-bottom: 25px;
    color: #2e7d32;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #3e5e3e;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="tel"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #c8e6c9;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #2e7d32;
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

.captcha-group .captcha-input {
    display: flex;
    gap: 10px;
    align-items: center;
}

.captcha-group .captcha-input input {
    width: 120px;
    flex: none;
    padding: 10px 12px;
    border: 1px solid #c8e6c9;
    border-radius: 8px;
    font-size: 1rem;
}

.captcha-img {
    height: 45px;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid #ddd;
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 16px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s;
    text-decoration: none;
    line-height: 1.5;
    min-height: 34px;
    vertical-align: middle;
}

.btn-primary {
    background: #2e7d32;
    color: #fff;
}

.btn-primary:hover {
    background: #1b5e20;
}

.btn-outline {
    background: transparent;
    border: 1px solid #2e7d32;
    color: #2e7d32;
}

.btn-outline:hover {
    background: #e8f5e9;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-sm {
    padding: 4px 12px;
    font-size: 0.85rem;
    min-height: 30px;
}

.btn-lg {
    padding: 15px 30px;
    font-size: 1.1rem;
}

.info-item .btn {
    margin-left: 8px;
}

/* 徽章 */
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
    margin-left: 10px;
    vertical-align: middle;
    line-height: 1.4;
}

.badge-success {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-info {
    background: #e3f2fd;
    color: #1565c0;
}

/* 警告提示 */
.alert {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.alert-danger {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.alert-info {
    background: #e3f2fd;
    color: #1565c0;
    border: 1px solid #90caf9;
}

.alert-warning {
    background: #fff8e1;
    color: #e65100;
    border: 1px solid #ffe082;
}

.error {
    color: #d32f2f;
    font-size: 0.85rem;
    margin-top: 5px;
    display: block;
}

/* 链接 */
.auth-links {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.auth-links a {
    color: #2e7d32;
    text-decoration: none;
}

/* -------------------- 用户中心 -------------------- */
.profile-layout {
    display: flex;
    gap: 30px;
    margin: 40px 0;
}

.profile-sidebar {
    width: 280px;
    flex-shrink: 0;
}

.user-info-card {
    background: #fff;
    border-radius: 12px;
    padding: 25px 20px;
    text-align: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.user-avatar {
    width: 100px;
    height: 100px;
    margin: 0 auto 15px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #a5d6a7;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-info-card h3 {
    font-size: 1rem;
    margin-bottom: 10px;
    word-break: break-all;
}

.profile-menu {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    list-style: none;
}

.profile-menu li {
    border-bottom: 1px solid #eee;
}

.profile-menu li:last-child {
    border-bottom: none;
}

.profile-menu a {
    display: block;
    padding: 15px 20px;
    color: #3e5e3e;
    text-decoration: none;
    transition: all 0.3s;
}

.profile-menu a:hover,
.profile-menu a.active {
    background: #e8f5e9;
    color: #2e7d32;
    font-weight: 500;
    border-left: 4px solid #2e7d32;
}

.profile-content {
    flex: 1;
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.profile-content form {
    max-width: 450px;
}

.info-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
    flex-wrap: wrap;
}

.info-item label {
    width: 100px;
    font-weight: 500;
    color: #6b8c6b;
}

/* 头像网格 */
.avatar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.avatar-option {
    display: block;
    text-align: center;
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.avatar-option.selected {
    border-color: #2e7d32;
    background: #e8f5e9;
}

.avatar-option input {
    display: none;
}

.avatar-option img {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    border-radius: 50%;
    margin-bottom: 8px;
}

/* 表格 */
.table {
    width: 100%;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-top: 15px;
}

.table th,
.table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.table th {
    background: #e8f5e9;
    font-weight: 600;
}

/* 充值表单 */
.recharge-form {
    background: #f1f8e9;
    padding: 30px;
    border-radius: 12px;
    margin: 20px 0;
}

.recharge-tips {
    background: #fff8e1;
    padding: 20px;
    border-radius: 12px;
}

.recharge-tips ul {
    margin-left: 20px;
    color: #6b8c6b;
}

/* 分页 */
.pagination {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 30px 0;
}

.pagination a {
    padding: 8px 15px;
    background: #fff;
    border: 1px solid #c8e6c9;
    color: #2e7d32;
    text-decoration: none;
    border-radius: 6px;
}

.pagination a.active {
    background: #2e7d32;
    color: #fff;
    border-color: #2e7d32;
}

/* -------------------- 后台管理 -------------------- */
.admin-layout {
    display: flex;
    align-items: stretch;
    min-height: 100vh; 
}

.admin-sidebar {
    width: 250px;
    background: #2c3e2c;
    padding: 20px 0;
}

.admin-sidebar ul {
    list-style: none;
}

.admin-sidebar li a {
    display: block;
    padding: 12px 20px;
    color: #e8f5e9;
    text-decoration: none;
}

.admin-sidebar li a:hover,
.admin-sidebar li a.active {
    background: #1b5e20;
}

.admin-content {
    flex: 1;
    padding: 30px;
    background: #f5f9f5;
    overflow-y: auto;
}

/* 文本辅助 */
.text-success {
    color: #2e7d32;
}

.text-danger {
    color: #c62828;
}

.text-muted {
    color: #6b8c6b;
    font-size: 0.9rem;
}

.no-data {
    text-align: center;
    padding: 40px;
    color: #9e9e9e;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 20px 0;
    padding: 15px;
    background: #f1f8e9;
    border-radius: 8px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group label {
    font-weight: 500;
    color: #2e7d32;
}

.filter-group select {
    padding: 8px 12px;
    border: 1px solid #c8e6c9;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
}

/* ========== 移动端用户中心侧边栏（间距统一为20px） ========== */
.profile-menu-toggle {
    display: none;
    width: 100%;
    padding: 12px 15px;
    background: #2e7d32;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    margin-bottom: 20px;
}

.profile-menu-toggle:hover {
    background: #1b5e20;
}

.tag-list a {
    display: inline-block;
    margin: 3px 6px 3px 0;
    padding: 4px 12px;
    background: #e8f5e9;
    color: #2e7d32;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.9rem;
}
.tag-list a:hover {
    background: #2e7d32;
    color: #fff;
}

/* 视频属性信息 */
.video-attributes {
    background: #f9f9f9;
    padding: 15px 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.attribute-item {
    display: flex;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid #eee;
}

.attribute-item:last-child {
    border-bottom: none;
}

.attr-label {
    font-weight: 500;
    color: #555;
    min-width: 70px;
    margin-right: 15px;
}

.attr-value {
    color: #333;
    word-wrap: break-word;
}

/* tag标签样式 */
.tag-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
    padding-top: 10px;
    padding-left: 8px;
    border-top: none;
}
.tag-filters .label {
    font-weight: 500;
    color: #6b8c6b;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
    padding: 6px 11px 6px 0;
    display: inline-flex;
    align-items: center;
}
.tag-filters a {
    display: inline-flex;
    align-items: center;
    padding: 6px 15px;
    font-size: 0.85rem;
    line-height: 1.5;
    border: 1px solid #c8e6c9;
    background: #f9f9f9;
    color: #3e5e3e;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}
.tag-filters a:hover,
.tag-filters a.active {
    background: #2e7d32;
    color: #fff;
    border-color: #2e7d32;
}
.tag-filters .clear-filter {
    background: #ffebee;
    color: #c62828;
    border-color: #ef9a9a;
}
.tag-filters .clear-filter:hover {
    background: #ef5350;
    color: #fff;
}
.pagination .disabled {
    padding: 8px 15px;
    border: 1px solid #e0e0e0;
    color: #aaa;
    border-radius: 6px;
    cursor: not-allowed;
}
.pagination .dots {
    padding: 8px 10px;
    color: #666;
}

/* -------------------- 响应式通用调整 -------------------- */
@media (max-width: 992px) {
    .hero h1 {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    /* ---------- 全局头部调整 ---------- */
    .site-header .container {
        flex-direction: column;
        gap: 15px;
    }
    .site-nav ul {
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }
    .hero {
        padding: 50px 0;
    }
    .hero h1 {
        font-size: 2rem;
    }

    /* ---------- 视频网格 ---------- */
    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 15px;
    }

    /* ---------- 用户中心布局 ---------- */
    .profile-layout {
        flex-direction: column;
        gap: 0;                      /* 去除 flex 间隙，改用 margin 控制 */
    }
    .profile-sidebar {
        width: 100%;
        margin-bottom: 0;
        padding-bottom: 0;
    }
    .profile-content {
        padding-top: 0;              /* 去除顶部内边距，确保间距统一由下方元素控制 */
        margin-top: 0;
    }

    /* ---------- 菜单按钮 ---------- */
    .profile-menu-toggle {
        display: block;
        margin-bottom: 20px;          /* 与后续内容间距 20px */
    }

    /* ---------- 菜单列表（3列网格） ---------- */
    .profile-menu {
        display: none;               /* 默认隐藏 */
        grid-template-columns: repeat(3, 1fr);
        gap: 5px;
        padding: 8px;
        margin: 0 0 20px 0;          /* 展开后与下方内容间距 20px */
        background: #fff;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    }
    .profile-menu.show {
        display: grid;               /* 展开时使用网格 */
    }
    .profile-menu li {
        border-bottom: none;
        margin: 0;
        padding: 0;
    }
    .profile-menu li a {
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        padding: 8px 4px;
        font-size: 0.85rem;
        border-radius: 6px;
        height: 100%;
        box-sizing: border-box;
    }
    /* 高亮样式修正 */
    .profile-menu li a.active {
        background: #2e7d32;
        color: #fff;
        font-weight: 600;
    }

    /* ---------- 头像卡片 ---------- */
    .user-info-card {
        margin-bottom: 20px !important;   /* 与统一间距 20px 保持一致 */
    }
    /* 非个人资料页移动端隐藏头像卡片 */
    .profile-sidebar[data-page]:not([data-page="profile"]) .user-info-card {
        display: none;
    }

    /* ---------- 其他页面调整 ---------- */
    .info-item {
        flex-direction: row;
        align-items: center;
    }
    .info-item label {
        width: 100px;
        margin-bottom: 0;
    }
    .admin-layout {
        flex-direction: column;
    }
    .admin-sidebar {
        width: 100%;
    }
    .video-player-container {
        padding: 10px 0;
    }
    .video-detail {
        padding: 20px 15px;
    }
    .video-player-container #player {
        border-radius: 0;
    }
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .auth-container {
        margin: 20px;
        padding: 20px;
    }

    /* 个人资料页：菜单移动到头像上方 */
    .profile-sidebar[data-page="profile"] {
        display: flex;
        flex-direction: column;
    }
    .profile-sidebar[data-page="profile"] .profile-menu {
        order: -1;
        margin-bottom: 20px;  /* 菜单在头像上，菜单底部与头像间距 */
    }
}

/* 桌面端恢复 */
@media (min-width: 769px) {
    .profile-menu {
        display: block !important;
    }
    .profile-menu-toggle {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .video-grid {
        grid-template-columns: 1fr;
    }
    .search-form {
        flex-direction: column;
    }
    .search-form input,
    .search-form button {
        border-radius: 30px;
        width: 100%;
    }
    .search-form button {
        margin-top: 10px;
    }
    .category-tabs a {
        font-size: 0.9rem;
        padding: 6px 12px;
    }
    .table {
        font-size: 0.8rem;
    }
    .table th,
    .table td {
        padding: 8px 6px;
    }
}