
/* 質問投稿ボタンのSVGアイコンの色をモードで切り替え */
.ask-questions-icon {
  color: #111;
  fill: #111;
  transition: color 0.2s, fill 0.2s;
}

@media (prefers-color-scheme: dark) {
  .ask-questions-icon {
    color: #e0e0e0;
    fill: #e0e0e0;
  }
}
/* === Modern AI Platform Inspired Archive Design === */
/* 
 * このCSSファイルは、index.cssと統一されたデザインを提供します。
 * サイドバー幅: 380px
 * サイドバーフッター: 統一されたスタイル
 * ナビゲーションボタン: 統一されたスタイル
 * メインコンテンツエリア: 統一されたレイアウト
 * 
 * 保守性の改善:
 * - !importantの使用を最小限に抑制
 * - CSS変数によるテーマカラーの統一管理
 * - カード回答テキストはプレーンテキスト表示に最適化
 * - 不要なMarkdown/HTMLレンダリング用CSSを削除
 * - 再利用可能なコンポーネントの整理
 * - tsクラスは外部ライブラリのため!important保持
 */

/* === CSS Variables for Theme Management === */
:root {
    /* Layout */
    --sidebar-width: 380px;
    
    /* Colors - Light Theme */
    --primary-color: #6366f1;
    --secondary-color: #06b6d4;
    --accent-color: #ec4899;
    --success-color: #10b981;
    
    /* Background Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    
    /* Text Colors */
    --text-primary: #111827;
    --text-secondary: #374151;
    --text-muted: #6b7280;
    
    /* Border Colors */
    --border-color: #e5e7eb;
    --border-color-light: #f3f4f6;
    
    /* Shadow */
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Dark Theme Variables */
@media (prefers-color-scheme: dark) {
    :root {
        /* Background Colors */
        --bg-primary: #303339;
        --bg-secondary: #2c2c2e;
        --bg-tertiary: #374151;
        
        /* Text Colors */
        --text-primary: #f9fafb;
        --text-secondary: #d1d5db;
        --text-muted: #9ca3af;
        
        /* Border Colors */
        --border-color: #444654;
        --border-color-light: #4b5563;
        
        /* Shadow */
        --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px 0 rgba(0, 0, 0, 0.2);
        --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    }
}

/* === Main Layout - Modern AI Platform Inspired === */
.main-layout {
    display: flex;
    gap: 0;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0;
    min-height: 100vh;
    background: transparent;
    box-sizing: border-box;
}

/* ==== Mobile Appbar (hidden by default) ==== */
.mobile-appbar { display: none; }
.appbar-btn { text-decoration: none; }

/* ==== Mobile-first overrides - SNS Inspired Design ==== */
@media (max-width: 768px) {
    /* Modern SNS-style Appbar */
    .mobile-appbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 56px;
        padding: 0 16px;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
        z-index: 100;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    }
    
    .mobile-appbar-left {
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .mobile-appbar-title { 
        font-size: 1.25rem; 
        font-weight: 700; 
        color: var(--text-color); 
        letter-spacing: -0.02em;
    }
    
    /* SNS-style navigation icons */
    .mobile-appbar-actions {
        display: flex;
        align-items: center;
        gap: 4px;
    }
    
    .mobile-appbar .appbar-btn { 
        display: inline-flex; 
        align-items: center; 
        justify-content: center; 
        width: 40px; 
        height: 40px; 
        border-radius: 50%;
        color: var(--text-color); 
        transition: all 0.2s ease;
        position: relative;
    }
    
    .mobile-appbar .appbar-btn:hover,
    .mobile-appbar .appbar-btn:active { 
        background: rgba(0, 0, 0, 0.06);
        transform: scale(0.95);
    }
    
    @media (prefers-color-scheme: dark) { 
        .mobile-appbar {
            background: rgba(26, 27, 30, 0.95);
            border-bottom-color: rgba(255, 255, 255, 0.08);
        }
        
        .mobile-appbar .appbar-btn:hover,
        .mobile-appbar .appbar-btn:active { 
            background: rgba(255, 255, 255, 0.08);
        }
    }

    /* Hide sidebar and heavy sections */
    .sidebar-nav { display: none !important; }
    .top-ad-container { display: none !important; }
    .search-filter-section { display: none !important; }

    /* Main content full width with top margin for fixed appbar */
    .main-layout {
        margin-top: 56px;
    }
    
    .main-content { 
        max-width: 100% !important; 
        width: 100% !important; 
        padding: 12px 16px 24px 16px !important; 
        border-left: none !important; 
    }

    /* Modern mobile search */
    .mobile-search { 
        position: sticky; 
        top: 56px; 
        z-index: 40; 
        background: var(--container-bg); 
        border-bottom: 1px solid var(--border-color); 
        padding: 12px 16px; 
        margin: 0 -16px 16px -16px; 
    }
    
    .mobile-search-form { 
        display: flex;
        gap: 8px; 
        align-items: center; 
    }
    
    .mobile-search-icon { 
        display: inline-flex; 
        align-items: center; 
        justify-content: center; 
        color: var(--subtext-color);
        margin-right: 4px;
    }
    
    .mobile-search-input { 
        flex: 1;
        height: 44px; 
        padding: 0 16px; 
        border: 1.5px solid var(--border-color); 
        border-radius: 22px; 
        background: var(--container-bg); 
        color: var(--text-color); 
        font-size: 1rem;
        transition: all 0.2s ease;
    }
    
    .mobile-search-input:focus { 
        outline: none; 
        border-color: rgba(102, 126, 234, 0.6);
        box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    }
    
    .mobile-search-clear { 
        height: 44px; 
        padding: 0 16px; 
        border: 1.5px solid var(--border-color); 
        background: transparent; 
        color: var(--subtext-color); 
        border-radius: 22px; 
        cursor: pointer;
        font-size: 0.9rem;
        font-weight: 500;
        transition: all 0.2s ease;
    }
    
    .mobile-search-clear:hover {
        background: rgba(0, 0, 0, 0.04);
        border-color: var(--text-color);
    }
    
    .mobile-search-submit { 
        height: 44px; 
        padding: 0 24px; 
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: #fff; 
        border: none; 
        border-radius: 22px; 
        font-weight: 600;
        font-size: 0.9rem;
        cursor: pointer;
        transition: all 0.2s ease;
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    }
    
    .mobile-search-submit:hover { 
        transform: translateY(-1px);
        box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
    }
    
    .mobile-search-submit:active {
        transform: translateY(0);
    }

    /* SNS-style cards */
    .questions-grid { 
        grid-template-columns: 1fr !important; 
        gap: 16px !important; 
        margin-top: 0 !important; 
    }
    
    .question-card { 
        padding: 16px !important; 
        border-radius: 16px !important;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
        transition: all 0.2s ease !important;
    }
    
    .question-card:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12) !important;
        transform: translateY(-2px) !important;
    }
}

