:root {
    /* 緑系 */
    --primary-green: #1b5e4a;
    --accent-green: #2e7d5e;
    --light-green: #4caf8a;
    --bright-green: #52d9a0;
    /* 青系 */
    --primary-blue: #0d3d6b;
    --accent-blue: #1565c0;
    --light-blue: #29b6f6;
    --bright-blue: #4dd0e1;
    /* ティール（中間色） */
    --teal-dark: #00455a;
    --teal-mid: #00796b;
    --teal-light: #26c6da;
    /* 共通 */
    --bg-base: #e8f5f2;
    --text-dark: #1a2e26;
    --text-light: #5a7a72;
    --border-color: #b2e8de;
    --shadow: 0 2px 8px rgba(0, 60, 60, 0.10);
    --shadow-hover: 0 6px 20px rgba(0, 100, 90, 0.22);
    /* Twitter風 */
    --tw-blue: #1d9bf0;
    --tw-green: #00ba7c;
    --tw-pink: #f91880;
    --tw-border: #eff3f4;
    --tw-bg-hover: #f7f9f9;
    --tw-text-secondary: #536471;
}

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

body {
    font-family: 'Noto Sans JP', sans-serif;
    background:
        repeating-linear-gradient(45deg, transparent, transparent 40px, rgba(0, 150, 120, 0.025) 40px, rgba(0, 150, 120, 0.025) 80px),
        repeating-linear-gradient(-45deg, transparent, transparent 40px, rgba(0, 100, 180, 0.025) 40px, rgba(0, 100, 180, 0.025) 80px),
        linear-gradient(150deg, #dff5ef 0%, #e3f0ff 45%, #d9f5ee 100%);
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ─── ヘッダー ─── */
.header {
    background: linear-gradient(135deg, #0d4a3a 0%, #0d5c7a 50%, #0d3d6b 100%);
    box-shadow: 0 2px 16px rgba(0, 50, 50, 0.28);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0.8rem 0;
}
.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    font-family: 'Zen Maru Gothic', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    text-shadow: 2px 2px 6px rgba(0,0,0,0.25);
    letter-spacing: 0.1em;
}
.logo-link {
    color: inherit;
    text-decoration: none;
}
.logo-link:hover { opacity: 0.9; }
.header-nav { display: flex; gap: 1.5rem; }
.nav-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}
.nav-link:hover, .nav-link.active {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

/* ─── メインコンテンツ ─── */
.main-content { flex: 1; padding: 3rem 0; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }

/* ─── 検索 ─── */
.search-section { margin-bottom: 2rem; }
.search-box { position: relative; max-width: 600px; margin: 0 auto; }
.search-icon {
    position: absolute; left: 1rem; top: 50%; transform: translateY(-50%);
    color: var(--teal-mid); font-size: 1.2rem;
}
.search-input {
    width: 100%; padding: 1rem 3rem; border: 2px solid var(--border-color);
    border-radius: 50px; font-size: 1rem; background: white; transition: all 0.3s ease;
}
.search-input:focus {
    outline: none; border-color: var(--teal-mid);
    box-shadow: 0 0 0 3px rgba(0, 121, 107, 0.15);
}
.clear-btn {
    position: absolute; right: 1rem; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: var(--text-light); font-size: 1.2rem;
    cursor: pointer; padding: 0.5rem; border-radius: 50%; transition: all 0.3s ease;
}
.clear-btn:hover { background: rgba(0,0,0,0.05); color: var(--text-dark); }

/* ─── タグ ─── */
.tags-section { margin-bottom: 2rem; }
.tags-container { display: flex; flex-wrap: wrap; gap: 0.8rem; justify-content: center; }
.tag-btn {
    padding: 0.6rem 1.2rem; border: 2px solid var(--teal-mid); background: white;
    color: var(--teal-mid); border-radius: 50px; font-size: 0.9rem; font-weight: 500;
    cursor: pointer; transition: all 0.3s ease; display: flex; align-items: center; gap: 0.5rem;
}
.tag-btn:hover {
    background: var(--teal-light); color: white; border-color: var(--teal-light);
    transform: translateY(-2px); box-shadow: var(--shadow-hover);
}
.tag-btn.active {
    background: linear-gradient(135deg, var(--teal-mid) 0%, var(--teal-light) 100%);
    color: white; border-color: var(--teal-mid);
}

/* ─── ツールグリッド ─── */
.tools-section { margin-bottom: 3rem; }
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }

/* ─── ツールカード ─── */
.tool-card {
    background: white; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow);
    transition: all 0.3s ease; cursor: pointer; border: 2px solid transparent;
    display: flex; flex-direction: column;
}
.tool-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-hover); border-color: var(--teal-mid); }
.tool-cover {
    width: 100%; height: 130px; display: flex; align-items: center; justify-content: center;
    position: relative; overflow: hidden; flex-shrink: 0;
}
.tool-cover-icon { font-size: 2.8rem; color: rgba(255,255,255,0.90); filter: drop-shadow(0 2px 6px rgba(0,0,0,0.20)); }
.tool-cover-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.tool-body { padding: 1.2rem 1.4rem 1.4rem; display: flex; flex-direction: column; flex: 1; }
.tool-title { font-size: 1.15rem; font-weight: 700; color: var(--teal-dark); margin-bottom: 0.45rem; }
.tool-description { color: var(--text-light); font-size: 0.88rem; margin-bottom: 0.9rem; line-height: 1.65; flex: 1; }
.tool-tags { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.tool-tag {
    display: inline-block; padding: 0.28rem 0.75rem;
    background: linear-gradient(135deg, var(--teal-mid) 0%, var(--teal-light) 100%);
    color: white; border-radius: 20px; font-size: 0.72rem; font-weight: 500;
}
.no-results { text-align: center; padding: 3rem; color: var(--text-light); }
.no-results i { font-size: 3rem; margin-bottom: 1rem; display: block; opacity: 0.5; }

/* ─── ブログページ（Twitter風） ─── */
.blog-main { background: #f7f9f9; padding: 0; }
.blog-container { max-width: 620px; margin: 0 auto; padding: 0; }
.blog-feed {
    background: white; border-left: 1px solid var(--tw-border);
    border-right: 1px solid var(--tw-border); min-height: 80vh;
}

/* タイムライン */
.timeline { display: flex; flex-direction: column; }

/* ツイート風カード */
.post-card {
    padding: 12px 16px; border-bottom: 1px solid var(--tw-border);
    transition: background 0.2s ease; display: flex; gap: 12px;
    background: white; cursor: pointer;
}
.post-card:hover { background: var(--tw-bg-hover); }

/* アバター */
.post-avatar {
    width: 40px; height: 40px; min-width: 40px; border-radius: 50%;
    background: linear-gradient(135deg, var(--teal-mid) 0%, var(--teal-light) 100%);
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 1.1rem; flex-shrink: 0; overflow: hidden;
}
.post-avatar-lg { width: 48px; height: 48px; min-width: 48px; font-size: 1.3rem; }
.avatar-img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

/* ツイート本文エリア */
.post-body { flex: 1; min-width: 0; }
.post-header { display: flex; align-items: center; gap: 4px; margin-bottom: 2px; flex-wrap: wrap; }
.post-author { font-weight: 700; font-size: 0.95rem; color: var(--text-dark); }
.post-handle { color: var(--tw-text-secondary); font-size: 0.9rem; }
.post-dot { color: var(--tw-text-secondary); font-size: 0.9rem; }
.post-time { font-size: 0.9rem; color: var(--tw-text-secondary); }
.post-content { margin-bottom: 12px; line-height: 1.6; color: var(--text-dark); font-size: 0.95rem; word-break: break-word; }
.hashtag { color: var(--teal-mid); font-weight: 500; }
.hashtag { color: var(--teal-mid); font-weight: 500; }
.hashtag { color: var(--teal-mid); font-weight: 500; }
.modal-tweet-content .hashtag { color: var(--teal-mid); }
.post-image { width: 100%; max-height: 400px; object-fit: cover; border-radius: 16px; border: 1px solid var(--tw-border); margin-bottom: 12px; }

/* アクションボタン */
.post-actions { display: flex; justify-content: space-between; max-width: 300px; }
.post-action {
    display: flex; align-items: center; gap: 6px; color: var(--tw-text-secondary);
    cursor: pointer; transition: all 0.2s ease; background: none; border: none;
    font-size: 0.85rem; padding: 6px; border-radius: 50px;
}
.post-action.action-reply:hover { color: var(--tw-blue); }
.post-action.action-retweet:hover { color: var(--tw-green); }
.post-action.action-like:hover { color: var(--tw-pink); }
.post-action.liked { color: var(--tw-pink); }
.post-action.retweeted { color: var(--tw-green); }

.no-posts { text-align: center; padding: 3rem 2rem; color: var(--tw-text-secondary); }

/* ─── ツイート詳細モーダル ─── */
.tweet-modal-overlay {
    position: fixed; inset: 0; background: rgba(0, 0, 0, 0.4);
    z-index: 2000; display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transition: all 0.25s ease;
}
.tweet-modal-overlay.active { opacity: 1; visibility: visible; }
.tweet-modal {
    background: white; border-radius: 16px; width: 90%; max-width: 600px;
    max-height: 90vh; overflow-y: auto; position: relative;
    transform: scale(0.9); transition: transform 0.25s ease;
}
.tweet-modal-overlay.active .tweet-modal { transform: scale(1); }
.tweet-modal-close {
    position: absolute; top: 8px; left: 8px; width: 36px; height: 36px;
    border-radius: 50%; border: none; background: none; font-size: 1.1rem;
    color: var(--text-dark); cursor: pointer; display: flex; align-items: center;
    justify-content: center; transition: background 0.2s ease; z-index: 1;
}
.tweet-modal-close:hover { background: rgba(0, 0, 0, 0.07); }
.tweet-modal-content { padding: 48px 16px 16px; }
.modal-tweet-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.modal-tweet-header .post-author { font-size: 1rem; }
.modal-tweet-header .post-handle { font-size: 0.9rem; }
.modal-tweet-content { font-size: 1.2rem; line-height: 1.7; color: var(--text-dark); margin-bottom: 16px; }
.modal-tweet-time { color: var(--tw-text-secondary); font-size: 0.9rem; padding-bottom: 12px; border-bottom: 1px solid var(--tw-border); }
.modal-tweet-stats { display: flex; gap: 1.5rem; padding: 12px 0; border-bottom: 1px solid var(--tw-border); font-size: 0.9rem; color: var(--tw-text-secondary); }
.modal-tweet-stats strong { color: var(--text-dark); }
.modal-tweet-actions { display: flex; justify-content: space-around; padding: 8px 0; border-bottom: 1px solid var(--tw-border); }
.modal-tweet-actions .post-action { padding: 10px; font-size: 1.2rem; }

/* ─── フッター ─── */
.footer {
    background: linear-gradient(135deg, #0d4a3a 0%, #0d5c7a 50%, #0d3d6b 100%);
    color: white; padding: 2rem 0; margin-top: auto;
}
.footer-content { max-width: 1200px; margin: 0 auto; padding: 0 2rem; text-align: center; }
.social-links { display: flex; justify-content: center; gap: 1.5rem; margin-bottom: 1.5rem; }
.social-link {
    width: 48px; height: 48px; border-radius: 50%; background: rgba(255,255,255,0.1);
    display: flex; align-items: center; justify-content: center; color: white;
    font-size: 1.3rem; text-decoration: none; transition: all 0.3s ease; border: 2px solid transparent;
}
.social-link:hover {
    background: rgba(255,255,255,0.2); border-color: var(--teal-light);
    transform: translateY(-4px); box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.social-tooltip-wrapper {
    position: relative;
    display: inline-flex;
}
.social-tooltip {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%) translateY(8px) scale(0.96);
    min-width: 260px;
    max-width: min(86vw, 340px);
    background: rgba(255, 255, 255, 0.96);
    border-radius: 14px;
    border: 1px solid rgba(180, 220, 214, 0.9);
    box-shadow: 0 16px 34px rgba(0, 28, 40, 0.28);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 0.68rem 0.78rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    z-index: 1002;
    text-align: center;
}
.social-tooltip::after {
    content: '';
    position: absolute;
    bottom: -9px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-top: 9px solid rgba(255, 255, 255, 0.96);
}
.social-tooltip-wrapper:hover .social-tooltip,
.social-tooltip-wrapper:focus-within .social-tooltip,
.social-tooltip-wrapper.active .social-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0) scale(1);
}
.social-tooltip-title {
    font-weight: 700;
    font-size: 0.86rem;
    color: var(--teal-dark);
    letter-spacing: 0.01em;
}
.social-tooltip-divider {
    width: min(88%, 220px);
    margin: 0.38rem auto 0.42rem;
    border-top: 1px solid transparent;
    border-image: linear-gradient(
        90deg,
        rgba(38, 198, 218, 0.08) 0%,
        rgba(38, 198, 218, 0.45) 22%,
        rgba(13, 92, 122, 0.62) 50%,
        rgba(38, 198, 218, 0.45) 78%,
        rgba(38, 198, 218, 0.08) 100%
    ) 1;
}
.social-tooltip-text {
    color: var(--text-light);
    font-size: 0.78rem;
    line-height: 1.5;
    white-space: pre-line;
}
.copyright { font-size: 0.9rem; opacity: 0.8; }

/* ─── Twitter ポップアップ ─── */
.twitter-wrapper { position: relative; }
.twitter-toggle { cursor: pointer; font-family: inherit; padding: 0; }
.twitter-toggle:hover {
    background: rgba(255,255,255,0.2); border-color: var(--teal-light);
    transform: translateY(-4px); box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.twitter-popup {
    position: absolute; bottom: calc(100% + 14px); left: 50%;
    transform: translateX(-50%) translateY(8px) scale(0.96);
    background: rgba(255, 255, 255, 0.96);
    border-radius: 14px;
    border: 1px solid rgba(180, 220, 214, 0.9);
    box-shadow: 0 16px 34px rgba(0, 28, 40, 0.28);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 0.6rem;
    min-width: 240px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    z-index: 1001;
}
.twitter-popup::after {
    content: '';
    position: absolute;
    bottom: -9px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 9px solid transparent;
    border-right: 9px solid transparent;
    border-top: 9px solid rgba(255, 255, 255, 0.96);
}
.twitter-popup.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0) scale(1);
}
.twitter-popup-head {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--teal-dark);
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 0.02em;
    padding: 0.3rem 0.45rem 0.5rem;
    margin-bottom: 0.25rem;
    border-bottom: 1px solid rgba(178, 232, 222, 0.75);
}
.twitter-popup-head i {
    color: var(--teal-mid);
    font-size: 0.95rem;
}
.twitter-popup-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-dark);
    transition: background 0.2s ease, transform 0.2s ease;
}
.twitter-popup-item:hover {
    background: rgba(38, 198, 218, 0.12);
    transform: translateX(2px);
}
.twitter-popup-item i { font-size: 1.2rem; color: var(--teal-mid); width: 24px; text-align: center; }
.popup-label { display: block; font-weight: 700; font-size: 0.9rem; color: var(--text-dark); }
.popup-sub { display: block; font-size: 0.75rem; color: var(--text-light); }

