/*
 * article-style-standard.css
 * 阿偉的物理 x AI 實驗室 — 教學文章正式樣式
 *
 * 由既有文章基礎樣式與兩篇試作文章驗證後的正式規則合併而成。
 * 僅由已完成遷移的文章載入，不影響仍使用 article-style.css 的舊文章。
 * 版本 2.0 | 2026-07-24
 */

/* ============================================================
   article-style.css — 阿偉的物理 x AI 實驗室
   教學文章統一樣式表 (Article Template Style)
   版本 1.0 | 2026-04
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500;700&family=Noto+Sans+TC:wght@400;500;700;900&display=swap');

/* ── CSS 品牌變數（繼承主站風格，並加入 Apple 設計微調）── */
:root {
    --art-max-width:     800px;
    --art-navbar-h:      60px;

    --brand-primary:    #657954;
    --brand-dark:       #4a5a3d;
    --brand-light:      #e8ede3;
    --action-blue:      #3B82F6;
    
    --text-main:        #1d1d1f; 
    --text-muted:       #86868b;
    --bg-page:          #fbfbfd;
    --bg-light:         #f5f5f7;
    --bg-white:         #ffffff;
    --bg-glass:         rgba(255, 255, 255, 0.75);
    
    --border-color:     #E2E8F0;
    --border-glass:     rgba(255, 255, 255, 0.6);
    --shadow-sm:        0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md:        0 4px 16px rgba(0, 0, 0, 0.06);
    --shadow-lg:        0 8px 32px rgba(0, 0, 0, 0.08);
    --shadow-apple:     0 2px 12px rgba(0,0,0,0.03), 0 12px 32px rgba(0,0,0,0.06);
    
    --radius-sm:        8px;
    --radius-md:        12px;
    --radius-lg:        18px;
}

/* ── 全局重置 ── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro TC", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
    background: radial-gradient(circle at top center, #ffffff 0%, var(--bg-light) 100%);
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.75;
    letter-spacing: 0.01em;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
}

/* ============================================================
   NAVBAR（簡易文章頁頂欄）
   【注意】文章頁面嵌入 App Shell iframe 時，以下 Navbar 樣式不會作用。
   僅在「獨立瀏覽」模式（直接開啟 .html 檔案）時才需要此樣式。
   ============================================================ */
.art-navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--art-navbar-h);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    gap: 16px;
}

.art-navbar-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--brand-primary);
    font-weight: 900;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
    white-space: nowrap;
    transition: opacity 0.2s;
}
.art-navbar-logo:hover { opacity: 0.75; }

.art-back-btn {
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    padding: 6px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    white-space: nowrap;
}
.art-back-btn:hover {
    background: var(--brand-light);
    color: var(--brand-primary);
    border-color: var(--brand-primary);
}

/* ============================================================
   主內容框架
   ============================================================ */
.art-main {
    width: 100%;
    padding-bottom: 60px;
}

