@charset "utf-8";

/* ------------------------------------------------------------------
   半導体マーケット・ダッシュボード（/semiconductor/）
   上昇=赤(#da0000) / 下落=緑(#009944) はサイト共通の配色に合わせる
------------------------------------------------------------------ */

/* 更新タイミングの注記 */
.sm-update-note {
    background: #f7f7f7;
    border-left: 4px solid #d5d5d5;
    padding: 10px 12px;
    margin: 0 0 20px;
    font-size: 0.9em;
    line-height: 1.6;
    color: #555;
}

.sm-lead {
    margin: 0 0 15px;
    font-size: 0.95em;
    line-height: 1.7;
    color: #555;
}

/* ------------------------------------------------------------------
   S1. 指数サマリーカード
------------------------------------------------------------------ */
.sm-card-list {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -5px 10px;
}

.sm-card {
    box-sizing: border-box;
    width: calc(25% - 10px);
    /* 高さを固定してスパークライン描画によるレイアウトシフトを防ぐ */
    min-height: 168px;
    padding: 10px 12px;
    margin: 0 5px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    background: #fff;
}

.sm-card-empty {
    background: #fafafa;
    color: #999;
}

.sm-card-head {
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
    margin-bottom: 8px;
}

.sm-card-title {
    display: block;
    font-size: 0.95em;
    font-weight: bold;
    line-height: 1.4;
}

.sm-card-title a {
    color: #333;
}

.sm-card-date {
    display: block;
    font-size: 0.75em;
    color: #999;
    line-height: 1.4;
}

.sm-card-val {
    margin: 0 0 6px;
    font-size: 1.35em;
    font-weight: bold;
    line-height: 1.3;
    word-break: break-all;
}

.sm-card-val span {
    font-size: 0.72em;
    margin-left: 3px;
}

/* 相対力カードは主数値そのものがspanのため、前日比用の縮小を打ち消す */
.sm-card-val .sm-card-val-main {
    font-size: 1em;
    margin-left: 0;
}

.sm-card-note {
    margin: 0 0 6px;
    font-size: 0.8em;
    color: #777;
    line-height: 1.4;
}

.sm-card-sub {
    list-style: none;
    padding: 0;
    margin: 0;
    border-top: 1px dotted #e5e5e5;
    padding-top: 6px;
}

.sm-card-sub li {
    display: flex;
    justify-content: space-between;
    font-size: 0.8em;
    line-height: 1.7;
}

.sm-sub-label {
    color: #888;
    margin-right: 8px;
}

/* スパークライン（サーバ側でSVG生成） */
.sm-spark {
    display: block;
    width: 100%;
    height: 28px;
    margin: 0 0 6px;
}

.sm-spark polyline {
    fill: none;
    stroke-width: 1.5;
    vector-effect: non-scaling-stroke;
}

.sm-spark-up polyline {
    stroke: #da0000;
}

.sm-spark-down polyline {
    stroke: #009944;
}

/* ------------------------------------------------------------------
   S2. 工程別ヒートマップ
------------------------------------------------------------------ */
/* PCは2カラム、SPは1カラム */
.sm-layer-list {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -5px 20px;
}

.sm-layer {
    box-sizing: border-box;
    width: calc(50% - 10px);
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    padding: 12px 14px;
    margin: 0 5px 10px;
    background: #fff;
}

.sm-layer-head {
    margin-bottom: 8px;
}

.sm-layer-title {
    font-size: 1.05em;
    font-weight: bold;
    line-height: 1.4;
}

.sm-layer-title a {
    color: #333;
}

.sm-layer-count {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 6px;
    font-size: 0.7em;
    font-weight: normal;
    color: #666;
    background: #f0f0f0;
    border-radius: 2px;
    vertical-align: middle;
}

.sm-layer-note {
    font-size: 0.8em;
    color: #999;
    line-height: 1.5;
}

.sm-layer-date {
    margin-left: 8px;
}

/* カード幅が狭いため騰落率バーと期間表示は縦に積む */
.sm-layer-body {
    display: block;
}

.sm-layer-bar-wrap {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    min-width: 0;
}

/* 数値を主役にするためバーの幅を削って騰落率を大きく取る */
.sm-layer-ratio {
    width: 100px;
    flex: 0 0 100px;
    font-size: 1.6em;
    font-weight: bold;
    text-align: right;
    padding-right: 12px;
    line-height: 1.2;
}

.sm-bar {
    display: block;
    flex: 1 1 auto;
    height: 14px;
    background: #f2f2f2;
    border-radius: 2px;
    overflow: hidden;
    min-width: 0;
}

.sm-bar span {
    display: block;
    height: 100%;
}

.sm-bar-up {
    background: #da0000;
}

.sm-bar-down {
    background: #009944;
}

.sm-layer-period {
    list-style: none;
    padding: 0;
    margin: 8px 0 0;
    display: flex;
    justify-content: flex-end;
}

.sm-layer-period li {
    font-size: 1.15em;
    margin-left: 18px;
    white-space: nowrap;
}

/* ラベルは小さく、数値は大きく太く */
.sm-layer-period .sm-sub-label {
    font-size: 0.7em;
}

.sm-layer-period .rise,
.sm-layer-period .fall,
.sm-layer-period .stay {
    font-weight: bold;
}

