/* ==========================================
   1. 変数と基本設定 (新デザイン統合版)
   ========================================== */
:root {
    /* 既存の変数 */
    --primary: #0000ff;
    --link: #106eb7;
    --bg-main: #f5fafd;
    --bg-light: #f0f7ff;
    --text: #333;
    --border: #d0e3ff;
    --white: #fff;
    --radius: 15px;

    /* 新デザイン用：ゴールド・ネイビー・グリーン */
    --compass-gold: #d4af37;   /* コンパスのゴールド */
    --navy-deep: #002244;      /* 深みのあるネイビー */
    --rescue-green: #40916c;   /* 救済の緑 */
    --warning-red: #cc3333;    /* 警告の赤（少し落ち着いたトーン） */
    
    /* ガラス質感（半透明白） */
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

/* 全ての要素で box-sizing を固定する */
* {
    box-sizing: border-box !important;
}

/* ==========================================
   2. 全体設定
   ========================================== */
html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text);
    background-image: url("images/umikamom.png");
    background-repeat: no-repeat;
    background-position: center center;
    background-attachment: fixed;
    background-size: cover;
    background-color: #e0f2f1;
}

body {
    background-color: var(--bg-main, #f5fafd) !important;
}

/* ==========================================
   3. 基本レイアウト（PC・タブレット用）
   ========================================== */

header {
    max-width: 880px;
    margin: 0 auto;
    padding: 20px;
    color: white;
    text-align: center;
    border-radius: var(--radius) var(--radius) 0 0;
    box-sizing: border-box;
}

nav {
    width: 95%;
    max-width: 750px;
    margin: 20px auto;
    padding: 10px;
    background-color: transparent;
    border-radius: 8px;
    box-sizing: border-box;
}

.container {
    max-width: 1250px;
    margin: 0 auto;
    padding: 16px;
    box-sizing: border-box;
}

.container2 {
    max-width: 800px;
    margin: 0 auto;
    padding: 40px 20px;
    text-align: left;
    box-sizing: border-box;
}

/* ==========================================
   4. 見出し（基本）
   ========================================== */
h1 {
    font-size: 1.5rem;
    text-align: center;
    margin: 20px 0;
}


h3 {
    margin-bottom: 10px;
}

.container2 h1,
.container2 h2,
.container2 h3 {
    text-align: left;
    margin-left: 0;
    padding-left: 15px;
}

/* ==========================================
   5. メニュー関連
   ========================================== */
.menu-toggle {
    display: block;
    width: 40%;
    max-width: 100px;
    margin: 10px auto;
    padding: 10px;
    background: blue;
    color: white;
    cursor: pointer;
    text-align: center;
}

.nav-links {
    display: block;
    width: 100%;
    text-align: center;
}

.menu-title-static {
    display: inline-block;
    width: auto;
    min-width: 150px;
    margin: 0 auto;
    padding: 10px 20px;
    background-color: #f0f4f8;
    border-radius: 8px;
    font-weight: bold;
}

.menu-content-exposed a {
    display: inline-block;
    width: fit-content;
    margin: 5px auto;
    padding: 8px 15px;
    background-color: #f0f4f8;
    color: #007bff;
}

/* ==========================================
   6. ログイン・カード系
   ========================================== */
.card-base,
#head,
.intro,
.msg,
.category-block,
.selector-card,
#content,
#content2,
.post-page,
.login-card {
    background: transparent;
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 20px;
    box-sizing: border-box;
}

.section {
    background: #fff;
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ==========================================
   7. ボタン・戻るリンク
   ========================================== */
.button {
    display: block;
    width: 100%;
    margin: 20px 0;
    padding: 16px;
    text-align: center;
    background: #ffffff;
    border-radius: 12px;
    color: #333;
    font-size: 1.1rem;
    font-weight: bold;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

.back {
    text-align: center;
    margin-top: 20px;
}

.back a {
    color: #555;
    font-size: 1rem;
}

/* ==========================================
   8. カテゴリ一覧・アコーディオンUI
   ========================================== */
.category-block ul,
.category-block li,
.item-list,
.item-list li {
    list-style: none;
    padding-left: 0;
    margin-left: 0;
}

.title-main {
    font-weight: 800;
}

.title-sub {
    font-weight: 500;
    font-size: 0.95em;
    margin-left: 4px;
    color: inherit;
}

.category-item {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 10px 15px 10px 1.5em;
    border-bottom: 1px solid #e1e1e1;
    color: #444;
    font-size: 0.95rem;
    text-align: left;
}

.category-normal {
    box-sizing: border-box;
}

/* ==========================================
   9. categories.php 専用
   ========================================== */
.categories-main {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

.strategy-main {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
}

.strategy-main h2 {
    margin-bottom: 15px;
    border-left: 6px solid #333;
    padding-left: 10px;
    font-weight: 700;
}

.strategy-main p {
    color: #0033ff;
    text-align: left;
    line-height: 1.9;
    margin-bottom: 20px;
    word-break: break-word;
}

.strategy-main p strong {
    color: #d63384;
    font-weight: bold;
    font-size: 1.05em;
}

.strategy-main ul {
    text-align: left;
    padding-left: 20px;
}

/* ==========================================
   10. メインヘッダー (categories.php用)
   ========================================== */
.main-header {
    background: #3182ec;
    border: 2px solid #3498db;
    padding: 20px 20px 20px 40px;
    border-radius: 10px;
    text-align: left !important;
    margin-bottom: 30px;
}

.main-header h1 {
    display: inline-block;
    position: relative;
    padding-bottom: 12px;
    color: #ffffff;
    font-size: 1.5rem;
    margin: 0;
    text-align: left;
}

.main-header h1::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: #ff9800;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.step-title-bar {
    padding: 15px 20px;
    font-weight: bold;
    font-size: 1.1em;
    text-shadow: 0 0 1px rgba(255, 255, 255, 0.5);
}

/* ==========================================
   11. リスト
   ========================================== */
.item-list {
    padding: 0;
    margin: 0;
}

.item-list li {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    text-align: left;
    line-height: 1.5;
}

.item-list a {
    color: #2f6fed;
    font-weight: bold;
    text-decoration: none;
    border-bottom: 1px solid #2f6fed;
    padding-bottom: 1px;
}

.item-list a:hover {
    color: #2f6fed;
    border-bottom: 2px solid #ff9800;
    background-color: rgba(49, 130, 236, 0.05);
}

/* ==========================================
   12. life-rank.php 専用
   ========================================== */
.strat-highlight-box {
    background-color: #f0f4f8;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    text-align: left;
}

.spirit-box {
    border-left: 6px solid #f1c40f;
    background-color: #fffaf0;
    padding: 25px;
    border-radius: 8px;
    margin: 30px 0;
    text-align: left;
}

.rank-card {
    border: 1px solid #e1e8ed;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    background-color: #fff;
    text-align: left;
}

.rank-a { border-top: 5px solid #27ae60; }
.rank-b { border-top: 5px solid #2980b9; }
.rank-c { border-top: 5px solid #f1c40f; }

.price-tag {
    font-size: 1.4rem;
    font-weight: bold;
    color: #e74c3c;
}

.important {
    color: #e74c3c;
    font-weight: bold;
}

.strategy-box {
    border: 2px dashed #bdc3c7;
    padding: 20px;
    background-color: #fff;
    margin: 20px 0;
    text-align: left;
}

.next-step-box {
    background-color: #fff;
    border: 2px solid #2c3e50;
    padding: 25px;
    margin-top: 40px;
    border-radius: 8px;
    text-align: center;
}

.next-btn {
    display: inline-block;
    background-color: #2c3e50;
    color: #fff;
    padding: 15px 30px;
    border-radius: 5px;
    font-weight: bold;
    margin-top: 15px;
    transition: background-color 0.3s;
}

.next-btn:hover {
    background-color: #34495e;
    text-decoration: none;
}

/* ==========================================
   13. university_cost_simulation.php 専用
   ========================================== */
.danger-box {
    background-color: #fff5f5;
    border: 2px solid #fc8181;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}
.strat-danger-box {
    background-color: #fff5f5;
    border: 2px solid #fc8181;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}
.simulation-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background-color: #fff;
}

.simulation-table th {
    background-color: #2c3e50;
    color: white;
    padding: 12px;
    font-size: 0.95rem;
}

.simulation-table td {
    padding: 12px;
    border: 1px solid #e2e8f0;
    text-align: center;
    font-size: 0.95rem;
}

.highlight-red {
    color: #e53e3e;
    font-weight: bold;
}

/* ==========================================
   14. ロゴプレート
   ========================================== */
.logo-plate-container {
    display: inline-block;
    background: #e3f2fd;
    padding: 10px 15px;
    border-radius: 12px;
    border: 1px solid #b3d7ff;
    text-align: center;
    margin: 15px auto;
}

.logo-link {
    text-decoration: none;
    color: #000;
}

.logo-title {
    margin: 0;
    font-size: 1.35rem;
    line-height: 1.15;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.logo-subtitle-box {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.logo-subtitle {
    margin: 0;
    font-size: 0.75rem;
    line-height: 1.2;
    letter-spacing: 0.02em;
    color: #333;
}

/* --- ログイン・ナビ関連 --- */
.nav-links.active {
    display: block;
}

.login-status {
    display: block;
    width: 80%;
    margin: 0 auto 10px;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    font-size: 14px;
    box-sizing: border-box;
}

a.is-viewed {
    color: #888 !important;
    text-decoration: line-through;
    opacity: 0.7;
}

a.is-viewed::after {
    content: " ✓済";
    font-size: 0.8em;
    color: #27ae60;
    margin-left: 5px;
    font-weight: bold;
}

.highlight-line {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 10px;
    line-height: 1.7;
}

.line-blue { color: #1201fd; }
.line-red  { color: #e63946; }
.line-dark { color: #333; }

/* ==========================================
   新デザイン用：共通コンポーネント
   ========================================== */
.main-nav-card {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border) !important;
    border-radius: 20px !important;
    padding: 25px !important;
    box-shadow: var(--glass-shadow) !important;
}

.btn-primary.rescue-theme {
    display: block;
    background: linear-gradient(135deg, #52b788 0%, var(--rescue-green) 100%) !important;
    color: #ffffff !important;
    padding: 16px !important;
    border-radius: 50px !important;
    text-decoration: none !important;
    font-weight: bold !important;
    font-size: 1.2rem !important;
    margin-bottom: 20px !important;
    box-shadow: 0 5px 15px rgba(64, 145, 108, 0.3) !important;
    text-align: center;
    border: none !important;
}

.grid-menu.icon-theme {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
}

.grid-menu.icon-theme a {
    background: var(--white);
    color: var(--navy-deep);
    padding: 20px 5px;
    border: 2px solid #e0e6ed;
    border-radius: 15px;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 800;
    transition: all 0.2s;
    text-align: center;
}

.grid-menu.icon-theme a:hover {
    background: #f0f7ff;
    border-color: var(--link);
    transform: translateY(-2px);
}

.message-box.gold-theme {
    margin: 40px auto 20px;
    background: rgba(255, 255, 255, 0.9);
    padding: 25px;
    border-radius: 15px;
    width: 92%;
    max-width: 500px;
    text-align: center;
    border: 4px solid var(--compass-gold);
    box-shadow: 0 12px 30px rgba(212, 175, 55, 0.2);
    position: relative;
    overflow: hidden;
}

.message-box.gold-theme .main-msg {
    display: block;
    color: var(--warning-red);
    font-weight: 1000;
    font-size: 1.35rem;
    line-height: 1.5;
}

.message-box.gold-theme .sub-msg {
    display: block;
    margin-top: 10px;
    color: var(--compass-gold);
    font-weight: bold;
    font-size: 1.2rem;
}

.menu-icon-img {
    width: 30px;
    height: 30px;
    filter: drop-shadow(0 2px 3px rgba(0,0,0,0.5));
}

.footer-description {
    font-size: 16px;
    line-height: 1.8;
}

p {
    line-height: 1.8;
    color: #444;
    margin-bottom: 1.5em;
}

.breadcrumb {
    background-color: #f1f3f5;
    padding: 10px 15px;
    font-size: 0.85em;
    color: #6c757d;
    border-radius: 4px;
    margin-bottom: 25px;
}

.intro-strategy-box {
    background-color: #f8f9fa;
    border-left: 5px solid #2c3e50;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.intro-strategy-box p {
    line-height: 1.8;
    margin: 0;
    color: #333;
}

.intro-strategy-box strong {
    color: #b8860b;
    background: linear-gradient(transparent 70%, #fff3cd 70%);
    font-weight: bold;
}

.strategy-core {
    font-weight: bold;
    color: #2c3e50;
    font-size: 1.15em;
}

/* ==========================================
   追加：shingaku_strategy.php 専用デザイン
   ========================================== */
.conclusion-box {
    background-color: #e0f2f1;
    border-left: 6px solid var(--rescue-green, #40916c);
    padding: 5px 5px;
    border-radius: 5px;
    margin: 20px 0;
}
.conclusion-box p {
    margin: 0;
    font-weight: bold;
}


.lead-box p {
    margin: 0;
    line-height: 1.6;
}

.highlight-info {
    background: #fff;
    border: 1px solid var(--border, #d0e3ff);
    border-radius: 12px;
    padding: 20px 20px 20px 40px !important;
    margin: 20px 0;
    list-style-type: square;
}
.highlight-info li {
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 1.05rem;
}
.highlight-info li:last-child {
    margin-bottom: 0;
}
.danger-highlight-text {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    background: #ffeb3b !important;
    background-color: #ffeb3b !important;
    color: #cc0000 !important;
    border: 3px solid #fdd835 !important;
    text-align: left !important;
    margin: 25px auto !important;
    padding: 15px 20px !important;
    border-radius: 8px !important;
    line-height: 1.7 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
}

.risk-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    border-radius: 8px;
    overflow: hidden;
}
.risk-table th {
    background-color: var(--navy-deep, #002244);
    color: #fff;
    padding: 12px;
    font-weight: bold;
}
.risk-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
    text-align: center;
    font-weight: bold;
}

.risk-table tr.safe { background-color: #e8f5e9; color: #2e7d32; }
.risk-table tr.caution { background-color: #fff3e0; color: #ef6c00; }
.risk-table tr.danger { background-color: #ffebee; color: #c62828; }
.risk-table tr.high-risk { background-color: #fce4ec; color: #ad1457; }

.chart-container {
    max-width: 100%;
    margin: 25px auto;
    background: #fff;
    padding: 15px;
    border-radius: 12px;
    border: 1px solid var(--border, #d0e3ff);
}
.caption {
    font-size: 0.85rem;
    color: #666;
    text-align: right;
    margin-top: -15px;
    margin-bottom: 25px;
}

.kian {
    display: block;
    font-size: 1.15rem;
    font-weight: bold;
    color: var(--compass-gold, #ffff00) !important;
    background-color: var(--navy-deep, #002244) !important;
    text-align: left;
    margin: 30px auto;
    padding: 15px 20px;
    border-radius: 8px;
    line-height: 1.7;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    box-sizing: border-box;
}

.quick-guide {
    margin: 30px 0;
    padding: 0;
}
.quick-guide ul {
    list-style: none;
    padding: 0;
    display: flex;
    gap: 15px;
}
.quick-guide li {
    flex: 1;
}
.quick-guide a {
    display: block;
    background: linear-gradient(135deg, #106eb7 0%, #002244 100%);
    color: #fff !important;
    text-align: center;
    padding: 14px;
    border-radius: 30px;
    text-decoration: none !important;
    font-weight: bold;
    font-size: 1rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s, opacity 0.2s;
}
.quick-guide a:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

/* ===================================================
   ★最優先：大学年収データ（PC・スマホ共通デザイン）
   ※メディアクエリの外側（ココ）に置くことでPCでも確実に適用
   =================================================== */
html body section.full-bleed-section div.inner-container article p.career-subtitle,
.career-subtitle {
    display: block !important;
    visibility: visible !important;
    background: #ffffff !important;
    background-color: #ffffff !important; /* 強制白座布団 */
    padding: 15px 20px !important;
    margin: 20px auto !important;
    border-radius: 8px !important;
    color: #2c3e50 !important;
    font-size: 0.95rem !important;
    line-height: 1.6 !important;
    text-align: left !important;
    box-sizing: border-box !important;
    max-width: 100% !important;
    opacity: 1 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05) !important;
}

/* ==========================================
   15. レレスポンシブ共通調整（ブレイクポイント別）
   ========================================== */
@media (max-width: 768px) {
    .sp-only {
        display: block;
        content: "";
        margin-top: 5px;
    }
    .strategy-core {
        display: inline;
        line-height: 1.6;
    }
    .intro-strategy-box {
        padding: 15px;
    }
    body {
        font-size: 0.95rem;
    }
    header {
        font-size: 1.1rem;
        width: 100%;
        padding: 15px 0;
    }
    .nav-links {
        width: 100%;
        margin: 10px auto;
        padding: 15px;
        background: transparent;
        box-shadow: none;
    }
}

@media (max-width: 600px) {
    .container2 {
        padding: 20px 15px;
    }
    .price-tag {
        font-size: 1.2rem;
    }
    .simulation-table th,
    .simulation-table td {
        padding: 8px;
        font-size: 0.85rem;
    }
    .category-normal {
        font-size: 1rem;
        padding: 12px 40px 12px 12px;
    }
    .category-item {
        font-size: 0.9rem;
        padding-left: 12px;
    }
    .logo-title {
        font-size: 1.2rem;
    }
    .logo-subtitle {
        font-size: 0.7rem;
    }
    .quick-guide ul {
        flex-direction: column;
        gap: 10px;
    }
    .risk-table th, .risk-table td {
        padding: 8px;
        font-size: 0.9rem;
    }
}

/* ==========================================
   16. スマホ専用対応（画面幅 480px 以下に完全集約）
   ========================================== */
    .nav-container {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
    }

    .main-nav-card {
        width: 100%;
        border-left: none;
        border-right: none;
        border-radius: 0;
        padding: 20px 10px;
    }

    /* 通常テキストの一括設定 */
    header, 
    p:not(.career-subtitle), 
    h1, 
    h2:not(.career-title), 
    ul:not(.grid-menu), 
    .message-box.gold-theme {
        padding-left: 10px;
        padding-right: 10px;
    }

    .main-nav-card a {
        box-sizing: border-box;
    }

    .container, .container2 {
        padding: 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
    }

    /* ---------------------------------------------------
       大学年収データテーブル（スマホ縦画面：左右余白ゼロ・端ぴったり）
       --------------------------------------------------- */
    .career-title {
        font-size: 22px !important;
        padding-left: 10px !important; /* ガラス面に張り付かないよう文字頭だけ10px確保 */
        padding-right: 10px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
/* ---------------------------------------------------
       大学年収データテーブル（スマホ縦画面対応）
       背景のエッジに文字が張り付かないよう、左右に1文字分の余白を確保
       --------------------------------------------------- */
    section.full-bleed-section {
        width: 100vw !important;
        margin-left: calc(50% - 50vw) !important;
        margin-right: calc(50% - 50vw) !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    /* 文字が書かれているインナコンテナの左右に「1文字分(1em)」の余白を強制適用 */
    section.full-bleed-section .inner-container,
    section.full-bleed-section .career-content-inner {
        padding-left: 1em !important;   /* 左側に1文字分の余白 */
        padding-right: 1em !important;  /* 右側に1文字分の余白（自動改行時のマージン） */
        margin-left: auto !important;
        margin-right: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    /* ただし、横スクロールさせたいテーブル部分だけは画面端まで広く使わせる */
    .career-table-wrapper,
    div[style*="overflow-x: auto"] {
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin-top: 15px;
    }

    .life-table,
    .career-table {
        min-width: 620px;
        width: 100% !important;
        border-left: none !important;
        border-right: none !important;
    }


    .career-table-wrapper {
        width: 100% !important;
        overflow-x: auto !important; /* はみ出たテーブルを横スクロールさせる */
        -webkit-overflow-scrolling: touch;
        padding: 0 !important; /* 左右余白ゼロで端ぴったりに密着 */
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin-top: 15px;
    }

    .career-table {
        min-width: 620px; /* 4列が綺麗に維持される幅 */
        width: 100% !important;
        border-left: none !important;
        border-right: none !important;
    }
