:root {
    --primary: #E91E63;
    --primary-hover: #D81B60;
    --primary-light: #FCE4EC;
    --text: #333333;
    --bg: #F8F9FA;
    --card-bg: #FFFFFF;
    --border: #EEEEEE;
    --max-width: 1200px;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    padding-bottom: 70px;
    font-size: 15px;
}

/* ヘッダー＆ロゴ */
.app-header {
    background: var(--card-bg);
    height: 60px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-container {
    max-width: var(--max-width);
    margin: 0 auto;
    height: 100%;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.header-left { display: flex; align-items: center; gap: 12px; }
.site-logo { height: 38px; width: auto; object-fit: contain; vertical-align: middle; }
.icon-btn { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: #444; }
.hidden { display: none !important; }

/* コンテナ */
.main-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 20px;
}

.page-view { display: none; }
.page-view.active { display: block; }

/* ボタン類 */
.btn-primary { background: var(--primary); color: white; border: none; padding: 12px 24px; border-radius: 24px; font-weight: bold; cursor: pointer; transition: background 0.2s; font-size: 0.95rem; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary.full { width: 100%; display: block; text-align: center; box-sizing: border-box; }
.btn-primary.sm { padding: 8px 16px; font-size: 0.85rem; border-radius: 16px; }

.btn-secondary { background: white; color: var(--primary); border: 1px solid var(--primary); padding: 10px 22px; border-radius: 24px; font-weight: bold; cursor: pointer; font-size: 0.95rem; }
.btn-secondary.full { width: 100%; display: block; text-align: center; box-sizing: border-box; }
.btn-secondary.sm { padding: 8px 16px; font-size: 0.85rem; border-radius: 16px; }

.btn-link { background: none; border: none; color: var(--primary); font-weight: bold; cursor: pointer; text-decoration: underline; }

/* ① ログイン画面 */
.auth-card { background: white; padding: 32px; border-radius: 20px; box-shadow: 0 4px 20px rgba(0,0,0,0.06); text-align: center; max-width: 420px; margin: 40px auto 0; }
.auth-logo { height: 50px; margin-bottom: 12px; }
.hero-subtext { font-size: 1rem; color: #666; margin-bottom: 24px; }
.form-group { text-align: left; margin-bottom: 18px; }
.form-group label { display: block; font-size: 0.85rem; font-weight: bold; margin-bottom: 6px; color: #555; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 8px; box-sizing: border-box; font-size: 0.95rem; }
.auth-links { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; align-items: center; }

/* ② ホーム・ダッシュボード */
.welcome-banner { background: var(--primary-light); padding: 20px; border-radius: 16px; margin-bottom: 20px; }
.welcome-banner h3 { margin: 0 0 6px; font-size: 1.2rem; color: var(--primary); }
.welcome-banner p { margin: 0; font-size: 0.95rem; color: #555; }

.section-label { font-size: 1rem; font-weight: bold; color: #444; margin: 24px 0 12px; display: flex; justify-content: space-between; align-items: center; }
.more-link { font-size: 0.85rem; color: var(--primary); text-decoration: none; }

/* クイックメニュー Grid (スマホ: 2列, PC: 4列) */
.quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.quick-card { background: white; border: 1px solid var(--border); padding: 20px; border-radius: 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; cursor: pointer; transition: transform 0.2s, box-shadow 0.2s; }
.quick-card:hover { transform: translateY(-3px); box-shadow: 0 6px 16px rgba(0,0,0,0.08); }
.quick-card .icon { font-size: 2.2rem; }
.quick-card .label { font-size: 0.95rem; font-weight: bold; }

.notice-card { background: white; border: 1px solid var(--border); padding: 16px; border-radius: 12px; display: flex; gap: 16px; align-items: center; }

/* 検索 & グリッド (PCレスポンシブ対応) */
.responsive-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
.search-header { display: flex; gap: 12px; margin-bottom: 16px; }
.search-header input { flex: 1; padding: 12px 18px; border: 1px solid var(--border); border-radius: 24px; font-size: 0.95rem; }

.category-chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 16px; }
.cat-tag { background: white; border: 1px solid var(--border); padding: 8px 16px; border-radius: 20px; font-size: 0.85rem; white-space: nowrap; cursor: pointer; }
.cat-tag.active { background: var(--primary); color: white; border-color: var(--primary); }

/* プロフィール */
.profile-card-full { background: white; padding: 32px; border-radius: 20px; text-align: center; position: relative; box-shadow: 0 4px 16px rgba(0,0,0,0.04); max-width: 700px; margin: 0 auto; }
.support-heart-btn { position: absolute; top: 20px; right: 20px; background: var(--primary-light); color: var(--primary); border: none; padding: 8px 16px; border-radius: 20px; font-size: 0.85rem; font-weight: bold; cursor: pointer; }
.avatar-large { font-size: 4rem; background: #EFEFEF; width: 100px; height: 100px; line-height: 100px; border-radius: 50%; margin: 0 auto 16px; }
.profile-cta { display: flex; gap: 12px; justify-content: center; margin-top: 24px; }

/* オファーカード */
.offer-tabs { display: flex; background: #EFEFEF; border-radius: 24px; padding: 4px; margin-bottom: 20px; max-width: 400px; }
.offer-tab-btn { flex: 1; border: none; background: none; padding: 10px; font-size: 0.95rem; font-weight: bold; color: #666; border-radius: 20px; cursor: pointer; }
.offer-tab-btn.active { background: #FFFFFF; color: var(--primary); box-shadow: 0 2px 6px rgba(0,0,0,0.08); }
.offer-content-pane { display: none; }
.offer-content-pane.active { display: block; }
.offer-card { background: #FFFFFF; border: 1px solid var(--border); border-radius: 16px; padding: 20px; box-shadow: 0 2px 10px rgba(0,0,0,0.03); }

/* マイページ */
.mypage-layout { display: flex; flex-direction: column; gap: 20px; }
.my-profile-head { display: flex; gap: 16px; align-items: center; background: white; padding: 20px; border-radius: 16px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; background: white; padding: 16px; border-radius: 16px; text-align: center; }
.stat-box .num { display: block; font-weight: bold; font-size: 1.1rem; color: var(--primary); }
.my-details { background: white; padding: 20px; border-radius: 16px; font-size: 0.95rem; line-height: 1.7; }

/* GIFT AI BUDDY */
.ai-chat-container { background: white; border-radius: 20px; padding: 20px; height: 75vh; display: flex; flex-direction: column; box-shadow: 0 4px 16px rgba(0,0,0,0.04); }
.chat-body { flex: 1; overflow-y: auto; padding: 16px 0; }
.chat-body .msg { padding: 12px 18px; border-radius: 16px; font-size: 0.95rem; margin-bottom: 12px; max-width: 75%; line-height: 1.5; }
.chat-body .msg.ai { background: #F0F0F0; color: #333; }
.chat-body .msg.user { background: var(--primary-light); color: var(--primary); margin-left: auto; }
.ai-quick-topics { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.topic-btn { background: #FAF0F4; border: 1px solid #FFCDD2; border-radius: 20px; padding: 8px 16px; font-size: 0.85rem; cursor: pointer; }
.chat-input-row { display: flex; gap: 12px; }
.chat-input-row input { flex: 1; padding: 12px 18px; border: 1px solid var(--border); border-radius: 24px; font-size: 0.95rem; }

/* ドロワーメニュー */
.drawer-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 200; }
.drawer-menu { position: fixed; top: 0; right: -300px; width: 300px; height: 100%; background: white; z-index: 201; transition: right 0.3s ease; box-shadow: -4px 0 16px rgba(0,0,0,0.15); }
.drawer-menu.open { right: 0; }
.drawer-header { background: var(--primary-light); padding: 20px; display: flex; justify-content: space-between; align-items: center; }
.drawer-title { font-weight: bold; color: var(--primary); }
.drawer-nav { list-style: none; margin: 0; padding: 12px 0; }
.drawer-nav li { padding: 16px 24px; font-size: 0.95rem; border-bottom: 1px solid #F5F5F5; cursor: pointer; }

/* ボトムナビ (スマホ専用) */
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; height: 60px; background: white; display: flex; border-top: 1px solid var(--border); z-index: 100; }
.nav-item { flex: 1; border: none; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #888; cursor: pointer; }
.nav-item.active { color: var(--primary); }

/* PC画面用メディアクエリ (768px以上) */
@media screen and (min-width: 768px) {
    body { padding-bottom: 0; font-size: 16px; }
    .bottom-nav { display: none; } /* PCでは下部ナビ非表示 */
    
    .quick-grid { grid-template-columns: repeat(4, 1fr); } /* 4列表示 */
    .responsive-grid { grid-template-columns: repeat(2, 1fr); } /* カード2列表示 */

    .mypage-layout { display: grid; grid-template-columns: 320px 1fr; } /* マイページ2カラム */
}

@media screen and (min-width: 1024px) {
    .responsive-grid { grid-template-columns: repeat(3, 1fr); } /* カード3列表示 */
}