body { 
    font-family: Arial, sans-serif; 
    /*display: flex; 
    justify-content: center; 
    padding: 20px;*/ 
}

.topic-7 {
    width: 100%;
    max-width: 900px;
    margin: 0 auto; 
    /*display: flex;
    flex-direction: column;
    align-items: flex-start;*/ 
}

.headline1 {
    color: rgb(252, 139, 31);
    font-size: 28px;
    text-align: left;
    margin-bottom: 10px; 
    width: 100%; 
}

.diagram-top {
    text-align: center;
    margin-bottom: 14px;
    display: flex;
    align-items: flex-start;
    gap: 24px;
    width: 100%;
    box-sizing: border-box;
    overflow-x: auto;
}

.diagram-top img {
    width: 400px;
    max-width: 100%; 
    height: auto; 
    display: block;
    margin-left: auto;  
    margin-right: auto; 
    flex-shrink: 0; 
}

/* 1. 預設隱藏所有分頁內容 */
.tab-content {
    display: none !important;
}

/* 2. 當分頁被加上 active 時，強制顯示出來 */
.tab-content.active {
    display: block !important;
}

/* 3. 修正頁籤外觀：連貫線條設計 */
.tab-container {
    display: flex;
    width: 100%;
    border-bottom: 2px solid #e0e0e0; /* 貫穿全寬的基底灰線 */
    margin-bottom: 25px;
    background-color: transparent;
}

/* 4. 修正頁籤按鈕：移除原本獨立的按鈕感，改為純文字與線條 */
.tab-btn {
    flex: 1;               /* 讓兩個頁籤平分寬度 */
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 500;
    color: #666;           /* 未選中時文字為灰色 */
    cursor: pointer;
    text-align: center;
    background: none;      /* 移除按鈕背景色 */
    border: none;          /* 移除按鈕外框 */
    margin-bottom: -2px;   /* 讓底線與容器的底線完美重疊 */
    border-bottom: 2px solid transparent; /* 預留底線空間 */
    transition: all 0.2s ease;
}

/* 5. 當頁籤被加上 active 時的外觀（高亮連結） */
.tab-btn.active {
    color: #1a73e8;        /* 啟動時的文字顏色（科技藍） */
    font-weight: bold;
    border-bottom: 3px solid #1a73e8; /* 作用中畫面的底部藍色粗線 */
}
.input-title {
    color: #1a3b7a; 
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 14px;
}

.card {
    background: #ffffff;
    border-radius: 6px;
    padding: 34px 34px; 
    gap: 14px;
    display: flex; 
    flex-direction: column;
    width: 100%; 
    box-sizing: border-box; 
    box-shadow: 0px 4px 8px 0px rgba(246, 246, 246, 1);
    backdrop-filter: blur(5px);
    margin: 20px 0; 
    border: 1px solid #f0f0f0;
}


table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

th {
    background-color: #1a3b7a;
    color: #ffffff;
    padding: 14px;
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    border-right: 1px solid rgba(255, 255, 255, 0.25); 
}

th:last-child {
    border-right: none; 
}

td {
    border-bottom: 1px solid #e2e8f0;
    border-right: 1px solid #edf2f7;
    background-color: #ffffff;
    padding: 12px 8px;
    text-align: center;
}

td:last-child {
    border-right: none;
}

tr:hover td {
    background-color: #f8fafc;
}

input[type="number"] {
    width: 85%;
    max-width: 120px;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    text-align: center;
    font-size: 0.95rem;
    color: #334155;
    background-color: #f8fafc;
    transition: all 0.2s ease-in-out;
}

input[type="number"]:focus {
    outline: none;
    border-color: #1a3b7a;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(26, 59, 122, 0.15);
}

.middle-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.middle-left img {
    max-width: 300px;
    height: auto;
}

/* 右側輸入區 */
.middle-right {
    flex: 1;
}

.middle-right p {
    color: #1a3b7a; /* 標題深藍色 */
    font-size: 18px;
    margin-bottom: 15px;
}

.input-group{
    gap: 7px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 14px;
}

input[type="number"], input[type="text"] {
    background: transparent;
    text-align: center;
    font-size: 14px;
    border: 1px solid #ccc !important;
    border-radius: 6px;
    padding: 6px;
    width: 80px !important; /* 統一加寬一點較美觀 */
    outline: none;
}


/* 附註文字樣式 */
.note {
    font-size: 11px;
    color: #666;
    margin-top: -7px;
    margin-left: 17px;
    margin-bottom: 10px;
    text-align: left;
}

/* 下方選擇區域 */
.material-section {
    text-align: center;
    font-size: 14px;
}

/* 下拉選單樣式：淡黃色背景 */
select#material {
    background-color: #ffffff; /* 圖片中的淡黃色 */
    border: 1px solid #e0b801;
    border-radius: 6px;
    padding: 5px;
    width: 120px !important;
    cursor: pointer;
}

    /* 模擬圖片中的按鈕 (可選) */
.btn-execute {
    background-color: #1a3b7a;
    color: white;
    border: none;
    padding: 10px 30px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 20px;
}

/* 輸出區域總容器 */
.output-section {
    max-width: 800px;
    margin-top: 14px;
}

.output-section u {
    color: #333;
    font-weight: bold;
    text-decoration: none;
    border-bottom: 1px solid #333;
    display: inline-block;
}

/* 網格佈局：每行顯示 2 或 3 個項目 */
.output-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 預設兩欄 */
    gap: 15px 40px;
    margin-bottom: 20px;
}

/* 針對 Core factors 特別設定三欄 (如 HTML 內註記) */
.output-grid[style*="grid-template-columns: 1fr 1fr 1fr"] {
    grid-template-columns: repeat(3, 1fr);
}

/* 輸出項目文字樣式 */
.output-item {
    display: flex;
    align-items: center;
    font-size: 14px;
    color: #444;
}

/* 數據結果框：淺灰色圓角背景 */
.output-box {
    min-width: 60px;
    height: 24px;
    background-color: #f2f2f2; /* 淺灰色 */
    border: 1px solid #ccc;
    border-radius: 4px;
    margin: 0 8px;
    padding: 2px 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #000;
}

.ref { 
    font-size: 11px; 
    color: #888; 
    font-style: italic; 
    line-height: 1.3; }

.table-header-info {
    margin-bottom: 7px;
    display: flex;
    flex-direction: column;
}

.table-header-info .main-title {
    font-size: 14px;
    font-weight: bold;
    color: #1a3b7a;
    line-height: 1.3;
}

.table-header-info .sub-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 4px;
    width: 100%;
    font-size: 11px;
    color: #555555; 
}

.table-header-info .unit-info {
    margin-right: 145px;
}

.product-data-table table {
    border-collapse: collapse;
    text-align: center;
    width: 50%;
    font-size: 11px;
    min-width: 400px; 
    max-width: 500px; 
}

.product-data-table th {
    background-color: #1a3b7a;
    border: 1px solid rgba(255, 255, 255, 0.25);
    padding: 8px;
    color: #ffffff;
    font-size: 11px;
}

.product-data-table td {
    border: 1px solid #edf2f7;
    padding: 6px;
}

.product-data-table td img { /*依據實際照片大小做更改*/
    width: 80px; 
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 6px auto; /* 讓照片和文字制中 */
}