/* =========================================================
   apple.css — シンプル編集（エディトリアル）デザイン
   モノクロ基調＋明朝見出し＋余白重視。最後に読み込む。
   CSS変数を再定義して既存クラスの配色を一括で切替え、
   ヘッダー/ナビ/ヒーロー/カード/Study/Book章立てを上書きする。
   ========================================================= */

:root,
body.theme-light {
    /* --nav-width は main.css の各ブレークポイント値をそのまま使う
       （0pxで上書きするとモバイルのドロワー幅が0になり開かなくなるため設定しない） */
    --header-h: 56px;
    --nav-row-h: 46px;
    --content-max: 1080px;

    /* エディトリアル・モノクロ配色 */
    --ink: #1a1a1a;
    --ink-2: #55555a;
    --ink-3: #8a8a90;
    --paper: #ffffff;
    --paper-2: #fafaf7;   /* 温かみのあるオフホワイト */
    --paper-3: #f2f1ec;
    --line: rgba(0, 0, 0, 0.12);
    --line-soft: rgba(0, 0, 0, 0.07);
    --accent: #1a1a1a;

    /* 既存クラスが参照する変数を上書き */
    --bg-main: #ffffff;
    --bg-section: #fafaf7;
    --bg-card: #ffffff;
    --bg-card-elevated: #f2f1ec;
    --accent-primary: #1a1a1a;
    --accent-secondary: #1a1a1a;
    --accent-soft: #55555a;
    --border-main: rgba(0, 0, 0, 0.12);
    --border-strong: rgba(0, 0, 0, 0.24);
    --text-main: #1a1a1a;
    --text-sub: #55555a;
    --text-muted: #8a8a90;
    --shadow-neon: 0 8px 30px rgba(0, 0, 0, 0.07);
    --focus-ring: #1a1a1a;
    --card: #ffffff;
    --card2: #fafaf7;
    --border: rgba(0, 0, 0, 0.12);
    --text: #1a1a1a;
    --muted: #8a8a90;
    --progress-color: #1a1a1a;
    --progress-border: rgba(0, 0, 0, 0.18);
    --progress-strong-border: rgba(0, 0, 0, 0.28);
    --progress-glow: rgba(0, 0, 0, 0.12);
    --progress-soft: rgba(0, 0, 0, 0.07);

    --radius: 14px;
    --serif: "Hiragino Mincho ProN", "Yu Mincho", YuMincho, "Noto Serif JP", Georgia, "Times New Roman", serif;
    --sans: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Hiragino Kaku Gothic ProN",
        "Hiragino Sans", "Noto Sans JP", Meiryo, sans-serif;
}

body,
body.theme-light {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    letter-spacing: 0.01em;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    color: var(--ink);
    font-family: var(--serif);
    font-weight: 600;
    letter-spacing: 0.01em;
}

a { color: var(--ink); }
a:hover { text-decoration: none; }

/* ---------- ヘッダー（1段目：ブランド＋検索/ログイン or ハンバーガー） ---------- */
body > header {
    width: 100%;
    height: var(--header-h);
    justify-content: space-between;
    padding: 0 24px;
    background: rgba(255, 255, 255, 0.82);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
    box-shadow: none;
    z-index: 1000;
}

.brand {
    color: var(--ink);
    font-family: var(--serif);
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.02em;
    margin-left: 4px;
}
.brand .tag { display: none; }

.hamburger span { background: var(--ink); }

.header-right { gap: 8px; }

.site-search input {
    width: 148px;
    min-height: 34px;
    background: var(--paper-3);
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--ink);
    padding: 0 14px;
    box-shadow: none;
}
.site-search input::placeholder { color: var(--ink-3); }
.site-search input:focus {
    border-color: var(--ink);
    box-shadow: none;
    outline: none;
}
.site-search button {
    min-height: 34px;
    background: var(--ink);
    border: 0;
    border-radius: 999px;
    color: #fff;
    font-weight: 500;
    box-shadow: none;
    padding: 0 15px;
}
.site-search button:hover { filter: none; opacity: 0.85; box-shadow: none; }
.admin-login-link {
    min-height: 34px;
    background: transparent;
    border: 0;
    color: var(--ink-2);
    font-weight: 400;
    padding: 0 6px;
}

