/* X (Twitter) 风格模板 */
:root {
    --x-bg: #000000;
    --x-bg-secondary: #16181c;
    --x-bg-hover: #1d1f23;
    --x-border: #2f3336;
    --x-text: #ffffff;
    --x-text-secondary: #71767a;
    --x-primary: #1d9bf0;
    --x-primary-hover: #1a8cd8;
    --x-error: #f4212e;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.x-body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--x-bg);
    color: var(--x-text);
    line-height: 1.5;
}

.x-app {
    display: flex;
    min-height: 100vh;
    max-width: 1265px;
    margin: 0 auto;
}

/* 左侧导航栏 */
.x-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 275px;
    height: 100vh;
    padding: 0 8px;
    overflow-y: auto;
    border-right: 1px solid var(--x-border);
}

.x-sidebar-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 8px 0;
}

.x-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    margin: 4px 0;
    color: var(--x-text);
    text-decoration: none;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.x-logo:hover {
    background: var(--x-bg-hover);
}

.x-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 8px 0;
}

.x-nav-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px 20px;
    color: var(--x-text);
    text-decoration: none;
    border-radius: 50px;
    transition: background-color 0.2s;
    font-size: 20px;
    font-weight: 400;
}

.x-nav-item:hover {
    background: var(--x-bg-hover);
}

.x-nav-item.is-active {
    font-weight: 700;
}

.x-nav-item svg {
    width: 26px;
    height: 26px;
}

.x-post-btn {
    width: 100%;
    margin: 16px 0;
    padding: 16px;
    background: var(--x-primary);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s;
}

.x-post-btn:hover {
    background: var(--x-primary-hover);
}

.x-user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: auto;
    padding: 12px;
    border-radius: 50px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.x-user-card:hover {
    background: var(--x-bg-hover);
}

.x-user-avatar {
    flex-shrink: 0;
}

.x-avatar-placeholder {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--x-primary);
    color: #fff;
    border-radius: 50%;
    font-weight: 700;
    font-size: 18px;
}

.x-user-info {
    flex: 1;
    min-width: 0;
}

.x-user-name {
    font-weight: 700;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.x-user-handle {
    color: var(--x-text-secondary);
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 主内容区 */
.x-main {
    flex: 1;
    margin-left: 275px;
    margin-right: 350px;
    min-height: 100vh;
    border-right: 1px solid var(--x-border);
}

.x-content {
    max-width: 600px;
    margin: 0 auto;
}

/* 顶部标签 */
.x-tabs {
    display: flex;
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--x-border);
}

.x-tab {
    flex: 1;
    padding: 16px;
    text-align: center;
    color: var(--x-text-secondary);
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
    transition: background-color 0.2s;
    position: relative;
}

.x-tab:hover {
    background: var(--x-bg-hover);
}

.x-tab.is-active {
    color: var(--x-text);
}

.x-tab.is-active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 56px;
    height: 4px;
    background: var(--x-primary);
    border-radius: 2px;
}

/* 发帖输入框 */
.x-compose {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--x-border);
}

.x-compose-avatar {
    flex-shrink: 0;
}

.x-compose-input-wrapper {
    flex: 1;
}

.x-compose-input {
    width: 100%;
    padding: 12px 0;
    background: transparent;
    border: none;
    color: var(--x-text-secondary);
    font-size: 20px;
    outline: none;
}

.x-compose-input::placeholder {
    color: var(--x-text-secondary);
}

/* 视频流 */
.x-feed {
    display: flex;
    flex-direction: column;
}

.x-post {
    padding: 12px 16px;
    border-bottom: 1px solid var(--x-border);
    transition: background-color 0.2s;
}

.x-post:hover {
    background: var(--x-bg-hover);
}

.x-post-header {
    display: flex;
    gap: 12px;
}

.x-post-avatar {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
}

.x-post-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.x-post-info {
    flex: 1;
    min-width: 0;
}