/* ── 窄版容器：限制文字最大閱讀寬度，左右置中 ── */
.art-container {
    max-width: var(--art-max-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* ── 寬版容器：供模擬器使用，突破文字閱讀寬度限制 ── */
/* ★ art-container-wide：最大寬 1200px，模擬器在大螢幕可以充分展開 */
.art-container-wide {
    max-width: 1200px;
    width: 100%;          /* 手機版自動縮小至螢幕寬度，不會爆版 */
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================================================
   HERO 主視覺區
   ============================================================ */
.art-hero {
    background: linear-gradient(
        135deg,
        var(--brand-dark) 0%,
        var(--brand-primary) 60%,
        #7a9468 100%
    );
    color: #ffffff;
    padding: 56px 0 48px;
    position: relative;
    overflow: hidden;
}

/* 裝飾性背景圓圈 */
.art-hero::before {
    content: '';
    position: absolute;
    top: -80px;
    right: -80px;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    pointer-events: none;
}
.art-hero::after {
    content: '';
    position: absolute;
    bottom: -60px;
    left: -60px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    pointer-events: none;
}

/* 麵包屑導航 */
.art-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.art-breadcrumb a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.2s;
}
.art-breadcrumb a:hover { color: #fff; }
.art-breadcrumb .art-current-page { color: rgba(255, 255, 255, 0.5); }

/* 主標題 */
.art-hero-title {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 900;
    line-height: 1.25;
    letter-spacing: -0.5px;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

/* 副標 */
.art-hero-subtitle {
    font-size: clamp(0.95rem, 2vw, 1.1rem);
    color: rgba(255, 255, 255, 0.88);
    line-height: 1.7;
    max-width: 600px;
    margin-bottom: 24px;
    position: relative;
    z-index: 1;
}

/* Meta 標籤列 */
.art-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.art-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}
.art-tag-mechanics {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.25);
}
.art-tag-kinematics {
    background: rgba(59, 130, 246, 0.25);
    color: #ffffff;
    border: 1px solid rgba(59, 130, 246, 0.4);
}
.art-tag-em {
    background: rgba(139, 92, 246, 0.25);
    color: #ffffff;
    border: 1px solid rgba(139, 92, 246, 0.4);
}
.art-tag-measurement {
    background: rgba(13, 148, 136, 0.25);
    color: #ffffff;
    border: 1px solid rgba(13, 148, 136, 0.4);
}
.art-tag-level {
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.art-tag-time {
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ============================================================
   封面大圖
   ============================================================ */
.art-cover-img-wrap {
    background: var(--bg-light);
    padding: 32px 0;
}

.art-cover-figure {
    margin: 0;
}

.art-cover-img {
    width: 100%;
    height: auto;
    max-height: 480px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    display: block;
}

.art-cover-caption {
    margin-top: 10px;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
}

/* ============================================================
   通用 Section 間距
   ============================================================ */
.art-section {
    padding: 48px 0;
    border-bottom: 1px solid var(--border-color);
}
.art-section:last-of-type {
    border-bottom: none;
}

/* 互動模擬區 */
.art-section-sim {
    background: transparent;
    border-bottom: none;
    padding: 56px 0;
}
.art-section-sim .art-section-title {
    color: var(--text-main);
}
.art-section-sim .art-body-text {
    color: var(--text-main);
}

/* 影片 Section */
.art-section-video {
    background: var(--bg-white);
}

/* Section 標題 (保留舊有類別以便向下相容，同時加入 .art-content h2) */
.art-content h2, .art-section-title {
    font-size: clamp(1.25rem, 2.5vw, 1.6rem);
    font-weight: 900;
    color: var(--text-main);
    margin-top: 2rem;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--brand-primary);
    display: block; /* 改為 block 避免 inline-block 導致的奇怪排版問題，但維持底部線條寬度可以使用 inline-block */
}

.art-content h2 {
    display: inline-block;
}


/* ============================================================
   引言與知識點卡片
   ============================================================ */
.art-intro-block {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 32px;
    font-size: 1.05rem;
    color: var(--text-main);
    line-height: 1.9;
}

.art-intro-block p { margin: 0; }

.art-knowledge-card {
    background: var(--bg-glass);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 24px 28px;
    margin: 32px 0;
    box-shadow: var(--shadow-apple);
    position: relative;
    overflow: hidden;
}





/* ============================================================
   文章內文排版 (Scoped Classless Typography - Apple Design Style)
   ============================================================ */
.art-content {
    font-size: 1.05rem; /* 字體稍微放大增加閱讀舒適度 */
    color: var(--text-main);
    line-height: 1.7;
    letter-spacing: 0.005em; /* 內文稍微放寬字距 */
}

/* 標題系統：Apple 風格會將標題字距微調縮緊 (-0.015em) */
.art-content h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 12px;
    color: var(--text-main);
    letter-spacing: -0.015em;
}

.art-content h4 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-top: 1.5rem;
    margin-bottom: 10px;
    color: var(--text-main);
    letter-spacing: -0.01em;
}

/* 段落 */
.art-content p, .art-body-text {
    margin-bottom: 20px;
}

/* 列表 */
.art-content ul, .art-content ol {
    margin-bottom: 20px;
    padding-left: 1.5rem;
}

.art-content li {
    margin-bottom: 8px;
}

/* 區塊引用 (Apple 風格的 Card 設計，捨棄死板的左邊線) */
.art-content blockquote {
    background: var(--bg-white);
    padding: 24px 32px;
    margin: 32px 0;
    border-radius: var(--radius-lg);
    font-size: 1.05rem;
    color: var(--text-muted);
    box-shadow: var(--shadow-apple);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.art-content blockquote p:last-child {
    margin-bottom: 0;
}

/* 程式碼與物理變數 */
.art-content code {
    font-family: 'Geist Mono', 'Courier New', monospace;
    background-color: rgba(0, 0, 0, 0.04); 
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.9em;
    color: var(--text-main);
    letter-spacing: 0;
}

.art-content pre {
    background-color: #1d1d1f; /* Apple 深色背景 */
    color: #f5f5f7;
    padding: 20px 24px;
    border-radius: var(--radius-lg);
    overflow-x: auto;
    margin: 28px 0;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.art-content pre code {
    background-color: transparent;
    padding: 0;
    color: inherit;
    font-weight: normal;
    font-size: 0.85rem;
}

/* ============================================================
   數學公式區塊
   ============================================================ */
.art-formula-block {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin: 28px 0;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.4), var(--shadow-sm);
    text-align: center;
    overflow-x: auto;
}





/* ============================================================
   提示/資訊框（三種樣式）
   ============================================================ */

/* 共用基礎 (Fixed layout + Glassmorphism) */
.art-info-box, .art-tip-box, .art-warning-box {
    position: relative;
    padding: 18px 20px 18px 50px;
    border-radius: var(--radius-md);
    margin: 24px 0;
    font-size: 0.93rem;
    line-height: 1.7;
    display: block;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.2s ease;
}
.art-info-box:hover, .art-tip-box:hover, .art-warning-box:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.art-info-box:active, .art-tip-box:active, .art-warning-box:active {
    transform: scale(0.99);
}

.art-info-box::before, .art-tip-box::before, .art-warning-box::before {
    position: absolute;
    left: 18px;
    top: 18px;
    font-size: 1.3rem;
    font-weight: bold;
    line-height: 1.4;
}
.art-info-box::before { content: 'i'; color: #1e3a62; }
.art-tip-box::before { content: '✓'; color: #263d1e; }
.art-warning-box::before { content: '!'; color: #7c2d12; }

/* 隱藏手動寫入的 icon */
.art-info-icon, .art-tip-icon, .art-warning-icon {
    display: none !important;
}

/* 資訊（藍） */
.art-info-box {
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    color: #1e3a62;
}

/* 提示（綠） */
.art-tip-box {
    background: var(--brand-light);
    border: 1px solid #c4d9b8;
    color: #263d1e;
}

/* 警告（橘） */
.art-warning-box {
    background: #FFF7ED;
    border: 1px solid #FED7AA;
    color: #7c2d12;
}

/* ============================================================
   比較表格
   ============================================================ */
.art-table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin: 28px 0;
    box-shadow: var(--shadow-sm);
}

.art-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
    min-width: 480px;
}

.art-table caption {
    font-size: 0.82rem;
    color: var(--text-muted);
    padding: 10px 16px;
    text-align: left;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border-color);
    caption-side: top;
    font-weight: 700;
}

.art-table thead th {
    background: var(--brand-light);
    color: var(--brand-dark);
    font-weight: 700;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 2px solid #c4d9b8;
}

.art-table tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

.art-table tbody tr:last-child td {
    border-bottom: none;
}

.art-table tbody tr:hover td {
    background: var(--bg-light);
}

/* ============================================================
   互動模擬容器 ⭐️（核心功能）
   ============================================================ */
.art-sim-container {
    position: relative;                /* 讓全螢幕按鈕能絕對定位 */
    width: 100%;
    height: clamp(400px, 72vh, 640px); /* 最小 400px，最大 640px */
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 4px 28px rgba(0, 0, 0, 0.35);
    background: #111827;               /* loading 前的佔位背景色 */
    margin: 24px 0 12px;
}

/* iframe 本體：填滿容器 */
.art-sim-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* 全螢幕按鈕（右下角懸浮） */
.art-fullscreen-btn {
    position: absolute;
    bottom: 16px;
    right: 16px;
    z-index: 20;

    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;

    background: rgba(15, 23, 42, 0.70);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;

    font-size: 0.85rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s, border-color 0.2s;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.art-fullscreen-btn:hover {
    background: rgba(101, 121, 84, 0.85);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.03);
}

.art-fullscreen-btn:active {
    transform: scale(0.97);
}

/* 全螢幕圖示文字 */
#fullscreenIcon {
    font-size: 1rem;
    line-height: 1;
}

/* 手機版隱藏文字標籤，只顯示 icon */
@media (max-width: 480px) {
    .art-fullscreen-label { display: none; }
    .art-fullscreen-btn { padding: 8px 10px; }
}

/* 全螢幕狀態下的容器調整（桌機 / Android Chrome / iPadOS Safari） */
.art-sim-container:fullscreen,
.art-sim-container:-webkit-full-screen,
.art-sim-container:-moz-full-screen {
    border-radius: 0;
    width: 100vw;
    height: 100vh;
}

/* ── iOS 偽全螢幕降級方案（iPhone Safari 不支援 requestFullscreen） ──
   由 article-script.js 偵測 API 不支援時動態套用此 class。
   使用 position:fixed 模擬全螢幕，覆蓋整個視口。
   退出時移除此 class 即可恢復原狀。 ── */
.ios-pseudo-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 99999 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    background-color: #1a1a1a; /* 配合模擬器暗色主題 */
    /* 確保偽全螢幕下的全螢幕按鈕仍可見並保持在右下角 */
}

