/* 구아바티비 스타일 - SOOP 참고 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #00c73c;
    --primary-hover: #00a832;
    --bg-dark: #f0f2f5;
    --bg-darker: #e8eaef;
    --bg-card: #ffffff;
    --bg-hover: #f5f7fa;
    --text-primary: #1a1a2e;
    --text-secondary: #555770;
    --text-muted: #8e90a6;
    --border-color: #e0e3eb;
    --danger-color: #ff3333;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
}

body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Malgun Gothic', sans-serif;
    background: linear-gradient(135deg, #f0f2f5 0%, #e4e8f0 25%, #dce1ec 50%, #d4dae8 75%, #ccd3e4 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    color: var(--text-primary);
    min-height: 100vh;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

a {
    color: inherit;
    text-decoration: none;
}

/* ========== 顶部导航栏 ========== */
.top-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 20px;
    z-index: 1000;
}

.header-left {
    flex: 0 0 200px;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 8px;
}

.logo-icon {
    font-size: 28px;
}

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

.logo-accent {
    color: var(--primary-color);
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 0 40px;
}

.search-form {
    display: flex;
    width: 100%;
    max-width: 500px;
}

.search-input {
    flex: 1;
    height: 40px;
    padding: 0 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px 0 0 20px;
    font-size: 14px;
    outline: none;
    color: var(--text-primary);
    transition: border-color 0.2s;
}

.search-input:focus {
    border-color: var(--primary-color);
}

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

.search-btn {
    width: 50px;
    height: 40px;
    background: var(--primary-color);
    border: none;
    border-radius: 0 20px 20px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.search-btn:hover {
    background: var(--primary-hover);
}

.header-right {
    flex: 0 0 200px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.header-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
}

.header-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.login-btn {
    padding: 8px 20px;
    background: var(--primary-color);
    color: #fff;
    text-decoration: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
}

.login-btn:hover {
    background: var(--primary-hover);
}

.header-user {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--border-color);
}

.header-user:hover {
    border-color: var(--primary-color);
}

.user-avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ========== 主容器 ========== */
.main-container {
    display: flex;
    margin-top: 60px;
    min-height: calc(100vh - 60px);
}

/* ========== 左侧边栏 ========== */
.sidebar {
    position: fixed;
    top: 60px;
    left: 0;
    width: 220px;
    height: calc(100vh - 60px);
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(10px);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    padding: 16px 0;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: var(--bg-darker);
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.sidebar-nav {
    padding: 0 12px;
    margin-bottom: 20px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s;
}

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

.nav-item.active {
    background: rgba(0, 199, 60, 0.1);
    color: var(--primary-color);
}

/* 人气列表 */
.popular-section {
    padding: 0 12px;
}

.popular-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px 12px;
}

.popular-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.refresh-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all 0.2s;
}

.refresh-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

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

.popular-item a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.2s;
}

.popular-item a:hover {
    background: var(--bg-hover);
}

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

.popular-info {
    flex: 1;
    min-width: 0;
}

.popular-name {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.popular-category {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.popular-viewers {
    font-size: 12px;
    color: var(--danger-color);
    font-weight: 500;
}

/* 侧边栏底部 */
.sidebar-footer {
    padding: 20px 12px;
    border-top: 1px solid var(--border-color);
    margin-top: 20px;
}

.sidebar-footer a {
    display: block;
    padding: 10px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    border-radius: 8px;
    transition: all 0.2s;
}

.sidebar-footer a:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* ========== 主要内容区 ========== */
.main-content {
    flex: 1;
    margin-left: 220px;
    padding: 24px;
}

/* 推荐 Banner - 主从联动 */
.featured-banner {
    position: relative;
    margin-bottom: 32px;
    border-radius: 12px;
    overflow: hidden;
}

.featured-main {
    width: 100%;
}

.featured-link {
    position: relative;
    display: block;
    text-decoration: none;
}

.featured-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    display: block;
}

.featured-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px;
    background: linear-gradient(transparent, rgba(0,0,0,0.9));
    color: #fff;
}

.live-badge {
    display: inline-block;
    padding: 4px 10px;
    background: var(--danger-color);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    border-radius: 4px;
    margin-bottom: 8px;
}

.live-badge.small {
    padding: 2px 6px;
    font-size: 10px;
}

.featured-info h2 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 6px;
}

.featured-streamer {
    font-size: 15px;
    opacity: 0.9;
}

.featured-category {
    display: inline-block;
    margin-top: 10px;
    padding: 4px 10px;
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
    font-size: 12px;
}

/* 右侧小框 - 叠加在大框内部 */
.featured-side {
    position: absolute;
    top: 16px;
    right: 16px;
    bottom: 16px;
    width: 280px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 10;
}

.featured-side-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    flex: 1;
}

.featured-side-item:hover {
    transform: scale(1.03);
    border-color: rgba(0, 199, 60, 0.6);
}

.featured-side-item.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 16px rgba(0, 199, 60, 0.5);
}

.featured-side-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 199, 60, 0.1);
    pointer-events: none;
    z-index: 1;
}

.side-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.side-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
    display: flex;
    align-items: center;
    gap: 6px;
}

.side-name {
    color: #fff;
    font-size: 13px;
    font-weight: 500;
}

/* 分类标签 */
.category-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.category-tab {
    padding: 8px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.category-tab:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.category-tab.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

/* 热门直播 */
.popular-live-section {
    margin-top: 32px;
}

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

.section-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

.more-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
}

.more-link:hover {
    color: var(--primary-color);
}

.live-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.live-card {
    text-decoration: none;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-card);
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.live-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.live-thumb-wrapper {
    position: relative;
    padding-top: 56.25%;
    background: var(--bg-darker);
}

.live-thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.viewer-count {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    border-radius: 4px;
}

.live-dot {
    width: 6px;
    height: 6px;
    background: var(--danger-color);
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.live-info {
    display: flex;
    gap: 12px;
    padding: 14px;
}

.live-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.live-text {
    flex: 1;
    min-width: 0;
}

.live-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.live-streamer {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.live-category {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ========== 表单样式 ========== */
.form-container {
    max-width: 400px;
    margin: 60px auto;
    padding: 40px;
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.form-title {
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 30px;
    color: var(--text-primary);
}

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

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

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-primary);
    transition: border-color 0.2s;
}

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

.form-control::placeholder {
    color: var(--text-muted);
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: var(--primary-color);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

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

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

.form-footer a {
    color: var(--primary-color);
    text-decoration: none;
}

.form-footer a:hover {
    text-decoration: underline;
}

/* ========== 响应式 ========== */
@media (max-width: 1024px) {
    .sidebar {
        width: 70px;
    }
    
    .nav-item span,
    .popular-section,
    .sidebar-footer {
        display: none;
    }
    
    .nav-item {
        justify-content: center;
        padding: 12px;
    }
    
    .main-content {
        margin-left: 70px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .featured-banner {
        flex-direction: column;
    }
    
    .featured-side {
        flex-direction: row;
    }
    
    .featured-side-item {
        aspect-ratio: 16/9;
    }
    
    .header-center {
        padding: 0 10px;
    }
    
    .live-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }
}

/* ========== 浮动客服按钮 ========== */
.floating-chat-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 56px;
    height: 56px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 199, 60, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    z-index: 1000;
    text-decoration: none;
    color: #fff;
}

.floating-chat-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 199, 60, 0.6);
}

/* 响应式 */
@media (max-width: 768px) {
    .floating-chat-btn {
        bottom: 20px;
        right: 20px;
        width: 48px;
        height: 48px;
        font-size: 20px;
    }
}
