/* ============================================================
   鑽井工程視覺化分析系統 - 主要樣式
   ============================================================ */

/* ── 基礎變數 ── */
:root {
    --primary: #1565C0;
    --primary-light: #1976D2;
    --primary-dark: #0D47A1;
    --primary-bg: #E3F2FD;
    
    --danger: #C62828;
    --danger-light: #EF5350;
    --danger-bg: #FFEBEE;
    
    --warning: #E65100;
    --warning-light: #FF6D00;
    --warning-bg: #FFF3E0;
    
    --success: #2E7D32;
    --success-light: #4CAF50;
    --success-bg: #E8F5E9;
    
    --gray-50: #F8F9FA;
    --gray-100: #F1F3F5;
    --gray-200: #E9ECEF;
    --gray-300: #DEE2E6;
    --gray-400: #CED4DA;
    --gray-500: #ADB5BD;
    --gray-600: #868E96;
    --gray-700: #495057;
    --gray-800: #343A40;
    --gray-900: #212529;
    
    --dark-bg: #0D1B2A;
    --dark-card: #1A2B3C;
    --dark-border: #2C3E50;
    
    --font-main: 'Noto Sans TC', 'Microsoft JhengHei', sans-serif;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.15);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.2);
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 20px;
    --transition: all 0.3s ease;
}

/* ── 重置與基礎 ── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-main);
    background: #F0F4F8;
    color: var(--gray-800);
    line-height: 1.7;
    overflow-x: hidden;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================================================
   導航列
   ============================================================ */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(13, 27, 42, 0.92);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255,255,255,0.08);
    transition: var(--transition);
}

.navbar.scrolled {
    background: rgba(13, 27, 42, 0.98);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
}

.nav-brand i {
    color: #4FC3F7;
    font-size: 1.3rem;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 8px;
}

.nav-links a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
    color: white;
    background: rgba(79, 195, 247, 0.2);
}

.nav-toggle {
    display: none;
    background: none;
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
}

/* ============================================================
   Hero Section
   ============================================================ */
.hero {
    min-height: 100vh;
    background: linear-gradient(135deg, #0D1B2A 0%, #1A2B4A 40%, #0D3060 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding: 100px 24px 60px;
}

/* 背景動畫 */
.hero::before {
    content: '';
    position: absolute;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(21, 101, 192, 0.15) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    border-radius: 50%;
    animation: pulse-glow 6s ease-in-out infinite;
}

.hero::after {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(79, 195, 247, 0.08) 0%, transparent 70%);
    bottom: -100px;
    left: -100px;
    border-radius: 50%;
    animation: pulse-glow 8s ease-in-out infinite reverse;
}

@keyframes pulse-glow {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.7; }
}

.hero-bg-animation {
    position: absolute;
    right: 10%;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.15;
}

.drill-animation {
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: drill-move 3s ease-in-out infinite;
}

.drill-pipe {
    width: 20px;
    height: 300px;
    background: linear-gradient(90deg, #B0BEC5, #90A4AE, #B0BEC5);
    border-radius: 4px;
}

.drill-bit {
    width: 30px;
    height: 50px;
    background: linear-gradient(180deg, #FFD700, #F57F17);
    clip-path: polygon(10% 0%, 90% 0%, 100% 100%, 0% 100%);
}

.drill-particles span {
    display: block;
    width: 8px;
    height: 8px;
    background: #FFD700;
    border-radius: 50%;
    margin: 2px auto;
    animation: particle-fall 1.5s ease-in infinite;
}

.drill-particles span:nth-child(2) { animation-delay: 0.3s; }
.drill-particles span:nth-child(3) { animation-delay: 0.6s; }
.drill-particles span:nth-child(4) { animation-delay: 0.9s; }
.drill-particles span:nth-child(5) { animation-delay: 1.2s; }

@keyframes drill-move {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(20px); }
}

@keyframes particle-fall {
    0% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(40px) scale(0.3); }
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(79, 195, 247, 0.15);
    border: 1px solid rgba(79, 195, 247, 0.3);
    color: #4FC3F7;
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 24px;
    animation: fade-up 0.8s ease forwards;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 900;
    color: white;
    line-height: 1.2;
    margin-bottom: 24px;
    animation: fade-up 0.8s ease 0.2s both;
}

