/* ========================================
   视频直播网站样式表
   ======================================== */

/* 基础样式重置 */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary-color: #ff6b6b;
    --primary-hover: #ff5252;
    --secondary-color: #4ecdc4;
    --bg-color: #0f0f0f;
    --card-bg: #1a1a1a;
    --surface-bg: #242424;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #666666;
    --border-color: #333333;
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --error-color: #f44336;
    --live-color: #ff2d55;
    --gradient-primary: linear-gradient(135deg, #ff6b6b 0%, #ff8e8e 100%);
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --transition: all 0.3s ease;
}

html {
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========================================
   按钮样式
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

/* ========================================
   头部导航
   ======================================== */
.main-header {
    background: rgba(15, 15, 15, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
    gap: 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-color);
}

.logo i {
    font-size: 28px;
}

.main-nav {
    display: flex;
    gap: 8px;
    flex: 1;
}

.nav-item {
    padding: 8px 16px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-item:hover,
.nav-item.active {
    color: var(--text-primary);
    background: var(--surface-bg);
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--surface-bg);
    border-radius: 24px;
    padding: 4px;
    width: 280px;
}

.search-box input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 8px 16px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-box button {
    background: var(--primary-color);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: var(--transition);
}

.search-box button:hover {
    background: var(--primary-hover);
}

.user-area {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
}

.user-avatar-default {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-avatar-default i {
    font-size: 18px;
    color: white;
}

.user-avatar:hover {
    border-color: var(--primary-color);
}

.user-dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    min-width: 180px;
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: var(--transition);
    box-shadow: var(--shadow-lg);
}

.user-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 8px;
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text-secondary);
    font-size: 14px;
}

.dropdown-menu a:hover {
    background: var(--surface-bg);
    color: var(--text-primary);
}

.dropdown-menu a.logout {
    color: var(--error-color);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
}

.auth-buttons {
    display: flex;
    gap: 12px;
}

/* ========================================
   首页内容
   ======================================== */
.hero-banner {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    padding: 60px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.1)"/></svg>') repeat;
    background-size: 50px 50px;
    animation: float 20s linear infinite;
}

@keyframes float {
    0% { transform: translateY(0); }
    100% { transform: translateY(-50px); }
}

.hero-banner h1 {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 16px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

.hero-banner p {
    font-size: 18px;
    color: var(--text-secondary);
    position: relative;
}

.category-nav {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 0;
    position: sticky;
    top: 64px;
    z-index: 100;
}

.category-list {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scrollbar-width: none;
}

.category-list::-webkit-scrollbar {
    display: none;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--surface-bg);
    border-radius: 24px;
    white-space: nowrap;
    color: var(--text-secondary);
    font-size: 14px;
    transition: var(--transition);
}

.category-item:hover,
.category-item.active {
    background: var(--primary-color);
    color: white;
}