/* ---------- モバイル：スライドイン ドロワー（main.cssの挙動を継承し再配色） ---------- */
body > nav {
    background: rgba(255, 255, 255, 0.99);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-right: 1px solid var(--line);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.12);
}
body > nav li { border-bottom: 1px solid var(--line-soft); }
body > nav a { color: var(--ink); font-weight: 400; }
body > nav a:hover { background: var(--paper-2); color: var(--ink); }
body > nav a.active {
    color: var(--ink);
    background: var(--paper-2);
    box-shadow: inset 3px 0 0 var(--ink);
    font-weight: 600;
}
body > nav .nav-children { background: rgba(0, 0, 0, 0.02); }
body > nav .nav-children a { color: var(--ink-2); }
body > nav .nav-children a::before { background: var(--ink); }
body::before {
    background: rgba(20, 20, 20, 0.28);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

/* ---------- コンテンツ幅・余白 ---------- */
.site-main {
    max-width: var(--content-max);
    width: min(100%, var(--content-max));
    margin: calc(var(--header-h) + 28px) auto 64px;
    padding: 0 24px 48px;
}

/* ---------- デスクトップ：ヘッダー下に独立した2段目ナビ（堅牢） ---------- */
@media (min-width: 981px) {
    :root, body.theme-light {
        --header-h: 56px;
        --content-max: 1080px;
    }

    body > header {
        width: 100%;
        height: var(--header-h);
        justify-content: space-between;
        border-right: 0;
        border-bottom: 1px solid var(--line-soft);
        box-shadow: none;
        padding: 0 28px;
    }
    .header-left { width: auto; }
    .header-right { display: flex; }
    .hamburger { display: none; }

    /* ナビは独立した2段目（overlapもpointer-eventsハックも無し） */
    body > nav {
        position: fixed;
        top: var(--header-h);
        left: 0;
        right: 0;
        width: 100%;
        height: var(--nav-row-h);
        max-height: none;
        transform: none;
        background: rgba(255, 255, 255, 0.82);
        -webkit-backdrop-filter: saturate(180%) blur(20px);
        backdrop-filter: saturate(180%) blur(20px);
        border: 0;
        border-bottom: 1px solid var(--line-soft);
        box-shadow: none;
        padding: 0;
        overflow: visible;
        display: flex;
        justify-content: center;
        align-items: center;
        z-index: 999;
    }

    body > nav .nav-root {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        gap: 2px;
        padding: 0;
        list-style: none;
        margin: 0;
    }

    body > nav > .nav-root > li {
        border: 0;
        position: relative;
        display: flex;
        align-items: center;
    }

    body > nav a {
        display: inline-flex;
        align-items: center;
        min-height: var(--nav-row-h);
        padding: 0 15px;
        font-size: 14px;
        font-weight: 400;
        color: var(--ink-2);
        border-radius: 0;
        white-space: nowrap;
        box-shadow: none;
        background: transparent;
    }
    body > nav a:hover { background: transparent; color: var(--ink); }
    body > nav a.active {
        background: transparent;
        color: var(--ink);
        box-shadow: none;
        font-weight: 600;
    }
    body > nav .has-children > a::after {
        content: "";
        width: 5px; height: 5px;
        border-right: 1.5px solid currentColor;
        border-bottom: 1.5px solid currentColor;
        opacity: 0.55;
        margin-left: 7px;
        transform: rotate(45deg);
    }

    /* ドロップダウン：隙間ゼロ（top:100%）でホバー＆クリック両対応 */
    body > nav .nav-children {
        position: absolute;
        top: 100%;
        left: 50%;
        transform: translateX(-50%);
        min-width: 190px;
        background: rgba(255, 255, 255, 0.97);
        -webkit-backdrop-filter: saturate(180%) blur(20px);
        backdrop-filter: saturate(180%) blur(20px);
        border: 1px solid var(--line);
        border-radius: 12px;
        box-shadow: 0 16px 44px rgba(0, 0, 0, 0.14);
        padding: 6px;
        display: none;
    }
    body > nav > .nav-root > li.has-children:hover > .nav-children,
    body > nav > .nav-root > li.has-children.is-open > .nav-children { display: block; }

    body > nav .nav-children li { border: 0; }
    body > nav .nav-children a {
        display: block;
        min-height: 0;
        padding: 9px 14px;
        font-size: 13px;
        color: var(--ink-2);
        border-radius: 8px;
    }
    body > nav .nav-children a::before { display: none; }
    body > nav .nav-children a:hover { background: var(--paper-2); color: var(--ink); }

    body::before { display: none; }

    .site-main {
        width: min(calc(100% - 56px), var(--content-max));
        max-width: var(--content-max);
        margin: calc(var(--header-h) + var(--nav-row-h) + 44px) auto 72px;
        padding: 0 28px 64px;
    }
}

/* =========================================================
   ホーム（エディトリアル）
   ========================================================= */
.apple-home { display: flex; flex-direction: column; gap: 84px; }

.apple-hero {
    text-align: center;
    padding: 48px 0 8px;
    border-bottom: 1px solid var(--line-soft);
}
.apple-hero__eyebrow {
    margin: 0 0 16px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--ink-3);
    font-family: var(--sans);
}
.apple-hero__title {
    margin: 0 0 22px;
    font-family: var(--serif);
    font-size: clamp(34px, 6vw, 60px);
    line-height: 1.14;
    font-weight: 600;
    letter-spacing: 0.01em;
}
.apple-hero__lead {
    margin: 0 auto 30px;
    max-width: 600px;
    font-size: clamp(15px, 2.2vw, 18px);
    line-height: 1.9;
    color: var(--ink-2);
}
.apple-hero__actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; padding-bottom: 40px; }