.sm-layer-top {
    list-style: none;
    padding: 8px 0 0;
    margin: 8px 0 0;
    border-top: 1px dotted #e5e5e5;
    display: flex;
    flex-wrap: wrap;
}

.sm-layer-top li {
    font-size: 0.82em;
    margin-right: 18px;
    line-height: 1.8;
    white-space: nowrap;
}

/* 米国銘柄など名称が長いものは省略して折り返しを防ぐ */
.sm-layer-top li a {
    display: inline-block;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}

.sm-layer-top li span {
    margin-left: 5px;
}

/* ------------------------------------------------------------------
   S3. 銘柄ヒートマップ（簡易ツリーマップ）
------------------------------------------------------------------ */
.sm-heatmap-title {
    font-size: 1.05em;
    font-weight: bold;
    margin: 20px 0 8px;
    padding: 0;
}

.sm-heatmap-date {
    font-size: 0.75em;
    font-weight: normal;
    color: #999;
    margin-left: 10px;
}

.sm-treemap {
    margin: 0 0 5px;
}

.sm-tm-row {
    display: flex;
    /* 行高を固定してタイル描画によるレイアウトシフトを防ぐ */
    height: 76px;
    margin-bottom: 3px;
}

.sm-tile {
    display: block;
    /* flex-grow は inline style でウエートを指定する */
    flex-basis: 0;
    min-width: 0;
    margin-right: 3px;
    padding: 6px 5px;
    overflow: hidden;
    text-align: center;
    text-decoration: none;
    border-radius: 2px;
    line-height: 1.3;
}

.sm-tile:last-child {
    margin-right: 0;
}

.sm-tile:hover {
    text-decoration: none;
    opacity: 0.85;
}

.sm-tile-name {
    display: block;
    font-size: 0.78em;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.sm-tile-ratio {
    display: block;
    font-size: 0.88em;
    font-weight: bold;
    margin-top: 3px;
    white-space: nowrap;
}

/* ヒートマップ配色（上昇=赤 / 下落=緑） */
.sm-heat-u1, .sm-heat-u2, .sm-heat-d1, .sm-heat-d2, .sm-heat-flat {
    color: #333;
}

.sm-heat-u3, .sm-heat-u4, .sm-heat-d3, .sm-heat-d4 {
    color: #fff;
}

.sm-heat-u1 { background: #fbeaea; }
.sm-heat-u2 { background: #f5bcbc; }
.sm-heat-u3 { background: #e05a5a; }
.sm-heat-u4 { background: #da0000; }

.sm-heat-flat { background: #ededed; }

.sm-heat-d1 { background: #e7f4ed; }
.sm-heat-d2 { background: #b3e2c8; }
.sm-heat-d3 { background: #4cb181; }
.sm-heat-d4 { background: #009944; }

.sm-heat-na {
    background: #f7f7f7;
    color: #bbb;
}

.sm-tile.sm-heat-u1, .sm-tile.sm-heat-u2,
.sm-tile.sm-heat-d1, .sm-tile.sm-heat-d2,
.sm-tile.sm-heat-flat {
    color: #333;
}

.sm-tile.sm-heat-u3, .sm-tile.sm-heat-u4,
.sm-tile.sm-heat-d3, .sm-tile.sm-heat-d4 {
    color: #fff;
}

/* 凡例 */
.sm-legend {
    display: flex;
    justify-content: center;
    margin: 10px 0 20px;
}

.sm-legend-item {
    padding: 3px 10px;
    font-size: 0.75em;
    margin-right: 2px;
}

/* ------------------------------------------------------------------
   S4. 関連ページ導線
------------------------------------------------------------------ */
.sm-cluster-list {
    list-style: none;
    padding: 0;
    margin: 0 -5px 20px;
    display: flex;
    flex-wrap: wrap;
}

.sm-cluster-item {
    box-sizing: border-box;
    width: calc(33.333% - 10px);
    margin: 0 5px 10px;
}

.sm-cluster-item a {
    display: block;
    height: 100%;
    min-height: 72px;
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    background: #fff;
    text-decoration: none;
}

.sm-cluster-item a:hover {
    background: #fafafa;
    text-decoration: none;
}

.sm-cluster-label {
    display: block;
    font-size: 0.95em;
    font-weight: bold;
    line-height: 1.4;
    margin-bottom: 3px;
}

.sm-cluster-note {
    display: block;
    font-size: 0.78em;
    color: #888;
    line-height: 1.5;
}

/* ------------------------------------------------------------------
   SP（Bootstrap3 の 767px を境界にする）
------------------------------------------------------------------ */
@media screen and (max-width: 767px) {

    .sm-card {
        width: calc(50% - 10px);
        min-height: 156px;
    }

    .sm-card-val {
        font-size: 1.15em;
    }

    /* 工程別の強弱はSPでは1カラム */
    .sm-layer {
        width: calc(100% - 10px);
    }

    .sm-layer-top li {
        margin-right: 12px;
        font-size: 0.78em;
    }

    .sm-tm-row {
        height: 58px;
        margin-bottom: 2px;
    }

    .sm-tile {
        margin-right: 2px;
        padding: 4px 2px;
    }

    .sm-tile-name {
        font-size: 0.68em;
    }

    .sm-tile-ratio {
        font-size: 0.75em;
        margin-top: 1px;
    }

    .sm-cluster-item {
        width: calc(50% - 10px);
    }
}