/* Sidebar styles - unified with index.css */
.sidebar-nav {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--container-bg);
    border-right: 1px solid var(--border-color);
    padding: 8px 12px;
    height: 100vh;
    position: sticky;
    top: 0;
    left: 0;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    box-sizing: border-box;
    word-wrap: break-word;
    max-height: 100vh;
}

@media (prefers-color-scheme: dark) {
    .sidebar-nav {
        background: var(--container-bg);
        border-right-color: var(--border-color);
    }
}

/* Navigation styles - unified with index.css */
.nav-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 8px 0 8px 0;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    letter-spacing: 0.01em;
    text-transform: none;
    position: relative;
    transition: all 0.2s ease;
}

/* Navigation styles - unified with index.css */
.nav-title .folder-icon {
    color: var(--primary-color);
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    width: 20px;
    height: 20px;
}

.nav-title-text {
    font-weight: 700;
    font-size: 1.05rem;
    position: relative;
    z-index: 1;
    letter-spacing: 0.01em;
}

.nav-count {
    background: var(--primary-color);
    color: #ffffff;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-left: auto;
}

@media (prefers-color-scheme: dark) {
    .nav-title {
        background: var(--bg-secondary);
        border-color: var(--border-color);
    }
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Navigation buttons - unified with index.css with modern enhancements */
.nav-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: transparent;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    color: #374151;
    font-weight: 500;
    font-size: 0.875rem;
    position: relative;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    overflow: hidden;
}

.nav-btn::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 100%;
    background: transparent;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.nav-btn:hover {
    background: linear-gradient(90deg, rgba(243, 244, 246, 0.8) 0%, rgba(243, 244, 246, 0.4) 100%);
    color: #111827;
    text-decoration: none;
    transform: translateX(4px);
}

