@charset "UTF-8";
/* ==========================================================================
   【初心者さんへのみちしるべ】Q&A 専用スタイルシート
   レスポンシブ（320px〜）、グラスモーフィズム、温かみのあるモダンデザイン
   ========================================================================== */

:root {
    --primary-color: #4a90e2;
    --primary-hover: #357abd;
    --secondary-color: #ff9800;
    --accent-color: #e91e63;
    --bg-gradient: linear-gradient(135deg, #f0f7ff 0%, #e8f4f8 50%, #fff0f5 100%);
    --card-bg: rgba(255, 255, 255, 0.92);
    --text-color: #2c3e50;
    --text-muted: #6c757d;
    --border-color: #e2e8f0;
    --success-color: #2e7d32;
    --warning-color: #ed6c02;
    --shadow: 0 8px 32px rgba(31, 38, 135, 0.08);
    --border-radius: 16px;
    --font-family: 'Segoe UI', Meiryo, 'Hiragino Kaku Gothic ProN', sans-serif;
}

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

body {
    font-family: var(--font-family);
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-color);
    line-height: 1.6;
    padding-bottom: 60px;
    min-width: 320px;
    overflow-x: hidden;
}

/* コンテナ */
.container {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px 15px;
}

/* ヘッダー */
.header-banner {
    background: linear-gradient(135deg, #4a90e2 0%, #63b3ed 100%);
    color: #ffffff;
    padding: 28px 20px;
    border-radius: var(--border-radius);
    text-align: center;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.header-banner h1 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 8px;
    word-break: break-word;
}

.header-banner p {
    font-size: 0.95rem;
    opacity: 0.95;
    word-break: break-word;
}

/* 心得・約束バナー (折りたたみ対応) */
.rules-card-collapsible {
    background: #fff8e1;
    border-left: 6px solid #ffa000;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    transition: all 0.3s ease;
}

.rules-card-summary {
    padding: 12px 18px;
    font-size: 0.95rem;
    font-weight: 700;
    color: #b78103;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    list-style: none; /* デフォルトの矢印を非表示 */
}

.rules-card-summary::-webkit-details-marker {
    display: none;
}

.rules-card-summary:hover {
    background: rgba(255, 160, 0, 0.08);
}

.collapsible-icon {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    color: #ffa000;
}

details[open] .collapsible-icon {
    transform: rotate(180deg);
}

.rules-card-content {
    padding: 12px 18px 16px;
    border-top: 1px dashed rgba(255, 160, 0, 0.3);
}

.rules-card-content ul {
    list-style: none;
    padding-left: 0;
}

.rules-card-content li {
    font-size: 0.88rem;
    color: #5d4037;
    margin-bottom: 6px;
    position: relative;
    padding-left: 20px;
    line-height: 1.5;
    word-break: break-word;
}

.rules-card li::before {
    content: "🌸";
    position: absolute;
    left: 0;
    top: 0;
}

/* 検索カード (折りたたみ対応) */
.search-card-collapsible {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    padding: 12px 18px;
    transition: all 0.3s ease;
}

.search-card-summary {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary-color);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    list-style: none;
}

.search-card-summary::-webkit-details-marker {
    display: none;
}

.search-card-summary:hover {
    opacity: 0.85;
}

/* 検索＆アクションバー */
.search-action-bar {
    background: transparent;
    padding: 0;
    margin-bottom: 0;
}

.search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.search-input-group {
    flex: 1 1 200px;
    display: flex;
    gap: 8px;
}

.search-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.95rem;
    transition: all 0.2s;
    outline: none;
    background: #ffffff;
}

.search-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.15);
}

.select-filter {
    padding: 12px 14px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 0.9rem;
    background: #ffffff;
    color: var(--text-color);
    outline: none;
    cursor: pointer;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    gap: 6px;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary-color);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-success {
    background: #43a047;
    color: #ffffff;
}