.hero-title .highlight {
    background: linear-gradient(135deg, #4FC3F7, #1565C0, #7C4DFF);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: rgba(255,255,255,0.7);
    margin-bottom: 40px;
    line-height: 1.8;
    animation: fade-up 0.8s ease 0.4s both;
}

.hero-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 32px;
    margin-bottom: 40px;
    animation: fade-up 0.8s ease 0.6s both;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 900;
    color: #4FC3F7;
    line-height: 1;
}

.stat-label {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
    margin-top: 4px;
}

.stat-divider {
    width: 1px;
    height: 40px;
    background: rgba(255,255,255,0.2);
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    animation: fade-up 0.8s ease 0.8s both;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #1565C0, #1976D2);
    color: white;
    padding: 14px 32px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
    box-shadow: 0 4px 20px rgba(21, 101, 192, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(21, 101, 192, 0.5);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.1);
    color: white;
    padding: 14px 32px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    border: 1px solid rgba(255,255,255,0.2);
    transition: var(--transition);
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-3px);
}

.hero-scroll {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}

.scroll-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,0.5);
    font-size: 0.8rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

@keyframes fade-up {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   主題總覽卡片
   ============================================================ */
.overview-section {
    padding: 80px 0;
    background: white;
}

.topic-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 48px;
}

