/* ══════════════════════════════════════════════════════════
   AI Print Hacks — Clean Design (Light/Dark)
   ══════════════════════════════════════════════════════════ */

/* ── ライトモード（デフォルト） ── */
:root {
    --bg: #f5f3ef;
    --bg2: #ffffff;
    --bg3: #eceae4;
    --surface: #ffffff;
    --border: #e2dfd7;
    --text: #1a1815;
    --text2: #706b62;
    --text3: #a09990;
    --accent: #3b7dd8;
    --accent-light: #ebf1fb;
    --accent-hover: #2c6bc0;
    --blue: #4a7fa5;
    --blue-light: #edf3f8;
    --green: #4d8c72;
    --green-light: #edf6f2;
    --radius: 12px;
    --radius-sm: 8px;
    --header-bg: rgba(255, 255, 255, 0.85);
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.04);
    --shadow-hover: 0 4px 20px rgba(59, 125, 216, 0.08);
    --font-primary: 'Noto Sans JP', 'Inter', -apple-system, sans-serif;
    --font-mono: 'SF Mono', 'Menlo', monospace;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
}

/* ── ダークモード ── */
[data-theme="dark"] {
    --bg: #141413;
    --bg2: #1c1c1a;
    --bg3: #242422;
    --surface: #1c1c1a;
    --border: #333330;
    --text: #e8e6e1;
    --text2: #9c9890;
    --text3: #6b6760;
    --accent: #5a9be6;
    --accent-light: #1a2538;
    --accent-hover: #74afe8;
    --blue: #6fa0c4;
    --blue-light: #1a2530;
    --green: #6aaa8c;
    --green-light: #1a2a22;
    --header-bg: rgba(28, 28, 26, 0.88);
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.2);
    --shadow-hover: 0 4px 20px rgba(90, 155, 230, 0.12);
}

/* ── リセット ── */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-primary);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background var(--transition-normal), color var(--transition-normal);
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ══════════════════════════════════
   ヘッダー
   ══════════════════════════════════ */
.site-header {
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background var(--transition-normal), border-color var(--transition-normal);
}

.header-inner {
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: -0.02em;
    color: var(--text);
    transition: opacity var(--transition-fast);
}

.logo:hover {
    opacity: 0.8;
}

.logo-mark {
    width: 32px;
    height: 32px;
    background: var(--accent);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logo-mark svg {
    color: #fff;
}

/* 旧ロゴ互換（非表示） */
.logo-icon {
    display: none;
}

.logo-text {
    background: none;
    -webkit-text-fill-color: var(--text);
}

.nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    padding: 6px 13px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text2);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.nav-link:hover {
    background: var(--bg3);
    color: var(--text);
}

.nav-link.active {
    color: var(--accent);
    background: var(--accent-light);
}

.nav-link svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* ── ドロップダウン ── */
.nav-dropdown {
    position: relative;
}

.nav-dropdown>.nav-link::after {
    content: '▾';
    font-size: 0.65rem;
    margin-left: 2px;
    opacity: 0.4;
    transition: transform var(--transition-fast);
}

.nav-dropdown:hover>.nav-link::after {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    min-width: 180px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    z-index: 50;
}

.nav-dropdown:hover .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.nav-dropdown-menu a {
    display: block;
    padding: 8px 14px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text2);
    border-radius: 6px;
    transition: all var(--transition-fast);
}

.nav-dropdown-menu a:hover {
    background: var(--accent-light);
    color: var(--accent);
}

/* ── 言語スイッチャー ── */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: 8px;
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--bg);
}

.lang-btn {
    background: none;
    border: none;
    color: var(--text3);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    padding: 2px 6px;
    border-radius: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-primary);
}

.lang-btn.active {
    background: var(--accent);
    color: #fff;
}

.lang-btn:hover:not(.active) {
    color: var(--accent);
}

.lang-sep {
    color: var(--border);
    font-size: 0.65rem;
}

/* ── テーマ切替ボタン ── */
.theme-toggle {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    transition: all var(--transition-fast);
    color: var(--text2);
    flex-shrink: 0;
}

.theme-toggle:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}

.theme-toggle svg {
    width: 16px;
    height: 16px;
}

