/* CurateX - メインスタイルシート */
:root {
    --primary: #1da1f2;
    --primary-dark: #0d8bd9;
    --bg: #0f1419;
    --bg-secondary: #16202a;
    --bg-card: #1c2938;
    --text: #e7e9ea;
    --text-secondary: #8899a6;
    --border: #2f3336;
    --danger: #f4212e;
    --success: #00ba7c;
    --warning: #ffad1f;
    --radius: 12px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}
/* レイアウト */
.app-container { display: flex; min-height: 100vh; }
.sidebar {
    width: 240px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    padding: 20px;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
}
.sidebar-logo {
    font-size: 24px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 30px;
    letter-spacing: -0.5px;
}
.sidebar-nav { list-style: none; flex: 1; }
.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text);
    text-decoration: none;
    border-radius: 30px;
    font-size: 18px;
    transition: background 0.2s;
}
.sidebar-nav li a:hover { background: var(--bg-card); }
.sidebar-nav li a.active { font-weight: 700; }
.main-content {
    flex: 1;
    margin-left: 240px;
    max-width: 700px;
    border-right: 1px solid var(--border);
    min-height: 100vh;
}
.page-header {
    position: sticky;
    top: 0;
    background: rgba(15, 20, 25, 0.85);
    backdrop-filter: blur(12px);
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    z-index: 10;
}
.page-header h1 { font-size: 20px; font-weight: 700; }
/* ログイン画面 */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}
.login-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
    max-width: 400px;
    width: 100%;
    text-align: center;
}
.login-box h1 { font-size: 32px; color: var(--primary); margin-bottom: 8px; }
.login-box p { color: var(--text-secondary); margin-bottom: 24px; }
/* ボタン */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-secondary { background: var(--bg-card); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover:not(:disabled) { background: var(--border); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 6px 16px; font-size: 13px; }
.btn-block { width: 100%; }
/* カード（記事） */
.article-card {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.2s;
    animation: fadeSlideIn 0.3s ease-out both;
}
.article-card:hover { background: var(--bg-secondary); }
.article-card .category {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
}
.cat-テクノロジー { background: #1d3a5f; color: #5cb3ff; }
.cat-政治 { background: #3d2424; color: #ff6b6b; }
.cat-経済 { background: #2d3d1d; color: #8bff6b; }
.cat-エンタメ { background: #3d2d4d; color: #c56bff; }
.cat-スポーツ { background: #3d3d1d; color: #ffeb6b; }
.cat-科学 { background: #1d3d3d; color: #6bfff2; }
.cat-社会 { background: #3d2d1d; color: #ffb36b; }
.cat-国際 { background: #2d1d3d; color: #9b6bff; }
.cat-その他 { background: #2d2d2d; color: #999; }
.article-card h3 { font-size: 16px; margin-bottom: 6px; line-height: 1.4; }
.article-card .summary {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.article-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    color: var(--text-secondary);
    font-size: 13px;
}
.importance-badge { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.importance-high { color: var(--danger); }
.importance-medium { color: var(--warning); }
.importance-low { color: var(--text-secondary); }
/* お気に入りユーザー */
.favorite-list { list-style: none; }
.favorite-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    animation: fadeSlideIn 0.3s ease-out both;
}
.favorite-info { display: flex; align-items: center; gap: 12px; }
.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--primary);
    font-size: 16px;
    border: 2px solid var(--border);
}
.user-name { font-weight: 600; }
.user-handle { color: var(--text-secondary); font-size: 14px; }
/* 検索 */
.search-box { padding: 12px 20px; border-bottom: 1px solid var(--border); }
.search-input {
    width: 100%;
    padding: 10px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 30px;
    color: var(--text);
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}
.search-input:focus { border-color: var(--primary); }
.search-input::placeholder { color: var(--text-secondary); }
/* 記事詳細 */
.article-detail { padding: 20px; animation: fadeIn 0.3s ease-out; }
.article-detail h1 { font-size: 22px; margin-bottom: 12px; line-height: 1.4; }
.article-detail .body { font-size: 15px; line-height: 1.8; margin: 16px 0; }
.source-post {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-bottom: 8px;
    transition: border-color 0.2s;
}
.source-post:hover { border-color: var(--text-secondary); }
.source-post .handle { color: var(--primary); font-weight: 600; font-size: 14px; }
.source-post .content { margin-top: 6px; font-size: 14px; line-height: 1.6; }
/* フィルタータブ */
.filter-tabs {
    display: flex;
    gap: 4px;
    padding: 8px 20px;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.filter-tabs::-webkit-scrollbar { display: none; }
.filter-tab {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    transition: all 0.2s;
}
.filter-tab:hover { background: var(--bg-card); }
.filter-tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }
/* ソート切替 */
.sort-toggle { display: flex; gap: 4px; }
.sort-btn {
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 13px;
    cursor: pointer;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    transition: all 0.2s;
}
.sort-btn:hover { background: var(--bg-card); }
.sort-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
/* 空状態 */
.empty-state {
    padding: 60px 20px;
    text-align: center;
    color: var(--text-secondary);
}
.empty-state .icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h2 { font-size: 20px; color: var(--text); margin-bottom: 8px; }
/* ローディング */
.loading { display: flex; justify-content: center; padding: 40px; }
.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
/* 無限スクロール読み込み中 */
.load-more { display: flex; justify-content: center; padding: 20px; }
/* 既読表示 */
.article-read { opacity: 0.65; }
.article-read h3 { color: var(--text-secondary); }
.read-badge {
    font-size: 11px;
    color: var(--text-secondary);
    background: var(--bg-card);
    padding: 1px 6px;
    border-radius: 8px;
}
/* トースト通知 */
.toast-container {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
    pointer-events: none;
}
.toast {
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    pointer-events: auto;
    animation: toastIn 0.3s ease-out;
    white-space: nowrap;
}
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-info { background: var(--primary); }
.toast.toast-out { animation: toastOut 0.3s ease-in forwards; }
/* カード */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
/* アニメーション */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes toastIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes toastOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(20px); }
}
/* アニメーション軽減設定対応 */
@media (prefers-reduced-motion: reduce) {
    .article-card, .favorite-item, .article-detail, .toast {
        animation: none;
    }
}
/* モバイル対応 */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-content { margin-left: 0; max-width: 100%; }
    .mobile-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        border-top: 1px solid var(--border);
        justify-content: space-around;
        padding: 8px 0;
        z-index: 100;
    }
    .mobile-nav a {
        color: var(--text-secondary);
        text-decoration: none;
        font-size: 12px;
        text-align: center;
        padding: 4px 8px;
    }
    .mobile-nav a.active { color: var(--primary); }
    .mobile-nav .nav-icon { font-size: 20px; display: block; }
    body { padding-bottom: 60px; }
    .toast-container { bottom: 70px; }
    .page-header h1 { font-size: 18px; }
    .sort-toggle { display: none; }
    .article-card { padding: 12px 16px; }
}
@media (min-width: 769px) {
    .mobile-nav { display: none; }
}