/* 偽全螢幕模式時，按鈕固定在畫面右下角 */
.ios-pseudo-fullscreen .art-fullscreen-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100000; /* 高於容器的 z-index */
}

/* 操作提示文字 */
.art-sim-hint {
    font-size: 0.85rem;
    color: #64748b;
    text-align: center;
    margin-top: 8px;
    padding: 0 8px;
}

.art-section-sim .art-sim-hint {
    color: #64748b;
}

/* ============================================================
   YouTube 影片 Grid
   ============================================================ */
.art-video-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px;
    margin-top: 24px;
}

/* 手機版：堆疊為單欄 */
@media (max-width: 640px) {
    .art-video-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

.art-video-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 16:9 影片比例容器 */
.art-video-wrap {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #0f172a;
    box-shadow: var(--shadow-md);
}

.art-video-wrap iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.art-video-caption {
    font-size: 0.83rem;
    color: var(--text-muted);
    text-align: center;
}

/* ============================================================
   延伸思考習題區
   ============================================================ */
.art-question-list {
    padding-left: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 28px;
    counter-reset: question-counter;
}

.art-question-list li {
    position: relative;
    font-size: 1.05rem;
    color: var(--text-main);
    line-height: 1.75;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px 24px 20px 52px;
    box-shadow: var(--shadow-apple);
    counter-increment: question-counter;
}

.art-question-list li::before {
    content: counter(question-counter) '.';
    position: absolute;
    left: 20px;
    top: 20px;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-muted);
}

/* ============================================================
   AI 助教 CTA
   ============================================================ */