/* 投稿フォーム折りたたみ用サマリーボタン */
.btn-post-toggle-summary {
    background: linear-gradient(135deg, #43a047 0%, #2e7d32 100%);
    color: #ffffff;
    padding: 14px 24px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    list-style: none;
    box-shadow: 0 4px 14px rgba(46, 125, 50, 0.25);
    transition: all 0.2s ease;
}

.btn-post-toggle-summary::-webkit-details-marker {
    display: none;
}

.btn-post-toggle-summary:hover {
    background: linear-gradient(135deg, #388e3c 0%, #1b5e20 100%);
    transform: translateY(-1px);
}

.btn-success:hover {
    background: #388e3c;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #e2e8f0;
    color: var(--text-color);
}

.btn-secondary:hover {
    background: #cbd5e1;
}

/* 質問追加ボタン枠 */
.post-btn-wrapper {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}

/* 質問カードリスト */
.question-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.question-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.7);
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.question-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(31, 38, 135, 0.12);
}

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

.badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-open {
    background: #e3f2fd;
    color: #1976d2;
}

.badge-resolved {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-category {
    background: #f3e5f5;
    color: #7b1fa2;
}

/* 勲章（ベストアンサー数称号）スタイル */
.medal-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.badge-rookie {
    background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.badge-kind {
    background: linear-gradient(135deg, #fce4ec, #f8bbd0);
    color: #c2185b;
    border: 1px solid #f48fb1;
}

.badge-master {
    background: linear-gradient(135deg, #fff8e1, #ffe082);
    color: #b78103;
    border: 1px solid #ffd54f;
}

.badge-legend {
    background: linear-gradient(135deg, #e0f7fa, #80deea);
    color: #00838f;
    border: 1px solid #4dd0e1;
}

.badge-god {
    background: linear-gradient(135deg, #fff3e0, #ffcc80);
    color: #e65100;
    border: 1px solid #ffb74d;
    animation: shine 2s infinite alternate;
}


.question-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 8px;
    line-height: 1.4;
    word-break: break-word;
}

.question-preview {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    line-height: 1.5;
    word-break: break-word;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
    flex-wrap: wrap;
    gap: 8px;
}

/* 質問詳細ページ */
.detail-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.detail-body {
    font-size: 1rem;
    line-height: 1.8;
    margin: 16px 0;
    white-space: pre-wrap;
    word-break: break-word;
}

/* 回答セクション */
.answers-section {
    margin-top: 32px;
}

.answers-header {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-color);
}

.answer-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border-color);
    position: relative;
}

.answer-card.is-best {
    border: 2px solid #ffa000;
    background: #fffdf5;
}

.best-tag {
    background: #ffa000;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    display: inline-block;
    margin-bottom: 10px;
}

.answer-body {
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 12px;
    white-space: pre-wrap;
    word-break: break-word;
}

.answer-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

/* 投稿モーダル・フォーム */
.form-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
    background: #ffffff;
}

.form-control:focus {
    border-color: var(--primary-color);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

/* メッセージ表示 */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.alert-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.alert-error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

/* ナビゲーション戻るボタン */
.nav-back {
    margin-bottom: 16px;
}

/* モバイル（320px〜）レスポンシブ調整 */
@media (max-width: 480px) {
    .container {
        padding: 10px 8px;
    }
    
    .header-banner {
        padding: 16px 12px;
        margin-bottom: 12px;
    }

    .header-banner h1 {
        font-size: 1.3rem;
        margin-bottom: 4px;
    }

    .header-banner p {
        font-size: 0.85rem;
    }

    .rules-card-collapsible {
        margin-bottom: 12px;
    }

    .rules-card-summary {
        padding: 10px 14px;
        font-size: 0.88rem;
    }

    .search-action-bar {
        padding: 12px 10px;
        margin-bottom: 14px;
    }

    .search-input-group {
        gap: 8px;
    }

    .btn-post-toggle {
        padding: 12px 14px;
        font-size: 0.95rem;
    }
}

    .header-banner h1 {
        font-size: 1.3rem;
    }

    .search-form {
        flex-direction: column;
    }

    .search-input-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .post-btn-wrapper .btn {
        width: 100%;
    }
}

/* 新着回答がついた質問のパルス強調スタイル */
.has-new-reply {
    border: 2px solid #ff4757 !important;
    box-shadow: 0 0 16px rgba(255, 71, 87, 0.3) !important;
}

.badge-new-reply {
    background: linear-gradient(135deg, #ff4757, #ff6b81) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    animation: qaPulseGlow 1.5s infinite alternate ease-in-out;
}

@keyframes qaPulseGlow {
    0% { transform: scale(1); box-shadow: 0 0 4px rgba(255, 71, 87, 0.4); }
    100% { transform: scale(1.06); box-shadow: 0 0 12px rgba(255, 71, 87, 0.85); }
}
