/* =========================================================
   C# .NET 專案開發服務頁（/service/dotnet）專用樣式
   以 sd- 為前綴，避免與 service.css 其他服務頁的樣式互相干擾
   ========================================================= */

/* 設計變數：集中管理色彩，所有文字配色皆已確認符合 AA 對比度 4.5:1 */
.sd-page {
    --sd-ink: #1a1340; /* 深紫：標題與深色區塊背景 */
    --sd-violet: #512bd4; /* .NET 官方品牌紫：與白色對比約 7.9:1，可直接用於小字與按鈕 */
    --sd-violet-soft: #f3f0fd; /* 淺紫：圖示底色與標籤背景 */
    --sd-light: #c4b5fd; /* 深色區塊上的淺紫文字：與深紫背景對比約 9.4:1 */
    --sd-blue: #1170b7; /* 品牌主色，沿用網站既有藍色，用於焦點框 */
    --sd-text: #1f2937; /* 內文主色 */
    --sd-muted: #4b5563; /* 次要文字，與白色對比約 7.5:1 */
    --sd-line: #e5e7eb; /* 分隔線與卡片框線 */
    --sd-bg-alt: #f8f7fc; /* 交錯區塊背景，帶一點紫色調與主色協調 */
    --sd-radius: 16px; /* 卡片與圖片統一圓角 */
    --sd-shadow: 0 12px 32px rgba(26, 19, 64, 0.1); /* 統一陰影，營造浮起層次 */

    display: block; /* main 在舊瀏覽器預設為 inline，明確指定避免版面錯亂 */
    overflow-x: clip; /* 裁切 AOS 滑入動畫的初始位移，避免手機出現水平捲軸；不用 hidden 是因為會讓本頁導覽的 sticky 失效 */
    color: var(--sd-text);
    font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif; /* 中文優先使用 layouts 已載入的 Noto Sans TC */
    line-height: 1.8; /* 中文長段落閱讀較舒適的行高 */
    letter-spacing: 0.03em;
}

/* 跳到主要內容後 main 會取得焦點，但 main 本身不需要顯示焦點框 */
.sd-page:focus {
    outline: none;
}

/* 錨點跳轉時預留固定選單與本頁導覽的高度，避免標題被遮住 */
.sd-page [id],
#contact {
    scroll-margin-top: 130px;
}

/* 使用者點擊本頁錨點時平滑捲動；偏好減少動態者維持瞬間跳轉 */
@media (prefers-reduced-motion: no-preference) {
    html:has(.sd-page) {
        scroll-behavior: smooth;
    }
}

/* ---------- 共用：按鈕 ---------- */

.sd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px; /* 觸控目標至少 44px，方便手指點擊 */
    padding: 10px 26px;
    border: 2px solid transparent;
    border-radius: 999px; /* 膠囊形按鈕，與網站浮動按鈕風格一致 */
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}

.sd-btn:hover {
    transform: translateY(-2px); /* 輕微上浮，提示可點擊 */
}

.sd-btn img {
    width: 20px;
    height: 20px;
}

/* LINE 按鈕：使用 LINE 官方綠色加深版，白字對比約 4.6:1 */
.sd-btn-line {
    background-color: #06833a;
    color: #fff;
}

.sd-btn-line:hover,
.sd-btn-line:focus {
    background-color: #056b30;
    color: #fff;
}

/* 淺色背景上的次要按鈕：紫框 */
.sd-btn-outline {
    border-color: var(--sd-violet);
    background-color: #fff;
    color: var(--sd-violet);
}

.sd-btn-outline:hover,
.sd-btn-outline:focus {
    background-color: var(--sd-violet);
    color: #fff;
}

/* 深色背景上的次要按鈕：白框白字 */
.sd-btn-outline-light {
    border-color: rgba(255, 255, 255, 0.7);
    color: #fff;
}

.sd-btn-outline-light:hover,
.sd-btn-outline-light:focus {
    background-color: #fff;
    color: var(--sd-ink);
}

/* 鍵盤焦點：加粗外框並與元素保留距離，淺色背景使用品牌藍 */
.sd-btn:focus-visible,
.sd-toc a:focus-visible,
.sd-service-note a:focus-visible,
.sd-related a:focus-visible,
.sd-faq-item summary:focus-visible {
    outline: 3px solid var(--sd-blue);
    outline-offset: 3px;
}