.topic-card {
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: var(--radius-lg);
    padding: 32px;
    text-decoration: none;
    border: 2px solid transparent;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.topic-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.card-blue::before { background: linear-gradient(90deg, #1565C0, #4FC3F7); }
.card-red::before { background: linear-gradient(90deg, #C62828, #FF5722); }
.card-orange::before { background: linear-gradient(90deg, #E65100, #FF9800); }

.topic-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.card-blue:hover { border-color: #1565C0; }
.card-red:hover { border-color: #C62828; }
.card-orange:hover { border-color: #E65100; }

.card-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.card-blue .card-icon { background: var(--primary-bg); color: var(--primary); }
.card-red .card-icon { background: var(--danger-bg); color: var(--danger); }
.card-orange .card-icon { background: var(--warning-bg); color: var(--warning); }

.card-content h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.card-content p {
    color: var(--gray-600);
    font-size: 0.95rem;
    margin-bottom: 16px;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
}

.card-tags li {
    background: var(--gray-100);
    color: var(--gray-700);
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
}

.card-arrow {
    position: absolute;
    bottom: 24px;
    right: 24px;
    color: var(--gray-400);
    transition: var(--transition);
}

.topic-card:hover .card-arrow { transform: translateX(6px); color: inherit; }

/* ============================================================
   主要區塊通用樣式
   ============================================================ */
.main-section {
    padding: 80px 0;
    background: var(--gray-50);
}

.main-section.section-dark {
    background: var(--dark-bg);
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-header h2 {
    font-size: clamp(1.8rem, 3.5vw, 2.8rem);
    font-weight: 800;
    color: var(--gray-900);
    margin: 12px 0;
}

.section-header p {
    font-size: 1.05rem;
    color: var(--gray-600);
    max-width: 720px;
    margin: 0 auto;
}

.section-dark .section-header h2 { color: white; }
.section-dark .section-header p { color: rgba(255,255,255,0.6); }
.section-dark .section-badge { color: #4FC3F7; border-color: rgba(79,195,247,0.3); }

.section-badge {
    display: inline-block;
    padding: 4px 16px;
    border: 1px solid rgba(0,0,0,0.15);
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--gray-600);
    margin-bottom: 12px;
}

.blue-badge { color: var(--primary); border-color: rgba(21,101,192,0.3); background: var(--primary-bg); }
.red-badge { color: var(--danger); border-color: rgba(198,40,40,0.3); background: var(--danger-bg); }
.orange-badge { color: var(--warning); border-color: rgba(230,81,0,0.3); background: var(--warning-bg); }

.subsection {
    margin-bottom: 64px;
}

.subsection-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 32px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--gray-200);
}

.section-dark .subsection-title { 
    color: white;
    border-bottom-color: rgba(255,255,255,0.1);
}

.subsection-title i {
    color: var(--primary);
    font-size: 1.2rem;
}

.section-dark .subsection-title i { color: #4FC3F7; }

/* ============================================================
   漏泥嚴重性分類卡片
   ============================================================ */
.severity-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.severity-card {
    background: white;
    border-radius: var(--radius);
    padding: 28px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border-top: 4px solid;
    transition: var(--transition);
}

.severity-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.level-low { border-top-color: #4CAF50; }
.level-medium { border-top-color: #FF9800; }
.level-high { border-top-color: #F44336; }

.severity-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 1.5rem;
}

.level-low .severity-icon { background: #E8F5E9; color: #4CAF50; }
.level-medium .severity-icon { background: #FFF3E0; color: #FF9800; }
.level-high .severity-icon { background: #FFEBEE; color: #F44336; }

.severity-level {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--gray-500);
    margin-bottom: 4px;
}

.severity-name {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.level-low .severity-name { color: #4CAF50; }
.level-medium .severity-name { color: #FF9800; }
.level-high .severity-name { color: #F44336; }

.severity-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 8px;
}

.severity-desc {
    font-size: 0.9rem;
    color: var(--gray-600);
    margin-bottom: 16px;
}

.severity-bar {
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 1.5s ease;
}

.level-low .bar-fill { background: linear-gradient(90deg, #A5D6A7, #4CAF50); }
.level-medium .bar-fill { background: linear-gradient(90deg, #FFCC80, #FF9800); }
.level-high .bar-fill { background: linear-gradient(90deg, #EF9A9A, #F44336); }

/* ============================================================
   地層剖面視覺化
   ============================================================ */
.mud-loss-visualization {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: start;
}

.formation-diagram {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.diagram-title {
    text-align: center;
    font-weight: 700;
    color: var(--gray-700);
    margin-bottom: 16px;
    font-size: 1rem;
}

.formation-svg {
    width: 100%;
    height: auto;
}

.mud-loss-types {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.loss-type-panel {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid;
}

.loss-type-panel:first-child { border-left-color: #2196F3; }
.loss-type-panel:last-child { border-left-color: #9C27B0; }

.loss-type-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--gray-200);
}

.loss-type-header h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gray-800);
}

.horizontal i { color: #2196F3; font-size: 1.3rem; }
.vertical i { color: #9C27B0; font-size: 1.3rem; }

.loss-type-items {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.loss-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.loss-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.9rem;
}

.loss-icon.sand { background: #FFF8E1; color: #F9A825; }
.loss-icon.crack { background: #E3F2FD; color: #1565C0; }
.loss-icon.induced { background: #E8EAF6; color: #3949AB; }
.loss-icon.cave { background: #F3E5F5; color: #7B1FA2; }
.loss-icon.vcrack { background: #EDE7F6; color: #512DA8; }
.loss-icon.vinduced { background: #E8F5E9; color: #2E7D32; }
.loss-icon.underground { background: #FFEBEE; color: #C62828; }

.loss-item strong {
    font-weight: 600;
    color: var(--gray-800);
    display: block;
    font-size: 0.95rem;
}

.loss-item p {
    color: var(--gray-600);
    font-size: 0.85rem;
    margin-top: 2px;
}

/* ============================================================
   漏泥原因分析
   ============================================================ */
.cause-analysis {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 24px;
    align-items: start;
}

.cause-panel {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.cause-panel-header {
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
}

.human-factors .cause-panel-header { background: linear-gradient(135deg, #1565C0, #1976D2); }
.formation-factors .cause-panel-header { background: linear-gradient(135deg, #2E7D32, #388E3C); }

.cause-items {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cause-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.cause-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gray-100);
    color: var(--gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}

.cause-content strong {
    font-weight: 600;
    color: var(--gray-800);
    display: block;
    font-size: 0.95rem;
}

.cause-content p {
    color: var(--gray-600);
    font-size: 0.85rem;
    margin: 2px 0 6px;
}

.risk-level {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
}

.risk-level.high { background: #FFEBEE; color: #C62828; }
.risk-level.medium { background: #FFF3E0; color: #E65100; }
.risk-level.low { background: #E8F5E9; color: #2E7D32; }

.cause-vs {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 60px;
}

.vs-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1565C0, #C62828);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

/* ============================================================
   堵漏材料卡片
   ============================================================ */
.materials-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.material-card {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border-top: 4px solid;
    transition: var(--transition);
}

.material-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-md);
}

.fiber { border-top-color: #4CAF50; }
.flake { border-top-color: #2196F3; }
.granule { border-top-color: #FF9800; }
.special { border-top-color: #9C27B0; }

.material-icon {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.material-card h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 14px;
}

.material-items {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-bottom: 14px;
}

.mat-tag {
    background: var(--gray-100);
    color: var(--gray-700);
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 500;
}

.material-desc {
    font-size: 0.85rem;
    color: var(--gray-600);
    line-height: 1.5;
}

/* ============================================================
   堵漏流程圖
   ============================================================ */
.flowchart-container {
    background: white;
    border-radius: var(--radius);
    padding: 40px;
    box-shadow: var(--shadow-sm);
}

.flow-start, .flow-assess, .flow-end {
    display: flex;
    justify-content: center;
    margin: 16px 0;
}

.flow-node {
    padding: 16px 28px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 1rem;
}

.start-node {
    background: linear-gradient(135deg, #FF5722, #F44336);
    color: white;
    box-shadow: 0 4px 16px rgba(244, 67, 54, 0.3);
}

.assess-node {
    background: linear-gradient(135deg, #1565C0, #1976D2);
    color: white;
    box-shadow: 0 4px 16px rgba(21, 101, 192, 0.3);
}

.end-node {
    background: linear-gradient(135deg, #2E7D32, #43A047);
    color: white;
    box-shadow: 0 4px 16px rgba(46, 125, 50, 0.3);
}

.flow-arrow {
    display: flex;
    justify-content: center;
    margin: 8px 0;
    color: var(--gray-400);
    font-size: 1.2rem;
}

.flow-branches {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 16px 0;
}

.flow-branch {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.branch-label {
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gray-600);
    padding: 6px 12px;
    background: var(--gray-100);
    border-radius: 50px;
}

.flow-node.soft-node,
.flow-node.medium-node,
.flow-node.hard-node {
    border-radius: var(--radius);
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 20px;
    height: 100%;
}

.soft-node { background: linear-gradient(135deg, #1B5E20, #2E7D32); color: white; }
.medium-node { background: linear-gradient(135deg, #E65100, #F57C00); color: white; }
.hard-node { background: linear-gradient(135deg, #880E4F, #AD1457); color: white; }

.flow-node strong {
    font-size: 1rem;
    display: block;
}

.flow-node p {
    font-size: 0.85rem;
    opacity: 0.85;
    font-weight: normal;
    display: block;
}

.flow-node ul {
    list-style: none;
    margin-top: 8px;
    font-size: 0.82rem;
    opacity: 0.8;
}

.flow-node ul li::before {
    content: '• ';
    opacity: 0.7;
}

/* ============================================================
   圖表區塊
   ============================================================ */
.chart-section {
    background: white;
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow-sm);
}

.chart-wrapper {
    position: relative;
}

.chart-legend-custom {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    margin-top: 20px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--gray-700);
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.dual-chart {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

/* ============================================================
   防噴工程 - 對比卡片
   ============================================================ */
.comparison-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 24px;
    align-items: start;
}

.comparison-card {
    background: var(--dark-card);
    border-radius: var(--radius);
    padding: 28px;
    border: 1px solid var(--dark-border);
    transition: var(--transition);
}

.comparison-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}

.kick-card { border-top: 4px solid #FF9800; }
.blowout-card { border-top: 4px solid #F44336; }

.comp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.comp-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.comp-icon.warning { background: rgba(255, 152, 0, 0.2); color: #FF9800; }
.comp-icon.danger { background: rgba(244, 67, 54, 0.2); color: #F44336; }

.comp-badge {
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
}

.warning-badge { background: rgba(255, 152, 0, 0.2); color: #FF9800; }
.danger-badge { background: rgba(244, 67, 54, 0.2); color: #F44336; }

.comparison-card h3 {
    font-size: 1.4rem;
    font-weight: 800;
    color: white;
    margin-bottom: 12px;
}

.comp-definition {
    color: rgba(255,255,255,0.7);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--dark-border);
}

.comp-definition strong {
    color: white;
}

.comp-indicators h5 {
    color: rgba(255,255,255,0.6);
    font-size: 0.8rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.indicator-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255,255,255,0.75);
    font-size: 0.9rem;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.indicator-item i {
    width: 24px;
    color: #4FC3F7;
}

.indicator-item.danger i { color: #F44336; }
.indicator-item.danger { color: rgba(255, 100, 100, 0.85); }

.comp-action {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
    padding: 12px 16px;
    background: rgba(255, 152, 0, 0.15);
    border: 1px solid rgba(255, 152, 0, 0.3);
    border-radius: var(--radius-sm);
    color: #FF9800;
    font-size: 0.9rem;
    font-weight: 600;
}

.danger-action {
    background: rgba(244, 67, 54, 0.15);
    border-color: rgba(244, 67, 54, 0.3);
    color: #F44336;
}

.comparison-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 80px;
}

.degrade-arrow {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: rgba(255,255,255,0.4);
    font-size: 0.8rem;
}

.degrade-arrow i {
    font-size: 2rem;
    color: #F44336;
    animation: pulse-right 1.5s infinite;
}

@keyframes pulse-right {
    0%, 100% { transform: translateX(0); opacity: 1; }
    50% { transform: translateX(6px); opacity: 0.5; }
}

/* ============================================================
   BOP 防噴器視覺化
   ============================================================ */
.bop-visualization {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 40px;
    align-items: start;
}

.bop-stack-diagram {
    background: var(--dark-card);
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid var(--dark-border);
    min-width: 280px;
}

.bop-title {
    text-align: center;
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 16px;
    letter-spacing: 1px;
}

.bop-svg {
    width: 100%;
    height: auto;
}

.bop-details {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.bop-detail-card {
    background: var(--dark-card);
    border-radius: var(--radius-sm);
    padding: 20px;
    border: 1px solid var(--dark-border);
    transition: var(--transition);
}

.bop-detail-card:hover {
    border-color: rgba(79, 195, 247, 0.3);
    background: rgba(79, 195, 247, 0.05);
}

.bop-detail-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.bop-detail-header h4 {
    color: white;
    font-size: 1rem;
    font-weight: 700;
}

.bop-type-badge {
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 0.72rem;
    font-weight: 700;
}

.annular-badge { background: rgba(21, 101, 192, 0.3); color: #4FC3F7; }
.pipe-badge { background: rgba(198, 40, 40, 0.3); color: #EF9A9A; }
.blind-badge { background: rgba(230, 81, 0, 0.3); color: #FFCC80; }
.var-badge { background: rgba(46, 125, 50, 0.3); color: #A5D6A7; }
.aux-badge { background: rgba(100, 100, 100, 0.3); color: #CFD8DC; }

.bop-detail-card p {
    color: rgba(255,255,255,0.6);
    font-size: 0.88rem;
    margin-bottom: 12px;
}

.bop-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.spec-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: rgba(255,255,255,0.6);
}

.spec-item i.fa-check { color: #4CAF50; }
.spec-item i.fa-times { color: #F44336; }

/* ============================================================
   制噴方法
   ============================================================ */
.kill-methods {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.method-card {
    background: var(--dark-card);
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid var(--dark-border);
    border-top: 4px solid;
    transition: var(--transition);
}

.method-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}

.driller { border-top-color: #1565C0; }
.wait-weight { border-top-color: #2E7D32; }
.concurrent { border-top-color: #7B1FA2; }

.method-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--dark-border);
}

.method-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 900;
    color: white;
    flex-shrink: 0;
}

.driller .method-number { background: #1565C0; }
.wait-weight .method-number { background: #2E7D32; }
.concurrent .method-number { background: #7B1FA2; }

.method-info h4 {
    color: white;
    font-size: 1.05rem;
    font-weight: 700;
}

.method-sub {
    color: rgba(255,255,255,0.4);
    font-size: 0.78rem;
}

.method-cycles {
    margin-left: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: rgba(255,255,255,0.5);
    font-size: 0.8rem;
}

.method-cycles i { color: #4FC3F7; }

.method-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

.method-step {
    display: flex;
    gap: 14px;
}

.step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
    color: white;
    flex-shrink: 0;
}

.step-1, .step-wait { background: #1565C0; }
.step-2, .step-pump { background: #0D47A1; }
.step-c { background: #7B1FA2; }
.step-e { background: #6A1B9A; }

.step-content strong {
    display: block;
    color: white;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.step-content p {
    color: rgba(255,255,255,0.65);
    font-size: 0.88rem;
}

.step-content .step-detail {
    display: block;
    color: rgba(255,255,255,0.45);
    font-size: 0.78rem;
    margin-top: 4px;
    font-style: italic;
}

.step-connector {
    width: 2px;
    height: 16px;
    background: var(--dark-border);
    margin-left: 17px;
}

.method-pros-cons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--dark-border);
}

.pro-con {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
}

.pro-con.pros { color: #A5D6A7; }
.pro-con.cons { color: #EF9A9A; }

.pro-con i { font-size: 0.8rem; }

/* ============================================================
   壓力原理
   ============================================================ */
.pressure-principle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: start;
}

.pressure-diagram {
    background: var(--dark-card);
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid var(--dark-border);
}

.pressure-title {
    text-align: center;
    color: rgba(255,255,255,0.7);
    font-weight: 600;
    margin-bottom: 16px;
}

.pressure-svg {
    width: 100%;
    height: auto;
}

.pressure-formula {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.formula-card, .monitoring-card {
    background: var(--dark-card);
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid var(--dark-border);
}

.formula-card h4, .monitoring-card h4 {
    color: white;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.formula-card h4 i { color: #4FC3F7; }
.monitoring-card h4 i { color: #4FC3F7; }

.formula {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.formula-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.formula-label {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.formula-eq {
    font-family: monospace;
    font-size: 1rem;
    color: #4FC3F7;
    background: rgba(79, 195, 247, 0.1);
    padding: 8px 14px;
    border-radius: 6px;
    border-left: 3px solid #4FC3F7;
}

.monitoring-items {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.monitor-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.monitor-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(79, 195, 247, 0.15);
    color: #4FC3F7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.monitor-item strong {
    display: block;
    color: white;
    font-size: 0.95rem;
}

.monitor-item p {
    color: rgba(255,255,255,0.55);
    font-size: 0.85rem;
    margin-top: 2px;
}

/* ============================================================
   試壓標準
   ============================================================ */
.test-standards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.test-card {
    background: var(--dark-card);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    border: 1px solid var(--dark-border);
    transition: var(--transition);
}

.test-card:hover {
    transform: translateY(-4px);
    border-color: rgba(79, 195, 247, 0.3);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.test-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(79, 195, 247, 0.15);
    color: #4FC3F7;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin: 0 auto 16px;
}

.test-card h4 {
    color: white;
    font-weight: 700;
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.test-value {
    font-size: 1.1rem;
    color: #4FC3F7;
    margin-bottom: 10px;
}

.test-value strong {
    color: #FFD700;
    font-size: 1.3rem;
}

.test-card p {
    color: rgba(255,255,255,0.5);
    font-size: 0.85rem;
}

/* ============================================================
   地熱鑽井 - 挑戰卡片
   ============================================================ */
.challenge-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.challenge-card {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    border-top: 4px solid;
    transition: var(--transition);
}

.challenge-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.temperature { border-top-color: #F44336; }
.pressure { border-top-color: #9C27B0; }
.corrosion { border-top-color: #FF9800; }
.scale { border-top-color: #607D8B; }

.challenge-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 1.5rem;
}

.temperature .challenge-icon { background: #FFEBEE; color: #F44336; }
.pressure .challenge-icon { background: #F3E5F5; color: #9C27B0; }
.corrosion .challenge-icon { background: #FFF3E0; color: #FF9800; }
.scale .challenge-icon { background: #ECEFF1; color: #607D8B; }

.challenge-card h4 {
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--gray-800);
}

.challenge-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 8px;
}

.challenge-value strong {
    font-size: 1.2rem;
    color: #F44336;
}

.challenge-card p {
    font-size: 0.85rem;
    color: var(--gray-600);
    margin-bottom: 16px;
}

.challenge-bar {
    height: 6px;
    background: var(--gray-200);
    border-radius: 3px;
    overflow: hidden;
}

.bar-fill-orange {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, #FF9800, #F44336);
    transition: width 1.5s ease;
}

/* ============================================================
   套管程序
   ============================================================ */
.casing-program {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 40px;
    align-items: start;
}

.casing-diagram {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    min-width: 280px;
}

.casing-title {
    text-align: center;
    font-weight: 700;
    color: var(--gray-700);
    margin-bottom: 16px;
}

.casing-svg {
    width: 100%;
    height: auto;
}

.casing-step-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.casing-step-card {
    background: white;
    border-radius: var(--radius-sm);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid;
    position: relative;
    transition: var(--transition);
}

.casing-step-card:hover {
    transform: translateX(6px);
    box-shadow: var(--shadow-md);
}

.step-surface { border-left-color: #1565C0; }
.step-intermediate { border-left-color: #0D47A1; }
.step-production { border-left-color: #1B5E20; }
.step-liner { border-left-color: #E65100; }

.step-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--gray-100);
    color: var(--gray-600);
    padding: 2px 10px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
}

.casing-step-card h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.step-surface h4 i { color: #1565C0; }
.step-intermediate h4 i { color: #0D47A1; }
.step-production h4 i { color: #1B5E20; }
.step-liner h4 i { color: #E65100; }

.step-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}

.spec {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--gray-600);
    background: var(--gray-100);
    padding: 4px 10px;
    border-radius: 50px;
}

.spec i { color: var(--primary); }

.casing-step-card > p {
    font-size: 0.88rem;
    color: var(--gray-600);
    line-height: 1.5;
}

/* ============================================================
   地熱設備卡片
   ============================================================ */
.equipment-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.equipment-card {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border-top: 4px solid var(--gray-200);
    transition: var(--transition);
}

.equipment-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-top-color: var(--warning);
}

.equipment-card.featured {
    border-top-color: #F44336;
    background: linear-gradient(135deg, white, #FFEBEE);
}

.eq-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 16px;
}

.eq-icon.wellhead { background: #E3F2FD; color: #1565C0; }
.eq-icon.cooling { background: #FFEBEE; color: #F44336; }
.eq-icon.bop-eq { background: #E8F5E9; color: #2E7D32; }
.eq-icon.aerated { background: #E8EAF6; color: #3949AB; }

.equipment-card h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 8px;
}

.eq-badge-imp {
    display: inline-block;
    background: #FFEBEE;
    color: #F44336;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.eq-specs {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.eq-spec {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    padding: 6px 0;
    border-bottom: 1px solid var(--gray-100);
}

.spec-key { color: var(--gray-500); }
.spec-val { color: var(--gray-800); font-weight: 600; }

.equipment-card > p {
    font-size: 0.85rem;
    color: var(--gray-600);
    line-height: 1.5;
}

/* ============================================================
   材料規格表
   ============================================================ */
.materials-comparison {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 32px;
}

.material-spec-table, .material-spec-details {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.material-spec-table h4, .material-spec-details h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.spec-table {
    display: flex;
    flex-direction: column;
    gap: 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--gray-200);
}

.spec-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1.5fr 1.5fr;
    gap: 0;
    border-bottom: 1px solid var(--gray-200);
}

.spec-row:last-child { border-bottom: none; }

.spec-row.header {
    background: var(--gray-800);
    color: white;
}

.spec-row.highlighted {
    background: #E8F5E9;
}

.spec-col {
    padding: 14px 16px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

.spec-row.header .spec-col {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.grade-j55 { color: #1565C0; font-weight: 700; }
.grade-k55 { color: #2E7D32; font-weight: 700; }
.grade-c75 { color: #E65100; font-weight: 700; }

.temp-bar {
    width: 100%;
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
}

.temp-bar div {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #F44336);
    border-radius: 4px;
}

.material-spec-details {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.spec-detail-card {
    padding: 20px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    border-left: 4px solid;
    transition: var(--transition);
}

.spec-detail-card:hover { transform: translateX(4px); }

.thread { border-left-color: #1565C0; }
.cement { border-left-color: #9C27B0; }

.spec-detail-icon {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.thread .spec-detail-icon { color: #1565C0; }
.cement .spec-detail-icon { color: #9C27B0; }

.spec-detail-card h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 4px;
}

.spec-detail-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 4px;
}

.spec-detail-en {
    font-size: 0.78rem;
    color: var(--gray-500);
    margin-bottom: 10px;
    font-style: italic;
}

.spec-detail-card p {
    font-size: 0.85rem;
    color: var(--gray-600);
    line-height: 1.5;
}

/* ============================================================
   泥漿冷卻系統
   ============================================================ */
.cooling-system {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: start;
}

.cooling-diagram {
    background: white;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.cooling-title {
    text-align: center;
    font-weight: 700;
    color: var(--gray-700);
    margin-bottom: 16px;
}

.cooling-svg {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.cooling-functions {
    background: white;
    border-radius: var(--radius);
    padding: 28px;
    box-shadow: var(--shadow-sm);
}

.cooling-functions h4 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.function-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.function-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--gray-50);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--gray-300);
    transition: var(--transition);
}

.function-item:hover { 
    background: var(--primary-bg);
    border-left-color: var(--primary);
    transform: translateX(4px);
}

.function-item.critical {
    background: #FFF3E0;
    border-left-color: #FF9800;
}

.function-item.critical:hover {
    background: #FFE0B2;
}

.func-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--primary-bg);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.function-item.critical .func-icon {
    background: #FFE0B2;
    color: #FF9800;
}

.func-content strong {
    display: block;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 4px;
    font-size: 0.95rem;
}

.func-content p {
    font-size: 0.85rem;
    color: var(--gray-600);
    line-height: 1.5;
}

/* ============================================================
   總結區塊
   ============================================================ */
.summary-section {
    padding: 80px 0;
    background: linear-gradient(135deg, #0D1B2A, #1A2B4A);
}

.summary-section .section-header h2 { color: white; }
.summary-section .section-header p { color: rgba(255,255,255,0.6); }

.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 48px;
}

.summary-card {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius);
    padding: 32px;
    transition: var(--transition);
}

.summary-card:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}

.summary-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    margin-bottom: 20px;
}

.summary-icon.blue { background: rgba(21, 101, 192, 0.3); color: #4FC3F7; }
.summary-icon.red { background: rgba(198, 40, 40, 0.3); color: #EF9A9A; }
.summary-icon.orange { background: rgba(230, 81, 0, 0.3); color: #FFCC80; }

.summary-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: white;
    margin-bottom: 16px;
}

.summary-card ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.summary-card ul li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: rgba(255,255,255,0.65);
    font-size: 0.9rem;
    line-height: 1.5;
}

.summary-card ul li::before {
    content: '→';
    color: #4FC3F7;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ============================================================
   頁腳
   ============================================================ */
.footer {
    background: #0A1220;
    padding: 40px 0;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
}

.footer-brand i { color: #4FC3F7; }

.footer-topics {
    display: flex;
    gap: 12px;
    color: rgba(255,255,255,0.5);
    font-size: 0.9rem;
}

.footer-note p {
    color: rgba(255,255,255,0.3);
    font-size: 0.85rem;
}

/* ============================================================
   捲動動畫
   ============================================================ */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================================
   響應式設計
   ============================================================ */
@media (max-width: 1100px) {
    .materials-grid { grid-template-columns: repeat(2, 1fr); }
    .challenge-grid { grid-template-columns: repeat(2, 1fr); }
    .equipment-grid { grid-template-columns: repeat(2, 1fr); }
    .test-standards { grid-template-columns: repeat(2, 1fr); }
    .materials-comparison { grid-template-columns: 1fr; }
    .bop-visualization { grid-template-columns: 1fr; }
    .casing-program { grid-template-columns: 1fr; }
    .mud-loss-visualization { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    .topic-cards { grid-template-columns: 1fr; }
    .kill-methods { grid-template-columns: 1fr; }
    .severity-cards { grid-template-columns: 1fr; }
    .comparison-container { grid-template-columns: 1fr; }
    .comparison-arrow { display: none; }
    .cause-analysis { grid-template-columns: 1fr; }
    .cause-vs { display: none; }
    .pressure-principle { grid-template-columns: 1fr; }
    .cooling-system { grid-template-columns: 1fr; }
    .summary-grid { grid-template-columns: 1fr; }
    .dual-chart { grid-template-columns: 1fr; }
    .flow-branches { grid-template-columns: 1fr; }
    .spec-row { grid-template-columns: 1fr 1fr; }
    .spec-row.header .spec-col:last-child,
    .spec-col:last-child { grid-column: span 2; }
}

@media (max-width: 768px) {
    .nav-links { display: none; }
    .nav-links.open {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: rgba(13, 27, 42, 0.98);
        padding: 16px 24px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    .nav-toggle { display: block; }
    
    .hero-stats {
        gap: 16px;
    }
    .stat-number { font-size: 1.8rem; }
    
    .hero-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .materials-grid { grid-template-columns: 1fr; }
    .challenge-grid { grid-template-columns: 1fr; }
    .equipment-grid { grid-template-columns: 1fr; }
    .test-standards { grid-template-columns: repeat(2, 1fr); }
    
    .section-header h2 { font-size: 1.6rem; }
    .subsection-title { font-size: 1.1rem; }
    
    .flowchart-container { padding: 20px; }
    .flow-branches { grid-template-columns: 1fr; }
    
    .hero-bg-animation { display: none; }
}

@media (max-width: 480px) {
    .container { padding: 0 16px; }
    .main-section { padding: 60px 0; }
    .test-standards { grid-template-columns: 1fr; }
    
    .comparison-card { padding: 20px; }
    .method-card { padding: 20px; }
}

/* ============================================================
   浮動記憶訓練按鈕
   ============================================================ */
.study-fab {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #6A1B9A, #AB47BC);
    color: white;
    padding: 14px 22px;
    border-radius: 50px;
    text-decoration: none;
    font-family: var(--font-main);
    font-weight: 700;
    font-size: 0.92rem;
    box-shadow: 0 4px 24px rgba(106,27,154,0.45);
    transition: all 0.3s ease;
    border: 1px solid rgba(255,255,255,0.15);
}
.study-fab:hover {
    transform: translateY(-4px) scale(1.04);
    box-shadow: 0 8px 32px rgba(106,27,154,0.6);
}
.study-fab i { font-size: 1.1rem; }

@media (max-width: 480px) {
    .study-fab span { display: none; }
    .study-fab { padding: 16px; border-radius: 50%; }
}

/* ============================================================
   自訂捲軸
   ============================================================ */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--gray-400); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-600); }
