/* ================================================================
   shopto_news_override.css
   覆蓋 news.php / newsCon.php 元件樣式
   — 完全符合 shopto_design.css v2.0 設計規範 —

   主色:   #365a9e  (品牌藍, --sp-primary)
   CTA:    #F97316  (橙色, --sp-cta)
   圓角:   10px card / 6px btn
   陰影:   0 2px 12px rgba(54,90,158,.10)
   字型:   Noto Sans TC, Microsoft JhengHei
   ================================================================ */

/* ══════════════════════════════════════════════════════════════
   1. news.php — part_menu_area（分類 Tab 選單）
   ══════════════════════════════════════════════════════════════ */

.part_menu_area {
    position: sticky;
    top: var(--header-height, 70px);
    z-index: 100;

    width: 100%;
    max-width: 100%;
    margin: 0 0 24px 0;
    padding: 0;

    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    border: none;
    border-bottom: 2px solid var(--sp-border, #e8edf5);
    box-shadow: 0 2px 16px rgba(54, 90, 158, 0.08);
}

.part_menu_area ul {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0;
    padding: 0 20px;
    margin: 0;
    list-style: none;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;          /* Firefox */
}
.part_menu_area ul::-webkit-scrollbar { display: none; }

/* 隱藏原本的 "|" 分隔符 li */
.part_menu_area li {
    display: inline-flex;
    align-items: center;
    margin: 0;
    padding: 0;
    height: 52px;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.4px;
    border: none;
    flex-shrink: 0;
    position: relative;
}

/* 隱藏分隔符文字 "|" */
.part_menu_area li:not(:first-child):not(:last-child) {
    /* 不處理，靠 a 的樣式控制 */
}

/* 所有連結（含 "全部消息"） */
.part_menu_area li a,
.part_menu_area li > a {
    display: inline-flex;
    align-items: center;
    height: 100%;
    padding: 0 18px;
    font-size: 14px;
    font-weight: 500;
    color: var(--sp-text-sub, #666) !important;
    white-space: nowrap;
    text-decoration: none;
    border-bottom: 3px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
    position: relative;
    top: 2px;         /* 讓 border-bottom 對齊底邊 */
}

.part_menu_area li a:hover {
    color: var(--sp-primary, #365a9e) !important;
    background-color: var(--sp-primary-light, #eef2fb);
    border-bottom-color: var(--sp-primary, #365a9e);
}

/* 當前選中狀態 */
.part_menu_area li a.isAtive,
.part_menu_area li .isAtive {
    color: var(--sp-primary, #365a9e) !important;
    font-weight: 700 !important;
    border-bottom-color: var(--sp-primary, #365a9e) !important;
    background: transparent !important;
}

/* 隱藏純文字分隔符 "|" 的 li（沒有 <a> 子元素時） */
.part_menu_area li:not(:has(a)) {
    display: none;
}

/* 手機版 */
@media (max-width: 768px) {
    .part_menu_area {
        margin-bottom: 16px;
    }
    .part_menu_area ul {
        padding: 0 12px;
    }
    .part_menu_area li {
        height: 46px;
        font-size: 13px;
    }
    .part_menu_area li a,
    .part_menu_area li > a {
        padding: 0 14px;
        font-size: 13px;
    }
}


/* ══════════════════════════════════════════════════════════════
   2. newsCon.php — 文章容器整體佈局
   ══════════════════════════════════════════════════════════════ */

.article_containter {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 24px;
    padding: 0 20px 40px !important;
    max-width: 1240px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* ── 左欄（文章主體）── */
.acon_left {
    flex: 1 1 0;
    min-width: 0;
    width: auto !important;
    padding-right: 0 !important;
}

/* ── 右欄（Sidebar）── */
.acon_right {
    flex: 0 0 280px;
    width: 280px !important;
    position: sticky;
    top: calc(var(--header-height, 70px) + 16px);
    align-self: flex-start;

    background: var(--sp-white, #fff) !important;
    border: 1px solid var(--sp-border, #e8edf5);
    border-radius: var(--sp-card-radius, 10px);
    box-shadow: var(--sp-shadow, 0 2px 12px rgba(54,90,158,.10));
    padding: 20px 16px !important;
    overflow: visible !important;
}

/* ── 文章主體卡片 ── */
.amain_incontent {
    background: var(--sp-white, #fff) !important;
    border-radius: var(--sp-card-radius, 10px) !important;
    border: 1px solid var(--sp-border, #e8edf5) !important;
    box-shadow: var(--sp-shadow, 0 2px 12px rgba(54,90,158,.10)) !important;
    padding: 28px 32px !important;
    margin-bottom: 20px !important;
}

/* ── 文章 meta（分類 + 日期 + 瀏覽數）── */
.amain_inothermsg {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    color: var(--sp-text-light, #999) !important;
    font-size: 13px !important;
    padding: 0 0 12px 0 !important;
    border-bottom: 1px solid var(--sp-border, #e8edf5);
    margin-bottom: 16px;
}

/* nmain_classtag 在 meta 行裡 */
.amain_inothermsg .nmain_classtag {
    margin-bottom: 0 !important;
}

/* ── 分享列（sticky 優化）── */
.share_block {
    background: var(--sp-bg, #f5f7fc) !important;
    border-radius: 8px !important;
    padding: 10px 14px !important;
    margin-bottom: 20px !important;
    border: 1px solid var(--sp-border, #e8edf5) !important;

    position: sticky;
    top: calc(var(--header-height, 70px) + 8px);
    z-index: 20;
}

/* 分享按鈕群 */
.shareArea_pos {
    display: flex !important;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: flex-start;
}

/* 各分享按鈕 */
.shareArea_pos .btn {
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    font-size: 15px !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}
.shareArea_pos .btn:hover {
    transform: translateY(-2px) scale(1.08);
    box-shadow: 0 4px 12px rgba(0,0,0,0.18) !important;
}

/* ── 文章 H1 標題 ── */
.news_h1title {
    font-size: 26px !important;
    font-weight: 700 !important;
    color: var(--sp-text, #1a1a2e) !important;
    line-height: 1.5 !important;
    letter-spacing: 1px !important;
    margin-top: 4px !important;
    margin-bottom: 24px !important;
    text-align: left !important;
}

/* ── 文章內文容器 ── */
.editor_htmlcon {
    padding: 0 !important;
}

#showcon_set {
    font-size: 16px;
    line-height: 1.85;
    color: var(--sp-text, #1a1a2e);
    letter-spacing: 0.5px;
    word-wrap: break-word;
    word-break: break-word;
}

#showcon_set img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 16px 0;
}

/* ── 返回列表按鈕區 ── */
.news_bbtnblock {
    text-align: center !important;
    padding: 32px 0 24px !important;
    border-top: 1px solid var(--sp-border, #e8edf5);
    margin-top: 24px;
}

/* 使用 sendv2_btn 原有類別，升級樣式 */
.sendv2_btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: transparent !important;
    color: var(--sp-primary, #365a9e) !important;
    border: 1.5px solid var(--sp-primary, #365a9e) !important;
    border-radius: 50px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    padding: 10px 32px !important;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.22s ease !important;
}
.sendv2_btn::before {
    content: '←';
    font-style: normal;
    margin-right: 2px;
}
.sendv2_btn:hover {
    background: var(--sp-primary, #365a9e) !important;
    color: #fff !important;
    transform: translateX(-3px);
    box-shadow: 0 4px 16px rgba(54, 90, 158, 0.28) !important;
}

/* ── 留言區塊 ── */
.cpost_block {
    margin-top: 4px;
}


/* ══════════════════════════════════════════════════════════════
   3. newsCon.php — 右側 Sidebar 元件
   ══════════════════════════════════════════════════════════════ */

/* Sidebar 區塊標題（分類 / 可能感興趣 / 熱門情報） */
.newsget_title,
.newshotget_title {
    display: block !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    letter-spacing: 2px !important;
    text-transform: uppercase;
    padding: 0 0 10px 0 !important;
    margin: 0 0 0 0 !important;
    color: var(--sp-text-sub, #666) !important;
    background: none !important;
    clip-path: none !important;
}

.newsget_hr,
.newshotget_hr {
    display: block !important;
    width: 100% !important;
    height: 1px !important;
    background-color: var(--sp-border, #e8edf5) !important;
    border-bottom: none !important;
    margin-bottom: 14px !important;
}

/* 分類 Sidebar 區塊間距 */
.acon_right h3 + .newsget_hr,
.acon_right h3 + .newshotget_hr {
    margin-top: 0;
}

/* ── 分類列表 nclass_ul / aclass_ul ── */
ul.nclass_ul,
ul.aclass_ul {
    width: 100% !important;
    list-style: none;
    padding: 0;
    margin: 0 0 24px 0 !important;
}

ul.nclass_ul li,
ul.aclass_ul li {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 9px 10px !important;
    font-size: 14px !important;
    color: var(--sp-text-sub, #666) !important;
    border-bottom: 1px solid var(--sp-border, #e8edf5) !important;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease !important;
}

ul.nclass_ul li:last-child,
ul.aclass_ul li:last-child {
    border-bottom: none !important;
}

ul.nclass_ul li:hover,
ul.aclass_ul li:hover {
    background: var(--sp-primary-light, #eef2fb) !important;
    color: var(--sp-primary, #365a9e) !important;
}

ul.nclass_ul li.active,
ul.nclass_ul li.active a,
ul.aclass_ul li.active,
ul.aclass_ul li.active a {
    background: var(--sp-primary-light, #eef2fb) !important;
    color: var(--sp-primary, #365a9e) !important;
    font-weight: 700 !important;
}

.aclass_liname {
    flex: 1;
    line-height: 1.5;
    letter-spacing: 0.5px !important;
    width: auto !important;
    font-size: 14px;
}

.aclass_nums {
    flex-shrink: 0;
    width: auto !important;
    min-width: 36px;
    text-align: right;
    font-size: 12px;
    color: var(--sp-text-light, #999);
    background: var(--sp-bg, #f5f7fc);
    border-radius: 20px;
    padding: 1px 7px;
}

ul.nclass_ul li.active .aclass_nums,
ul.aclass_ul li.active .aclass_nums {
    background: var(--sp-primary, #365a9e);
    color: #fff;
}

/* ── 感興趣列表 interest_ul ── */
ul.interest_ul {
    width: 100% !important;
    list-style: none;
    padding: 0;
    margin: 0 0 24px 0 !important;
    counter-reset: myli 0;
}

ul.interest_ul li {
    display: flex !important;
    align-items: flex-start;
    gap: 10px;
    padding: 9px 6px !important;
    font-size: 14px;
    color: var(--sp-text-sub, #666) !important;
    border-bottom: 1px solid var(--sp-border, #e8edf5) !important;
    border-radius: 0;
    cursor: pointer;
    transition: color 0.18s ease !important;
    counter-increment: myli 1;
}

ul.interest_ul li:last-child {
    border-bottom: none !important;
}

ul.interest_ul li::before {
    content: counter(myli);
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 20px !important;
    height: 20px !important;
    border-radius: 4px !important;
    background: var(--sp-primary-light, #eef2fb) !important;
    color: var(--sp-primary, #365a9e) !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    margin-top: 2px;
    margin-right: 0;
}

ul.interest_ul li a {
    flex: 1;
    width: auto !important;
    font-size: 14px;
    line-height: 1.5;
    color: var(--sp-text-sub, #666) !important;
    transition: color 0.18s ease !important;
}

ul.interest_ul li:hover a {
    color: var(--sp-primary, #365a9e) !important;
}

/* ── 熱門情報 hotnews_ul ── */
ul.hotnews_ul {
    width: 100% !important;
    list-style: none;
    padding: 0;
    margin: 0 0 8px 0 !important;
}

ul.hotnews_ul li {
    display: flex !important;
    align-items: flex-start;
    gap: 8px;
    padding: 9px 6px !important;
    font-size: 14px;
    color: var(--sp-text-sub, #666) !important;
    border-bottom: 1px solid var(--sp-border, #e8edf5) !important;
    cursor: pointer;
    transition: color 0.18s ease !important;
}

ul.hotnews_ul li:last-child {
    border-bottom: none !important;
}

ul.hotnews_ul li::before {
    font-family: 'icomoon' !important;
    content: '\ea57';
    flex-shrink: 0;
    display: inline-block !important;
    width: 18px !important;
    font-size: 13px !important;
    color: var(--sp-cta, #F97316) !important;
    margin-right: 0 !important;
    margin-top: 2px;
}

ul.hotnews_ul li a {
    flex: 1;
    width: auto !important;
    font-size: 14px;
    line-height: 1.5;
    color: var(--sp-text-sub, #666) !important;
    transition: color 0.18s ease !important;
}

ul.hotnews_ul li:hover a {
    color: var(--sp-cta, #F97316) !important;
}


/* ══════════════════════════════════════════════════════════════
   4. RWD — 響應式斷點
   ══════════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
    .article_containter {
        gap: 18px;
        padding: 0 16px 32px !important;
    }
    .acon_right {
        flex: 0 0 240px;
        width: 240px !important;
    }
}

@media (max-width: 768px) {
    /* 平板/手機：取消左右並排，改為垂直堆疊 */
    .article_containter {
        flex-direction: column !important;
        gap: 16px;
        padding: 0 12px 28px !important;
    }

    .acon_left {
        width: 100% !important;
    }

    .acon_right {
        flex: none;
        width: 100% !important;
        position: static !important;  /* 手機不 sticky */
        border-radius: var(--sp-card-radius, 10px);
        padding: 16px !important;
    }

    .amain_incontent {
        padding: 18px 16px !important;
    }

    .news_h1title {
        font-size: 21px !important;
        margin-bottom: 16px !important;
    }

    .share_block {
        position: static !important;  /* 手機不 sticky */
    }
}

@media (max-width: 480px) {
    .amain_incontent {
        padding: 14px 12px !important;
    }
    .news_h1title {
        font-size: 19px !important;
    }
    #showcon_set {
        font-size: 15px;
    }
}
