/* 구아바티비 스타일 - 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 - 轮播图样式 (Cover Flow) */
.carousel-banner {
    position: relative;
    margin-bottom: 60px;
    padding: 40px 0;
}

.carousel-container {
    position: relative;
    width: 100%;
    height: 280px;
    overflow: hidden;
}

.carousel-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    perspective: 1000px;
}

.carousel-slide {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 180px;
    height: 240px;
    margin-left: -90px;
    margin-top: -120px;
    transition: all 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
    cursor: pointer;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.carousel-slide.prev {
    transform: translateX(-210px) scale(0.85);
    opacity: 0.7;
    filter: blur(1px) brightness(0.7);
    z-index: 1;
}

.carousel-slide.active {
    transform: translateX(0) scale(1);
    opacity: 1;
    filter: none;
    z-index: 2;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.carousel-slide.next {
    transform: translateX(210px) scale(0.85);
    opacity: 0.7;
    filter: blur(1px) brightness(0.7);
    z-index: 1;
}

.carousel-slide.far-prev {
    transform: translateX(-400px) scale(0.7);
    opacity: 0.4;
    filter: blur(2px) brightness(0.5);
    z-index: 0;
}

.carousel-slide.far-next {
    transform: translateX(400px) scale(0.7);
    opacity: 0.4;
    filter: blur(2px) brightness(0.5);
    z-index: 0;
}

.carousel-slide.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.5);
    z-index: -1;
}

.slide-image-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    overflow: hidden;
}

.slide-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slide-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.slide-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.slide-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #fff;
    object-fit: cover;
}

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

.slide-title {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.slide-streamer {
    font-size: 12px;
    color: rgba(255,255,255,0.85);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* LIVE 标签 */
.slide-overlay .live-badge {
    align-self: flex-start;
    padding: 3px 8px;
    font-size: 11px;
    margin-bottom: 4px;
}

/* 轮播箭头 */
.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(255,255,255,0.95);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}

.carousel-arrow:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.08);
    box-shadow: 0 4px 12px rgba(0,0,0,0.18);
}

.carousel-prev {
    left: 10px;
}

.carousel-next {
    right: 10px;
}

.carousel-arrow svg {
    width: 20px;
    height: 20px;
    color: #333;
}

/* 轮播指示器 */
.carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 16px;
}

.indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(0,0,0,0.15);
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator.active {
    width: 24px;
    border-radius: 4px;
    background: var(--primary-color);
}

/* 响应式 */
@media (max-width: 1024px) {
    .carousel-slide {
        width: 140px;
        height: 210px;
    }
    
    .carousel-slide.prev,
    .carousel-slide.next {
        transform: translateX(-170px) scale(0.8);
    }
    
    .carousel-slide.next {
        transform: translateX(170px) scale(0.8);
    }
    
    .carousel-slide.far-prev {
        transform: translateX(-320px) scale(0.62);
    }
    
    .carousel-slide.far-next {
        transform: translateX(320px) scale(0.62);
    }
}

@media (max-width: 768px) {
    .carousel-container {
        height: 220px;
    }
    
    .carousel-slide {
        width: 120px;
        height: 180px;
    }
    
    .carousel-slide.prev,
    .carousel-slide.next {
        transform: translateX(-140px) scale(0.75);
        opacity: 0.5;
    }
    
    .carousel-slide.next {
        transform: translateX(140px) scale(0.75);
    }
    
    .carousel-slide.far-prev,
    .carousel-slide.far-next {
        opacity: 0;
        pointer-events: none;
    }
    
    .carousel-arrow {
        width: 36px;
        height: 36px;
    }
    
    .carousel-prev {
        left: 5px;
    }
    
    .carousel-next {
        right: 5px;
    }
    
    .slide-title {
        font-size: 12px;
    }
    
    .slide-avatar {
        width: 28px;
        height: 28px;
    }
}

/* 分类标签 */
.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 {
        display: none;
    }
    
    .sidebar-footer {
        display: block !important;
    }
    
    .sidebar-footer a {
        display: block !important;
        font-size: 10px !important;
        padding: 8px !important;
        text-align: center;
        color: var(--text-secondary);
        text-decoration: none;
    }
    
    .sidebar-footer a::before {
        display: none;
    }
    
    .nav-item {
        justify-content: center;
        padding: 12px;
    }
    
    .main-content {
        margin-left: 70px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        display: flex !important;
        flex-direction: column;
        width: 60px;
        position: fixed;
        left: 0;
        top: 60px;
        bottom: 0;
        z-index: 100;
        background: var(--bg-card);
        box-shadow: 2px 0 8px rgba(0,0,0,0.1);
        overflow-y: auto;
    }
    
    .sidebar-nav {
        padding: 10px 0;
        flex: 1;
    }
    
    .nav-item {
        padding: 12px 8px;
        justify-content: center;
    }
    
    .nav-item span {
        display: none;
    }
    
    .nav-item svg {
        width: 20px;
        height: 20px;
    }
    
    .sidebar-footer {
        display: block !important;
        padding: 10px 0;
        border-top: 1px solid var(--border-color);
    }
    
    .sidebar-footer a {
        display: block !important;
        font-size: 10px !important;
        padding: 8px !important;
        text-align: center;
        color: var(--text-secondary);
        text-decoration: none;
    }
    
    .main-content {
        margin-left: 60px;
        padding: 15px;
    }
    
    .featured-banner {
        flex-direction: column;
    }
    
    .featured-side {
        flex-direction: row;
    }
    
    .featured-side-item {
        aspect-ratio: 16/9;
    }
    
    .header-center {
        padding: 0 10px;
    }
    /* 手机端 header 样式 */
    .top-header {
        padding: 0 10px;
    }
    
    .header-left {
        flex: 0 0 auto;
    }
    
    .header-left {
        flex: 0 0 auto !important;
        width: auto !important;
    }
    
    .logo-text {
        font-size: 18px !important;
    }
    
    .header-center {
        flex: 1 !important;
        min-width: 0 !important;
        padding: 0 6px !important;
    }
    
    .search-form {
        max-width: 200px !important;
        width: 100% !important;
    }
    
    .search-input {
        padding: 0 10px !important;
        font-size: 13px !important;
        min-width: 0 !important;
    }
    
    .search-btn {
        width: 36px !important;
    }
    
    .header-right {
        flex: 0 0 auto !important;
        width: auto !important;
        gap: 6px !important;
        margin-left: 6px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: flex-end !important;
    }
    
    .login-btn {
        padding: 5px 10px !important;
        font-size: 12px !important;
        white-space: nowrap !important;
        display: inline-block !important;
    }
    
    .user-menu {
        padding: 4px 6px !important;
        gap: 4px !important;
        display: flex !important;
        align-items: center !important;
    }
    
    .user-name {
        font-size: 12px !important;
        max-width: 70px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        display: inline !important;
    }
    
    .user-grade-icon {
        height: 16px !important;
    }
    
    .dropdown-arrow {
        font-size: 8px !important;
    }
    
    .login-btn {
        padding: 6px 12px;
        font-size: 12px;
    }

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

/* ========== 浮动客服按钮 ========== */
.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;
    }
}