.apple-btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 44px; padding: 0 24px;
    border-radius: 999px;
    font-size: 15px; font-weight: 500;
    text-decoration: none;
    transition: opacity 0.15s ease, background 0.15s ease, transform 0.15s ease;
    font-family: var(--sans);
}
.apple-btn--primary { background: var(--ink); color: #fff; }
.apple-btn--primary:hover { opacity: 0.85; }
.apple-btn--ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.apple-btn--ghost:hover { background: var(--paper-2); }
.apple-btn:active { transform: scale(0.98); }

/* セクション見出し */
.apple-section-head {
    display: flex; align-items: flex-end; justify-content: space-between;
    gap: 16px; margin-bottom: 28px;
    padding-bottom: 14px; border-bottom: 1px solid var(--line-soft);
}
.apple-section-head--compact { margin-bottom: 18px; align-items: center; }
.apple-eyebrow {
    margin: 0 0 8px;
    font-size: 11px; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase;
    color: var(--ink-3); font-family: var(--sans);
}
.apple-section-head h2 { margin: 0; font-size: clamp(24px, 4vw, 34px); line-height: 1.2; }
.apple-section-lead { margin: 12px 0 0; color: var(--ink-2); font-size: 15px; line-height: 1.8; max-width: 620px; }
.apple-textlink {
    white-space: nowrap; font-size: 14px; font-weight: 500; text-decoration: none;
    color: var(--ink); font-family: var(--sans);
    border-bottom: 1px solid var(--ink); padding-bottom: 2px;
}
.apple-textlink:hover { opacity: 0.6; }

/* 俺のステータス */
.apple-status {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 28px;
    align-items: center;
    background: var(--paper-2);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    padding: 32px 34px;
}
.apple-status__name { margin: 0 0 8px; font-size: clamp(22px, 3vw, 30px); }
.apple-status__headline { margin: 0 0 18px; color: var(--ink-2); font-size: 15px; line-height: 1.8; }
.apple-status__facts { display: flex; flex-direction: column; gap: 12px; }
.apple-status__fact {
    display: flex; justify-content: space-between; gap: 14px;
    padding: 10px 0; border-top: 1px solid var(--line-soft); font-size: 14px;
}
.apple-status__fact:first-child { border-top: 0; }
.apple-status__fact dt { color: var(--ink-3); margin: 0; }
.apple-status__fact dd { color: var(--ink); margin: 0; text-align: right; font-weight: 500; }

/* カードグリッド（Study / Book / Projects） */
.apple-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 22px;
}
.apple-card {
    display: flex; flex-direction: column;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    color: var(--ink);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.apple-card:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(0, 0, 0, 0.09); border-color: var(--line); }