.nav-btn:hover::before {
    background: linear-gradient(180deg, #a855f7 0%, #6366f1 100%);
}

/* 各ナビゲーションボタンの固有色（左側の縦線） */
.nav-btn.ask-questions:hover::before {
    background: #000000;
}

.nav-btn.all-questions:hover::before {
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
}

.nav-btn.my-questions:hover::before {
    background: #10b981;
}

.nav-btn.liked-questions:hover::before {
    background: linear-gradient(180deg, #ec4899 0%, #f472b6 100%);
}

.nav-btn.active {
    background: linear-gradient(90deg, rgba(229, 231, 235, 0.9) 0%, rgba(243, 244, 246, 0.6) 100%);
    color: #111827;
    font-weight: 600;
}

/* アクティブ時は縦線を非表示 */
.nav-btn.active::before {
    background: transparent !important;
}

.nav-btn.ask-questions:hover {
    background: linear-gradient(90deg, rgba(243, 244, 246, 0.8) 0%, rgba(243, 244, 246, 0.4) 100%);
    color: var(--text-color);
    font-weight: 500;
    transform: translateX(4px);
}

.nav-btn.all-questions.active {
    background: #e4e5ff;
    color: var(--text-color);
    font-weight: 600;
    border-left: 4px solid #6366f1;
    padding-left: 8px;
}
.nav-btn.all-questions:hover {
    background: linear-gradient(90deg, rgba(243, 244, 246, 0.8) 0%, rgba(243, 244, 246, 0.4) 100%);
    color: var(--text-color);
    transform: translateX(4px);
}

.nav-btn.my-questions.active {
    background: hsl(166, 100%, 95%);
    color: var(--text-color);
    font-weight: 600;
    border-left: 4px solid #06b6d4;
    padding-left: 8px;
}
.nav-btn.my-questions:hover {
    background: linear-gradient(90deg, rgba(243, 244, 246, 0.8) 0%, rgba(243, 244, 246, 0.4) 100%);
    color: var(--text-color);
    transform: translateX(4px);
}

.nav-btn.liked-questions.active {
    background: #ffe0f1;
    color: var(--text-color);
    font-weight: 600;
    border-left: 4px solid #ec4899;
    padding-left: 8px;
}
.nav-btn.liked-questions:hover {
    background: linear-gradient(90deg, rgba(243, 244, 246, 0.8) 0%, rgba(243, 244, 246, 0.4) 100%);
    color: var(--text-color);
    transform: translateX(4px);
}

@media (prefers-color-scheme: dark) {
    .nav-btn {
        color: #d1d5db;
    }
    .nav-btn:hover {
        background: rgba(99, 165, 250, 0.12);
        color: #f9fafb;
        transform: translateX(4px);
    }
    .nav-btn.ask-questions:hover {
        background: rgba(99, 165, 250, 0.12);
        color: #f9fafb;
        transform: translateX(4px);
    }
    .nav-btn.all-questions.active {
        background: rgba(99, 165, 250, 0.12);
        color: #f9fafb;
        border-left: 4px solid #6366f1;
        padding-left: 8px;
    }
    .nav-btn.all-questions:hover {
        background: rgba(99, 165, 250, 0.12);
        color: #f9fafb;
        transform: translateX(4px);
    }
    .nav-btn.my-questions.active {
        background: #1e293b;
        color: #f9fafb;
        border-left: 4px solid #06b6d4;
        padding-left: 8px;
    }
    .nav-btn.my-questions:hover {
        background: rgba(99, 165, 250, 0.12);
        color: #f9fafb;
        transform: translateX(4px);
    }
    .nav-btn.liked-questions.active {
        background: #1e293b;
        color: #f9fafb;
        border-left: 4px solid #ec4899;
        padding-left: 8px;
    }
    .nav-btn.liked-questions:hover {
        background: rgba(99, 165, 250, 0.12);
        color: #f9fafb;
        transform: translateX(4px);
    }
}

/* Navigation icon and text styles */

.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-icon svg {
    width: 16px;
    height: 16px;
}

.nav-text {
    font-size: 0.875rem;
    line-height: 1.25;
}

/* Main Content Area - unified with index.css */
.main-content {
    flex: 1;
    min-width: 0;
    max-width: calc(100% - var(--sidebar-width));
    width: calc(100% - var(--sidebar-width));
    background: var(--bg-secondary);
    padding: 12px 32px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
    border-left: 1px solid var(--border-color);
    box-sizing: border-box;
}

@media (prefers-color-scheme: dark) {
    .main-content {
        background: #24282a;
        border-left-color: var(--border-color);
    }
}

/* Page Header - Enhanced visibility */
.page-header {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 32px;
    box-shadow: var(--shadow-sm);
}

@media (prefers-color-scheme: dark) {
    .page-header {
        background: var(--bg-primary);
        border-color: var(--border-color);
        box-shadow: var(--shadow-sm);
    }
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 8px 0;
    line-height: 1.2;
}

@media (prefers-color-scheme: dark) {
    .page-title {
        color: var(--text-primary);
    }
}

/* Active Filters - Compact and clean */
.active-filters {
    margin-top: 2px;
}

.filter-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

@media (prefers-color-scheme: dark) {
    .filter-title {
        color: var(--text-muted);
    }
}

.filter-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.filter-badge {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
}

@media (prefers-color-scheme: dark) {
    .filter-badge {
        background: var(--bg-tertiary);
        color: var(--text-secondary);
        border-color: var(--border-color-light);
    }
}

/* Search & Filter Section - Enhanced contrast */
.search-filter-section {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

@media (prefers-color-scheme: dark) {
    .search-filter-section {
        background: var(--container-bg);
        border-color: var(--border-color);
        box-shadow: var(--shadow-sm);
    }
}

.modern-filter-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.parent-category-field {
    position: relative;
}

.parent-category-dropdown {
    position: relative;
}

.parent-category-menu {
    top: calc(100% + 8px);
    left: 0;
    width: min(790px, calc(100vw - 64px));
    max-height: 400px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px 18px 20px;
    overflow-y: auto;
}

.parent-category-menu__header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.parent-category-menu__reset {
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
    background: rgba(99, 102, 241, 0.08);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.parent-category-menu__reset:hover,
.parent-category-menu__reset:focus {
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(79, 70, 229, 0.35);
    outline: none;
}

.parent-category-menu__reset.is-active {
    background: rgba(79, 70, 229, 0.18);
    border-color: rgba(79, 70, 229, 0.35);
    color: #4338ca;
}

.parent-category-menu__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px 20px;
}

.parent-category-menu__group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.parent-category-menu__group-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #4338ca;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.25);
    box-shadow: 0 2px 12px rgba(79, 70, 229, 0.18);
    text-transform: none;
    line-height: 1;
}

.parent-category-menu__group-title::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    box-shadow: 0 0 8px rgba(99, 102, 241, 0.45);
}

.parent-category-menu__items {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.parent-category-menu__item {
    padding: 6px 12px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-size: 0.92rem;
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.65);
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.parent-category-menu__item:hover,
.parent-category-menu__item:focus {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(79, 70, 229, 0.25);
    transform: translateY(-1px);
    outline: none;
}

.parent-category-menu__item.is-active {
    background: rgba(79, 70, 229, 0.18);
    border-color: rgba(79, 70, 229, 0.35);
    color: #4338ca;
}

.filter-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
}

@media (prefers-color-scheme: dark) {
    .filter-group label {
        color: var(--text-secondary);
    }

    .parent-category-menu {
        background: rgba(17, 24, 39, 0.97);
    }

    .parent-category-menu__group-title {
        color: #e0e7ff;
        background: rgba(79, 70, 229, 0.32);
        border-color: rgba(129, 140, 248, 0.4);
        box-shadow: 0 6px 14px rgba(30, 64, 175, 0.35);
    }

    .parent-category-menu__item {
        background: rgba(30, 41, 59, 0.6);
        color: #e2e8f0;
    }

    .parent-category-menu__item.is-active {
        color: #c7d2fe;
        background: rgba(99, 102, 241, 0.22);
        border-color: rgba(129, 140, 248, 0.45);
    }

    .parent-category-menu__reset {
        background: rgba(99, 102, 241, 0.18);
        color: #c7d2fe;
    }

    .parent-category-menu__reset:hover,
    .parent-category-menu__reset:focus {
        background: rgba(99, 102, 241, 0.3);
        border-color: rgba(129, 140, 248, 0.5);
    }

    .parent-category-menu__reset.is-active {
        background: rgba(99, 102, 241, 0.32);
        border-color: rgba(129, 140, 248, 0.55);
        color: #e0e7ff;
    }
}

@media (max-width: 1024px) {
    .parent-category-menu {
        width: min(640px, calc(100vw - 32px));
    }

    .parent-category-menu__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .parent-category-menu {
        width: calc(100vw - 24px);
        left: 50%;
        transform: translateX(-50%);
        max-height: 360px;
    }

    .parent-category-menu__grid {
        grid-template-columns: repeat(1, minmax(0, 1fr));
    }
}

/* Form inputs - Clean and modern */
select, input[type="text"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: border-color 0.2s ease;
    box-shadow: none;
}

@media (prefers-color-scheme: dark) {
    select, input[type="text"] {
        background: var(--bg-tertiary);
        color: var(--text-primary);
        border-color: var(--border-color-light);
    }
}

select:focus, input[type="text"]:focus {
    outline: none;
    border-color: var(--text-muted);
    box-shadow: none;
}

/* Disabled select styling */
select:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background-color: var(--bg-secondary);
    color: var(--text-muted);
    border-color: var(--border-color);
}