/* 深色的行動呼籲區改用亮黃色焦點框，藍色在深色底上看不清楚 */
.sd-cta .sd-btn:focus-visible {
    outline-color: #ffbf47;
}

/* ---------- 共用：區塊、標題與圖示 ---------- */

.sd-section {
    padding: 88px 0;
}

/* 交錯背景：讓長頁面的段落邊界更清楚 */
.sd-section-alt {
    background-color: var(--sd-bg-alt);
}

.sd-section-head {
    max-width: 780px;
    margin: 0 auto 56px;
    text-align: center;
}

/* 英文小標：增加視覺層次，左側短線引導視線到標題 */
.sd-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 10px;
    color: var(--sd-violet);
    font-family: Montserrat, sans-serif;
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.sd-eyebrow::before {
    content: "";
    width: 28px;
    height: 2px;
    background-color: currentColor;
}

.sd-title {
    margin: 0 0 16px;
    color: var(--sd-ink);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.45;
}

.sd-desc {
    margin: 0;
    color: var(--sd-muted);
    font-size: 1.0625rem;
}

/* 圓角方形圖示底：多個區塊共用 */
.sd-icon {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background-color: var(--sd-violet-soft);
    color: var(--sd-violet);
    font-size: 1.375rem;
}

/* ---------- 首屏 ---------- */

.sd-hero {
    position: relative;
    padding: 72px 0 96px;
    overflow: hidden; /* 裁切背景光暈，避免產生水平捲軸 */
    background: linear-gradient(160deg, #f3f0fd 0%, #ffffff 55%, #eef2ff 100%);
}

/* 右上角紫色光暈：呼應 .NET 品牌色，不使用圖片以節省流量 */
.sd-hero-glow {
    position: absolute;
    top: -180px;
    right: -140px;
    width: 560px;
    height: 560px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(81, 43, 212, 0.16) 0%, rgba(81, 43, 212, 0) 70%);
    pointer-events: none; /* 不攔截滑鼠事件 */
}

/* 內容需疊在裝飾之上 */
.sd-hero .container {
    position: relative;
}

.sd-hero-title {
    margin: 0 0 20px;
    color: var(--sd-ink);
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.3;
}

.sd-hero-subtitle {
    display: block;
    margin-top: 8px;
    color: var(--sd-violet);
    font-size: 1.5rem;
    font-weight: 700;
}

.sd-hero-lead {
    max-width: 560px;
    margin: 0 0 32px;
    color: var(--sd-muted);
    font-size: 1.0625rem;
}

.sd-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 40px;
}

/* 核心數據：三欄等寬，以左側線條分隔 */
.sd-hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: 540px;
    margin: 0;
}

.sd-hero-stats div {
    display: flex;
    flex-direction: column-reverse; /* HTML 中說明（dt）在前符合語意，畫面上數值在上較醒目 */
    padding-left: 16px;
    border-left: 3px solid #ddd6fe;
}

.sd-hero-stats dt {
    color: var(--sd-muted);
    font-size: 0.875rem;
    font-weight: 400;
}

.sd-hero-stats dd {
    margin: 0;
    color: var(--sd-ink);
    font-family: Montserrat, "Noto Sans TC", sans-serif;
    font-size: 1.625rem;
    font-weight: 700;
    line-height: 1.3;
}

/* ---------- 首屏：系統架構示意 ---------- */

.sd-arch-wrap {
    max-width: 540px;
    margin: 0 auto;
}

.sd-arch {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 28px;
    border: 1px solid var(--sd-line);
    border-radius: var(--sd-radius);
    background-color: #fff;
    box-shadow: 0 30px 60px rgba(26, 19, 64, 0.14);
    letter-spacing: 0;
}

.sd-arch-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
}

/* 一般節點：圖示在上、名稱在下的小卡片 */
.sd-arch-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 8px;
    border: 1px solid #e9e5fb;
    border-radius: 12px;
    background-color: #faf9fe;
    color: var(--sd-ink);
    font-size: 0.875rem;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
}

.sd-arch-node i {
    color: var(--sd-violet);
    font-size: 1.25rem;
}

/* 連接線：上下層之間的虛線，中央的小圓點沿線移動表示資料流動 */
.sd-arch-link {
    position: relative;
    width: 2px;
    height: 36px;
    background-image: linear-gradient(var(--sd-violet) 50%, transparent 50%);
    background-size: 2px 8px;
    opacity: 0.5;
}