.apple-card__cover {
    display: block; aspect-ratio: 3 / 4;
    background-size: cover; background-position: center; background-color: var(--paper-3);
}
.apple-card__cover--blank {
    display: flex; align-items: center; justify-content: center;
    color: var(--ink-3); font-family: var(--serif); font-size: 20px; letter-spacing: 0.1em;
}
.apple-card__body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.apple-card__kicker { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); }
.apple-card__title { font-family: var(--serif); font-size: 17px; font-weight: 600; line-height: 1.45; }
.apple-card__meta { font-size: 13px; color: var(--ink-3); line-height: 1.6; }

/* Studyなどのテキスト主体カード */
.apple-note-card {
    display: flex; flex-direction: column; gap: 8px;
    background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 22px 24px; text-decoration: none; color: var(--ink);
    transition: box-shadow 0.18s ease, transform 0.18s ease;
}
.apple-note-card:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(0, 0, 0, 0.09); }
.apple-note-card__title { font-family: var(--serif); font-size: 19px; font-weight: 600; line-height: 1.5; }
.apple-note-card__excerpt { color: var(--ink-2); font-size: 14px; line-height: 1.85; }
.apple-note-card__meta { font-size: 12px; color: var(--ink-3); }
.apple-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.apple-tag {
    font-size: 12px; color: var(--ink-2); background: var(--paper-3);
    border-radius: 999px; padding: 3px 10px;
}

/* 2カラム/リスト */
.apple-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 28px; }
.apple-panel { background: var(--paper-2); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 26px 26px 22px; }
.apple-panel h2 { font-size: 20px; margin: 0; }
.apple-list { display: flex; flex-direction: column; }
.apple-list__item {
    display: flex; flex-direction: column; gap: 4px;
    padding: 15px 2px; border-top: 1px solid var(--line-soft);
    text-decoration: none; color: var(--ink);
}
.apple-list__item:first-child { border-top: 0; }
.apple-list__item:hover .apple-list__title { text-decoration: underline; }
.apple-list__title { font-family: var(--serif); font-size: 16px; font-weight: 600; }
.apple-list__meta { font-size: 12px; color: var(--ink-3); }
.apple-empty {
    margin: 8px 0; padding: 22px; border-radius: 12px;
    background: var(--paper-2); color: var(--ink-3); font-size: 14px; text-align: center;
}

/* 管理ホーム */
.apple-admin-hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 4px; }
.apple-admin-hero h1 { font-size: clamp(26px, 5vw, 36px); margin: 4px 0; }
.apple-admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.apple-count-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.apple-count-card { background: var(--paper); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--line-soft); }
.apple-count-card__title { font-size: 13px; color: var(--ink-3); }
.apple-count-card__value { font-family: var(--serif); font-size: 26px; font-weight: 600; }
.apple-count-card__value span { font-size: 14px; color: var(--ink-3); margin-left: 4px; }
.apple-progress-list { display: flex; flex-direction: column; gap: 12px; }
.apple-progress-row { display: grid; grid-template-columns: 1fr 90px auto; align-items: center; gap: 12px; padding: 10px 2px; text-decoration: none; color: var(--ink); font-size: 15px; }
.apple-progress-bar { height: 5px; border-radius: 999px; background: var(--progress-soft); overflow: hidden; }
.apple-progress-fill { display: block; height: 100%; width: var(--progress, 0%); background: var(--ink); border-radius: 999px; }

@media (max-width: 720px) {
    .apple-home { gap: 60px; }
    .apple-status { grid-template-columns: 1fr; padding: 26px; }
}

/* =========================================================
   汎用ページ（lab-*）
   ========================================================= */
.lab-page__header h1 { font-size: clamp(28px, 5vw, 40px); }
.lab-content-card, .lab-list-item, .lab-year-group, .j-card, a.card {
    background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: none; color: var(--ink);
}
.lab-list-item:hover { background: var(--paper-2); box-shadow: 0 10px 26px rgba(0, 0, 0, 0.07); }
.lab-list-title, .lab-content-card h2, .lab-content-card h3 { font-family: var(--serif); }
.lab-button, .lab-search-form button {
    background: var(--ink); border: 0; border-radius: 999px; color: #fff; font-weight: 500; box-shadow: none;
}
.tag-pill, .lab-list-tag, .tag, .j-pill {
    background: var(--paper-3); border: 1px solid var(--line-soft); color: var(--ink-2);
}
.lab-action, .lab-page__breadcrumb a { color: var(--ink); }