.art-ai-cta {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px 24px;
    background: linear-gradient(135deg, #f0fdf4, #fafffe);
    border: 1.5px solid #c4d9b8;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.art-ai-cta-icon {
    font-size: 2rem;
    flex-shrink: 0;
    line-height: 1;
}

.art-ai-cta-text {
    font-size: 0.93rem;
    color: var(--text-main);
    line-height: 1.75;
}

/* ============================================================
   響應式斷點
   ============================================================ */
@media (max-width: 768px) {
    .art-hero {
        padding: 40px 0 36px;
    }

    .art-section {
        padding: 36px 0;
    }

    .art-section-sim {
        padding: 40px 0;
    }

    .art-sim-container {
        height: clamp(300px, 60vh, 480px);
    }

    .art-formula-block {
        padding: 18px 16px;
    }

    .art-knowledge-card {
        padding: 18px 20px;
    }
}

@media (max-width: 480px) {
    .art-container {
        padding: 0 16px;
    }

    .art-navbar {
        padding: 0 16px;
    }

    .art-cover-img {
        border-radius: var(--radius-md);
        max-height: 240px;
    }

    .art-sim-container {
        border-radius: var(--radius-md);
    }
}

/* ============================================================
   程式碼展示框（art-code-block）⭐️
   使用方式：在教學文章 HTML 中貼入以下結構：

   <div class="art-code-block">
     <div class="art-code-header">
       <div class="art-code-header-left">
         <div class="art-code-dots">
           <span></span><span></span><span></span>
         </div>
         <span class="art-code-lang html">HTML</span>
         <span class="art-code-title">範例標題（可選）</span>
       </div>
     </div>
     <pre class="art-code-pre"><code class="art-code">在這裡貼程式碼</code></pre>
   </div>

   ※ 複製按鈕由 article-script.js 自動注入，不需手動加入。
   ============================================================ */

/* 外層容器 */
.art-code-block {
    position: relative;
    margin: 28px 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
    background: #0f172a;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

/* 頂端工具列 */
.art-code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    background: #1e293b;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

/* 左側：圓點 + 語言 + 標題 */
.art-code-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

/* macOS 風格三個裝飾圓點 */
.art-code-dots {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}
.art-code-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: block;
}
.art-code-dots span:nth-child(1) { background: #FF5F57; }
.art-code-dots span:nth-child(2) { background: #FFBD2E; }
.art-code-dots span:nth-child(3) { background: #28C840; }

/* 語言標籤 */
.art-code-lang {
    font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', monospace;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 4px;
    flex-shrink: 0;
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}
.art-code-lang.html { background: rgba(239,68,68,0.18);  color: #f87171;  border-color: rgba(239,68,68,0.3); }
.art-code-lang.js,
.art-code-lang.javascript { background: rgba(234,179,8,0.18); color: #fbbf24; border-color: rgba(234,179,8,0.3); }
.art-code-lang.css { background: rgba(139,92,246,0.18); color: #c4b5fd; border-color: rgba(139,92,246,0.3); }
.art-code-lang.python { background: rgba(34,197,94,0.18); color: #86efac; border-color: rgba(34,197,94,0.3); }

/* 標題文字 */
.art-code-title {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.42);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 複製按鈕（由 JS 動態注入） */
.art-code-copy-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 700;
    font-family: inherit;
    color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}
.art-code-copy-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.4);
    color: #93c5fd;
    transform: scale(1.03);
}
.art-code-copy-btn:active { transform: scale(0.97); }

/* 複製成功狀態 */
.art-code-copy-btn.copied {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.4);
    color: #86efac;
    animation: art-code-copied-pulse 0.4s ease;
}
@keyframes art-code-copied-pulse {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.08); }
    100% { transform: scale(1); }
}

/* 程式碼本體 */
.art-code-pre {
    margin: 0;
    padding: 20px 24px;
    overflow-x: auto;
    max-height: 520px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.art-code-pre::-webkit-scrollbar { width: 5px; height: 5px; }
.art-code-pre::-webkit-scrollbar-track { background: transparent; }
.art-code-pre::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
}

.art-code-pre code,
.art-code {
    font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.75;
    color: #e2e8f0;
    white-space: pre;
    display: block;
    tab-size: 2;
}

/* 可選的說明文字列（框底部） */
.art-code-caption {
    font-size: 0.8rem;
    color: rgba(148, 163, 184, 0.8);
    padding: 8px 16px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.02);
}

/* 手機版 */
@media (max-width: 640px) {
    .art-code-pre {
        padding: 14px 16px;
        max-height: 380px;
    }
    .art-code-pre code, .art-code { font-size: 0.78rem; }
    .art-code-title { display: none; }
}

/* ============================================================
   延伸閱讀模組（Related Articles）
   由 /components/related-articles.js 動態注入至 #art-related
   ============================================================ */

/* ── 整體區塊 ── */
.art-related-section {
    padding: 56px 0 64px;
    background: var(--bg-light);
    border-top: 1px solid var(--border-color);
    /* 防止任何子元素撐破橫向版面 */
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

/* ── 區塊標題列 ── */
.art-related-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 32px;
}

/* 品牌色左側裝飾短線 */
.art-related-header::before {
    content: '';
    display: block;
    width: 4px;
    height: 28px;
    background: linear-gradient(180deg, var(--brand-primary), var(--brand-dark));
    border-radius: 4px;
    flex-shrink: 0;
}

.art-related-title {
    font-size: clamp(1.1rem, 2vw, 1.35rem);
    font-weight: 900;
    color: var(--text-main);
    letter-spacing: -0.3px;
    margin: 0;
}

/* ── 三欄 Grid（電腦版）── */
.art-related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    /* 防止 grid 撐破容器 */
    min-width: 0;
    width: 100%;
}

/* ── 平板：兩欄 ── */
@media (max-width: 900px) {
    .art-related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ── 手機：單欄 ── */
@media (max-width: 768px) {
    .art-related-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .art-related-section {
        padding: 40px 0 48px;
    }
}

/* ── 卡片本體 ── */
/* 關鍵：overflow:hidden 確保圖片被圓角裁切，不會刺穿出去 */
.art-related-card {
    display: flex;
    flex-direction: column;   /* 圖片在上，文字在下 */
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);    /* 12px */
    box-shadow: var(--shadow-md);
    overflow: hidden;          /* ★ 必須：裁切溢出的圖片 */
    text-decoration: none;
    color: inherit;
    /* 防止 grid 子元素橫向撐破 */
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.22s cubic-bezier(0.22, 1, 0.36, 1),
                border-color 0.2s;
    cursor: pointer;
}

.art-related-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: #c4d9b8;
}

.art-related-card:active {
    transform: translateY(-2px);
}

/* ── 卡片封面縮圖容器 ── */
/* 固定高度容器，overflow:hidden 雙保險 */
.art-related-card-img-wrap {
    width: 100%;
    height: 180px;             /* ★ 固定高度，呈現 16:9 類似比例 */
    min-height: 180px;         /* 防止被壓扁 */
    max-height: 180px;         /* 防止被撐高 */
    overflow: hidden;          /* ★ 必須 */
    background: var(--bg-light);
    flex-shrink: 0;            /* 不被 flex 縮小 */
    display: block;
    position: relative;
}

/* ── 卡片封面圖片本體 ── */
/* 直接設定 height: 180px，不用 height:100%（在 flex 子元素中不可靠）*/
.art-related-card-img {
    display: block;            /* ★ 消除圖片底部預設空白 */
    width: 100%;
    height: 180px;             /* ★ 與容器同高，不依賴 height:100% */
    min-height: 180px;
    max-height: 180px;
    object-fit: cover;         /* ★ 裁切填滿，不變形 */
    object-position: center;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.art-related-card:hover .art-related-card-img {
    transform: scale(1.05);
}

/* ── 無封面圖時的 Placeholder ── */
.art-related-card-placeholder {
    width: 100%;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--brand-light), #e0edd9);
    font-size: 2.5rem;
}

/* ── 卡片內文區域 ── */
.art-related-card-body {
    padding: 18px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;                   /* 撐滿剩餘高度，讓三張卡高度一致 */
    min-width: 0;              /* 防止文字撐破卡片 */
}

/* 文章標題（最多 2 行截斷）*/
.art-related-card-name {
    font-size: 0.95rem;
    font-weight: 900;
    color: var(--text-main);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

/* 文章摘要（最多 2 行截斷）*/
.art-related-card-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
    word-break: break-word;
}

/* Tag 列 */
.art-related-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: auto;
}

