/* =====================================================================
   guide.css — 解説ページ (/guide/*) 共通スタイル
   トークンは DESIGN.md / index.html の <style> と同じ値を使用する。
   index.html 側の CSS には手を触れない方針のため値が重複しているが、
   これはランキング本体へ影響を出さないための意図的な分離。
   デザイントークンを変更する場合は DESIGN.md・index.html と併せて更新すること。
   ===================================================================== */

:root {
    --font-rounded: 'Zen Maru Gothic', system-ui, sans-serif;
    --font-body:    'Zen Kaku Gothic New', 'Hiragino Kaku Gothic ProN', 'Meiryo', system-ui, sans-serif;
    --font-mono:    'JetBrains Mono', monospace;

    --bg:            #FFFBF2;
    --bg-elev:       #FFFFFF;
    --bg-soft:       #FFF5E0;
    --border:        #F0E6D2;
    --border-strong: #E5D8BD;

    --text:      #2B2722;
    --text-sub:  #7A7269;
    --text-mute: #A89F93;

    --brand:        #FFB84D;
    --brand-strong: #FF9A2E;
    --brand-soft:   #FFF0D6;
    --coral:        #FF8A5C;
    --coral-soft:   #FFE3D6;

    --up:        #3DBE8B;
    --up-soft:   #DFF5EA;
    --down:      #E86A6A;
    --down-soft: #FBE2E2;
    --flat:      #B9B0A3;

    /* ローソク足は iSpeed 規約。UI のセマンティック色とは別系統（変更禁止） */
    --candle-up:   #E53935;
    --candle-down: #00ACC1;

    --shadow-sm: 0 1px 2px rgba(60,40,10,0.04), 0 2px 6px rgba(60,40,10,0.03);
    --shadow-md: 0 4px 14px rgba(80,55,20,0.06), 0 2px 4px rgba(80,55,20,0.04);

    --radius-xs: 8px;
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 22px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.95;
    -webkit-text-size-adjust: 100%;
}