/* =========================================================
   Study 一覧ページ
   ========================================================= */
.study-page__intro { color: var(--ink-2); font-size: 15px; line-height: 1.9; max-width: 660px; margin: 8px 0 0; }
.study-field { margin-top: 44px; }
.study-field__head { display: flex; align-items: baseline; gap: 12px; border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: 20px; }
.study-field__title { font-family: var(--serif); font-size: 22px; margin: 0; }
.study-field__count { font-size: 13px; color: var(--ink-3); }
.study-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }

/* =========================================================
   Book：折りたたみ章立ての考察
   ========================================================= */
.book-public-hero { gap: 24px; }
.book-public-cover { border-radius: 12px; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.14); }

.book-chapters__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.book-chapters__head h2 { font-size: clamp(22px, 4vw, 28px); margin: 0; }
.book-chapters__lead { margin: 8px 0 0; color: var(--ink-2); font-size: 14px; line-height: 1.7; }
.book-chapters__controls { display: flex; gap: 8px; }
.book-chapters__toggle {
    appearance: none; border: 1px solid var(--line); background: var(--paper);
    color: var(--ink); border-radius: 999px; padding: 7px 15px; font-size: 13px; font-weight: 500;
    cursor: pointer; min-height: 34px; font-family: var(--sans);
}
.book-chapters__toggle:hover { background: var(--paper-2); }
.book-chapters__list { display: flex; flex-direction: column; gap: 12px; }
.book-chapter {
    border: 1px solid var(--line); border-radius: 14px; background: var(--paper);
    overflow: hidden; transition: box-shadow 0.18s ease;
}
.book-chapter[open] { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06); }
.book-chapter__summary {
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    padding: 18px 22px; cursor: pointer; list-style: none; user-select: none;
}
.book-chapter__summary::-webkit-details-marker { display: none; }
.book-chapter__summary:hover { background: var(--paper-2); }
.book-chapter__label { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.book-chapter__num {
    font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: 0.1em;
    color: var(--ink-2); background: var(--paper-3); border-radius: 999px; padding: 3px 11px; white-space: nowrap;
}
.book-chapter__title { font-family: var(--serif); font-size: 18px; font-weight: 600; }
.book-chapter__chevron {
    width: 9px; height: 9px; flex: none;
    border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3);
    transform: rotate(45deg); transition: transform 0.2s ease;
}
.book-chapter[open] .book-chapter__chevron { transform: rotate(-135deg); }
.book-chapter__body { padding: 4px 22px 26px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 20px; }
.book-chapter__field-label {
    margin: 16px 0 8px; font-family: var(--sans); font-size: 12px; font-weight: 600;
    letter-spacing: 0.12em; color: var(--ink-3); text-transform: uppercase;
}
.book-chapter__prose { font-family: var(--serif); font-size: 16px; line-height: 2.0; color: var(--ink); }
.book-chapter__field--reflection .book-chapter__field-label { color: var(--ink); }
.book-chapter__field--reflection .book-chapter__prose { font-size: 17px; line-height: 2.05; }
.book-chapter__field--keywords .book-chapter__prose,
.book-chapter__field--quote_note .book-chapter__prose { font-family: var(--sans); color: var(--ink-2); font-size: 14px; line-height: 1.8; }

@media (max-width: 600px) {
    .book-chapter__summary { padding: 16px; }
    .book-chapter__body { padding: 4px 16px 20px; }
    .book-chapter__title { font-size: 16px; }
}

/* =========================================================
   視認性改善：Journal / Profile / 汎用ページ
   旧ダークテーマ（濃紺背景＋ほぼ白文字＋ネオン）を
   白基調・高コントラストへ全面上書き。lab.css/profile.cssより後に読む。
   ========================================================= */

/* ---- ページ共通の見出し・パンくず・メタ ---- */
.lab-page { color: var(--ink); }
.lab-page__header { margin-bottom: 8px; }
.lab-page__header h1 { font-family: var(--serif); color: var(--ink); font-size: clamp(28px, 5vw, 40px); line-height: 1.2; }
.lab-page__meta { color: var(--ink-2); font-size: 14px; }
.lab-page__breadcrumb { font-size: 14px; }
.lab-page__breadcrumb a { color: var(--ink-2); text-decoration: none; }
.lab-page__breadcrumb a:hover { color: var(--ink); }
.lab-empty {
    background: var(--paper-2); border: 1px solid var(--line-soft); color: var(--ink-2);
    border-radius: var(--radius); padding: 22px; font-size: 15px;
}

