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

html {
    height: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #000;
    color: #e7e9ea;
    line-height: 1.5;
    overflow-x: hidden;
}

.container {
    display: flex;
    min-height: 100vh;
    max-width: 1280px;
    margin: 0 auto;
    position: relative;
}

/* サイドバー */
.sidebar {
    width: 275px;
    padding: 0 20px;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.logo {
    padding: 16px 0;
}

.logo-icon {
    width: 28px;
    height: 28px;
    fill: #e7e9ea;
    cursor: pointer;
}

.nav-menu {
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    margin: 4px 0;
    text-decoration: none;
    color: #e7e9ea;
    font-size: 20px;
    border-radius: 9999px;
    transition: background-color 0.2s;
}

.nav-item:hover {
    background-color: #181818;
}

.nav-item.active {
    font-weight: 700;
}

.nav-icon {
    width: 26px;
    height: 26px;
    fill: currentColor;
    margin-right: 20px;
}

.post-button {
    width: 100%;
    padding: 16px;
    margin: 16px 0;
    background-color: #1d9bf0;
    color: white;
    border: none;
    border-radius: 9999px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s;
}

.post-button:hover {
    background-color: #1a8cd8;
}

.user-menu {
    display: flex;
    align-items: center;
    padding: 12px;
    margin-bottom: 12px;
    border-radius: 9999px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.user-menu:hover {
    background-color: #181818;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background-color: #16181c;
}

.user-info {
    flex: 1;
}

.user-name {
    font-weight: 700;
    font-size: 15px;
}

.user-handle {
    color: #71767b;
    font-size: 15px;
}

.more-icon {
    width: 18px;
    height: 18px;
    fill: #e7e9ea;
}

/* メインコンテンツ */
.main-content {
    flex: 1;
    margin-left: 275px;
    margin-right: 350px;
    border-left: 1px solid #2f3336;
    border-right: 1px solid #2f3336;
    min-height: 100vh;
}

.header {
    position: sticky;
    top: 0;
    background-color: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid #2f3336;
}

.header h1 {
    font-size: 20px;
    font-weight: 700;
    padding: 16px 16px 0;
}

.header-tabs {
    display: flex;
    margin-top: 16px;
}

.tab {
    flex: 1;
    padding: 16px;
    background: none;
    border: none;
    color: #71767b;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    transition: background-color 0.2s;
}

.tab:hover {
    background-color: #181818;
}

.tab.active {
    color: #e7e9ea;
    font-weight: 700;
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 56px;
    height: 4px;
    background-color: #1d9bf0;
    border-radius: 9999px;
}

/* 投稿フォーム */
.post-form {
    display: flex;
    padding: 16px;
    border-bottom: 1px solid #2f3336;
}

.post-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    background-color: #16181c;
    flex-shrink: 0;
}

.post-input-area {
    flex: 1;
}

.post-input {
    width: 100%;
    background: none;
    border: none;
    color: #e7e9ea;
    font-size: 20px;
    resize: none;
    outline: none;
    min-height: 52px;
    font-family: inherit;
}

.post-input::placeholder {
    color: #71767b;
}

.post-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #2f3336;
}

.post-options {
    display: flex;
    gap: 4px;
}

.option-button {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.2s;
}

.option-button:hover {
    background-color: #031018;
}

.option-button svg {
    width: 20px;
    height: 20px;
    fill: #1d9bf0;
}

.post-submit {
    padding: 8px 16px;
    background-color: #1d9bf0;
    color: white;
    border: none;
    border-radius: 9999px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s;
}

.post-submit:hover {
    background-color: #1a8cd8;
}

/* タイムライン */
.timeline {
    background-color: #000;
}

.post {
    display: flex;
    padding: 12px 16px;
    border-bottom: 1px solid #2f3336;
    cursor: pointer;
    transition: background-color 0.2s;
}

.post:hover {
    background-color: #080808;
}

.post-content {
    flex: 1;
}

.post-header {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
}

.post-author {
    font-weight: 700;
    font-size: 15px;
    margin-right: 4px;
}

.post-handle,
.post-time {
    color: #71767b;
    font-size: 15px;
}

.post-menu {
    margin-left: auto;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.2s;
}

.post-menu:hover {
    background-color: #181818;
}

.post-menu svg {
    width: 18px;
    height: 18px;
    fill: #71767b;
}

.post-text {
    font-size: 15px;
    line-height: 20px;
    margin-bottom: 12px;
}

.post-image {
    margin-top: 12px;
    margin-bottom: 12px;
    border-radius: 16px;
    overflow: hidden;
}

.post-image img {
    width: 100%;
    height: auto;
    display: block;
}

.post-actions {
    display: flex;
    justify-content: space-between;
    max-width: 425px;
}