.live-section {
    padding: 40px 0;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.section-header h2 {
    font-size: 24px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header h2 i {
    color: var(--primary-color);
}

.live-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.live-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.live-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.card-cover {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.live-card:hover .card-cover img {
    transform: scale(1.05);
}

.live-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--live-color);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.viewer-count {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-info {
    padding: 16px;
    display: flex;
    gap: 12px;
}

.streamer-avatar {
    flex-shrink: 0;
}

.streamer-avatar img {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}

.stream-info {
    flex: 1;
    min-width: 0;
}

.stream-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.streamer-name {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.category-tag {
    display: inline-block;
    padding: 2px 8px;
    background: var(--surface-bg);
    border-radius: 4px;
    font-size: 12px;
    color: var(--text-muted);
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 18px;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
}

.page-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition);
}

.page-item:hover,
.page-item.active {
    background: var(--primary-color);
    color: white;
}

/* ========================================
   直播间页面
   ======================================== */
.room-page {
    background: var(--bg-color);
}

.room-container {
    padding: 20px;
}

.room-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 20px;
    max-width: 1600px;
    margin: 0 auto;
}

.video-section {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.video-player-container {
    position: relative;
    aspect-ratio: 16/9;
    background: #000;
}

.player-switch {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.btn-small {
    padding: 6px 14px;
    font-size: 12px;
    border-radius: var(--radius-sm);
    background: rgba(0, 0, 0, 0.7);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(4px);
}

.btn-small:hover {
    background: rgba(0, 0, 0, 0.9);
    color: var(--text-primary);
    border-color: var(--primary-color);
}

.btn-small.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.video-player {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.offline-screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.offline-screen i {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.offline-screen p {
    font-size: 20px;
    margin-bottom: 8px;
}

.offline-screen span {
    font-size: 14px;
    color: var(--text-muted);
}

.room-info-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.streamer-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.streamer-avatar-large {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color);
}

.streamer-details h1 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.streamer-details p {
    display: flex;
    align-items: center;
    gap: 12px;
}

.room-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.viewer-stats {
    display: flex;
    gap: 16px;
    color: var(--text-secondary);
    font-size: 14px;
}

.viewer-stats span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.room-description {
    padding: 20px;
}

.room-description h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

.room-description p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.8;
}

/* 聊天区域 */
.chat-section {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 104px);
    position: sticky;
    top: 84px;
}

.chat-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.chat-header h3 {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-message {
    font-size: 14px;
    line-height: 1.5;
}

.chat-message .username {
    color: var(--primary-color);
    font-weight: 500;
}

.chat-message .message-text {
    color: var(--text-secondary);
}

.chat-input-area {
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.input-wrapper {
    display: flex;
    gap: 10px;
}

.input-wrapper input {
    flex: 1;
    background: var(--surface-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.input-wrapper input:focus {
    border-color: var(--primary-color);
}

.input-wrapper input::placeholder {
    color: var(--text-muted);
}

.input-wrapper button {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: var(--radius-md);
}

.login-prompt {
    text-align: center;
    padding: 12px;
    color: var(--text-secondary);
    font-size: 14px;
}

.login-prompt a {
    color: var(--primary-color);
}

/* ========================================
   认证页面
   ======================================== */
.auth-page {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-container {
    width: 100%;
    max-width: 420px;
}

.auth-box {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 40px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.auth-header p {
    color: var(--text-secondary);
}

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.alert-error {
    background: rgba(244, 67, 54, 0.1);
    color: var(--error-color);
    border: 1px solid rgba(244, 67, 54, 0.2);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    position: relative;
}

.form-group label {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.form-group input {
    width: 100%;
    background: var(--surface-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px 16px 14px 48px;
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
    transition: var(--transition);
}

.form-group input:focus {
    border-color: var(--primary-color);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
}

.toggle-password:hover {
    color: var(--text-secondary);
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.auth-footer p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 16px;
}

.auth-footer a {
    color: var(--primary-color);
}

.auth-footer a:hover {
    text-decoration: underline;
}

.back-home {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 14px;
}

.back-home:hover {
    color: var(--text-secondary);
}

/* ========================================
   页脚
   ======================================== */
.main-footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    padding: 60px 0 30px;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 16px;
}

.footer-section h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.footer-section p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.8;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul a {
    color: var(--text-secondary);
    font-size: 14px;
}

.footer-section ul a:hover {
    color: var(--primary-color);
}

.social-links {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: var(--surface-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--primary-color);
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.footer-bottom p {
    color: var(--text-muted);
    font-size: 14px;
}

/* ========================================
   响应式设计
   ======================================== */
@media (max-width: 1200px) {
    .room-layout {
        grid-template-columns: 1fr;
    }
    
    .chat-section {
        height: 500px;
        position: static;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
        height: auto;
        padding: 12px 0;
    }
    
    .main-nav {
        order: 3;
        width: 100%;
        justify-content: center;
    }
    
    .search-box {
        width: 200px;
    }
    
    .hero-banner h1 {
        font-size: 32px;
    }
    
    .live-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 16px;
    }
    
    .footer-content {
        grid-template-columns: 1fr 1fr;
    }
    
    .room-info-bar {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .live-grid {
        grid-template-columns: 1fr;
    }
    
    .auth-box {
        padding: 24px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .social-links {
        justify-content: center;
    }
}

/* 默认头像和封面样式 */
.default-cover {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.default-cover i {
    font-size: 48px;
    color: rgba(255,255,255,0.8);
}

.default-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.default-avatar i {
    font-size: 20px;
    color: white;
}

.default-avatar-large {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid var(--primary-color);
}

.default-avatar-large i {
    font-size: 28px;
    color: white;
}