/* ---- Journal 一覧：年アコーディオン ---- */
.lab-accordion { display: flex; flex-direction: column; gap: 14px; }
.lab-year-group {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}
.lab-year-title {
    color: var(--ink);
    font-family: var(--sans);
    font-weight: 600;
    font-size: 16px;
    padding: 16px 18px;
}
.lab-year-title::after { content: "›"; color: var(--ink-3); font-size: 20px; transform: rotate(90deg); }
details[open] .lab-year-title::after { transform: rotate(-90deg); }
.lab-year-title .lab-year-count {
    color: var(--ink-3); font-size: 13px; font-weight: 500;
    background: var(--paper-3); border-radius: 999px; padding: 2px 10px;
}
.lab-list { padding: 0 14px 14px; gap: 0; }
.lab-list-item {
    background: var(--paper);
    border: 0;
    border-top: 1px solid var(--line-soft);
    border-radius: 0;
    color: var(--ink);
    padding: 16px 6px;
    align-items: center;
}
.lab-list-item:first-child { border-top: 0; }
.lab-list-item:hover { background: var(--paper-2); box-shadow: none; }
.lab-list-item:active { background: var(--paper-2); }
.lab-list-title { font-family: var(--serif); color: var(--ink); font-size: 17px; font-weight: 600; line-height: 1.5; }
.lab-list-meta { color: var(--ink-3); font-size: 12.5px; margin-top: 4px; }
.lab-list-tag {
    color: var(--ink-2); background: var(--paper-3);
    border: 1px solid var(--line-soft); border-radius: 999px; padding: 1px 9px; font-size: 11px;
}
.lab-action { color: var(--ink); font-weight: 500; }

/* ---- 記事本文（journal-view / study-view / profile fallback）読みやすさ ---- */
.lab-content-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    padding: clamp(22px, 4vw, 40px);
}
.page-journal-view .lab-content-card,
.page-books-view .lab-content-card { max-width: 760px; margin-left: auto; margin-right: auto; }

.lab-content-card :is(p, li, dd, td, span) { color: var(--ink); }
.lab-content-card p,
.lab-content-card li {
    font-family: var(--serif);
    font-size: 17px;
    line-height: 2.0;
    color: #2a2a2a;
}
.lab-content-card p { margin: 0 0 1.2em; }
.lab-content-card ul, .lab-content-card ol { padding-left: 1.4em; margin: 0 0 1.2em; }
.lab-content-card li { margin: 0 0 0.5em; }
.lab-content-card :is(h1, h2, h3, h4) {
    font-family: var(--serif); color: var(--ink);
    line-height: 1.35; margin: 1.6em 0 0.6em; letter-spacing: 0.01em;
}
.lab-content-card h1 { font-size: clamp(24px, 4vw, 30px); }
.lab-content-card h2 { font-size: clamp(21px, 3.4vw, 25px); padding-bottom: 0.3em; border-bottom: 1px solid var(--line-soft); }
.lab-content-card h3 { font-size: clamp(18px, 3vw, 21px); }
.lab-content-card a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--ink-3); }
.lab-content-card a:hover { text-decoration-color: var(--ink); }
.lab-content-card strong { font-weight: 700; color: var(--ink); }
.lab-content-card blockquote {
    margin: 1.4em 0; padding: 6px 0 6px 18px; border-left: 3px solid var(--line);
    color: var(--ink-2); font-style: normal;
}
.lab-content-card :not(pre) > code {
    background: var(--paper-3); color: #b5316b; border-radius: 6px; padding: 2px 6px; font-size: 0.92em;
}
.lab-content-card hr { border: 0; border-top: 1px solid var(--line-soft); margin: 2em 0; }
.lab-content-card img { max-width: 100%; height: auto; border-radius: 10px; }

