/* Global Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden; /* 防止水平滾動條 */
}

body {
    font-family: 'Noto Serif TC', 'Cinzel', serif;
    background-color: #120722;
    color: #e2d9f3;
    line-height: 1.6;
    overflow-x: hidden;
}

/* 時尚簡約客製化垂直滾動條 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #1a0b2e;
}

::-webkit-scrollbar-thumb {
    background: #5c2c90;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #e0a96d;
}

/* Header & Navigation */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 50px;
    background: rgba(18, 7, 34, 0.85);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid rgba(224, 169, 109, 0.2);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo span {
    font-size: 1.5rem;
    font-weight: 700;
    color: #e0a96d;
    letter-spacing: 2px;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 20px;
}

.nav-btn {
    position: relative;
    text-decoration: none;
    color: #cbb4d5;
    font-size: 1rem;
    font-weight: 500;
    padding: 8px 16px;
    transition: all 0.3s ease;
    border-radius: 4px;
    overflow: hidden;
}

/* 按鈕動態效果 (懸停光芒與底線擴展) */
.nav-btn::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0%;
    height: 2px;
    background-color: #e0a96d;
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-btn:hover {
    color: #ffffff;
    background: rgba(92, 44, 144, 0.3);
    box-shadow: 0 0 12px rgba(224, 169, 109, 0.4);
}

.nav-btn:hover::before {
    width: 80%;
}

/* Hero Section (大圖輪播) */
.hero-section {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

.carousel {
    position: relative;
    width: 100%;
    height: 100%;
}

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

.slide.active {
    opacity: 1;
}

.hero-text {
    text-align: center;
    color: #ffffff;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.8);
    padding: 0 20px;
}

.hero-text h1 {
    font-size: 3.2rem;
    margin-bottom: 20px;
    color: #f3e5ab;
    letter-spacing: 4px;
}

.hero-text p {
    font-size: 1.4rem;
    color: #e2d9f3;
}

/* 輪播切換按鈕 */
.prev-btn, .next-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(45, 18, 77, 0.6);
    color: #e0a96d;
    border: 1px solid #e0a96d;
    font-size: 2rem;
    padding: 10px 18px;
    cursor: pointer;
    transition: 0.3s;
    border-radius: 50%;
    z-index: 10;
}

.prev-btn:hover, .next-btn:hover {
    background: #e0a96d;
    color: #120722;
}

.prev-btn { left: 30px; }
.next-btn { right: 30px; }

/* Sections Common Style */
.content-section {
    padding: 100px 8%;
    min-height: 80vh;
}

.dark-bg {
    background-color: #1a0b2e;
}

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

.section-title h2 {
    font-size: 2.3rem;
    color: #e0a96d;
    letter-spacing: 3px;
    margin-bottom: 10px;
}

.title-underline {
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #e0a96d, transparent);
    margin: 0 auto;
}

/* Cards Layout */
.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.card {
    background: #25123e;
    border: 1px solid rgba(224, 169, 109, 0.2);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px rgba(142, 68, 173, 0.3);
    border-color: #e0a96d;
}

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

.card-content {
    padding: 25px;
}

.card-content h3 {
    font-size: 1.5rem;
    color: #f3e5ab;
    margin-bottom: 12px;
}

.card-content p {
    font-size: 0.95rem;
    color: #cbb4d5;
}

/* Form Styles */
.form-card {
    max-width: 650px;
    margin: 0 auto;
    background: #25123e;
    padding: 40px;
    border-radius: 12px;
    border: 1px solid rgba(224, 169, 109, 0.3);
    box-shadow: 0 15px 35px rgba(0,0,0,0.5);
}

.form-desc {
    margin-bottom: 25px;
    color: #cbb4d5;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #e0a96d;
    font-size: 0.95rem;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 12px 15px;
    background: #120722;
    border: 1px solid #5c2c90;
    border-radius: 6px;
    color: #ffffff;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.3s;
}

.form-group input:focus, .form-group textarea:focus {
    border-color: #e0a96d;
}

.submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(45deg, #5c2c90, #8e44ad);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 1.05rem;
    cursor: pointer;
    transition: 0.3s;
    font-weight: bold;
    letter-spacing: 1px;
}

.submit-btn:hover {
    background: linear-gradient(45deg, #8e44ad, #e0a96d);
    color: #120722;
    box-shadow: 0 0 15px rgba(224, 169, 109, 0.5);
}

.image-preview img {
    max-width: 100%;
    margin-top: 15px;
    border-radius: 6px;
    border: 1px solid #e0a96d;
}

.json-output-container {
    margin-top: 30px;
    padding: 20px;
    background: #120722;
    border: 1px dashed #e0a96d;
    border-radius: 8px;
}

.json-output-container h3 {
    color: #e0a96d;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

#json-output {
    color: #7efc20;
    font-family: monospace;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Footer */
footer {
    text-align: center;
    padding: 25px;
    background-color: #0b0416;
    color: #887498;
    font-size: 0.85rem;
    border-top: 1px solid rgba(224, 169, 109, 0.1);
}

/* Responsive Design (RWD) */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        padding: 15px 20px;
        gap: 15px;
    }

    nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    .hero-text h1 {
        font-size: 2.1rem;
    }

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

    .prev-btn { left: 10px; }
    .next-btn { right: 10px; }

    .content-section {
        padding: 60px 5%;
    }
}