.art-related-tag {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 12px;
    background: var(--brand-light);
    color: var(--brand-dark);
    border: 1px solid #c4d9b8;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

/* ── 底部「繼續閱讀 →」提示 ── */
.art-related-card-cta {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--brand-primary);
    margin-top: 4px;
    transition: gap 0.2s;
}

.art-related-card:hover .art-related-card-cta {
    gap: 8px;
}




/* 提示框內的標題 (h3, h4, strong) 特殊排版 */
.art-info-box h3, .art-tip-box h3, .art-warning-box h3,
.art-info-box h4, .art-tip-box h4, .art-warning-box h4 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
    letter-spacing: -0.01em;
    line-height: 1.4;
}

.art-info-box h3:first-child, .art-tip-box h3:first-child, .art-warning-box h3:first-child,
.art-info-box h4:first-child, .art-tip-box h4:first-child, .art-warning-box h4:first-child {
    /* 讓第一個標題的頂部剛好對齊左側的絕對定位 Icon */
    margin-top: -2px; 
}

/* Remove bullet points inside formula block as requested */
.art-formula-block ul,
.art-formula-block ol {
    list-style: none;
    padding: 0;
    margin: 0;
}
.art-formula-block li {
    margin-bottom: 8px;
}


/* ============================================================
   正式文章 v2：閱讀系統、語意色票與共用元件
   僅套用於 body.art-standard
   ============================================================ */

body.art-standard {
    --article-ink: #1E293B;
    --article-muted: #64748B;
    --article-muted-strong: #475569;

    --article-brand: #657954;
    --article-brand-text: #526344;
    --article-brand-soft: #F1F5EE;
    --article-brand-border: #CBD8C5;

    --article-action: #0891B2;
    --article-action-text: #0E7490;
    --article-action-soft: #ECFEFF;
    --article-action-border: #A5F3FC;

    --article-category: #F59E0B;
    --article-category-text: #B45309;
    --article-category-soft: #FFF7ED;
    --article-category-border: #FED7AA;

    --article-danger: #EF4444;
    --article-danger-text: #B91C1C;
    --article-danger-soft: #FEF2F2;
    --article-danger-border: #FECACA;

    --article-line: #E2E8F0;
    --article-paper: #FFFFFF;
    --article-canvas: #F8FAFC;
    --article-canvas-dark: #111827;

    --article-radius-sm: 10px;
    --article-radius-md: 16px;
    --article-radius-lg: 24px;
    --article-shadow: 0 18px 50px rgba(30, 41, 59, 0.08);

    background: var(--article-canvas);
    color: var(--article-ink);
    font-family: "Noto Sans TC", -apple-system, BlinkMacSystemFont, "PingFang TC", "Microsoft JhengHei", sans-serif;
    font-size: clamp(1rem, 0.97rem + 0.15vw, 1.075rem);
    line-height: 1.82;
}

body.art-standard * {
    text-rendering: optimizeLegibility;
}

body.art-standard .art-main {
    overflow: clip;
    padding-bottom: 0;
}

body.art-standard .art-container {
    max-width: 760px;
    padding-inline: clamp(20px, 4vw, 32px);
}

body.art-standard .art-container-wide {
    max-width: 1180px;
    padding-inline: clamp(16px, 3vw, 32px);
}

body.art-standard .art-skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 100000;
    padding: 10px 16px;
    color: var(--article-paper);
    background: var(--article-brand);
    border-radius: 8px;
    text-decoration: none;
    transform: translateY(-160%);
    transition: transform 0.2s ease;
}

body.art-standard .art-skip-link:focus {
    transform: translateY(0);
}

body.art-standard :where(h2, h3, h4)[id] {
    scroll-margin-top: 24px;
}

body.art-standard :where(a, button, [tabindex="0"]):focus-visible {
    outline: 3px solid var(--article-action);
    outline-offset: 4px;
}

/* Hero */
body.art-standard .art-hero {
    min-height: 420px;
    padding: clamp(52px, 8vw, 88px) 0 clamp(64px, 9vw, 96px);
    background:
        radial-gradient(circle at 84% 18%, rgba(245, 158, 11, 0.14) 0 10%, transparent 11%),
        radial-gradient(circle at 12% 88%, rgba(8, 145, 178, 0.10) 0 16%, transparent 17%),
        linear-gradient(
            135deg,
            var(--article-brand-soft) 0%,
            var(--article-paper) 52%,
            color-mix(in srgb, var(--article-category-soft) 40%, var(--article-paper)) 100%
        );
    color: var(--article-ink);
}

body.art-standard .art-hero::before {
    width: 420px;
    height: 420px;
    top: -210px;
    right: -100px;
    background: rgba(245, 158, 11, 0.06);
    border: 1px solid rgba(245, 158, 11, 0.14);
}

body.art-standard .art-hero::after {
    width: 280px;
    height: 280px;
    bottom: -170px;
    left: -80px;
    background: rgba(8, 145, 178, 0.045);
    border: 1px solid rgba(8, 145, 178, 0.12);
}

body.art-standard .art-breadcrumb {
    margin-bottom: clamp(30px, 5vw, 48px);
    font-size: 0.82rem;
    letter-spacing: 0.02em;
}

body.art-standard .art-breadcrumb a {
    color: var(--article-brand-text);
    text-decoration: underline;
    text-decoration-color: rgba(101, 121, 84, 0.32);
    text-underline-offset: 4px;
}

body.art-standard .art-breadcrumb,
body.art-standard .art-breadcrumb .art-current-page {
    color: var(--article-muted-strong);
}