/* 競プロメタ */
.competitive-meta-card { background: var(--paper-2); border: 1px solid var(--line); border-radius: 12px; }
.competitive-meta-card__title, .competitive-meta-card__title a { color: var(--ink); }
.competitive-meta-card__grid div { background: var(--paper); border: 1px solid var(--line-soft); }
.competitive-meta-card__grid dt { color: var(--ink-3); }
.competitive-meta-card__grid dd { color: var(--ink); }

/* ---- Profile ---- */
.profile-resume { max-width: 860px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; }
.profile-resume__hero { text-align: center; gap: 14px; }
.profile-resume__hero h1 { font-family: var(--serif); color: var(--ink); font-size: clamp(28px, 5vw, 40px); }
.profile-resume__hero p { color: var(--ink-2); font-size: 16px; line-height: 1.8; }
.profile-resume__photo { border: 1px solid var(--line); background: var(--paper-3); }
.profile-resume__section {
    background: var(--paper-2);
    border: 1px solid var(--line-soft);
    border-radius: var(--radius);
    padding: 24px 26px;
}
.profile-resume__section h2 {
    font-family: var(--serif); color: var(--ink); font-size: 20px;
    margin: 0 0 16px; padding-bottom: 10px; border-bottom: 1px solid var(--line-soft);
}
.profile-resume__attrs { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.profile-resume__attrs div { background: var(--paper); border: 1px solid var(--line-soft); border-radius: 10px; padding: 12px 14px; }
.profile-resume__attrs dt { color: var(--ink-3); font-size: 12px; }
.profile-resume__attrs dd { color: var(--ink); font-size: 15px; margin: 4px 0 0; }
.profile-resume__section :is(ul, li, p) { color: var(--ink); font-size: 15px; line-height: 1.9; }
.profile-resume__links a {
    color: var(--ink); background: var(--paper); border: 1px solid var(--line);
    border-radius: 999px; padding: 8px 16px; text-decoration: none; font-size: 14px;
}
.profile-resume__links a:hover { background: var(--paper-2); }

/* =========================================================
   レスポンシブ：PC と iPhone をそれぞれ最適化
   ========================================================= */

/* --- PC（広い画面）：読みやすい行長と大きめの余白 --- */
@media (min-width: 981px) {
    .apple-hero__title { font-size: clamp(44px, 4.4vw, 60px); }
    .apple-card-grid { gap: 26px; }
}

/* --- タブレット〜iPhone 横 --- */
@media (max-width: 820px) {
    .apple-columns { gap: 20px; }
    .profile-resume__grid { grid-template-columns: 1fr; }
}

/* --- iPhone（縦・狭い画面）：文字を詰めすぎず、1カラムで大きく --- */
@media (max-width: 600px) {
    .site-main { padding: 0 16px 40px; }
    .apple-home { gap: 52px; }
    .apple-hero { padding: 28px 0 4px; }
    .apple-hero__title { font-size: clamp(30px, 9vw, 40px); }
    .apple-hero__lead { font-size: 16px; line-height: 1.85; }
    .apple-hero__actions .apple-btn { flex: 1 1 auto; }

    .apple-section-head { flex-direction: column; align-items: flex-start; gap: 6px; }
    .apple-section-head h2 { font-size: 24px; }
    .apple-card-grid { grid-template-columns: 1fr; gap: 14px; }
    .apple-note-card { padding: 20px; }
    .apple-note-card__title { font-size: 18px; }
    .apple-note-card__excerpt { font-size: 15px; }

    /* Book/Studyカバーカードは横並びのミニカードに */
    .apple-card { flex-direction: row; align-items: stretch; }
    .apple-card__cover { width: 96px; aspect-ratio: 3 / 4; flex: none; }
    .apple-card__body { justify-content: center; }

    .apple-status { padding: 22px; }
    .apple-status__name { font-size: 22px; }

    /* Journal 一覧：メタを下に、読むボタンを右に保ちつつ余白確保 */
    .lab-list-item { padding: 15px 4px; }
    .lab-list-title { font-size: 16px; }
    .lab-list-meta { font-size: 12px; }

    /* 記事本文：iPhoneで16px以上・行間ゆったり */
    .lab-content-card { padding: 22px 18px; }
    .lab-content-card p, .lab-content-card li { font-size: 16.5px; line-height: 1.95; }

    /* Profile：1カラム・カード余白 */
    .profile-resume__section { padding: 20px; }
    .profile-resume__attrs { grid-template-columns: 1fr; }
}

/* --- 極小（iPhone SE等） --- */
@media (max-width: 380px) {
    .apple-hero__title { font-size: 28px; }
    .apple-card__cover { width: 80px; }
}

/* ---- フォーム・検索・メッセージ・ボタン（Contact / Applications / Search） ---- */
.lab-app-meta { color: var(--ink-2); font-size: 14px; line-height: 1.7; }
.lab-form__field label { color: var(--ink-2); font-size: 14px; font-weight: 500; }
.lab-form__field input,
.lab-form__field textarea,
.lab-search-form .lab-search-input,
.lab-search-select,
.lab-search-form button {
    background: var(--paper);
    border: 1px solid var(--line);
    color: var(--ink);
    border-radius: 10px;
    font-size: 16px; /* iOSの自動ズーム防止 */
}
.lab-form__field input::placeholder,
.lab-form__field textarea::placeholder,
.lab-search-form .lab-search-input::placeholder { color: var(--ink-3); }
.lab-form__field input:focus,
.lab-form__field textarea:focus,
.lab-search-form .lab-search-input:focus,
.lab-search-select:focus {
    border-color: var(--ink); outline: 2px solid rgba(0, 0, 0, 0.12); outline-offset: 1px;
}
.lab-search-form button { background: var(--ink); color: #fff; font-weight: 500; }

.lab-button {
    background: var(--ink); border: 0; color: #fff; border-radius: 999px;
    min-height: 42px; padding: 0 20px; font-weight: 500;
}
.lab-button:hover { opacity: 0.85; }
.lab-button.secondary {
    background: var(--paper); color: var(--ink); border: 1px solid var(--line);
}
.lab-button.secondary:hover { background: var(--paper-2); opacity: 1; }

.lab-message--ok {
    border: 1px solid #b7dcc4; background: #eef7f1; color: #1f6b43;
}
.lab-message--error {
    border: 1px solid #e6bcbc; background: #fbeeee; color: #a3312f;
}

/* =========================================================
   ホーム：カウントアップ / 進捗 / 更新情報 / スクロール位置インジケータ
   ========================================================= */
.apple-count-grid--wide { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.apple-count-card { border: 1px solid var(--line); background: var(--paper); }
.apple-count-card__desc { font-size: 12px; color: var(--ink-3); line-height: 1.6; margin-top: 2px; }

/* 進捗バー（公開ホーム用の行） */
.apple-progress-row { grid-template-columns: minmax(0, 1fr) minmax(120px, 200px) 48px; }
.apple-progress-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.apple-progress-pct { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); }
.apple-progress-bar { height: 6px; }

.apple-list__item--row { flex-direction: row; align-items: baseline; justify-content: space-between; gap: 14px; }
.apple-list__item--row .apple-list__meta { white-space: nowrap; }

/* スクロール位置インジケータ（右側ドットナビ。広い画面のみ） */
.home-spy {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 500;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px;
}
.home-spy__item {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    height: 26px;
    text-decoration: none;
}
.home-spy__dot {
    width: 8px; height: 8px; border-radius: 999px; flex: none;
    background: transparent;
    border: 1.5px solid var(--ink-3);
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}
.home-spy__label {
    font-family: var(--sans);
    font-size: 12px;
    color: var(--ink-2);
    white-space: nowrap;
    opacity: 0;
    transform: translateX(6px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    background: rgba(255, 255, 255, 0.9);
    padding: 2px 8px;
    border-radius: 999px;
}
.home-spy__item:hover .home-spy__label,
.home-spy__item.is-active .home-spy__label { opacity: 1; transform: none; }
.home-spy__item:hover .home-spy__dot { border-color: var(--ink); }
.home-spy__item.is-active .home-spy__dot { background: var(--ink); border-color: var(--ink); transform: scale(1.2); }

/* サイドに余白のある広い画面のみ表示（狭い画面では非表示） */
@media (max-width: 1240px) {
    .home-spy { display: none; }
}

@media (max-width: 600px) {
    .apple-count-grid--wide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .apple-progress-row { grid-template-columns: minmax(0, 1fr) 80px 44px; gap: 10px; font-size: 14px; }
    .apple-list__item--row { flex-direction: column; align-items: flex-start; gap: 4px; }
}
