html {
    margin: 0;
    padding: 0;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    line-height: 1.6;
    background-color: #f4f7f6;
    color: #333;
    margin: 0;
    padding: 0;
}

header {
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 1rem 5%;
    position: sticky;
    top: 0;
    z-index: 10;
    width: 90%;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

nav a {
    text-decoration: none;
    color: #005f73;
    font-weight: 500;
    transition: color 0.3s;
    font-size: 1rem;
}

nav a:hover {
    color: #00a896;
}

#lang-toggle {
    background: none;
    border: 2px solid #005f73;
    color: #005f73;
    font-weight: 500;
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 5px;
    transition: all 0.3s;
}

#lang-toggle:hover {
    background-color: #005f73;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 95, 115, 0.3);
}

main {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
}

article {
    background-color: #ffffff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

article h1 {
    font-size: 2.2rem;
    color: #005f73;
    margin-top: 0;
    margin-bottom: 30px;
    border-bottom: 3px solid #00a896;
    padding-bottom: 15px;
}

section {
    margin-bottom: 40px;
}

section:last-child {
    margin-bottom: 0;
}

section h2 {
    font-size: 1.8rem;
    color: #007a6e;
    margin-top: 0;
    margin-bottom: 20px;
    border-left: 4px solid #00a896;
    padding-left: 15px;
}

section p {
    margin-bottom: 15px;
    line-height: 1.8;
    color: #555;
}

section ul,
section ol {
    margin: 15px 0;
    padding-left: 25px;
}

section li {
    margin-bottom: 12px;
    line-height: 1.7;
    color: #555;
}

section li strong {
    color: #005f73;
}

section li ul,
section li ol {
    margin-top: 8px;
    margin-bottom: 8px;
}

section li li {
    margin-bottom: 8px;
    color: #666;
}

.image-row {
    display: flex;
    justify-content: center;
    margin: 25px 0;
    width: 100%;
}

.image-row img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 1px solid #ddd;
}

.media-row {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 25px 0;
    align-items: center;
}

.media-row video,
.media-row img {
    width: auto;
    max-width: 800px;
    height: auto;
}

.video-row {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 25px 0;
}

.video-container {
    width: 100%;
}

.video-container video {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 1px solid #ddd;
    display: block;
}

.video-caption {
    text-align: center;
    margin-top: 10px;
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

.fpc-image {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.catheter-types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin: 25px 0;
}

.catheter-type-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.catheter-type-item img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 1px solid #ddd;
    object-fit: cover;
}

.welding-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin: 25px 0;
}

.welding-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.welding-item img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 1px solid #ddd;
    object-fit: cover;
}

.image-caption {
    text-align: center;
    margin-top: 10px;
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
    line-height: 1.4;
}

.acoustic-field-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin: 25px 0;
}

.acoustic-field-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.acoustic-field-item img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 1px solid #ddd;
    object-fit: cover;
}

.comparison-grid {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin: 25px 0;
}

.comparison-section {
    background-color: #f9f9f9;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

.comparison-section h3 {
    font-size: 1.4rem;
    color: #005f73;
    margin-top: 0;
    margin-bottom: 20px;
    text-align: center;
    border-bottom: 2px solid #00a896;
    padding-bottom: 10px;
}

.comparison-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.comparison-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.comparison-item img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border: 1px solid #ddd;
    object-fit: cover;
}

.comparison-note {
    background-color: #e8f4f8;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #00a896;
    margin-top: 25px;
}

.comparison-note p {
    margin: 0;
    line-height: 1.8;
    color: #333;
}

footer {
    text-align: center;
    padding: 20px;
    color: #777;
    margin-top: 40px;
    position: relative;
}

.footer-crafting-table {
    height: 100px;
    width: auto;
    display: block;
    margin: 0 auto 15px auto;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

/* =================================
   遊戲圖片樣式
   ================================= */

/* 隨機遊戲圖片 - Steve 位於右下角 */
.random-game-image {
    position: fixed;
    bottom: 0;
    right: 0;
    width: auto;
    height: 100px;
    opacity: 0;
    z-index: -1;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.random-game-image.show {
    opacity: 0.3;
}

/* 目標圖片 - 蘑菇樹位於左下角 */
.target-image {
    position: fixed;
    bottom: 0;
    left: 0;
    width: auto;
    height: 100px;
    opacity: 0;
    z-index: -1;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.target-image.show {
    opacity: 0.4;
}

/* Item 圖片 - 蘑菇疊在 crafting table 上方 */
.item-image {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    height: 50px;
    width: auto;
    opacity: 0;
    transition: opacity 0.5s ease;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    z-index: 10;
}

.item-image.show {
    opacity: 1;
}

/* 響應式調整 */
@media (max-width: 768px) {
    .random-game-image {
        height: 100px;
        bottom: 0;
        right: 0;
    }
    
    .target-image {
        height: 100px;
    }
    
    .item-image {
        height: 50px;
    }
}

@media (min-width: 851px) {
    .video-row {
        flex-direction: row;
        gap: 20px;
    }
    
    .video-container {
        flex: 1;
    }
    
    .media-row {
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: 15px;
        width: 100%;
        overflow: hidden;
    }
    
    .media-row video,
    .media-row img {
        width: auto;
        max-width: calc(50% - 10px);
        height: auto;
        max-height: 500px;
        object-fit: contain;
        border: none;
        box-shadow: none;
        border-radius: 8px;
    }
}

@media (max-width: 850px) {
    header {
        padding: 1rem 3%;
        width: 94%;
    }
    
    main {
        padding: 10px;
        margin: 10px auto;
    }
    
    article {
        padding: 20px;
    }
    
    article h1 {
        font-size: 1.6rem;
        margin-bottom: 20px;
    }
    
    section h2 {
        font-size: 1.4rem;
        margin-bottom: 15px;
    }
    
    section {
        margin-bottom: 30px;
    }
    
    .video-row {
        flex-direction: column;
    }
    
    .video-container {
        width: 100%;
    }
    
    .media-row {
        flex-direction: column;
    }
    
    .media-row video,
    .media-row img {
        width: auto;
        max-width: 100%;
    }
    
    .catheter-types-grid,
    .welding-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .acoustic-field-grid,
    .comparison-images {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .comparison-section {
        padding: 15px;
    }
    
    .comparison-section h3 {
        font-size: 1.2rem;
    }
    
    .comparison-note {
        padding: 15px;
    }
    
    .image-caption {
        font-size: 0.85rem;
    }
}

@media (min-width: 600px) and (max-width: 850px) {
    .catheter-types-grid,
    .welding-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .acoustic-field-grid,
    .comparison-images {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 851px) {
    .catheter-types-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .welding-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .acoustic-field-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .comparison-images {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .comparison-grid {
        gap: 40px;
    }
}