body.art-standard .art-hero-kicker {
    margin: 0 0 10px;
    color: var(--article-category-text);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

body.art-standard .art-hero-title {
    max-width: 13ch;
    margin-bottom: 18px;
    color: var(--article-ink);
    font-size: clamp(2.35rem, 7vw, 4.25rem);
    font-weight: 900;
    line-height: 1.08;
    letter-spacing: -0.045em;
}

body.art-standard .art-hero-subtitle {
    max-width: 620px;
    margin-bottom: 30px;
    color: var(--article-muted);
    font-size: clamp(1rem, 1.5vw, 1.15rem);
    line-height: 1.8;
}

body.art-standard .art-hero-meta {
    gap: 8px;
}

body.art-standard .art-tag {
    min-height: 34px;
    padding: 6px 13px;
    border: 1px solid var(--article-brand-border);
    background: rgba(255, 255, 255, 0.82);
    color: var(--article-brand-text);
    font-size: 0.78rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

body.art-standard .art-tag-em {
    color: var(--article-category-text);
    background: var(--article-category-soft);
    border-color: var(--article-category-border);
}

/* Cover */
body.art-standard .art-cover-img-wrap {
    padding: clamp(28px, 6vw, 52px) 0;
    background: var(--article-paper);
    border-bottom: 1px solid var(--article-line);
}

body.art-standard .art-cover-img {
    width: 100%;
    max-height: none;
    aspect-ratio: 1200 / 630;
    object-fit: contain;
    background: var(--article-brand-soft);
    border: 1px solid rgba(38, 54, 36, 0.08);
    border-radius: var(--article-radius-lg);
    box-shadow: var(--article-shadow);
}

body.art-standard .art-cover-caption {
    margin-top: 14px;
    color: var(--article-muted);
    font-size: 0.8rem;
    line-height: 1.6;
}

/* Reading rhythm */
body.art-standard .art-section {
    padding: clamp(52px, 8vw, 84px) 0;
    border: 0;
    background: var(--article-paper);
}

body.art-standard .art-section + .art-section {
    border-top: 0;
}

body.art-standard .art-section-compact {
    padding-block: clamp(40px, 6vw, 64px);
}

body.art-standard .art-section-tint {
    background:
        linear-gradient(180deg, rgba(237, 242, 233, 0.78), rgba(246, 248, 244, 0.95));
}

body.art-standard .art-content {
    color: var(--article-ink);
    font-size: inherit;
    line-height: 1.82;
    letter-spacing: 0.008em;
}

body.art-standard .art-content > * {
    max-width: 100%;
}

body.art-standard .art-content h2,
body.art-standard .art-section-title {
    display: block;
    margin: 0 0 24px;
    padding: 0;
    border: 0;
    color: var(--article-ink);
    font-size: clamp(1.55rem, 2.8vw, 1.85rem);
    font-weight: 900;
    line-height: 1.28;
    letter-spacing: -0.035em;
}

body.art-standard .art-content h2::after,
body.art-standard .art-section-title::after {
    content: "";
    display: block;
    width: 42px;
    height: 4px;
    margin-top: 14px;
    background: var(--article-brand);
    border-radius: 99px;
}

body.art-standard .art-content h3 {
    margin: clamp(52px, 8vw, 72px) 0 16px;
    color: var(--article-ink);
    font-size: clamp(1.25rem, 2vw, 1.42rem);
    font-weight: 800;
    line-height: 1.35;
    letter-spacing: -0.02em;
}

body.art-standard .art-content h4 {
    margin: 0 0 8px;
    color: inherit;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.5;
}

body.art-standard .art-content p,
body.art-standard .art-body-text {
    margin-bottom: 20px;
}

body.art-standard .art-content p:last-child {
    margin-bottom: 0;
}

body.art-standard .art-content :where(ul, ol) {
    margin-bottom: 0;
}

body.art-standard .art-content li {
    margin-bottom: 10px;
}

body.art-standard .art-section-lead {
    max-width: 640px;
    margin: -8px 0 30px;
    color: var(--article-muted);
    font-size: 1.05rem;
}

body.art-standard .art-intro-block {
    display: block;
    margin: 0;
    color: var(--article-ink);
    font-size: 1.05rem;
    line-height: 1.9;
}

body.art-standard .art-intro-block p + p {
    margin-top: 20px;
}

/* Learning goals */
body.art-standard .art-knowledge-card {
    margin: 0;
    padding: clamp(28px, 5vw, 40px);
    overflow: visible;
    background: var(--article-brand-soft);
    border: 1px solid var(--article-brand-border);
    border-radius: var(--article-radius-lg);
    box-shadow: none;
}

body.art-standard .art-knowledge-card h2 {
    margin-bottom: 24px;
}

body.art-standard .art-card-eyebrow {
    margin: 0 0 6px;
    color: var(--article-brand-text);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.12em;
}

body.art-standard .art-knowledge-card ul {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

body.art-standard .art-knowledge-card li {
    position: relative;
    margin: 0;
    padding-left: 28px;
}

body.art-standard .art-knowledge-card li::before {
    content: "✓";
    position: absolute;
    top: 0;
    left: 0;
    color: var(--article-brand);
    font-weight: 900;
}

/* Core concepts and formulas */
body.art-standard .art-core-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 30px 0 20px;
}

body.art-standard .art-core-card {
    padding: 24px;
    background: var(--article-paper);
    border: 1px solid var(--article-line);
    border-radius: var(--article-radius-md);
    box-shadow: 0 10px 30px rgba(30, 41, 59, 0.055);
}

body.art-standard .art-core-card .art-formula-label {
    margin: 0;
    color: var(--article-action-text);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.05em;
}

body.art-standard .art-core-card .art-formula {
    min-height: 88px;
    display: grid;
    place-items: center;
    overflow-x: auto;
    color: var(--article-ink);
    font-size: 1.05rem;
}

body.art-standard .art-core-card > p:last-child {
    color: var(--article-muted);
    font-size: 0.9rem;
    line-height: 1.65;
}

body.art-standard .art-key-idea {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 20px 0 4px;
    padding: 18px 20px;
    color: var(--article-ink);
    background: var(--article-action-soft);
    border: 1px solid var(--article-action-border);
    border-radius: var(--article-radius-md);
}

body.art-standard .art-key-idea-label {
    flex: 0 0 auto;
    padding: 4px 9px;
    color: var(--article-action-text);
    background: var(--article-action-border);
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.04em;
}

body.art-standard .art-key-idea p {
    margin: 0;
    font-weight: 700;
}

body.art-standard .art-formula-block {
    margin: 24px 0;
    padding: 24px;
    text-align: left;
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid var(--article-line);
    border-radius: var(--article-radius-md);
    box-shadow: none;
}

body.art-standard .art-definition-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

body.art-standard .art-definition-list li {
    display: grid;
    grid-template-columns: minmax(4.5rem, max-content) minmax(0, 1fr);
    align-items: start;
    column-gap: 14px;
    row-gap: 6px;
    margin: 0;
    padding: 12px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: var(--article-radius-sm);
}

body.art-standard .art-definition-list strong {
    min-width: 0;
    color: var(--article-action-text);
    font-size: 1.05rem;
    line-height: 1.6;
}

body.art-standard .art-definition-list span {
    min-width: 0;
    color: var(--article-muted);
    font-size: 0.88rem;
    line-height: 1.6;
}

/* Callouts */
body.art-standard :where(.art-info-box, .art-tip-box, .art-warning-box) {
    margin: 24px 0;
    padding: 22px 24px;
    color: var(--article-ink);
    border-radius: var(--article-radius-md);
    box-shadow: none;
    transform: none;
}

body.art-standard .art-content :is(.art-info-box, .art-tip-box, .art-warning-box) :is(h3, h4) {
    margin: 0 0 12px;
}

body.art-standard .art-content :where(.art-info-box, .art-tip-box, .art-warning-box) > :last-child {
    margin-bottom: 0;
}

body.art-standard :where(.art-info-box, .art-tip-box, .art-warning-box)::before {
    display: none;
}

body.art-standard :where(.art-info-box, .art-tip-box, .art-warning-box):hover,
body.art-standard :where(.art-info-box, .art-tip-box, .art-warning-box):active {
    transform: none;
    box-shadow: none;
}

body.art-standard .art-info-box {
    background: var(--article-action-soft);
    border: 1px solid var(--article-action-border);
}

body.art-standard .art-tip-box {
    background: var(--article-brand-soft);
    border: 1px solid var(--article-brand-border);
}

body.art-standard .art-warning-box {
    background: var(--article-danger-soft);
    border: 1px solid var(--article-danger-border);
}

body.art-standard .art-info-box :where(h3, h4) {
    color: var(--article-action-text);
}

body.art-standard .art-warning-box h3 {
    margin: 0 0 14px;
    color: var(--article-danger-text);
}

body.art-standard .art-warning-box ul {
    margin: 0;
}

/* Table */
body.art-standard .art-table-wrap {
    margin: 28px 0 0;
    overflow-x: auto;
    background: var(--article-paper);
    border: 1px solid var(--article-line);
    border-radius: var(--article-radius-md);
    box-shadow: none;
}

body.art-standard .art-table {
    min-width: 680px;
    font-size: 0.88rem;
}

body.art-standard .art-table caption {
    padding: 14px 18px;
    color: var(--article-muted-strong);
    background: var(--article-brand-soft);
    font-size: 0.78rem;
}

body.art-standard .art-table thead th {
    padding: 14px 16px;
    color: var(--article-ink);
    background: var(--article-brand-soft);
    border-color: var(--article-brand-border);
}

body.art-standard .art-table tbody td {
    padding: 14px 16px;
    color: var(--article-ink);
    vertical-align: top;
}

/* Simulator */
body.art-standard .art-section-sim {
    padding-block: clamp(56px, 8vw, 84px);
    background: var(--article-canvas);
    border-top: 0;
    border-bottom: 0;
}

body.art-standard .art-section-sim .art-content h2,
body.art-standard .art-section-sim .art-content p {
    color: var(--article-ink);
}

body.art-standard .art-section-sim .art-content h2::after {
    background: var(--article-action);
}

body.art-standard .art-section-sim .art-section-lead {
    color: var(--article-muted);
}

body.art-standard .art-sim-container {
    height: clamp(460px, 72vh, 680px);
    margin: 12px 0 14px;
    background: var(--article-paper);
    border: 1px solid var(--article-line);
    border-radius: var(--article-radius-lg);
    box-shadow: 0 18px 46px rgba(30, 41, 59, 0.12);
}

body.art-standard .art-fullscreen-btn {
    min-height: 44px;
    padding: 10px 16px;
    color: var(--article-action-text);
    background: rgba(255, 255, 255, 0.94);
    border-color: var(--article-action-border);
    border-radius: 10px;
}

body.art-standard .art-fullscreen-btn:hover {
    color: var(--article-action-text);
    background: var(--article-action-soft);
    border-color: var(--article-action);
}

body.art-standard .art-sim-hint,
body.art-standard .art-section-sim .art-sim-hint {
    max-width: 820px;
    margin: 18px auto 0;
    color: var(--article-muted);
    font-size: 0.82rem;
    line-height: 1.7;
}

body.art-standard .art-sim-subsection {
    margin-top: clamp(56px, 8vw, 84px);
    padding-top: clamp(40px, 6vw, 64px);
    border-top: 1px solid var(--article-line);
}

/* Steps */
body.art-standard .art-step-list {
    display: grid;
    gap: 16px;
    margin: 32px 0 0;
    padding: 0;
    list-style: none;
    counter-reset: article-step;
}

body.art-standard .art-step-list > li {
    position: relative;
    min-height: 96px;
    margin: 0;
    padding: 22px 24px 22px 78px;
    background: var(--article-canvas);
    border: 1px solid var(--article-line);
    border-radius: var(--article-radius-md);
    counter-increment: article-step;
}

body.art-standard .art-step-list > li::before {
    content: counter(article-step);
    position: absolute;
    top: 22px;
    left: 22px;
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    color: var(--article-paper);
    background: var(--article-brand);
    border-radius: 50%;
    font-size: 0.86rem;
    font-weight: 900;
}

body.art-standard .art-step-list h3 {
    margin: 0 0 6px;
    font-size: 1.05rem;
}

body.art-standard .art-step-list p {
    margin: 0;
    color: var(--article-muted);
    font-size: 0.94rem;
    line-height: 1.7;
}

/* Observations */
body.art-standard .art-observation-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 30px;
}

body.art-standard .art-observation-grid article {
    padding: 22px;
    background: var(--article-canvas);
    border: 1px solid var(--article-line);
    border-radius: var(--article-radius-md);
}

body.art-standard .art-observation-number {
    display: block;
    margin-bottom: 22px;
    color: var(--article-brand-text);
    font-size: 0.75rem;
    font-weight: 900;
    letter-spacing: 0.1em;
}

body.art-standard .art-observation-grid h3 {
    margin: 0 0 10px;
    font-size: 1.02rem;
}

body.art-standard .art-observation-grid p {
    margin: 0;
    color: var(--article-muted);
    font-size: 0.9rem;
    line-height: 1.7;
}

/* Summary and questions */
body.art-standard .art-summary-card {
    padding: clamp(28px, 5vw, 42px);
    color: var(--article-ink);
    background:
        radial-gradient(circle at 100% 0, rgba(8, 145, 178, 0.08), transparent 34%),
        linear-gradient(135deg, var(--article-brand-soft), var(--article-paper));
    border: 1px solid var(--article-brand-border);
    border-radius: var(--article-radius-lg);
    box-shadow: var(--article-shadow);
}

body.art-standard .art-summary-card .art-card-eyebrow {
    color: var(--article-brand);
}

body.art-standard .art-summary-card h2 {
    color: var(--article-ink);
}

body.art-standard .art-summary-card h2::after {
    background: var(--article-brand);
}

body.art-standard .art-check-list {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

body.art-standard .art-check-list li {
    position: relative;
    margin: 0;
    padding-left: 30px;
}

body.art-standard .art-check-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--article-brand);
    font-weight: 900;
}