.theme-toggle .icon-moon {
    display: none;
}

[data-theme="dark"] .theme-toggle .icon-sun {
    display: none;
}

[data-theme="dark"] .theme-toggle .icon-moon {
    display: block;
}

/* ── モバイルメニュー ── */
.mobile-menu-btn {
    display: none;
    background: none;
    border: 1px solid var(--border);
    border-radius: 8px;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text);
    align-items: center;
    justify-content: center;
}

/* ══════════════════════════════════
   ヒーロー
   ══════════════════════════════════ */
.hero {
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    padding: 56px 0 52px;
    transition: background var(--transition-normal), border-color var(--transition-normal);
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 48px;
    align-items: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 0.06em;
    margin-bottom: 16px;
}

.hero-badge::before {
    content: '';
    width: 20px;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
}

.hero-title {
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
}

/* 互換：gradient-text → accent色 */
.gradient-text {
    background: none;
    -webkit-text-fill-color: var(--accent);
    color: var(--accent);
}

.hero-desc {
    font-size: 0.95rem;
    color: var(--text2);
    line-height: 1.8;
    margin-bottom: 28px;
    max-width: 480px;
}

.hero-stats {
    display: flex;
    gap: 28px;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.stat-number,
.stat-num {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--text);
    background: none;
    -webkit-text-fill-color: var(--text);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text3);
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    margin-top: 2px;
}

/* hero-glow を無効化 */
.hero-glow {
    display: none;
}

/* ── ユウキ プロフィール ── */
.yuuki-profile {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    text-align: center;
    transition: all var(--transition-normal);
}

.yuuki-avatar {
    width: 240px;
    height: auto;
    object-fit: contain;
    margin: 0 auto 16px;
    display: block;
}

.yuuki-name {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.yuuki-title-badge {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--accent-light);
}

.yuuki-bio {
    font-size: 0.82rem;
    color: var(--text2);
    line-height: 1.7;
}

/* ══════════════════════════════════
   メインコンテンツ / 記事一覧
   ══════════════════════════════════ */
.main-content {
    padding: 48px 0;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.section-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.filter-reset-btn {
    padding: 6px 14px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text2);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-primary);
}

.filter-reset-btn:hover {
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent);
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--text3);
    font-size: 1.1rem;
}

.last-updated {
    font-size: 0.8rem;
    color: var(--text3);
    font-family: var(--font-mono);
}

/* ── 記事カード ── */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.article-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.article-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.article-card:hover {
    border-color: rgba(59, 125, 216, 0.3);
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.article-card:hover::before {
    opacity: 1;
}

.card-category {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.card-title {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.5;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-desc {
    font-size: 0.85rem;
    color: var(--text2);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 16px;
    flex: 1;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 14px;
    border-top: 1px solid var(--border);
}

.card-date {
    font-size: 0.78rem;
    color: var(--text3);
    font-family: var(--font-mono);
}

.card-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.card-tag {
    font-size: 0.68rem;
    color: var(--text3);
    padding: 2px 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-weight: 500;
}

.card-tag:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}

/* ── カードのheader/body（publisher.py生成構造対応） ── */
.article-card:has(.card-header) {
    padding: 0;
}

.card-header {
    padding: 12px 20px 10px;
    background: linear-gradient(135deg, rgba(59, 125, 216, 0.07) 0%, rgba(59, 125, 216, 0.03) 70%, transparent 100%);
    border-left: 3px solid var(--accent);
    border-bottom: 1px solid var(--border);
}

.card-body {
    padding: 14px 20px 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    font-size: 0.78rem;
    color: var(--text3);
    font-family: var(--font-mono);
}

/* ── 全N件の記事を見る ── */
.load-more-wrap {
    text-align: center;
    margin-top: 40px;
    padding-bottom: 8px;
}

.load-more-btn {
    display: inline-block;
    padding: 14px 40px;
    background: var(--accent);
    color: #fff;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.95rem;
    transition: opacity 0.2s, transform 0.2s;
    box-shadow: 0 4px 16px rgba(59, 125, 216, 0.3);
}

.load-more-btn:hover {
    opacity: 0.88;
    transform: translateY(-2px);
}

/* ══════════════════════════════════
   記事ページ
   ══════════════════════════════════ */
.article-page {
    padding: 48px 0;
}

.article-page .container {
    max-width: 780px;
}

.article {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow-card);
}

.article-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.article-category {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    background: var(--accent-light);
    padding: 4px 12px;
    border-radius: 100px;
}

.article-date {
    font-size: 0.8rem;
    color: var(--text3);
    font-family: var(--font-mono);
}

.article-title {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.article-body {
    font-size: 1rem;
    line-height: 1.85;
    color: var(--text);
}

.article-body h2,
.article-body h3 {
    font-weight: 700;
    margin: 28px 0 14px;
    letter-spacing: -0.01em;
}

.article-body h2 {
    font-size: 1.25rem;
}

.article-body h3 {
    font-size: 1.1rem;
}

.article-body p {
    margin-bottom: 18px;
}

.article-body ul,
.article-body ol {
    margin: 14px 0 18px 24px;
    color: var(--text2);
}

.article-body li {
    margin-bottom: 6px;
}

.article-body blockquote {
    margin: 18px 0;
    padding: 16px 20px;
    background: var(--accent-light);
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text2);
    font-size: 0.95rem;
}

/* ── ユウキのリアクション ── */
.yuuki-reaction {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 18px 20px;
    background: var(--accent-light);
    border: 1px solid rgba(59, 125, 216, 0.15);
    border-radius: var(--radius);
    margin: 24px 0;
}

.yuuki-reaction-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
    border: 2px solid var(--border);
}