.sd-arch-link::after {
    content: "";
    position: absolute;
    top: 0;
    left: -3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--sd-violet);
}

@media (prefers-reduced-motion: no-preference) {
    .sd-arch-link::after {
        animation: sd-flow 2s ease-in-out infinite;
    }
}

@keyframes sd-flow {
    0% {
        top: 0;
        opacity: 0;
    }

    30%,
    70% {
        opacity: 1;
    }

    100% {
        top: calc(100% - 8px);
        opacity: 0;
    }
}

/* 核心服務節點：以品牌紫實心底強調，為整張圖的視覺中心 */
.sd-arch-core {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 18px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--sd-violet) 0%, #3b1fa3 100%);
    color: #fff;
    text-align: center;
    box-shadow: 0 12px 24px rgba(81, 43, 212, 0.3);
}

.sd-arch-core b {
    font-family: Montserrat, sans-serif;
    font-size: 1.125rem;
}

.sd-arch-core small {
    color: #ddd6fe; /* 與品牌紫背景對比約 5.7:1 */
    font-size: 0.8125rem;
}

.sd-arch-caption {
    margin-top: 14px;
    color: #64748b; /* 與白色對比約 4.8:1 */
    font-size: 0.8125rem;
    text-align: center;
}

/* ---------- 本頁導覽 ---------- */

/* 捲動時固定在選單下方，長頁面隨時可跳轉段落 */
.sd-toc {
    position: sticky;
    top: 70px;
    z-index: 10;
    border-top: 1px solid var(--sd-line);
    border-bottom: 1px solid var(--sd-line);
    background-color: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(8px); /* 半透明底搭配模糊，捲過內容時文字仍清楚 */
}

.sd-toc ul {
    display: flex;
    gap: 4px;
    margin: 0;
    padding: 10px 0;
    overflow-x: auto; /* 手機上項目過多時改為水平滑動，不換成多行佔用版面 */
    list-style: none;
    scrollbar-width: none; /* 隱藏捲軸保持版面乾淨，仍可滑動 */
}

.sd-toc ul::-webkit-scrollbar {
    display: none;
}

/* 以首尾 auto 外距置中：空間足夠時置中，項目溢出時外距歸零，不像 justify-content: center 會把第一項裁到捲動範圍外 */
.sd-toc li:first-child {
    margin-left: auto;
}

.sd-toc li:last-child {
    margin-right: auto;
}

.sd-toc a {
    display: block;
    padding: 8px 16px;
    border-radius: 999px;
    color: var(--sd-muted);
    font-size: 0.9375rem;
    white-space: nowrap; /* 避免項目文字被擠成兩行 */
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
}

.sd-toc a:hover,
.sd-toc a:focus {
    background-color: var(--sd-violet-soft);
    color: var(--sd-violet);
}

/* ---------- 關於 C# .NET ---------- */

