/* リセット・基本設定 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans', 'Noto Sans JP', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

/* ヘッダー */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header__title {
    font-size: 1.5rem;
    font-weight: 600;
}

/* メイン */
.main {
    max-width: 800px;
    margin: 0 auto;
    padding: 16px;
}

/* 検索セクション */
.search-section {
    margin-bottom: 20px;
}

.search-box {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
}

.search-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.search-btn:active {
    transform: translateY(0);
}

/* タグフィルター */
.tag-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-btn {
    padding: 6px 14px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.tag-btn:hover {
    background: #f0f0f0;
}

.tag-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* 投稿カード */
.posts-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.post-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.post-card__header {
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.post-card__title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.post-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.post-card__tag {
    padding: 4px 10px;
    background: #f0f0f0;
    border-radius: 12px;
    font-size: 12px;
    color: #666;
}

/* 画像ギャラリー */
.post-card__images {
    display: flex;
    gap: 4px;
    padding: 8px 16px;
}

.post-card__image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
}

/* テキストエリア */
.post-card__content {
    padding: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.post-card__text {
    flex: 1;
    font-size: 14px;
    color: #555;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 52px;
    overflow-y: auto;
    background: #fafafa;
    padding: 12px;
    border-radius: 8px;
}

/* コピーボタン */
.copy-btn {
    flex-shrink: 0;
    padding: 10px 16px;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(17, 153, 142, 0.4);
}

.copy-btn:active {
    transform: translateY(0);
}

.copy-btn.copied {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* トースト通知 */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #333;
    color: white;
    padding: 14px 28px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}


/* 検索結果なし */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.no-results__icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.no-results__text {
    font-size: 16px;
}

/* レスポンシブ対応 */
@media (max-width: 600px) {
    .header {
        padding: 16px;
    }

    .header__title {
        font-size: 1.25rem;
    }

    .main {
        padding: 12px;
    }

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

    .search-btn {
        width: 100%;
    }

    .post-card__title {
        font-size: 1.1rem;
    }

}

/* PC向け調整 */
@media (min-width: 801px) {
    .main {
        padding: 24px;
    }
}

/* スマホ向けコンテンツ配置調整 */
@media (max-width: 480px) {
    .post-card__content {
        flex-direction: column;
        gap: 8px;
    }

    .copy-btn {
        width: 100%;
        justify-content: center;
    }
}

/* 固定フッター */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 12px 16px;
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.footer__content {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.footer__title {
    color: white;
    font-size: 13px;
    font-weight: 500;
    opacity: 0.9;
}

.footer__links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.footer__link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(255,255,255,0.15);
    border-radius: 6px;
    text-decoration: none;
    color: white;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.footer__link:hover {
    background: rgba(255,255,255,0.25);
}

.footer__link-icon {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    object-fit: contain;
}

/* フッター分の余白を確保 */
body {
    padding-bottom: 60px;
}
