/* =========================
   元素詳細ページ
========================= */

:root{
    --bg-main:#0f172a;
    --bg-sub:#1e293b;

    --panel:#ffffff10;
    --panel-strong:#ffffff16;
    --border:#ffffff18;
    --border-strong:#38bdf855;

    --text-main:#f8fafc;
    --text-sub:#cbd5e1;
    --text-muted:#94a3b8;

    --accent:#38bdf8;
    --green:#22c55e;
}

*{
    box-sizing:border-box;
}

html,
body{
    margin:0;
    padding:0;
    width:100%;
    min-height:100%;
    overflow-x:hidden;
}

body{
    font-family:"Segoe UI","Noto Sans JP",sans-serif;
    background:
        radial-gradient(circle at top left,#0ea5e933,transparent 32%),
        linear-gradient(135deg,var(--bg-main),var(--bg-sub));
    color:var(--text-main);
    min-height:100vh;
    display:flex;
    flex-direction:column;
}

.detail-container{
    width:min(92%,980px);
    max-width:980px;
    margin:26px auto 0;
    flex:1;
}

.detail-panel{
    background:linear-gradient(135deg,#ffffff12,#ffffff08);
    border:1px solid var(--border);
    border-radius:26px;
    padding:28px;
    box-shadow:0 18px 50px rgba(0,0,0,.24);
}

.detail-header{
    display:grid;
    grid-template-columns:170px 1fr;
    gap:22px;
    align-items:center;
    margin-bottom:24px;
}

.detail-symbol-card{
    position:relative;
    min-height:170px;
    background:#02061770;
    border:1px solid #334155;
    border-radius:24px;
    padding:18px;
    text-align:center;
    box-shadow:0 14px 30px rgba(0,0,0,.24);
    overflow:hidden;
}

.detail-symbol-card::before{
    content:"";
    position:absolute;
    inset:0;
    opacity:.24;
    background:linear-gradient(135deg,#38bdf8,transparent 58%);
    pointer-events:none;
}

.detail-symbol-card > *{
    position:relative;
}

.detail-number{
    color:#cbd5e1;
    font-size:14px;
    font-weight:850;
    text-align:left;
}

.detail-symbol{
    margin-top:14px;
    font-size:70px;
    font-weight:900;
    color:#e0f2fe;
    line-height:1;
}

.detail-name-small{
    margin-top:12px;
    color:#f8fafc;
    font-size:18px;
    font-weight:850;
}

.detail-title-box h1{
    margin:0;
    color:#e0f2fe;
    font-size:42px;
    font-weight:900;
    line-height:1.3;
}

.detail-subtitle{
    color:#bae6fd;
    font-size:16px;
    font-weight:850;
    margin-top:6px;
}

.detail-badges{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    margin-top:14px;
}

.detail-badge{
    background:#02061770;
    border:1px solid #334155;
    color:#e2e8f0;
    border-radius:999px;
    padding:7px 11px;
    font-size:13px;
    font-weight:750;
}

.detail-grid{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:16px;
}

.detail-card{
    background:#02061770;
    border:1px solid #334155;
    color:white;
    padding:20px;
    margin-bottom:16px;
    border-radius:20px;
    box-shadow:0 10px 24px rgba(0,0,0,.16);
}

.detail-card h2{
    color:#e0f2fe;
    margin:0 0 14px;
    border-left:5px solid var(--accent);
    padding-left:10px;
    font-size:18px;
    font-weight:850;
}

.detail-card p{
    margin:0;
    color:#e2e8f0;
    line-height:1.85;
    overflow-wrap:anywhere;
}

.info-list{
    display:flex;
    flex-direction:column;
    gap:10px;
}

.info-row{
    display:flex;
    justify-content:space-between;
    gap:14px;
    border-bottom:1px solid #334155;
    padding-bottom:9px;
    line-height:1.55;
}

.info-row:last-child{
    border-bottom:none;
    padding-bottom:0;
}

.info-row span{
    color:var(--text-muted);
    font-size:13px;
    font-weight:850;
    white-space:nowrap;
}

.info-row strong{
    color:#f8fafc;
    text-align:right;
    overflow-wrap:anywhere;
}

.electron-box{
    background:#0f172a;
    border:1px solid #334155;
    border-radius:14px;
    padding:14px;
    color:#bae6fd;
    line-height:1.8;
    font-weight:850;
    overflow-wrap:anywhere;
}

.hint-text{
    margin-top:12px !important;
    color:var(--text-sub) !important;
    font-size:13px;
}

.topic-list{
    margin:0;
    padding-left:22px;
    color:#e2e8f0;
    line-height:1.85;
}

.topic-list li{
    margin-bottom:6px;
}

.muted-text{
    color:var(--text-muted) !important;
}

.back-links{
    display:flex;
    justify-content:center;
    gap:12px;
    flex-wrap:wrap;
    margin-top:24px;
}

.back-links a{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    background:#64748b;
    color:white;
    text-decoration:none;
    padding:12px 20px;
    border-radius:13px;
    font-weight:850;
    min-width:150px;
    transition:.18s ease;
}

.back-links a:hover{
    transform:translateY(-2px);
    filter:brightness(1.05);
}

/* 分類色のアクセント */

.alkali_metal::before{
    background:linear-gradient(135deg,#ff6b6b,transparent 58%);
}

.alkaline_earth_metal::before{
    background:linear-gradient(135deg,#ffb86b,transparent 58%);
}

.transition_metal::before{
    background:linear-gradient(135deg,#f4d35e,transparent 58%);
}

.post_transition_metal::before{
    background:linear-gradient(135deg,#a6a831,transparent 58%);
}

.metalloid::before{
    background:linear-gradient(135deg,#8eff3d,transparent 58%);
}

.nonmetal::before{
    background:linear-gradient(135deg,#51cf66,transparent 58%);
}

.halogen::before{
    background:linear-gradient(135deg,#845ef7,transparent 58%);
}

.noble_gas::before{
    background:linear-gradient(135deg,#4dabf7,transparent 58%);
}

.lanthanide::before{
    background:linear-gradient(135deg,#ff9ff3,transparent 58%);
}

.actinide::before{
    background:linear-gradient(135deg,#ff6bcb,transparent 58%);
}

/* 固定ホームボタン */

.floating-home-btn{
    position:fixed;
    right:22px;
    bottom:22px;
    z-index:9999;
    display:flex;
    align-items:center;
    gap:8px;
    background:linear-gradient(135deg,#38bdf8,#22c55e);
    color:#082f49;
    text-decoration:none;
    border-radius:999px;
    padding:12px 16px;
    font-size:14px;
    font-weight:850;
    box-shadow:0 14px 30px rgba(0,0,0,.35);
    border:1px solid #ffffff55;
    transition:.18s ease;
}

.floating-home-btn:hover{
    transform:translateY(-3px);
    filter:brightness(1.05);
}

.floating-home-btn:active{
    transform:translateY(-1px);
}

.floating-home-btn svg{
    width:20px;
    height:20px;
    flex-shrink:0;
}

@media(max-width:760px){

    .detail-container{
        width:94%;
        margin-top:18px;
    }

    .detail-panel{
        padding:20px 14px;
        border-radius:22px;
    }

    .detail-header{
        grid-template-columns:1fr;
        gap:14px;
        text-align:center;
    }

    .detail-symbol-card{
        width:180px;
        min-height:160px;
        margin:0 auto;
        border-radius:22px;
    }

    .detail-title-box h1{
        font-size:32px;
    }

    .detail-badges{
        justify-content:center;
    }

    .detail-grid{
        grid-template-columns:1fr;
        gap:0;
    }

    .detail-card{
        padding:17px;
        border-radius:18px;
    }

    .detail-card h2{
        font-size:16px;
    }

    .detail-card p,
    .topic-list{
        font-size:14px;
    }

    .back-links{
        flex-direction:column;
    }

    .back-links a{
        width:100%;
    }

    .floating-home-btn{
        right:16px;
        bottom:16px;
        width:52px;
        height:52px;
        padding:0;
        justify-content:center;
        border-radius:50%;
    }

    .floating-home-btn span{
        display:none;
    }

    .floating-home-btn svg{
        width:23px;
        height:23px;
    }

}

@media(max-width:380px){

    .detail-symbol-card{
        width:100%;
    }

    .detail-symbol{
        font-size:62px;
    }

}

.cs-footer{
    margin-top:0;
    width:100%;
    max-width:100%;
    flex-shrink:0;
}