body.art-standard .art-question-list {
    gap: 14px;
    margin-top: 30px;
}

body.art-standard .art-question-list li {
    padding: 22px 24px 22px 58px;
    color: var(--article-ink);
    background: var(--article-canvas);
    border-color: var(--article-line);
    border-radius: var(--article-radius-md);
    box-shadow: none;
}

body.art-standard .art-question-list li::before {
    top: 22px;
    left: 22px;
    color: var(--article-brand);
}

body.art-standard .art-ai-cta {
    justify-content: center;
    align-items: center;
    margin-top: 32px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    text-align: center;
}

body.art-standard .art-ai-cta-text {
    max-width: 680px;
    font-size: 1rem;
    line-height: 1.75;
}

/* Related reading alignment */
body.art-standard .art-related-section {
    background: var(--article-brand-soft);
    border-top: 1px solid var(--article-line);
}

body.art-standard .art-related-card-desc {
    color: var(--article-muted);
}

/* Video */
body.art-standard .art-video-wrap {
    border-radius: var(--article-radius-lg);
    background: var(--article-canvas-dark);
    box-shadow: var(--article-shadow);
}

body.art-standard .art-video-caption {
    color: var(--article-muted);
    font-size: 0.82rem;
    line-height: 1.7;
}

@media (max-width: 768px) {
    body.art-standard .art-hero {
        min-height: 0;
        padding: 42px 0 54px;
    }

    body.art-standard .art-breadcrumb {
        margin-bottom: 30px;
    }

    body.art-standard .art-hero-title {
        font-size: clamp(2.25rem, 12vw, 3.25rem);
    }

    body.art-standard .art-core-grid,
    body.art-standard .art-observation-grid {
        grid-template-columns: 1fr;
    }

    body.art-standard .art-definition-list {
        grid-template-columns: 1fr;
    }

    body.art-standard .art-definition-list li {
        grid-template-columns: minmax(4.5rem, max-content) minmax(0, 1fr);
    }

    body.art-standard .art-key-idea {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    body.art-standard .art-sim-container {
        height: clamp(420px, 68vh, 600px);
        border-radius: var(--article-radius-md);
    }
}

@media (max-width: 480px) {
    body.art-standard {
        font-size: 1rem;
    }

    body.art-standard .art-container {
        padding-inline: 20px;
    }

    body.art-standard .art-hero-kicker {
        font-size: 0.78rem;
        letter-spacing: 0.05em;
    }

    body.art-standard .art-hero-subtitle {
        line-height: 1.7;
    }

    body.art-standard .art-cover-img {
        max-height: none;
        border-radius: var(--article-radius-md);
    }

    body.art-standard .art-content h2,
    body.art-standard .art-section-title {
        font-size: 1.52rem;
    }

    body.art-standard .art-core-card,
    body.art-standard .art-formula-block,
    body.art-standard :where(.art-info-box, .art-tip-box, .art-warning-box) {
        padding: 20px;
    }

    body.art-standard .art-step-list > li {
        padding: 68px 20px 20px;
    }

    body.art-standard .art-step-list > li::before {
        top: 18px;
        left: 20px;
    }

    body.art-standard .art-question-list li {
        padding: 56px 20px 20px;
    }

    body.art-standard .art-question-list li::before {
        top: 18px;
        left: 20px;
    }

    body.art-standard .art-ai-cta {
        align-items: center;
    }
}

@media (max-width: 390px) {
    body.art-standard .art-definition-list li {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.art-standard *,
    body.art-standard *::before,
    body.art-standard *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

@media print {
    body.art-standard {
        background: #fff;
        color: #000;
        font-size: 11pt;
    }

    body.art-standard .art-hero {
        min-height: 0;
        padding: 24px 0;
        color: #000;
        background: #fff;
        border-bottom: 2px solid #000;
    }

    body.art-standard .art-hero :where(h1, p, span, a) {
        color: #000 !important;
    }

    body.art-standard :where(.art-cover-img-wrap, .art-section) {
        background: #fff !important;
    }

    body.art-standard :where(.art-section-sim, .art-related-section, .art-fullscreen-btn, .art-ai-cta) {
        display: none !important;
    }

    body.art-standard :where(.art-core-card, .art-knowledge-card, .art-summary-card, .art-info-box, .art-tip-box, .art-warning-box) {
        color: #000 !important;
        background: #fff !important;
        box-shadow: none !important;
        break-inside: avoid;
    }
}