.x-post-author {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.x-author-name {
    font-weight: 700;
    font-size: 15px;
    color: var(--x-text);
}

.x-author-handle {
    color: var(--x-text-secondary);
    font-size: 15px;
}

.x-post-time {
    color: var(--x-text-secondary);
    font-size: 15px;
}

.x-post-content {
    margin-top: 4px;
}

.x-post-link {
    color: inherit;
    text-decoration: none;
}

.x-post-text {
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 12px;
    word-wrap: break-word;
}

.x-post-media {
    margin-top: 12px;
    border-radius: 16px;
    overflow: hidden;
}

.x-post-media img {
    width: 100%;
    height: auto;
    display: block;
}

.x-post-media-large {
    max-height: 510px;
}

.x-post-media-large img {
    max-height: 510px;
    object-fit: cover;
}

.x-post-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    padding: 0 8px;
}

.x-action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: transparent;
    border: none;
    color: var(--x-text-secondary);
    cursor: pointer;
    border-radius: 50px;
    transition: all 0.2s;
    font-size: 13px;
}

.x-action-btn:hover {
    background: rgba(29, 155, 240, 0.1);
    color: var(--x-primary);
}

/* 右侧边栏 */
.x-rightbar {
    position: fixed;
    right: 0;
    top: 0;
    width: 350px;
    height: 100vh;
    padding: 0 16px;
    overflow-y: auto;
}

.x-rightbar-inner {
    padding: 8px 0;
}

/* 搜索框 */
.x-search-box {
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 8px 0;
    background: var(--x-bg);
}

.x-search-input-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--x-bg-secondary);
    border-radius: 50px;
}

.x-search-input-wrapper svg {
    color: var(--x-text-secondary);
    flex-shrink: 0;
}

.x-search-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--x-text);
    font-size: 15px;
    outline: none;
}

.x-search-input::placeholder {
    color: var(--x-text-secondary);
}

/* 小部件 */
.x-widget {
    margin: 16px 0;
    background: var(--x-bg-secondary);
    border-radius: 16px;
    overflow: hidden;
}

.x-widget-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--x-border);
}

.x-widget-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--x-text);
}

.x-widget-content {
    padding: 12px 16px;
}

.x-widget-text {
    font-size: 15px;
    color: var(--x-text);
    margin-bottom: 12px;
}

.x-widget-btn {
    width: 100%;
    padding: 12px;
    background: var(--x-primary);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s;
}

.x-widget-btn:hover {
    background: var(--x-primary-hover);
}

/* 趋势 */
.x-trend-item {
    display: block;
    padding: 12px 0;
    color: inherit;
    text-decoration: none;
    transition: background-color 0.2s;
    border-radius: 8px;
}

.x-trend-item:hover {
    background: var(--x-bg-hover);
}

.x-trend-category {
    font-size: 13px;
    color: var(--x-text-secondary);
    margin-bottom: 2px;
}

.x-trend-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--x-text);
    margin-bottom: 2px;
}

.x-trend-count {
    font-size: 13px;
    color: var(--x-text-secondary);
}

.x-widget-more {
    display: block;
    padding: 16px 0 0;
    color: var(--x-primary);
    text-decoration: none;
    font-size: 15px;
}

.x-widget-more:hover {
    text-decoration: underline;
}

/* 推荐关注 */
.x-follow-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
}

.x-follow-avatar {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
}

.x-follow-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.x-follow-info {
    flex: 1;
    min-width: 0;
}

.x-follow-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--x-text);
    margin-bottom: 2px;
}

.x-follow-handle {
    font-size: 15px;
    color: var(--x-text-secondary);
}

.x-follow-btn {
    flex-shrink: 0;
    padding: 8px 16px;
    background: var(--x-text);
    color: var(--x-bg);
    border: none;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s;
}

.x-follow-btn:hover {
    background: var(--x-text-secondary);
}

/* 列表页 */
.x-list-header {
    padding: 16px;
    border-bottom: 1px solid var(--x-border);
}

.x-list-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--x-text);
    margin-bottom: 4px;
}

.x-list-count {
    font-size: 13px;
    color: var(--x-text-secondary);
}

.x-empty {
    padding: 48px 16px;
    text-align: center;
    color: var(--x-text-secondary);
}

/* 分页 */
.x-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 16px;
}