/* ===== ヘッダー ===== */
.g-header {
    position: sticky; top: 0; z-index: 50;
    background: rgba(255,251,242,.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}
.g-header-inner {
    max-width: 820px; margin: 0 auto; padding: 12px 20px;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.g-logo {
    font-family: var(--font-rounded); font-size: 16px; font-weight: 700;
    color: var(--text); text-decoration: none; letter-spacing: -.02em;
    display: flex; align-items: center; gap: 8px;
}
.g-logo .accent { color: var(--brand-strong); }
.g-logo-mark {
    width: 26px; height: 26px; border-radius: 8px; flex: none;
    background: linear-gradient(135deg, var(--brand), var(--brand-strong));
    display: flex; align-items: center; justify-content: center; color: #fff;
}
.g-header-cta {
    font-size: 12px; font-weight: 700; text-decoration: none;
    padding: 7px 14px; border-radius: var(--radius-xs);
    background: var(--brand-strong); color: #fff; white-space: nowrap;
}

/* ===== レイアウト ===== */
.g-main { max-width: 820px; margin: 0 auto; padding: 24px 20px 64px; }

.g-breadcrumb {
    font-size: 11.5px; color: var(--text-mute);
    margin-bottom: 18px; line-height: 1.7;
}
.g-breadcrumb a { color: var(--text-sub); text-decoration: none; }
.g-breadcrumb a:hover { color: var(--brand-strong); text-decoration: underline; }

h1 {
    font-family: var(--font-rounded);
    font-size: 25px; font-weight: 700; line-height: 1.45; letter-spacing: -.02em;
    margin: 0 0 10px; color: var(--text);
}
.g-lede {
    font-size: 13.5px; color: var(--text-sub); line-height: 1.9;
    margin: 0 0 6px; padding-bottom: 20px; border-bottom: 2px solid var(--border);
}

h2 {
    font-family: var(--font-rounded);
    font-size: 19px; font-weight: 700; line-height: 1.5;
    margin: 42px 0 14px; padding-bottom: 9px;
    border-bottom: 2px solid var(--border); color: var(--text);
}
h3 {
    font-family: var(--font-rounded);
    font-size: 15px; font-weight: 700; margin: 26px 0 8px; color: var(--text);
}
h4 {
    font-family: var(--font-rounded);
    font-size: 13.5px; font-weight: 700; margin: 18px 0 6px; color: var(--text-sub);
}
p { margin: 0 0 14px; }
strong { color: var(--text); font-weight: 700; }
a { color: var(--brand-strong); }
a:hover { text-decoration: underline; }
code, .num {
    font-family: var(--font-mono); font-size: .92em;
    background: var(--bg-soft); padding: 1px 6px; border-radius: 5px;
    color: var(--text);
}
ul, ol { margin: 0 0 14px; padding-left: 1.4em; }
li { margin-bottom: 6px; }

/* ===== 目次 ===== */
.g-toc {
    background: var(--bg-elev); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 16px 20px; margin: 24px 0 8px;
    box-shadow: var(--shadow-sm);
}
.g-toc-title {
    font-family: var(--font-rounded); font-size: 12px; font-weight: 700;
    color: var(--text-sub); margin-bottom: 8px;
}
.g-toc ol { margin: 0; padding-left: 1.3em; font-size: 13px; }
.g-toc li { margin-bottom: 3px; }
.g-toc a { color: var(--text-sub); text-decoration: none; }
.g-toc a:hover { color: var(--brand-strong); text-decoration: underline; }

/* ===== 補足ボックス ===== */
.g-note, .g-warn, .g-tip {
    border-radius: var(--radius-sm); padding: 13px 16px; margin: 0 0 16px;
    font-size: 12.5px; line-height: 1.85;
}
.g-note { background: var(--bg-soft);    border: 1px solid var(--border-strong); border-left: 3px solid var(--brand); }
.g-warn { background: var(--down-soft);  border: 1px solid rgba(232,106,106,.3);  border-left: 3px solid var(--down); }
.g-tip  { background: var(--up-soft);    border: 1px solid rgba(61,190,139,.3);   border-left: 3px solid var(--up); }
.g-note-label, .g-warn-label, .g-tip-label {
    font-family: var(--font-rounded); font-weight: 700; display: block; margin-bottom: 3px;
}
.g-note-label { color: #B57A1E; }
.g-warn-label { color: var(--down); }
.g-tip-label  { color: #2E9970; }

/* ===== テーブル ===== */
.g-table-wrap { overflow-x: auto; margin: 0 0 18px; -webkit-overflow-scrolling: touch; }
table {
    border-collapse: collapse; width: 100%; min-width: 460px;
    background: var(--bg-elev); font-size: 12.5px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    overflow: hidden;
}
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
th {
    background: var(--bg-soft); font-family: var(--font-rounded);
    font-weight: 700; color: var(--text); white-space: nowrap;
}
tbody tr:last-child td { border-bottom: none; }
td.n { font-family: var(--font-mono); white-space: nowrap; }
.c-up   { color: var(--up);   font-weight: 700; }
.c-down { color: var(--down); font-weight: 700; }
.c-mute { color: var(--text-mute); }

/* ===== カードグリッド（ハブ・関連リンク） ===== */
.g-cards {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px; margin: 0 0 20px;
}
.g-card {
    display: block; text-decoration: none; color: inherit;
    background: var(--bg-elev); border: 1px solid var(--border);
    border-radius: var(--radius-md); padding: 16px 18px;
    box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s, transform .15s;
}
.g-card:hover {
    border-color: var(--brand); box-shadow: var(--shadow-md);
    transform: translateY(-2px); text-decoration: none;
}
.g-card-title {
    font-family: var(--font-rounded); font-size: 14px; font-weight: 700;
    color: var(--text); margin-bottom: 5px; display: flex; align-items: center; gap: 7px;
}
.g-card-desc { font-size: 12px; color: var(--text-sub); line-height: 1.8; }

/* ===== 用語カード ===== */
.g-terms {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 10px; margin: 0 0 18px;
}
.g-term {
    background: var(--bg-elev); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 12px 14px; box-shadow: var(--shadow-sm);
}
.g-term dt {
    font-family: var(--font-rounded); font-size: 12.5px; font-weight: 700;
    color: var(--text); margin-bottom: 3px;
}
.g-term dd { margin: 0; font-size: 12px; line-height: 1.8; color: var(--text-sub); }

/* ===== FAQ ===== */
.g-faq {
    background: var(--bg-elev); border: 1px solid var(--border);
    border-radius: var(--radius-sm); padding: 14px 17px; margin-bottom: 9px;
    box-shadow: var(--shadow-sm);
}
.g-faq h3 { margin: 0 0 4px; font-size: 13.5px; }
.g-faq p  { margin: 0; font-size: 12.5px; color: var(--text-sub); }

/* ===== CTA ===== */
.g-cta {
    background: linear-gradient(135deg, var(--brand-soft), var(--coral-soft));
    border: 1px solid var(--border-strong); border-radius: var(--radius-lg);
    padding: 24px 22px; margin: 40px 0 8px; text-align: center;
}
.g-cta-title {
    font-family: var(--font-rounded); font-size: 16px; font-weight: 700;
    color: var(--text); margin-bottom: 6px;
}
.g-cta-desc { font-size: 12.5px; color: var(--text-sub); margin-bottom: 16px; }
.g-cta-btn {
    display: inline-block; padding: 12px 30px; border-radius: var(--radius-sm);
    background: var(--brand-strong); color: #fff; text-decoration: none;
    font-family: var(--font-rounded); font-weight: 700; font-size: 14px;
    box-shadow: var(--shadow-md);
}
.g-cta-btn:hover { background: #F08A1A; text-decoration: none; }

/* ===== 免責・フッター ===== */
.g-disclaimer {
    margin-top: 40px; padding: 13px 16px;
    background: var(--brand-soft); border: 1px solid rgba(255,184,77,.25);
    border-left: 3px solid var(--brand); border-radius: var(--radius-sm);
    font-size: 11.5px; color: var(--text-sub); line-height: 1.8;
}
.g-footer {
    border-top: 1px solid var(--border); margin-top: 32px; padding: 22px 20px 40px;
    text-align: center; font-size: 11.5px; color: var(--text-mute); line-height: 2;
}
.g-footer a { color: var(--brand-strong); text-decoration: none; }
.g-footer a:hover { text-decoration: underline; }
.g-footer-nav { margin-top: 4px; }

/* ===== レスポンシブ ===== */
@media (max-width: 600px) {
    body { font-size: 13.5px; }
    .g-main { padding: 18px 16px 48px; }
    h1 { font-size: 21px; }
    h2 { font-size: 17px; margin-top: 34px; }
    h3 { font-size: 14px; }
    .g-header-inner { padding: 10px 16px; }
    .g-logo { font-size: 14px; }
    .g-cards, .g-terms { grid-template-columns: 1fr; }
}