.floating-index-btn {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1200;
    border: 1px solid rgba(178, 232, 222, 0.95);
    border-radius: 999px;
    padding: 0.56rem 0.86rem;
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--teal-dark);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 8px 18px rgba(0, 45, 60, 0.18);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    text-decoration: none;
}
.floating-index-btn:hover {
    transform: translateY(-2px);
    background: #ffffff;
    box-shadow: 0 12px 24px rgba(0, 55, 70, 0.27);
}
.floating-index-btn i { font-size: 0.78rem; }

/* ─── レスポンシブ ─── */
@media (max-width: 768px) {
    .header-content { flex-direction: column; gap: 1rem; text-align: left; }
    .header-nav { flex-direction: column; gap: 0.5rem; }
    .tools-grid { grid-template-columns: 1fr; }
    .tags-container { justify-content: flex-start; }
    .tag-btn { font-size: 0.85rem; padding: 0.5rem 1rem; }
    .container { padding: 0 0.9rem; }
    .blog-container { padding: 0 0.75rem; }
    .social-links { gap: 1rem; }
    .social-link { width: 40px; height: 40px; font-size: 1.1rem; }
    .social-tooltip {
        min-width: 220px;
        max-width: min(90vw, 300px);
    }
    .blog-feed { border-left: none; border-right: none; border-radius: 12px; overflow: hidden; }
    .floating-index-btn {
        right: 12px;
        bottom: 14px;
        padding: 0.54rem 0.78rem;
        font-size: 0.78rem;
    }
}

@media (max-width: 480px) {
    .container { padding: 0 0.7rem; }
    .blog-container { padding: 0 0.6rem; }
    .logo { font-size: 1.3rem; }
    .search-input { font-size: 0.9rem; padding: 0.9rem 2.8rem; }
    .tool-cover { height: 110px; }
    .tool-body { padding: 1rem 1.1rem 1.2rem; }
    .tool-title { font-size: 1.05rem; }
}
