/* =========================================
   各種計算ツール (Calc) 共通スタイルシート
   ========================================= */

/* 1. テーマカラー変数定義 */
:root {
    --primary-color: #1629CC; 
    --bg-color: #f4f7f6;
    --card-bg: #ffffff;
    --text-main: #333333;
    --text-sub: #666666;
    --border-color: #e0e0e0;
}

body.theme-health { --primary-color: #2ecc71; }
body.theme-money { --primary-color: #f39c12; }
body.theme-date { --primary-color: #1629CC; }
body.theme-life { --primary-color: #9b59b6; }

/* 2. 基本レイアウト */
.calc-wrapper {
    max-width: 650px;
    margin: 0 auto;
    padding: 20px;
}
.calc-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

/* 3. 見出し (H1) & 説明文 */
.calc-h1-title {
    font-size: 24px; 
    font-weight: bold; 
    color: var(--primary-color); 
    border-bottom: 2px solid var(--primary-color); 
    padding-bottom: 8px; 
    margin-bottom: 10px; 
    text-align: center; 
    line-height: 1.4;
}
.calc-desc {
    font-size: 14px;
    color: var(--text-sub);
    line-height: 1.6;
    margin: 0 0 20px 0;
}

/* 4. パンくずリスト */
.breadcrumb-container {
    margin-bottom: 15px;
    font-size: 13px;
    color: #64748b;
}
.CrumbList {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}
.CrumbList li { display: inline-flex; align-items: center; }
.CrumbList li:not(:last-child)::after {
    content: '\003E'; margin: 0 8px; color: #cbd5e1; font-size: 11px;
}
.CrumbList li a { color: var(--primary-color); text-decoration: none; }
.CrumbList li a:hover { text-decoration: underline; }

/* 5. フォーム・入力要素 */
.input-group { margin-bottom: 20px; }
.input-group:last-child { margin-bottom: 0; }
.input-label {
    display: block;
    font-size: 14px;
    font-weight: bold;
    color: var(--text-main);
    margin-bottom: 8px;
}
.calc-input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
}
.calc-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* 6. 計算結果エリア */
.result-area {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid var(--border-color);
    text-align: center;
}
body.theme-health .result-area { background: rgba(46, 204, 113, 0.05); border-color: rgba(46, 204, 113, 0.2); }
body.theme-money .result-area { background: rgba(243, 156, 18, 0.05); border-color: rgba(243, 156, 18, 0.2); }
body.theme-date .result-area { background: rgba(52, 152, 219, 0.05); border-color: rgba(52, 152, 219, 0.2); }
body.theme-life .result-area { background: rgba(155, 89, 182, 0.05); border-color: rgba(155, 89, 182, 0.2); }

.result-title { font-size: 14px; color: var(--text-sub); margin-bottom: 10px; }
.result-main {
    font-size: 32px;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 15px;
}
.result-sub {
    font-size: 15px;
    color: var(--text-sub);
    margin: 5px 0;
    padding-top: 10px;
    border-top: 1px dashed var(--border-color);
}

/* 7. CTAボタン */
.btn-cta {
    display: block;
    width: 100%;
    box-sizing: border-box;
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    padding: 16px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: bold;
    font-size: 16px;
    transition: opacity 0.2s;
    border: none;
}
.btn-cta:hover { opacity: 0.9; color: white; text-decoration: none;}


/* 🌟 PC版入力エリアの2列グリッドレイアウト */
@media (min-width: 769px) {
    .calc-inputs-wrapper {
        display: grid;
        grid-template-columns: repeat(2, 1fr); /* 强制分成均等的2列 */
        column-gap: 24px; /* 两列之间的间距 */
    }
    
    /* 要素数が奇数の場合、最後の1個は全幅を使う（デザインのバランスを取るため） */
    .calc-inputs-wrapper .input-group:last-child:nth-child(odd) {
        grid-column: span 2;
    }
}

/* =========================================================
   Calc Hubページ（一覧/ポータル）専用スタイル
========================================================= */
.calc-hub-container { padding-bottom: 40px; }
.calc-info-box { background: #f8fafc; color: #334155; padding: 16px 20px; border-radius: 8px; font-size: 14px; margin-bottom: 25px; border: 1px solid #e2e8f0; border-left-width: 4px; display: flex; align-items: flex-start; gap: 10px; width: 100%; box-sizing: border-box; }
.calc-hub-controls { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; flex-wrap: wrap; gap: 15px; }

/* カテゴリタブ */
.calc-hub-tabs { display: flex; gap: 10px; }
.calc-hub-tab { padding: 8px 16px; background: #fff; border: 1px solid #cbd5e1; border-radius: 20px; font-size: 14px; font-weight: bold; color: #475569; cursor: pointer; transition: 0.2s; }
.calc-hub-tab:hover { background: #f1f5f9; }

/* 表示切り替えボタン（カード/リスト） */
.calc-view-toggle { display: flex; background: #f1f5f9; border-radius: 6px; padding: 4px; border: 1px solid #e2e8f0; }
.calc-view-btn { padding: 6px 12px; background: transparent; border: none; border-radius: 4px; color: #64748b; cursor: pointer; font-size: 13px; font-weight: bold; display: flex; align-items: center; gap: 6px; transition: 0.2s; }
.calc-view-btn svg { width: 16px; height: 16px; fill: currentColor; }
.calc-view-btn.active { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }

/* グリッドレイアウト（デフォルト：カード型） */
.calc-hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin-bottom: 40px; }
.calc-hub-group-title { grid-column: 1 / -1; font-size: 18px; color: #1e293b; border-bottom: 2px solid #e2e8f0; padding-bottom: 8px; margin-top: 10px; margin-bottom: 5px; }

/* カード自体のデザイン */
.calc-hub-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 20px; display: flex; flex-direction: column; transition: all 0.2s ease; text-decoration: none; box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
.calc-hub-card:hover { transform: translateY(-3px); box-shadow: 0 8px 15px rgba(0,0,0,0.08); }
.calc-hub-card-icon { font-size: 28px; margin-bottom: 12px; width: 50px; height: 50px; display: flex; align-items: center; justify-content: center; border-radius: 12px; }
.calc-hub-card-title { font-size: 16px; font-weight: bold; color: #1e293b; margin-bottom: 8px; }
.calc-hub-card-desc { font-size: 13px; color: #64748b; line-height: 1.5; flex-grow: 1; }

/* リストレイアウト（切り替え時） */
.calc-hub-container.view-list .calc-hub-grid { display: flex; flex-direction: column; gap: 10px; }
.calc-hub-container.view-list .calc-hub-card { flex-direction: row; align-items: center; padding: 15px 20px; }
.calc-hub-container.view-list .calc-hub-card-icon { margin-bottom: 0; margin-right: 15px; font-size: 24px; width: auto; height: auto; background: transparent !important; }
.calc-hub-container.view-list .calc-hub-card-title { margin-bottom: 0; width: 220px; flex-shrink: 0; }
.calc-hub-container.view-list .calc-hub-card-desc { margin-bottom: 0; }

/* SEO コンテンツ用スタイル */
.calc-seo-section { background: #fff; padding: 30px; border-radius: 12px; box-shadow: 0 4px 6px rgba(0,0,0,0.05); border: 1px solid #e2e8f0; margin-bottom: 30px; color: #334155; line-height: 1.7; }
@media (max-width: 600px) {
    .calc-hub-controls { flex-direction: column; align-items: flex-start; }
    .calc-hub-container.view-list .calc-hub-card { flex-direction: column; align-items: flex-start; }
    .calc-hub-container.view-list .calc-hub-card-icon { margin-bottom: 8px; }
    .calc-hub-container.view-list .calc-hub-card-title { width: 100%; margin-bottom: 4px; }
}