.yuuki-reaction-body {
    flex: 1;
}

.yuuki-reaction-name {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 4px;
}

.yuuki-reaction-text {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text2);
}

/* ── ユウキのひとことコメント ── */
.yuuki-comment {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 18px 20px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin: 24px 0;
}

.yuuki-comment-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
    border: 2px solid var(--border);
}

.yuuki-comment-body {
    flex: 1;
}

.yuuki-comment-name {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 4px;
}

.yuuki-comment-text {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text2);
}

/* ── キーポイント ── */
.key-points {
    margin: 24px 0;
    padding: 20px 24px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.key-points h3 {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text);
}

.key-points ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.key-points li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 8px;
    font-size: 0.95rem;
    color: var(--text2);
}

.key-points li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 700;
}

/* ── タグ ── */
.tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.tag-link {
    font-size: 0.78rem;
    padding: 4px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text2);
    transition: all var(--transition-fast);
    font-weight: 500;
}

.tag-link:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}

/* ── 出典 ── */
.article-source {
    padding: 16px 20px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.85rem;
    color: var(--text2);
    display: flex;
    align-items: center;
    gap: 8px;
}

.article-source a {
    color: var(--accent);
    font-weight: 600;
    transition: color var(--transition-fast);
}

.article-source a:hover {
    color: var(--accent-hover);
}

/* ── 戻るボタン ── */
.article-cta {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text2);
    transition: all var(--transition-fast);
}

.btn-back:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}

/* ══════════════════════════════════
   フッター
   ══════════════════════════════════ */
.site-footer {
    background: var(--bg2);
    border-top: 1px solid var(--border);
    padding: 36px 0;
    margin-top: 48px;
    transition: all var(--transition-normal);
}

.footer-inner {
    text-align: center;
}

.footer-brand {
    font-weight: 800;
    font-size: 0.95rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.footer-links {
    display: flex;
    gap: 20px;
    justify-content: center;
    font-size: 0.8rem;
    color: var(--text2);
    margin-bottom: 12px;
}

.footer-links a {
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--accent);
}

.footer-copy {
    font-size: 0.75rem;
    color: var(--text3);
}

/* ── フッターユウキ ── */
.footer-team {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text2);
    margin-bottom: 16px;
}

.footer-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid var(--border);
    object-fit: cover;
    background: var(--bg3);
}

/* ══════════════════════════════════
   スクロールアニメーション
   ══════════════════════════════════ */