.x-page-btn {
    padding: 8px 16px;
    background: var(--x-bg-secondary);
    color: var(--x-text);
    text-decoration: none;
    border-radius: 50px;
    font-size: 15px;
    transition: background-color 0.2s;
}

.x-page-btn:hover {
    background: var(--x-bg-hover);
}

.x-page-info {
    font-size: 15px;
    color: var(--x-text-secondary);
}

/* 详情页 */
.x-post-detail {
    border-bottom: 1px solid var(--x-border);
}

.x-player-section {
    padding: 16px;
    border-bottom: 1px solid var(--x-border);
}

.x-player-wrapper {
    position: relative;
    width: 100%;
}

.x-player-wrapper .player-ad-layer {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    z-index: 10;
    overflow: hidden;
}

.x-episode-section {
    padding: 16px;
    border-bottom: 1px solid var(--x-border);
}

.x-episode-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--x-text);
    margin-bottom: 16px;
}

.x-episode-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.x-episode-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.x-episode-group-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--x-text);
}

.x-episode-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.x-episode-item,
.x-episode-btn {
    padding: 8px 16px;
    background: var(--x-bg-secondary);
    color: var(--x-text);
    text-decoration: none;
    border-radius: 50px;
    font-size: 15px;
    transition: all 0.2s;
}

.x-episode-item:hover,
.x-episode-btn:hover {
    background: var(--x-bg-hover);
}

.x-episode-item.is-active,
.x-episode-btn.is-active {
    background: var(--x-primary);
    color: #fff;
}

.x-episode-btn {
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.x-related-section {
    padding: 16px;
}

.x-related-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--x-text);
    margin-bottom: 16px;
}

/* 播放页 */
.x-play-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-bottom: 1px solid var(--x-border);
}

.x-back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    color: var(--x-text);
    text-decoration: none;
    border-radius: 50px;
    transition: background-color 0.2s;
}

.x-back-btn:hover {
    background: var(--x-bg-hover);
}

.x-play-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--x-text);
}

/* 移动端菜单按钮 */
.x-mobile-menu-btn {
    display: none;
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1000;
    width: 40px;
    height: 40px;
    padding: 8px;
    background: var(--x-bg-secondary);
    border: 1px solid var(--x-border);
    border-radius: 50%;
    color: var(--x-text);
    cursor: pointer;
    transition: background-color 0.2s;
}

.x-mobile-menu-btn:hover {
    background: var(--x-bg-hover);
}

.x-mobile-menu-btn svg {
    width: 100%;
    height: 100%;
}

/* 移动端遮罩 */
.x-mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
}

.x-mobile-overlay.is-open {
    display: block;
}

/* 移动端 */
@media (max-width: 1024px) {
    .x-mobile-menu-btn {
        display: block;
    }

    .x-sidebar {
        position: fixed;
        z-index: 999;
        transform: translateX(-100%);
        transition: transform 0.3s;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.3);
    }

    .x-sidebar.is-open {
        transform: translateX(0);
    }

    .x-main {
        margin-left: 0;
        margin-right: 0;
    }

    .x-rightbar {
        display: none;
    }

    .x-content {
        padding-top: 60px;
    }
}

@media (max-width: 768px) {
    .x-sidebar {
        width: 100%;
        max-width: 300px;
    }

    .x-content {
        max-width: 100%;
        padding-top: 60px;
    }

    .x-post-actions {
        padding: 0;
        justify-content: space-around;
    }

    .x-action-btn {
        flex: 1;
        justify-content: center;
    }

    .x-action-btn span {
        display: none;
    }

    .x-tabs {
        position: sticky;
        top: 0;
        z-index: 10;
    }

    .x-compose {
        padding: 8px 12px;
    }

    .x-compose-input {
        font-size: 18px;
    }

    .x-post {
        padding: 12px;
    }

    .x-post-text {
        font-size: 15px;
    }

    .x-post-media-large {
        max-height: 300px;
    }

    .x-player-section {
        padding: 12px;
    }

    .x-episode-section {
        padding: 12px;
    }

    .x-play-header {
        padding: 12px;
        flex-wrap: wrap;
    }

    .x-play-title {
        font-size: 18px;
    }
}