@media (prefers-color-scheme: dark) {
    select:disabled {
        background-color: #1f2937;
        color: #6b7280;
        border-color: #374151;
    }
}

.select-wrapper.disabled {
    opacity: 0.6;
    pointer-events: none;
}

.select-wrapper.disabled select {
    background-color: #f9fafb;
    color: #9ca3af;
    cursor: not-allowed;
    border-color: #e5e7eb;
}

@media (prefers-color-scheme: dark) {
    .select-wrapper.disabled select {
        background-color: #1f2937;
        color: #6b7280;
    }
}

/* Search Section */
.search-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.search-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

#search_input {
    flex: 1;
    min-width: 0;
}

.search-btn, .clear-btn {
    padding: 8px 16px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.search-btn {
    background: linear-gradient(135deg, #d63dee 0%, #524cf1 100%);
    color: white;
    border: none;
    box-shadow: 
        0 2px 8px rgba(102, 126, 234, 0.25),
        inset 0 1px 2px rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.search-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.2) 50%, 
        transparent 100%);
    transition: left 0.5s ease;
}

.search-btn:hover::before {
    left: 100%;
}

.search-btn:hover {
    background: linear-gradient(135deg, #d63dee 0%, #524cf1 100%);
    transform: translateY(-2px);
    box-shadow: 
        0 6px 16px rgba(102, 126, 234, 0.35),
        inset 0 1px 2px rgba(255, 255, 255, 0.3);
}

.clear-btn {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.95) 0%, 
        rgba(249, 250, 251, 0.95) 100%);
    color: #6b7280;
    border: 1px solid #d1d5db;
    transition: all 0.25s ease;
}

@media (prefers-color-scheme: dark) {
    .clear-btn {
        background: linear-gradient(135deg, 
            rgba(55, 65, 81, 0.95) 0%, 
            rgba(45, 55, 72, 0.95) 100%);
        color: #9ca3af;
        border-color: #4b5563;
    }
}