.article-card {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease, border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.article-card.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ══════════════════════════════════
   レスポンシブ
   ══════════════════════════════════ */
@media (max-width: 768px) {
    .nav {
        display: none;
    }

    .nav.active {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 60px;
        left: 0;
        right: 0;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        padding: 16px;
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
        z-index: 50;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .hero-content {
        grid-template-columns: 1fr;
        gap: 32px;
        text-align: center;
    }

    .hero-title {
        font-size: 1.8rem;
    }

    .hero-stats {
        justify-content: center;
    }

    .hero-desc {
        margin: 0 auto 28px;
    }

    .yk-scene {
        flex-direction: row !important;
        align-items: flex-end;
        gap: 12px;
    }

    .yk-chara {
        width: 100px;
        height: 120px;
    }

    .yk-bubble {
        height: 90px;
        padding: 12px;
        font-size: 0.85rem;
    }

    .yuuki-profile {
        max-width: 320px;
        margin: 0 auto;
    }

    .articles-grid {
        grid-template-columns: 1fr;
    }

    .article {
        padding: 24px;
    }

    .article-title {
        font-size: 1.4rem;
    }

    .nav-dropdown-menu {
        position: static;
        transform: none;
        box-shadow: none;
        border: none;
        padding: 0 0 0 16px;
        opacity: 1;
        visibility: visible;
        background: transparent;
    }

    .lang-switcher {
        margin: 12px 0 0;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .hero {
        padding: 36px 0 32px;
    }

    .hero-title {
        font-size: 1.5rem;
    }

    .hero-stats {
        gap: 16px;
    }

    .stat-number,
    .stat-num {
        font-size: 1.2rem;
    }

    .article-card {
        padding: 18px;
    }
}

/* ── 白瀬アイ 吹き出しアニメーション (yk-section) ── */
.yk-section {
    margin: 40px auto 0;
    max-width: 600px;
    padding: 28px 24px;
    background: var(--accent-light, rgba(59, 125, 216, .07));
    border: 1px solid rgba(59, 125, 216, .2);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

.yk-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent, #3b7dd8);
}

.yk-scene {
    display: flex;
    align-items: center;
    gap: 20px;
}

.yk-chara {
    position: relative;
    width: 200px;
    height: 250px;
    flex-shrink: 0;
    overflow: visible;
}

.yk-chara img.yk-layer {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: bottom center;
    position: absolute;
    bottom: 0;
    left: 0;
}

@keyframes yk-float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.yk-layer {
    width: 160px;
    display: block;
}

.yk-ov {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    transition: opacity .07s;
}

.yk-ov.on {
    opacity: 1;
}

.yk-bubble-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.yk-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 12px;
    border-radius: 999px;
    border: 1.5px solid rgba(59, 125, 216, .4);
    background: rgba(59, 125, 216, .08);
    font-size: .78rem;
    font-weight: 700;
    color: var(--accent, #3b7dd8);
    width: fit-content;
}

.yk-sub {
    font-size: .68rem;
    color: var(--text3, rgba(0, 0, 0, .35));
    font-weight: 400;
}

.yk-bubble {
    background: var(--surface, rgba(255, 255, 255, .9));
    border: 1px solid var(--border, rgba(0, 0, 0, .08));
    border-radius: 16px 16px 16px 4px;
    padding: 16px 18px;
    font-size: .92rem;
    line-height: 1.85;
    height: 120px;
    overflow-y: auto;
}

.yk-bubble p {
    margin: 0;
    color: var(--text, #1a1815);
}

.yk-cur {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: var(--accent, #3b7dd8);
    vertical-align: middle;
    margin-left: 1px;
    animation: yk-bc .65s steps(1) infinite;
}

@keyframes yk-bc {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* ── 白瀬の部屋用 インタラクションエリア ── */
.yk-q-wrap {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px dashed var(--border);
}

.yk-q-btn {
    background: var(--surface);
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.yk-q-btn:hover {
    background: var(--accent);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(59, 125, 216, 0.2);
}

/* ── トグルボタン追加スタイル ── */
.yk-badge-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.ai-room-toggle-btn {
    background: transparent;
    border: none;
    color: var(--text2);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all var(--transition-fast);
}

.ai-room-toggle-btn:hover {
    background: var(--bg3);
    color: var(--accent);
}

.ai-room-bubble-wrap.is-minimized #yk-bubble-content {
    display: none;
}

.ai-room-bubble-wrap.is-minimized .yk-badge {
    display: none;
}

.ai-room-bubble-wrap.is-minimized .yk-badge-wrap {
    margin-bottom: 0;
    justify-content: flex-end;
}


/* =========================================
   白瀬の部屋 (PC・基本レイアウト / クラス完全分離)
   ========================================= */
.ai-room-section {
    max-width: 1000px;
    margin: 40px auto 0;
    border: none;
    background: transparent;
    overflow: visible;
}

.ai-room-scene {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    justify-content: center;
    gap: 40px;
    position: relative;
}

.ai-room-chara {
    position: relative;
    width: 320px;
    height: 600px;
    border-radius: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    overflow: visible;
    flex-shrink: 0;
}

.ai-room-chara img.yk-layer {
    width: 100%;
    height: auto;
    position: absolute;
    bottom: 0;
    top: auto;
    left: 0;
    transform: none;
}

.ai-room-bubble-wrap {
    flex: 0 1 500px;
    align-self: center;
    z-index: 10;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

[data-theme="dark"] .ai-room-bubble-wrap {
    background: rgba(28, 28, 26, 0.95);
}

.ai-room-bubble {
    border: none;
    padding: 0;
    background: transparent;
    height: 100px;
    max-height: 100px;
    min-height: 100px;
    overflow-y: auto;
    text-align: left;
}

.ai-room-chara img.yk-ov {
    /* js control */
}

.ai-room-chara img.yk-ov.on {
    opacity: 1 !important;
}

/* =========================================
   スマホ用レイアウト (max-width: 768px)
   ========================================= */
@media (max-width: 768px) {
    .ai-room {
        margin: 0;
        padding: 0;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .ai-room-section:first-of-type {
        margin: 0;
        max-width: 100%;
        height: auto;
        min-height: calc(100vh - 60px);
        border: none;
        border-radius: 0;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        padding: 20px 20px 0 20px;
        background: var(--bg2);
        overflow: hidden;
    }

    .ai-room-section:not(:first-of-type) {
        height: auto;
        padding: 20px;
        overflow: visible;
        margin-top: 20px;
    }

    .ai-room-scene {
        display: block;
        height: 280vw;
        /* 画像のaspect 1.4 * width 200vw = 280vw */
        position: relative;
    }

    /* キャラクターは全画面に対して表示 */
    .ai-room-chara {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border-radius: 0;
        background: transparent;
        border: none;
        box-shadow: none;
        overflow: hidden;
        z-index: 1;
        opacity: 1 !important;
        pointer-events: none;
    }

    /* スマホ用に全身が収まるようobject-fitで配置。スケール倍 */
    .ai-room-chara img.yk-layer {
        width: 200%;
        height: 200%;
        object-fit: contain;
        object-position: center 5%;
        position: absolute;
        top: 0;
        left: -50%;
        bottom: auto;
        transform: none;
        max-width: none;
    }

    /* 吹き出しは胸のあたりにオーバーレイ・半透明で配置 */
    .ai-room-bubble-wrap {
        position: absolute;
        top: 35%;
        /* 画像の胸あたりを狙って調整 */
        left: 5%;
        right: 5%;
        width: 90%;
        margin: 0;
        z-index: 10;
        background: rgba(255, 255, 255, 0.85);
        /* 半透明 */
        backdrop-filter: blur(8px);
        /* 背景ぼかし */
        -webkit-backdrop-filter: blur(8px);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .ai-room-bubble-wrap.is-minimized {
        width: auto;
        left: auto;
        padding: 4px;
        border-radius: 50px;
        border: 1px solid var(--border);
    }

    [data-theme="dark"] .ai-room-bubble-wrap {
        background: rgba(28, 28, 26, 0.85);
    }

    .ai-room-bubble {
        height: auto;
        max-height: 120px;
    }

    .ai-room-bio {
        display: none;
    }
}

/* ── 多言語対応 強制表示・非表示 ── */
html[lang="ja"] [data-lang-en] {
    display: none !important;
}

html[lang="en"] [data-lang-ja] {
    display: none !important;
}