.sd-about {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sd-about li {
    display: flex;
    gap: 16px;
    padding: 22px;
    border: 1px solid var(--sd-line);
    border-radius: var(--sd-radius);
    background-color: #fff;
}

.sd-about h3 {
    margin: 0 0 4px;
    color: var(--sd-ink);
    font-size: 1.125rem;
    font-weight: 700;
}

.sd-about p {
    margin: 0;
    color: var(--sd-muted);
    font-size: 0.9375rem;
    line-height: 1.7;
}

/* ---------- 外包優勢 ---------- */

.sd-advantages {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sd-advantages li {
    position: relative;
    padding: 32px 28px;
    overflow: hidden; /* 裁切右上角的大序號 */
    border-radius: var(--sd-radius);
    background-color: #fff;
    box-shadow: 0 4px 16px rgba(26, 19, 64, 0.06);
    transition: box-shadow 0.25s, transform 0.25s;
}

.sd-advantages li:hover {
    box-shadow: var(--sd-shadow);
    transform: translateY(-4px);
}

/* 右上角大序號：淺色裝飾數字，作為卡片的視覺錨點 */
.sd-advantage-no {
    position: absolute;
    top: 12px;
    right: 20px;
    color: #efebfd;
    font-family: Montserrat, sans-serif;
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1;
}

.sd-advantages .sd-icon {
    position: relative; /* 疊在大序號上方 */
    margin-bottom: 18px;
}

.sd-advantages h3 {
    position: relative;
    margin: 0 0 10px;
    color: var(--sd-ink);
    font-size: 1.25rem;
    font-weight: 700;
}

.sd-advantages p {
    margin: 0;
    color: var(--sd-muted);
    font-size: 0.9375rem;
    line-height: 1.75;
}

/* ---------- 服務項目 ---------- */

.sd-services {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sd-services li {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border: 1px solid var(--sd-line);
    border-radius: 12px;
    background-color: #fff;
    color: var(--sd-ink);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.5;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.sd-services li:hover {
    border-color: #d9d0fa;
    box-shadow: 0 6px 18px rgba(26, 19, 64, 0.08);
}

.sd-services .sd-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 1.125rem;
}

.sd-service-note {
    margin: 36px 0 0;
    color: var(--sd-muted);
    text-align: center;
}

.sd-service-note a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 8px;
    color: var(--sd-violet);
    font-weight: 700;
    text-decoration: none;
}

.sd-service-note a:hover {
    text-decoration: underline;
}

/* ---------- 舊系統升級移轉 ---------- */

.sd-upgrade {
    position: relative;
    padding: 88px 0;
    overflow: hidden;
    background: linear-gradient(135deg, var(--sd-ink) 0%, #2e1a6b 100%);
    color: #fff;
}

.sd-upgrade .sd-eyebrow {
    color: var(--sd-light);
}

.sd-upgrade h2 {
    margin: 0 0 16px;
    color: #fff;
    font-size: 1.875rem;
    font-weight: 700;
    line-height: 1.45;
}

.sd-upgrade p {
    color: rgba(255, 255, 255, 0.88);
}

/* 舊版風險清單：以警示圖示提醒 */
.sd-risks {
    margin: 24px 0 0;
    padding: 0;
    list-style: none;
}

.sd-risks li {
    position: relative;
    padding: 6px 0 6px 30px;
    color: #fff;
}

.sd-risks li::before {
    content: "\f071";
    position: absolute;
    top: 7px;
    left: 0;
    color: #fbbf24; /* 琥珀色警示：與深色背景對比足夠，且直覺表達風險 */
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
}

/* 新舊對照示意：上下兩張卡片以箭頭連接，表達移轉方向 */
.sd-migrate {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    max-width: 360px;
    margin: 0 auto;
}

.sd-migrate-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 20px 24px;
    border-radius: var(--sd-radius);
    text-align: center;
}

.sd-migrate-card small {
    font-size: 0.8125rem;
    letter-spacing: 0.1em;
}

.sd-migrate-card b {
    font-family: Montserrat, "Noto Sans TC", sans-serif;
    font-size: 1.5rem;
    line-height: 1.4;
}

.sd-migrate-card em {
    font-size: 0.9375rem;
    font-style: normal;
}

/* 改版前：虛線框與淡色文字，呈現「過時」的視覺印象 */
.sd-migrate-card.is-old {
    border: 2px dashed rgba(255, 255, 255, 0.3);
    color: var(--sd-light);
}

/* 升級移轉後：白底實心卡片，視覺上明顯較新、較穩固 */
.sd-migrate-card.is-new {
    background-color: #fff;
    color: var(--sd-ink);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.25);
}

.sd-migrate-card.is-new small {
    color: var(--sd-violet);
    font-weight: 700;
}

.sd-migrate-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--sd-violet);
    color: #fff;
}

/* 升級步驟：四欄橫向排列，以計數器產生序號 */
.sd-upgrade-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    margin: 56px 0 0;
    padding: 0;
    list-style: none;
    counter-reset: sd-upgrade;
}

.sd-upgrade-steps li {
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--sd-radius);
    background-color: rgba(255, 255, 255, 0.06);
    counter-increment: sd-upgrade;
}

.sd-upgrade-steps li::before {
    content: "STEP " counter(sd-upgrade);
    display: block;
    margin-bottom: 8px;
    color: var(--sd-light);
    font-family: Montserrat, sans-serif;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.1em;
}

.sd-upgrade-steps h3 {
    margin: 0 0 6px;
    color: #fff;
    font-size: 1.125rem;
    font-weight: 700;
}

.sd-upgrade-steps p {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.7;
}

/* ---------- 技術能力 ---------- */

.sd-stack {
    max-width: 860px;
    margin: 0 auto;
    text-align: center;
}

.sd-frameworks,
.sd-tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* 框架：較大的實心標籤 */
.sd-frameworks li {
    padding: 10px 28px;
    border-radius: 999px;
    background-color: var(--sd-violet);
    color: #fff;
    font-family: Montserrat, sans-serif;
    font-size: 1.125rem;
    font-weight: 700;
}

