/* ===== 全局與暖色系主題變數設定 ===== */
:root {
    --primary-red: #E05A47;       /* 溫暖珊瑚紅 */
    --primary-orange: #FF8C42;    /* 暖心橙 */
    --primary-yellow: #FFB347;    /* 柔和黃 */
    --warm-bg: #FFFBF7;           /* 暖白背景 */
    --warm-card-bg: #FFFFFF;      /* 卡片純白背景 */
    --alt-bg: #FFF4EC;             /* 交替區塊溫暖微橘背景 */
    --text-dark: #2C221E;          /* 暖黑文字 */
    --text-muted: #6E655F;        /* 柔和灰褐色 */
    --shadow-color: rgba(224, 90, 71, 0.12);
}

/* 消除邊距並設置 box-sizing */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Noto Sans TC', sans-serif;
}

/* 防止水平捲軸出現 */
html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    background-color: var(--warm-bg);
    color: var(--text-dark);
    scroll-behavior: smooth;
}

/* ===== (6) 時尚簡約客製化右側捲軸 ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #F1ECE6;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-orange), var(--primary-red));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-red);
}

/* ===== Header & Nav ===== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    padding: 0 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(255, 251, 247, 0.92);
    backdrop-filter: blur(8px);
    z-index: 1000;
    box-shadow: 0 2px 15px var(--shadow-color);
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

/* Nav Menu & (4) 動態按鈕 */
.nav-menu {
    display: flex;
    gap: 15px;
}

.nav-btn {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 8px 16px;
    border-radius: 20px;
    position: relative;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    background: transparent;
    overflow: hidden;
    z-index: 1;
}

.nav-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-orange), var(--primary-red));
    border-radius: 20px;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
    z-index: -1;
}

.nav-btn:hover {
    color: #FFFFFF;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(224, 90, 71, 0.3);
}

.nav-btn:hover::before {
    transform: scaleX(1);
    transform-origin: left;
}

/* ===== (3) 首頁大圖輪播 (Hero Banner) ===== */
.hero-slider {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.slide.active {
    opacity: 1;
}

.hero-text {
    color: #FFFFFF;
    max-width: 800px;
    padding: 0 20px;
    animation: fadeInUp 1s ease-out;
}

.hero-text h2 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 15px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.hero-text p {
    font-size: 1.3rem;
    font-weight: 300;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.slider-dots {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 10;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.dot.active, .dot:hover {
    background-color: var(--primary-yellow);
    width: 28px;
    border-radius: 10px;
}

/* ===== 通用 Section 樣式 ===== */
.section {
    padding: 100px 5% 80px 5%;
}

.main-container {
    max-width: 1200px;
    margin: 0 auto;
}

.alt-bg {
    background-color: var(--alt-bg);
}

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

.section-header h2 {
    font-size: 2.2rem;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.underline {
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-red), var(--primary-yellow));
    margin: 0 auto;
    border-radius: 2px;
}

/* ===== 健身房自介 (About) ===== */
.about-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.story-card {
    background: var(--warm-card-bg);
    padding: 35px;
    border-radius: 16px;
    box-shadow: 0 8px 25px var(--shadow-color);
    border-left: 5px solid var(--primary-orange);
    transition: transform 0.3s ease;
}

.story-card:hover {
    transform: translateY(-5px);
}

.story-card h3 {
    font-size: 1.4rem;
    color: var(--primary-red);
    margin-bottom: 15px;
}

.story-card p {
    line-height: 1.8;
    color: var(--text-muted);
}

/* ===== 作品欣賞 (Gallery) ===== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.gallery-card {
    background: var(--warm-card-bg);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 6px 20px var(--shadow-color);
    transition: transform 0.3s ease;
}

.gallery-card:hover {
    transform: translateY(-8px);
}

.gallery-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.gallery-info {
    padding: 20px;
}

.gallery-info h4 {
    font-size: 1.2rem;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.gallery-info p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.gallery-tag {
    display: inline-block;
    margin-top: 12px;
    padding: 4px 10px;
    background-color: #FFE6D5;
    color: var(--primary-red);
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* ===== 客製化說明 (Custom) ===== */
.custom-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}

.custom-info h3 {
    font-size: 1.6rem;
    color: var(--primary-red);
    margin-bottom: 15px;
}

.custom-info p {
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 25px;
}

.custom-steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.step-item {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.step-num {
    background: linear-gradient(135deg, var(--primary-orange), var(--primary-red));
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.step-item h4 {
    font-size: 1.1rem;
    color: var(--text-dark);
}

.step-item p {
    font-size: 0.9rem;
    margin-bottom: 0;
}

.custom-form-box, .contact-form {
    background: var(--warm-card-bg);
    padding: 30px;
    border-radius: 16px;
    box-shadow: 0 8px 25px var(--shadow-color);
}

/* ===== 表單通用元件 ===== */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-dark);
    font-size: 0.95rem;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1.5px solid #EAE3DC;
    border-radius: 8px;
    background-color: #FAFAFA;
    font-size: 0.95rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--primary-orange);
    background-color: #FFFFFF;
}

.submit-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(90deg, var(--primary-orange), var(--primary-red));
    color: white;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.3s ease, transform 0.2s ease;
}

.submit-btn:hover {
    opacity: 0.92;
    transform: translateY(-2px);
}

/* ===== 聯絡我們 (Contact) & JSON Display ===== */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.form-sub {
    font-size: 0.85rem;
    color: var(--primary-red);
    margin-bottom: 20px;
}

.json-output-box {
    background: #2C221E;
    color: #FFB347;
    padding: 25px;
    border-radius: 16px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
}

.json-output-box h3 {
    color: #FFFFFF;
    margin-bottom: 8px;
    font-size: 1.2rem;
}

.json-output-box p {
    color: #A0958D;
    font-size: 0.85rem;
    margin-bottom: 15px;
}

.json-output-box pre {
    background: #1E1613;
    padding: 15px;
    border-radius: 8px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    color: #81E6D9;
    white-space: pre-wrap;
    word-break: break-all;
    flex-grow: 1;
    overflow-y: auto;
    max-height: 300px;
}

footer {
    text-align: center;
    padding: 25px;
    background-color: var(--text-dark);
    color: #A0958D;
    font-size: 0.9rem;
}

/* ===== (1) RWD 響應式媒體查詢 ===== */
@media (max-width: 900px) {
    .custom-container, .contact-wrapper {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .header {
        flex-direction: column;
        height: auto;
        padding: 15px;
    }

    .nav-menu {
        margin-top: 10px;
        gap: 5px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-btn {
        padding: 6px 10px;
        font-size: 0.85rem;
    }

    .hero-text h2 {
        font-size: 1.8rem;
    }

    .hero-text p {
        font-size: 1rem;
    }

    .section {
        padding: 60px 5% 40px 5%;
    }
}

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