.action-button {
    display: flex;
    align-items: center;
    background: none;
    border: none;
    color: #71767b;
    font-size: 13px;
    cursor: pointer;
    padding: 8px;
    margin: -8px;
    border-radius: 50%;
    transition: color 0.2s, background-color 0.2s;
}

.action-button:hover {
    background-color: rgba(29, 155, 240, 0.1);
    color: #1d9bf0;
}

.action-button:hover svg {
    fill: #1d9bf0;
}

.action-button svg {
    width: 18px;
    height: 18px;
    fill: #71767b;
    margin-right: 4px;
}

/* 右サイドバー */
.right-sidebar {
    width: 350px;
    padding: 12px 20px;
    position: fixed;
    right: 0;
    height: 100vh;
    overflow-y: auto;
    margin-left: auto;
}

.search-box {
    display: flex;
    align-items: center;
    background-color: #202327;
    border-radius: 9999px;
    padding: 12px 20px;
    margin-bottom: 16px;
}

.search-icon {
    width: 20px;
    height: 20px;
    fill: #71767b;
    margin-right: 12px;
}

.search-input {
    flex: 1;
    background: none;
    border: none;
    color: #e7e9ea;
    font-size: 15px;
    outline: none;
}

.search-input::placeholder {
    color: #71767b;
}

.trends,
.who-to-follow {
    background-color: #16181c;
    border-radius: 16px;
    padding: 12px 0;
    margin-bottom: 16px;
}

.trends h2,
.who-to-follow h2 {
    font-size: 20px;
    font-weight: 800;
    padding: 12px 16px;
}

.trend-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.trend-item:hover {
    background-color: #1d1f23;
}

.trend-meta {
    font-size: 13px;
    color: #71767b;
}

.trend-name {
    font-weight: 700;
    font-size: 15px;
    margin: 2px 0;
}

.trend-count {
    font-size: 13px;
    color: #71767b;
}

.follow-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    transition: background-color 0.2s;
}

.follow-item:hover {
    background-color: #1d1f23;
}

.follow-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background-color: #16181c;
}

.follow-info {
    flex: 1;
}

.follow-name {
    font-weight: 700;
    font-size: 15px;
}

.follow-handle {
    color: #71767b;
    font-size: 15px;
}

.follow-button {
    padding: 6px 16px;
    background-color: #eff3f4;
    color: #0f1419;
    border: none;
    border-radius: 9999px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s;
}

.follow-button:hover {
    background-color: #d7dbdc;
}

.show-more {
    display: block;
    padding: 16px;
    color: #1d9bf0;
    text-decoration: none;
    font-size: 15px;
    transition: background-color 0.2s;
}

.show-more:hover {
    background-color: #1d1f23;
}

/* レスポンシブ対応 */
@media (max-width: 1280px) {
    .container {
        max-width: 100%;
    }
    
    .right-sidebar {
        display: none;
    }
    
    .main-content {
        margin-right: 0;
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 68px;
        padding: 0 12px;
    }
    
    .nav-item span,
    .user-info {
        display: none;
    }
    
    .nav-icon {
        margin-right: 0;
    }
    
    .main-content {
        margin-left: 68px;
    }
}

@media (max-width: 480px) {
    .sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: auto;
        padding: 0;
        padding-bottom: env(safe-area-inset-bottom);
        border-top: 1px solid #2f3336;
        background-color: #000;
        z-index: 100;
        overflow: visible;
    }
    
    .nav-menu {
        display: flex;
        flex-direction: row;
        justify-content: space-around;
        padding: 8px 0;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .nav-item {
        padding: 8px;
        margin: 0;
        flex-shrink: 0;
    }
    
    .nav-item:nth-child(n+6) {
        display: none;
    }
    
    .logo,
    .user-menu {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
        margin-bottom: calc(60px + env(safe-area-inset-bottom));
        width: 100%;
        border-left: none;
        border-right: none;
    }
    
    .header {
        padding: 0 16px;
        position: sticky;
        top: 0;
        z-index: 50;
        background-color: rgba(0, 0, 0, 0.8);
        backdrop-filter: blur(12px);
    }
    
    .tab {
        font-size: 14px;
    }
    
    .post-form {
        padding: 12px 16px;
    }
    
    .post {
        padding: 12px 16px;
    }
    
    .header-tabs {
        border-bottom: 1px solid #2f3336;
    }
    
    .post-actions {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .action-button {
        font-size: 12px;
        padding: 4px;
    }
    
    .action-button svg {
        width: 16px;
        height: 16px;
    }
    
    .post-image {
        margin-left: -16px;
        margin-right: -16px;
        border-radius: 0;
    }
    
    .post-input {
        font-size: 16px;
    }
}