/* --- 変数・基本設定 --- */
:root {
    --primary: #2c3e50;
    --success: #27ae60;
    --danger: #e74c3c;
    --gray: #95a5a6;
    --bg: #f4f7f6;
    --link-blue: #3498db;
}

body {
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", sans-serif;
    margin: 0;
    padding-top: 70px;
    background-color: var(--bg);
    color: #333;
}

/* --- ヘッダー・しおりパネル --- */
.header-panel {
    position: fixed;
    top: 0;
    width: 100%;
    height: 60px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: center;
    gap: 10px;
    align-items: center;
    z-index: 1000;
}

button {
    padding: 10px 15px;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
}

.btn-list { background: var(--link-blue); color: #fff; }
.btn-add { background: var(--success); color: #fff; }
.btn-edit { background: var(--gray); color: #fff; }
.btn-close { width: 100%; margin-top: 10px; background: #ddd; }

#bookmark-panel {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    background: white;
    border: 1px solid #ccc;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    z-index: 1001;
}

.hidden { display: none; }

.bookmark-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.jump-link {
    color: var(--link-blue);
    cursor: pointer;
    flex-grow: 1;
}

/* --- コンテンツレイアウト --- */
.content {
    max-width: 700px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    min-height: 120vh;
}

.chapter-container {
    margin-bottom: 40px;
}

.lecture-section {
    margin-bottom: 60px;
    padding: 20px;
    border-left: 6px solid var(--primary);
    background: #fff;
}

.ad-space {
    background: #f9f9f9;
    border: 1px dashed #bbb;
    color: #999;
    text-align: center;
    padding: 40px 0;
    margin: 40px 0;
}

/* --- ホーム画面のボタン --- */
.home-menu {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    max-width: 500px;
    margin: 0 auto;
}

.home-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 25px;
    text-decoration: none;
    color: white;
    border-radius: 15px;
    box-shadow: 0 6px 0 rgba(0,0,0,0.2); 
    transition: all 0.2s ease;
}

.home-btn:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 rgba(0,0,0,0.2);
}

@media (hover: hover) {
    .home-btn:hover {
        transform: translateY(-3px);
        box-shadow: 0 9px 0 rgba(0,0,0,0.15);
    }
}

.btn-Introduction { background: linear-gradient(135deg, #f1c40f, #f1c40f); }
.btn-law { background: linear-gradient(135deg, #34495e, #2c3e50); }
.btn-physics { background: linear-gradient(135deg, #3498db, #2980b9); }
.btn-properties { background: linear-gradient(135deg, #e74c3c, #c0392b); }
.btn-quiz { background: linear-gradient(135deg, #3ce764, #3ce764); }
.btn-update { background: linear-gradient(135deg, #D3D3D3, #D3D3D3); }
.btn-contents { background: linear-gradient(135deg, #7cbde6, #7cbde6); }

.home-btn h2 {
    margin: 0;
    font-size: 1.3rem;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

/* --- 目次 (TOC) --- */
.table-of-contents ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.table-of-contents > ul > li {
    font-weight: bold;
    margin-top: 15px;
    margin-bottom: 5px;
}

.table-of-contents ul ul {
    padding-left: 20px;
    margin-top: 5px;
}

.table-of-contents ul ul li {
    font-weight: normal;
    margin-bottom: 8px;
    padding-left: 1.5rem;
    position: relative;
}

.table-of-contents ul ul li::before {
    content: "▶";
    position: absolute;
    left: 0;
    font-size: 0.7rem;
    color: var(--link-blue);
    top: 50%;
    transform: translateY(-50%);
}

.table-of-contents a {
    color: var(--link-blue);
    text-decoration: none;
}

.table-of-contents a:hover { text-decoration: underline; }

/* --- 暗記表・数式ボックス --- */
.table-wrapper {
    overflow-x: auto;
    margin: 20px 0;
}

.design-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.design-table th, .design-table td {
    border: 1px solid #ddd;
    padding: 12px 8px;
    text-align: center;
}

.design-table th { background-color: var(--primary); color: white; }
.highlight-red { background-color: #fff0f0; font-weight: bold; }
.highlight-blue { background-color: #f0f7ff; font-weight: bold; }

.memo-box {
    background-color: #fff9db;
    border-left: 5px solid #f1c40f;
    padding: 15px;
    margin-top: 15px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.formula-box {
    background: #f8f9fa;
    border: 1px solid #ddd;
    padding: 15px;
    text-align: center;
    font-weight: bold;
    margin: 15px 0;
    border-radius: 8px;
}


.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 10px;
}

.footer-links a {
    color: #666;
    text-decoration: none;
    font-size: 0.85rem;
}

.footer-links a:hover { color: var(--link-blue); text-decoration: underline; }

@media (max-width: 480px) {
    .footer-links { flex-direction: column; gap: 10px; }
}

/* --- 応援エリア --- */
.support-wrapper {
    margin: 20px auto 40px; 
    padding: 0 20px;
    max-width: 500px;
    box-sizing: border-box;
}

.support-card {
    background-color: #ffffff;
    border: 1px solid #eee; 
    border-radius: 15px;
    padding: 20px; 
    text-align: center;
}

.support-concept {
    font-weight: bold;
    font-size: 1rem;
    color: var(--primary);
    margin: 0 0 10px 0;
}

.support-description, 
.support-usage {
    font-size: 0.8rem;
    color: #666;
    line-height: 1.5;
    margin: 5px 0;
}

.btn-support {
    background: linear-gradient(135deg, #ff9a44, #fc6076) !important;
    margin-top: 15px !important;
    width: 100%;
    box-sizing: border-box;
    box-shadow: 0 6px 0 rgba(0,0,0,0.15) !important;
}

.btn-support:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 rgba(0,0,0,0.15) !important;
}

.btn-support h2 {
    font-size: 1.1rem !important;
    margin: 0;
}

.codoc-support-title, 
.codoc-entries-title,
.codoc-text-center.codoc-p-3,
.codoc-support-footer {
    display: none !important;
}

/* --- 紹介文セクション --- */
.site-intro {
    text-align: center;
    margin: 20px auto 30px;
    padding: 0 20px;
    max-width: 500px;
}

.intro-main {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 5px;
}

.intro-sub {
    font-size: 0.85rem;
    color: #666;
    line-height: 1.6;
    margin: 0;
}

@media (max-width: 480px) {
    .intro-main {
        font-size: 1rem;
    }
    .intro-sub {
        font-size: 0.8rem;
    }
}

/* ==========================================
   フッターエリアの装飾とリッチな動き
   ========================================== */
.guide-footer {
    text-align: center;
    padding: 50px 0;
    margin-top: 60px;
    border-top: 1px solid #eee;
}

/* 運営テキスト */
.footer-copy {
    color: #888888;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

/* リンクを囲むディブ */
.footer-link-item {
    margin-bottom: 10px;
}

/* 🔗 フッターのリンク単体の設定（ここから動きをつけます） */
.footer-link {
    color: #888888;
    font-size: 0.8rem;
    text-decoration: none;
    position: relative;
    padding-bottom: 2px;
    display: inline-block;
    
    /* 文字色がフワッと変わる時間設定 */
    transition: color 0.25s ease;
}

/* ✨ リンクの下線をアニメーションさせるための下準備（透明な線を作っておく） */
.footer-link::after {
    content: '';
    position: absolute;
    width: 100%;
    transform: scaleX(0); /* 最初は幅をゼロにして隠す */
    height: 1px;
    bottom: 0;
    left: 0;
    background-color: #333333; /* ホバー時に出る線の色 */
    transform-origin: bottom right;
    /* 線が伸びる滑らかさの設定 */
    transition: transform 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* 🚀 カーソルを合わせた（ホバー）時の動き */
.footer-link:hover {
    color: #333333; /* 文字色を濃くしてアクティブ感を出す */
}

.footer-link:hover::after {
    transform: scaleX(1); /* 線を左から右へシャキッと100%伸ばす */
    transform-origin: bottom left;
}