.clear-btn:hover {
    background: linear-gradient(135deg, 
        rgba(249, 250, 251, 1) 0%, 
        rgba(243, 244, 246, 1) 100%);
    color: #374151;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

@media (prefers-color-scheme: dark) {
    .clear-btn:hover {
        background: linear-gradient(135deg, 
            rgba(75, 85, 99, 1) 0%, 
            rgba(55, 65, 81, 1) 100%);
        color: #d1d5db;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }
}

/* Questions Grid - Pinterest/Masonry style */
.questions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 12px;
    margin-top: 8px;
}

/* Question Card - 紫を基調としたモダンデザイン */
.question-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

@media (prefers-color-scheme: dark) {
    .question-card {
        background: #2a2d47;
        border: 1px solid #4c4f69;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    }
}

.question-card:hover {
    border-color: #a855f7;
    box-shadow: 0 2px 8px rgba(168, 85, 247, 0.1);
    transform: translateY(-2px);
}

@media (prefers-color-scheme: dark) {
    .question-card:hover {
        border-color: #a855f7;
        box-shadow: 0 4px 24px rgba(168, 85, 247, 0.2);
        transform: translateY(-2px);
    }
}

/* いいね済みカードは全体に紫色を適用 */
.question-card.liked {
    background: linear-gradient(135deg, #f3e8ff 0%, #ede9fe 100%);
    border-color: #a855f7;
}

@media (prefers-color-scheme: dark) {
    .question-card.liked {
        background: #411d95;
        border-color: #a855f7;
    }
}

.question-card.liked:hover {
    border-color: #9333ea;
    box-shadow: 0 2px 12px rgba(147, 51, 234, 0.15);
    transform: translateY(-2px);
}

.question-card.liked .card-title {
    color: var(--text-color);
}

.question-card.liked .card-line-label {
    background: rgba(124, 58, 237, 0.18);
    color: #6d28d9;
}

.question-card.liked .card-line-label.answer {
    background: rgba(244, 114, 182, 0.2);
    color: #db2777;
}

@media (prefers-color-scheme: dark) {
    .question-card.liked .card-title {
        color: #e9d5ff;
    }

    .question-card.liked .card-line-label {
        background: rgba(196, 181, 253, 0.2);
        color: #ede9fe;
    }

    .question-card.liked .card-line-label.answer {
        background: rgba(253, 164, 175, 0.25);
        color: #ffe4e6;
    }
}

.card-body {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.card-title-row {
    display: flex;
    align-items: center;
}

.card-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (prefers-color-scheme: dark) {
    .card-title {
        color: #f3f4f6;
    }
}

.card-lines {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.card-line {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.card-line-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    font-size: 0.75rem;
    font-weight: 700;
    background: #f3e8ff;
    color: #7c3aed;
    border-radius: 999px;
    flex-shrink: 0;
}

.card-line-label.answer {
    background: #fee2e2;
    color: #dc2626;
}

@media (prefers-color-scheme: dark) {
    .card-line-label {
        background: rgba(124, 58, 237, 0.15);
        color: #c4b5fd;
    }

    .card-line-label.answer {
        background: rgba(248, 113, 113, 0.2);
        color: #fca5a5;
    }
}

/* Badge Container - 統一されたカテゴリバッジデザイン */
.badge-container {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 8px;
}

.badge {
    padding: 3px 10px;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    line-height: 1.3;
    background: linear-gradient(135deg, #8b5cf6 0%, #a855f7 100%);
    color: white;
    border: none;
}

@media (prefers-color-scheme: dark) {
    .badge {
        background: linear-gradient(135deg, #6d28d9 0%, #7c3aed 100%);
        color: #f3e8ff;
    }
}

/* カテゴリバッジ共通 */
.badge-primary,
.badge-secondary,
.badge-auto,
.badge-auto-sub,
.badge-error {
    background: linear-gradient(135deg, #8b5cf6 0%, #a855f7 100%);
    color: white;
    border: none;
}

/* カテゴリバッジ（クリック可能リンク） */
.badge-category-link {
    cursor: pointer;
    transition: all 0.2s ease;
}

.badge-category-link:hover {
    text-decoration: none;
    color: white;
    filter: brightness(1.1);
    transform: translateY(-1px);
}

/* タグバッジ - カテゴリバッジと区別するデザイン */
.badge-tag {
    background: #dbeafe;
    color: #1d4ed8;
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.badge-tag:hover {
    background: #bfdbfe;
    color: #1e40af;
    text-decoration: none;
    transform: translateY(-1px);
}

@media (prefers-color-scheme: dark) {
    .badge-primary,
    .badge-secondary,
    .badge-auto,
    .badge-auto-sub,
    .badge-error {
        background: linear-gradient(135deg, #6d28d9 0%, #7c3aed 100%);
        color: #f3e8ff;
    }
    
    /* タグバッジ - ダークモード */
    .badge-tag {
        background: #1e3a5f;
        color: #60a5fa;
        border: none;
    }
    
    .badge-tag:hover {
        background: #1e40af;
        color: #93c5fd;
    }
}

/* Card Content - Clean typography */
.card-content-link {
    text-decoration: none;
    color: var(--text-color);
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.card-content-link:hover {
    text-decoration: none;
    color: var(--text-color);
}

.card-content-link:hover .question-text {
    color: var(--text-color);
}

.card-content-link:hover .answer-text {
    color: var(--text-color);
}

@media (prefers-color-scheme: dark) {
    .card-content-link:hover .answer-text {
        color: inherit;
    }
}

.question-content,
.answer-content {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    justify-content: flex-start;
    width: 100%;
}

.question-label, .answer-label {
    font-weight: 700;
    font-size: 0.88rem;
    min-width: 20px;
    color: #555b65;
    margin-left: 2px;
}

@media (prefers-color-scheme: dark) {
    .question-label, .answer-label {
        color: #9ca3af;
    }
}

.question-text {
    flex: 1;
    line-height: 1.7;
    color: var(--text-color);
    font-size: 0.95rem;
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}

@media (prefers-color-scheme: dark) {
    .question-text {
        color: #e2e8f0;
    }
}

/* Answer Text（archive.htmlで使用） */
.answer-text {
    flex: 1;
    line-height: 1.6;
    color: var(--subtext-color);
    font-size: 0.875rem;
    word-break: break-word;
    text-align: left;
    
    /* 4行制限で末尾を省略 */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: calc(1.6em * 4);
}

@media (prefers-color-scheme: dark) {
    .answer-text {
        color: #cbd5e1;
    }
}

/* === Card Footer === */
.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 8px;
    border-top: 1px solid #e2e8f0;
    margin-top: 8px;
}

@media (prefers-color-scheme: dark) {
    .card-footer {
        border-top-color: #475569;
    }
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.timestamp {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
}

/* スコア表示 */
.score-display {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: transparent;
    padding: 2px 8px;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(text-primary);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.score-label {
    font-size: 0.7rem;
    opacity: 0.9;
    letter-spacing: 0.025em;
}

.score-value {
    font-family: 'Noto Sans JP', monospace;
    font-size: 0.75rem;
    font-weight: 700;
}

@media (prefers-color-scheme: dark) {
    .timestamp {
        color: #94a3b8;
    }
}

.like-section {
    display: flex;
    align-items: center;
}

.like-form {
    margin: 0;
}

/* いいねボタン - 透明背景、ホバー時は外枠のみ濃いピンクに */
.like-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 10px;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    font-size: 0.875rem;
    outline: none;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    font-weight: 500;
}

.like-button:hover {
    background: transparent;
    color: #e11d48;
}

.like-button.liked {
    background: transparent;
    color: #e11d48;
}

.like-button.liked:hover {
    background: transparent;
    color: #be185d;
}

@media (prefers-color-scheme: dark) {
    .like-button {
        color: #94a3b8;
        border-color: transparent;
    }
    
    .like-button:hover {
        color: #ec4899;
        background: transparent;
    }
    
    .like-button.liked {
        color: #ca1963;
        background: transparent;
    }
    
    .like-button.liked:hover {
        color: #ba175b;
        background: transparent;
    }
}

/* Material Symbols thumb_upアイコンのFILL切り替え */
.like-icon {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
    font-size: 1.1rem;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
    transition: font-variation-settings 0.2s, color 0.2s;
    color: inherit;
}

.like-button.liked .like-icon {
    color: inherit;
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}


/* ホバー時もFILLは0のまま（小さいハートが出ないように） */
.like-button:hover .like-icon {
    color: inherit;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* いいね済みのボタンはホバーしてもFILL 1のまま */
.like-button.liked:hover .like-icon {
    font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.like-count {
    font-size: 0.875rem;
    color: inherit;
    font-weight: 500;
}

/* No Results - Friendly empty state */
.no-results {
    text-align: center;
    padding: 48px 24px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: #6b7280;
}

@media (prefers-color-scheme: dark) {
    .no-results {
        background: #1f2937;
        border-color: #374151;
        color: #9ca3af;
    }
}

.no-results-icon {
    margin: 0 auto 16px;
    opacity: 0.5;
    display: flex;
    justify-content: center;
    align-items: center;
}

.no-results h3 {
    font-size: 1.125rem;
    color: #374151;
    margin-bottom: 8px;
    font-weight: 600;
}

@media (prefers-color-scheme: dark) {
    .no-results h3 {
        color: #d1d5db;
    }
}

.no-results p {
    color: #6b7280;
    font-size: 0.875rem;
}

@media (prefers-color-scheme: dark) {
    .no-results p {
        color: #9ca3af;
    }
}

/* Load Indicators */
.load-indicators {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 24px;
}

.loading-indicator, .end-indicator {
    text-align: center;
    padding: 16px;
    color: #9ca3af;
    font-size: 0.875rem;
}

.loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #f3f4f6;
    border-top: 2px solid #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Flash Messages */
.flash-messages {
    margin-bottom: 16px;
}

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.alert-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

/* Archive Section */
.archive-section {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 24px;
    margin-top: 24px;
}

@media (prefers-color-scheme: dark) {
    .archive-section {
        background: #1f2937;
        border-color: #374151;
    }
}

.section-header {
    text-align: center;
    margin-bottom: 24px;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 8px;
}

@media (prefers-color-scheme: dark) {
    .section-title {
        color: #f9fafb;
    }
}

.section-subtitle {
    color: #6b7280;
    font-size: 0.875rem;
    margin: 0;
}

@media (prefers-color-scheme: dark) {
    .section-subtitle {
        color: #9ca3af;
    }
}

.category-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.category-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 20px;
    text-align: center;
    transition: all 0.15s ease;
    cursor: pointer;
}

@media (prefers-color-scheme: dark) {
    .category-card {
        background: #374151;
        border-color: #4b5563;
    }
}

.category-card:hover {
    border-color: #d1d5db;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
}

@media (prefers-color-scheme: dark) {
    .category-card:hover {
        border-color: #6b7280;
    }
}

.category-icon {
    font-size: 2rem;
    margin-bottom: 12px;
    display: block;
}

.category-card h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
}

@media (prefers-color-scheme: dark) {
    .category-card h3 {
        color: #f9fafb;
    }
}

.category-card p {
    color: #6b7280;
    font-size: 0.875rem;
    margin: 0;
}

@media (prefers-color-scheme: dark) {
    .category-card p {
        color: #9ca3af;
    }
}

/* === Material Symbols Support === */
.material-symbols-outlined {
    font-family: 'Material Symbols Outlined', 'Material Icons', sans-serif;
    font-weight: normal;
    font-style: normal;
    font-size: 18px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
    vertical-align: middle;
    user-select: none;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
    
    .sidebar-nav {
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
        padding: 16px;
    }
    
    @media (prefers-color-scheme: dark) {
        .sidebar-nav {
            border-bottom-color: #444654;
        }
    }
    
    .nav-links {
        flex-direction: row;
        overflow-x: auto;
        gap: 8px;
        padding-bottom: 4px;
    }
    
    .nav-btn {
        flex-shrink: 0;
        white-space: nowrap;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 16px 20px;
    }
    
    .filter-grid {
        grid-template-columns: 1fr;
    }
    
    .questions-grid {
        grid-template-columns: 1fr;
    }
    
    .search-input-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
}

/* Accessibility improvements - throttle keyframe animations when reduce motion is requested
   Note: we intentionally keep transitions intact (matches index page UX and allows dropdown animations) */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

.nav-btn:focus-visible,
.search-btn:focus-visible,
.clear-btn:focus-visible,
.like-button:focus-visible,
select:focus-visible,
input:focus-visible {
    outline: 2px solid #a855f7;
    outline-offset: 2px;
}

/* === サイドバーフッター === */
.sidebar-footer {
    margin-top: auto; /* サイドバーの下部に配置 */
    padding: 12px 8px 8px 8px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

@media (prefers-color-scheme: dark) {
    .sidebar-footer {
        border-top-color: #444654;
    }
}

.footer-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: #6b7280;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.footer-link:hover {
    background: #f3f4f6;
    text-decoration: none;
    color: #374151;
}

@media (prefers-color-scheme: dark) {
    .footer-link {
        color: #9ca3af;
    }
    
    .footer-link:hover {
        background: rgba(99, 165, 250, 0.12);
        color: inherit;
        text-decoration: none;
    }
}

.footer-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.footer-link:hover .footer-icon {
    opacity: 1;
}

/* SVGアイコンは外枠のみ（塗りなし、線のみ） */
.footer-icon svg {
    width: 16px;
    height: 16px;
    color: #111;
    fill: none;
    stroke: currentColor;
    stroke-width: 2px;
    transition: color 0.2s;
}

@media (prefers-color-scheme: dark) {
    .footer-icon svg {
        color: #e0e0e0;
    }
}

.footer-text {
    flex: 1;
    line-height: 1.4;
}



/* === Tom Select モダンデザイン 2025 === */
/* 
 * 注意: Tom Selectは外部ライブラリのため、!importantを使用してスタイルを確実にオーバーライドします。
 * これは保守性のために必要な措置です。
 */

/* Tom Select ラッパー - 外部ライブラリのデフォルトスタイルをリセット */
.ts-wrapper {
    position: relative;
    background: transparent;
    border: none !important;
    box-shadow: none !important;
}

/* Tom Select コントロール（入力フィールド）- 最新デザイン */
.ts-wrapper.single .ts-control {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 12px !important;
    padding: 12px 16px !important;
    min-height: 48px !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    color: #1e293b !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1) !important;
    position: relative;
    overflow: hidden;
}

/* コントロールのホバー効果 */
.ts-wrapper.single .ts-control:hover {
    border-color: #afbfd5 !important;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12) !important;
}

/* フォーカス時の現代的なスタイル */
.ts-wrapper.single .ts-control.focus,
.ts-wrapper.single .ts-control:focus-within {
    border-color: #a855f7 !important;
    background: #ffffff !important;
    outline: none !important;
    transform: translateY(-2px);
}

/* アクティブ状態（ドロップダウン開いている時） */
.ts-wrapper.single.dropdown-active .ts-control {
    border-color: #a855f7 !important;
    border-bottom-left-radius: 4px !important;
    border-bottom-right-radius: 4px !important;
    background: #ffffff !important;
    box-shadow: 0 8px 25px rgba(168, 85, 247, 0.3) !important;
}

/* ドロップダウンメニューの最新デザイン */
.ts-dropdown {
    background: #ffffff !important;
    border: 2px solid #a855f7 !important;
    border-top: none !important;
    border-radius: 0 0 12px 12px !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1) !important;
    margin-top: -2px !important;
    z-index: 1000 !important;
    overflow-y: auto !important;
    max-height: 450px !important;
    backdrop-filter: blur(8px);
}

/* Tom Selectのドロップダウンコンテンツ（スクロールは親要素で制御） */
.ts-dropdown-content {
    max-height: none !important;
    overflow-y: visible !important;
}

/* optgroupヘッダー */
.ts-dropdown .optgroup-header {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%) !important;
    color: #475569 !important;
    font-weight: 600 !important;
    font-size: 0.75rem !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    padding: 8px 20px !important;
    cursor: default !important;
    border-bottom: 2px solid #cbd5e1;
}

/* 無効なオプション */
.ts-dropdown .option.disabled {
    color: #94a3b8 !important;
    background: #f8fafc !important;
    font-weight: 400 !important;
    font-style: italic !important;
    cursor: not-allowed !important;
    opacity: 0.7 !important;
    transform: none !important;
}

/* カテゴリ選択特殊スタイル */
.ts-dropdown .option.category_select {
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 100%) !important;
    color: #3730a3 !important;
    font-weight: 600 !important;
    border-left: 4px solid #6366f1 !important;
    padding-left: 16px !important;
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
    /* === インデックスページと同一のダークモードTom Selectドロップダウンメニュー === */
    .ts-wrapper.single .ts-control {
        background: linear-gradient(135deg, #1e293b 0%, #263241 100%) !important;
        border-color: #475569 !important;
        color: #f1f5f9 !important;
    }
    .ts-wrapper.single .ts-control:hover {
        border-color: #64748b !important;
        background: linear-gradient(135deg, #1e293b 0%, #263241 100%) !important;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12) !important;
    }
    .ts-wrapper.single .ts-control.focus,
    .ts-wrapper.single .ts-control:focus-within {
        border-color: var(--dark-primary-color) !important;
        background: #1e293b !important;
    }
    .ts-wrapper.single.dropdown-active .ts-control {
        border-color: var(--dark-primary-color) !important;
        background: #1e293b !important;
    }
    .ts-dropdown {
        background: #1e293b !important;
        border-color: var(--dark-primary-color) !important;
        width: auto !important; /* アーカイブページと同じく、コンテンツ幅に合わせる */
        min-width: 100% !important; /* 最小幅はコントロールと同じ */
        max-height: 450px !important;
        overflow-y: auto !important;
    }
    .ts-dropdown-content {
        max-height: none !important;
        overflow-y: visible !important;
    }
    .ts-dropdown .option,
    .ts-dropdown .optgroup-header {
        color: #f1f5f9 !important;
    }
    .ts-dropdown .option:hover,
    .ts-dropdown .option.active,
    .ts-dropdown .option.focus {
        background: #2b364b !important;
        color: #fff !important;
    }
    .ts-dropdown .optgroup-header {
        background: linear-gradient(135deg, #334155 0%, #475569 100%) !important;
        color: #cbd5e1 !important;
        font-weight: 600 !important;
        font-size: 0.75rem !important;
        text-transform: uppercase !important;
        letter-spacing: 0.05em !important;
        padding: 8px 20px !important;
        cursor: default !important;
        border-bottom: 2px solid #64748b;
    }
}

/* === カテゴリ連動の視覚的フィードバック === */
.select-wrapper.loading .ts-control {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.select-wrapper.loading .ts-control::after {
    content: '';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.select-wrapper.disabled .ts-control {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%) !important;
    color: #9ca3af !important;
    cursor: not-allowed;
}

/* スピンアニメーション */
@keyframes spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

/* カテゴリオプションの特殊スタイル */
.ts-dropdown .option.option-disabled {
    color: #9ca3af !important;
    background: #f8fafc !important;
    font-style: italic !important;
    cursor: not-allowed !important;
}

.ts-dropdown .option.option-all {
    font-weight: 600 !important;
    color: #059669 !important;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%) !important;
    border-left: 3px solid #10b981 !important;
    padding-left: 17px !important;
}

.ts-dropdown .option.option-empty {
    color: #6b7280 !important;
    background: #f9fafb !important;
    font-style: italic !important;
    text-align: center !important;
}

/* === ページトップボタンのアニメーション強化 === */
/* 他のページと統一するためのアニメーション確保 */
.page-top-btn {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    transform: translateY(0) !important;
}

.page-top-btn.visible {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
}

.page-top-btn:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 4px 12px rgba(142, 154, 206, 0.4) !important;
}

.page-top-btn svg {
    transition: all 0.2s ease !important;
}

/* アーカイブページではページボトムボタンを非表示 */
.page-bottom-btn {
    display: none !important;
}

/* === LINEスタイル未読バッジ === */
/* 未読バッジ - 赤い丸（LINEを模倣） */
.unread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: linear-gradient(135deg, #FF3B30 0%, #FF453A 100%);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 10px;
    margin-left: 8px;
    flex-shrink: 0;
    animation: unreadPulse 2s ease-in-out infinite;
}

/* 数字なしの小さいドット版 */
.unread-badge.dot {
    min-width: 10px;
    width: 10px;
    height: 10px;
    padding: 0;
    font-size: 0;
}

@keyframes unreadPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(255, 59, 48, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 3px 12px rgba(255, 59, 48, 0.6);
    }
}

/* カード右上の絶対配置バッジ */
.question-card {
    position: relative;
}

.question-card .unread-indicator {
    position: absolute;
    top: 12px;
    right: 12px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: rgba(107, 114, 128, 0.7);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

/* ドット版インジケーター */
.question-card .unread-indicator.dot {
    min-width: 10px;
    width: 10px;
    height: 10px;
    padding: 0;
}

/* タイトル横のインラインバッジ */
.card-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
    .unread-badge,
    .question-card .unread-indicator {
        background: rgba(156, 163, 175, 0.6);
    }
}