/* 技術領域：較小的框線標籤 */
.sd-tags {
    margin: 24px 0 36px;
}

.sd-tags li {
    padding: 6px 16px;
    border: 1px solid #ddd6fe;
    border-radius: 999px;
    background-color: #fff;
    color: var(--sd-ink);
    font-size: 0.9375rem;
}

/* ---------- 外包流程 ---------- */

.sd-process {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: sd-step; /* 以 CSS 計數器產生步驟編號，增減步驟時不需手動調整 */
}

.sd-process li {
    position: relative;
    padding: 30px 16px 24px;
    border: 1px solid var(--sd-line);
    border-radius: var(--sd-radius);
    background-color: #fff;
    text-align: center;
    counter-increment: sd-step;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.sd-process li:hover {
    border-color: #d9d0fa;
    box-shadow: var(--sd-shadow);
}

/* 步驟序號：卡片上緣置中的小圓標 */
.sd-process li::before {
    content: counter(sd-step, decimal-leading-zero);
    position: absolute;
    top: -14px;
    left: 50%;
    padding: 2px 12px;
    border-radius: 999px;
    background-color: var(--sd-violet);
    color: #fff;
    font-family: Montserrat, sans-serif;
    font-size: 0.8125rem;
    font-weight: 700;
    transform: translateX(-50%);
}

.sd-process .sd-icon {
    margin-bottom: 14px;
}

.sd-process h3 {
    margin: 0 0 8px;
    color: var(--sd-ink);
    font-size: 1.125rem;
    font-weight: 700;
}

.sd-process p {
    margin: 0;
    color: var(--sd-muted);
    font-size: 0.9375rem;
    line-height: 1.7;
}

/* ---------- 常見問題 ---------- */

.sd-faq {
    max-width: 860px;
    margin: 0 auto;
}

.sd-faq-item {
    margin-bottom: 14px;
    border: 1px solid var(--sd-line);
    border-radius: var(--sd-radius);
    background-color: #fff;
    transition: box-shadow 0.2s, border-color 0.2s;
}

.sd-faq-item[open] {
    border-color: #d9d0fa;
    box-shadow: var(--sd-shadow);
}

.sd-faq-item summary {
    position: relative;
    padding: 20px 60px 20px 24px;
    border-radius: var(--sd-radius);
    cursor: pointer;
    list-style: none; /* 移除預設三角形，改用自訂圖示 */
}

/* Safari 需另外移除預設三角形 */
.sd-faq-item summary::-webkit-details-marker {
    display: none;
}

/* 自訂展開圖示：圓形底加號，展開時旋轉成叉號，視覺呈現開合狀態 */
.sd-faq-item summary::after {
    content: "\f067";
    position: absolute;
    top: 50%;
    right: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: var(--sd-violet-soft);
    color: var(--sd-violet);
    font-family: "Font Awesome 5 Free";
    font-size: 0.8125rem;
    font-weight: 900;
    transform: translateY(-50%);
    transition: transform 0.2s, background-color 0.2s, color 0.2s;
}

.sd-faq-item[open] summary::after {
    background-color: var(--sd-violet);
    color: #fff;
    transform: translateY(-50%) rotate(45deg);
}

.sd-faq-item summary h3 {
    display: inline; /* 標題在 summary 內維持行內，避免多出額外行距 */
    margin: 0;
    color: var(--sd-ink);
    font-size: 1.125rem;
    font-weight: 700;
}

.sd-faq-item p {
    margin: 0;
    padding: 0 24px 22px;
    color: var(--sd-muted);
}

/* ---------- 相關服務 ---------- */

.sd-related {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sd-related a {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 24px;
    border: 1px solid var(--sd-line);
    border-radius: var(--sd-radius);
    background-color: #fff;
    color: inherit;
    text-decoration: none;
    transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}

.sd-related a:hover,
.sd-related a:focus {
    border-color: #d9d0fa;
    box-shadow: var(--sd-shadow);
    transform: translateY(-3px);
}

.sd-related .sd-icon {
    margin-bottom: 16px;
}

.sd-related-title {
    margin-bottom: 6px;
    color: var(--sd-ink);
    font-size: 1.125rem;
    font-weight: 700;
}

/* 標題後方的箭頭：提示整張卡片可點擊 */
.sd-related-title::after {
    content: "\f061";
    margin-left: 8px;
    color: var(--sd-violet);
    font-family: "Font Awesome 5 Free";
    font-size: 0.875rem;
    font-weight: 900;
    transition: margin-left 0.2s;
}

.sd-related a:hover .sd-related-title::after {
    margin-left: 12px;
}

.sd-related-text {
    color: var(--sd-muted);
    font-size: 0.9375rem;
    line-height: 1.7;
}

/* ---------- 行動呼籲 ---------- */

.sd-cta {
    position: relative;
    padding: 80px 0;
    overflow: hidden;
    background: linear-gradient(135deg, var(--sd-ink) 0%, var(--sd-violet) 100%);
    color: #fff;
    text-align: center;
}

/* 背景大圓形裝飾，增加深色區塊的層次 */
.sd-cta::before {
    content: "";
    position: absolute;
    top: -160px;
    right: -160px;
    width: 520px;
    height: 300px;
    border: 50px solid rgba(255, 255, 255, 0.06);
    border-radius: 50%;
}

.sd-cta .container {
    position: relative;
}

.sd-cta h2 {
    margin: 0 0 12px;
    color: #fff;
    font-size: 2rem;
    font-weight: 700;
}

.sd-cta p {
    margin: 0 0 32px;
    color: rgba(255, 255, 255, 0.88);
    font-size: 1.0625rem;
}

.sd-cta-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
}

/* ---------- 響應式：大型平板與小筆電 ---------- */

@media (max-width: 1199.98px) {
    /* 六欄過擠，改為三欄兩列 */
    .sd-process {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        row-gap: 36px; /* 預留步驟序號凸出卡片上緣的空間 */
    }

    .sd-services {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .sd-hero-title {
        font-size: 2.5rem;
    }
}

/* ---------- 響應式：平板 ---------- */

@media (max-width: 991.98px) {
    .sd-section,
    .sd-upgrade {
        padding: 64px 0;
    }

    .sd-hero {
        padding: 48px 0 64px;
        text-align: center;
    }

    .sd-hero .sd-eyebrow::before {
        display: none; /* 置中排版時左側短線會讓標題看起來偏移 */
    }

    .sd-hero-lead,
    .sd-hero-stats {
        margin-right: auto;
        margin-left: auto;
    }

    .sd-hero-actions {
        justify-content: center;
    }

    .sd-hero-stats div {
        padding-left: 0;
        border-left: 0;
    }

    /* 平板以下選單高度改變，導覽列不再固定，避免與展開的選單重疊 */
    .sd-toc {
        position: static;
    }

    /* 關於 C# .NET 的標題區改為置中，與其他區塊標題一致 */
    #sd-about .col-lg-5 {
        text-align: center;
    }

    .sd-advantages,
    .sd-related,
    .sd-upgrade-steps {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

}

/* ---------- 響應式：手機 ---------- */

@media (max-width: 575.98px) {
    .sd-section,
    .sd-upgrade {
        padding: 52px 0;
    }

    .sd-title,
    .sd-cta h2,
    .sd-upgrade h2 {
        font-size: 1.5rem;
    }

    .sd-hero-title {
        font-size: 2rem;
    }

    .sd-hero-subtitle {
        font-size: 1.125rem;
    }

    .sd-hero-stats dd {
        font-size: 1.125rem;
    }

    /* 手機按鈕滿版，觸控更容易 */
    .sd-hero-actions .sd-btn,
    .sd-cta-actions .sd-btn {
        width: 100%;
    }

    /* 手機寬度較窄，縮小架構示意的內距與節點字級，三欄節點才排得下 */
    .sd-arch {
        padding: 22px 14px;
    }

    .sd-arch-row {
        gap: 8px;
    }

    .sd-arch-node {
        padding: 12px 4px;
        font-size: 0.75rem;
        white-space: normal; /* 允許換行，避免節點名稱超出卡片 */
    }

    .sd-about,
    .sd-advantages,
    .sd-process,
    .sd-related,
    .sd-upgrade-steps {
        grid-template-columns: minmax(0, 1fr);
    }

    .sd-services {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    /* 兩欄服務方塊較窄，改為圖示在上、文字在下 */
    .sd-services li {
        flex-direction: column;
        gap: 10px;
        padding: 16px 12px;
        font-size: 0.9375rem;
        text-align: center;
    }

    .sd-service-note a {
        display: flex;
        justify-content: center;
        margin: 8px 0 0;
    }
}
