/* ====== 系統手冊頁面樣式 — Group 2 暖咖啡夜 ====== */
main {
    background: var(--bg-group-2);
}

body {
    color: var(--text-on-light);
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 20% 30%, rgba(101, 199, 208, 0.15) 0%, transparent 60%),
        radial-gradient(circle at 80% 70%, rgba(143, 185, 139, 0.12) 0%, transparent 55%),
        radial-gradient(circle at 60% 20%, rgba(227, 219, 116, 0.08) 0%, transparent 50%),
        conic-gradient(from 45deg at 40% 80%, transparent, rgba(255, 230, 167, 0.06), transparent);
    pointer-events: none;
    z-index: 1;
    animation: atmosphereShift 30s ease-in-out infinite;
}

@keyframes atmosphereShift {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

.usage-guides-wrapper {
    padding-top: 2rem;
    width: 100%;
    max-width: 100%;
    animation: fadeInUp 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    z-index: 2;
    overflow-x: hidden;
}

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

.usage-guide-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
}

/* ====== 標題區域樣式 ====== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2.5rem;
    margin-bottom: 4rem;
    padding: 2rem 2rem 0 2rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    animation: slideInFromLeft 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s both;
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.04) 0%, transparent 70%);
    border-radius: 40px;
    position: relative;
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.section-header::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 250px;
    height: 4px;
    background: linear-gradient(90deg,
        transparent,
        #e3db74 20%,
        #8fb98b 50%,
        #65c7d0 80%,
        transparent);
    background-size: 300% 100%;
    border-radius: 4px;
    box-shadow: 0 0 20px rgba(101, 199, 208, 0.4);
    animation: decorativeLineFlow 4s ease-in-out infinite;
}

@keyframes decorativeLineFlow {
    0%, 100% {
        background-position: 0% 50%;
        box-shadow: 0 0 20px rgba(101, 199, 208, 0.4);
    }
    50% {
        background-position: 100% 50%;
        box-shadow: 0 0 30px rgba(227, 219, 116, 0.6);
    }
}

.section-header img {
    width: 75px;
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    filter: drop-shadow(0 6px 15px rgba(0, 0, 0, 0.3)) drop-shadow(0 0 20px rgba(227, 219, 116, 0.4));
    animation: logoBreathing 4s ease-in-out infinite;
    position: relative;
    z-index: 2;
}

@keyframes logoBreathing {
    0%, 100% {
        filter: drop-shadow(0 6px 15px rgba(0, 0, 0, 0.3)) drop-shadow(0 0 20px rgba(227, 219, 116, 0.4));
    }
    50% {
        filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.4)) drop-shadow(0 0 30px rgba(227, 219, 116, 0.7));
    }
}

.section-header img:hover {
    transform: scale(1.08) rotate(8deg);
    filter: drop-shadow(0 10px 25px rgba(0, 0, 0, 0.4)) drop-shadow(0 0 40px rgba(227, 219, 116, 0.8));
}

.page-title {
    font-size: 3.2rem;
    font-weight: 800;
    background: linear-gradient(135deg,
        #e3db74 0%,
        #d4c347 25%,
        #8fb98b 50%,
        #7ba085 75%,
        #65c7d0 100%);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: 0.18em;
    animation: advancedGradientShift 5s ease-in-out infinite;
    filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.3)) drop-shadow(0 0 15px rgba(101, 199, 208, 0.2));
    position: relative;
}

@keyframes advancedGradientShift {
    0%, 100% {
        background-position: 0% 50%;
        transform: scale(1);
    }
    33% {
        background-position: 50% 0%;
        transform: scale(1.02);
    }
    66% {
        background-position: 100% 100%;
        transform: scale(1.01);
    }
}

/* ====== 系統手冊卡片網格 ====== */
.usage-guides-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 4rem;
    animation: fadeInUp 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) 1s both;
}

.guide-card {
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.12) 0%,
        rgba(240, 248, 255, 0.08) 50%,
        rgba(255, 255, 255, 0.1) 100%);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 28px;
    padding: 1.5rem 1.5rem;
    box-shadow:
        0 15px 50px rgba(0, 0, 0, 0.2),
        0 5px 20px rgba(0, 0, 0, 0.1),
        0 0 30px rgba(101, 199, 208, 0.1),
        inset 0 2px 4px rgba(255, 255, 255, 0.15),
        inset 0 -1px 2px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
}

.guide-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
        transparent,
        rgba(255, 255, 255, 0.15) 30%,
        rgba(101, 199, 208, 0.1) 50%,
        rgba(255, 255, 255, 0.15) 70%,
        transparent);
    transition: left 0.8s ease;
    z-index: 1;
}

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

.guide-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
    position: relative;
    z-index: 2;
}

.guide-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-on-light);
    margin: 0;
    flex: 1;
    letter-spacing: 0.05em;
    transition: all 0.4s ease;
    text-shadow: none;
    position: relative;
    z-index: 2;
}

.guide-meta {
    display: flex;
    gap: 1.5rem;
    color: rgba(44, 62, 80, 0.85);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 2;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s ease;
}

.guide-content {
    color: var(--text-on-light);
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 2;
    transition: all 0.4s ease;
}

/* ====== 相關連結樣式 ====== */
.link-section {
    margin: 1rem 0;
    position: relative;
    z-index: 2;
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: #2e7a85;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.link-btn:hover {
    background: rgba(101, 199, 208, 0.15);
    border-color: rgba(101, 199, 208, 0.4);
    color: #7dd8e0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(101, 199, 208, 0.2);
}

/* ====== 載入和空狀態 ====== */
.loading,
.no-guides {
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.1) 0%,
        rgba(240, 248, 255, 0.08) 50%,
        rgba(255, 255, 255, 0.1) 100%);
    backdrop-filter: blur(20px) saturate(150%);
    border-radius: 25px;
    box-shadow:
        0 8px 30px rgba(0, 0, 0, 0.15),
        inset 0 1px 2px rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(44, 62, 80, 0.85);
    grid-column: 1 / -1;
}

.no-guides h3 {
    color: var(--text-on-light);
    font-size: 1.6rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.no-guides p {
    color: rgba(44, 62, 80, 0.75);
    font-size: 1.1rem;
}

/* ====== 響應式設計 ====== */
@media (max-width: 900px) {
    .section-header {
        flex-direction: row;
        gap: 1.5rem;
        padding: 1.5rem;
        margin-top: 1rem;
    }

    .section-header::after {
        bottom: -8px;
    }

    .section-header img {
        width: 55px;
    }

    .usage-guide-container {
        padding: 2rem 1.5rem;
    }

    .page-title {
        font-size: 2.5rem;
    }

    .usage-guides-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .guide-card {
        padding: 1.2rem 1.2rem;
    }

    .guide-title {
        font-size: 1.3rem;
    }
}

@media (max-width: 600px) {
    .section-header img {
        width: 55px;
    }

    .page-title {
        font-size: 2.5rem;
    }

    .guide-card {
        padding: 1rem;
        border-radius: 20px;
    }

    .guide-title {
        font-size: 1.2rem;
    }

    .guide-content {
        font-size: 1rem;
    }

    .link-section {
        flex-direction: column;
    }
}

/* ====== 粒子系統 ====== */
.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    animation-iteration-count: infinite;
    animation-timing-function: linear;
    filter: blur(0.5px);
}

.pulsing-particle {
    animation: pulseGlow 3s infinite alternate;
}

.twinkling-particle {
    animation: twinkle 2s infinite alternate;
}

@keyframes floatParticle {
    0% {
        transform: translateY(100vh) rotate(0deg) scale(1);
        opacity: 0.3;
    }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% {
        transform: translateY(-20vh) rotate(360deg) scale(0.8);
        opacity: 0;
    }
}

@keyframes floatParticleAlt {
    0% {
        transform: translateY(100vh) translateX(0) rotate(0deg) scale(0.5);
        opacity: 0;
    }
    15% { opacity: 0.8; }
    50% {
        transform: translateY(50vh) translateX(20px) rotate(180deg) scale(1.2);
        opacity: 1;
    }
    85% { opacity: 0.8; }
    100% {
        transform: translateY(-20vh) translateX(-20px) rotate(360deg) scale(0.3);
        opacity: 0;
    }
}

@keyframes floatParticleSpiral {
    0% {
        transform: translateY(100vh) translateX(0) rotate(0deg) scale(0.8);
        opacity: 0;
    }
    20% { opacity: 1; }
    50% {
        transform: translateY(50vh) translateX(50px) rotate(720deg) scale(1.5);
    }
    80% { opacity: 1; }
    100% {
        transform: translateY(-20vh) translateX(-50px) rotate(1080deg) scale(0.2);
        opacity: 0;
    }
}

@keyframes floatParticleFast {
    0% {
        transform: translateY(100vh) rotate(0deg) scale(1);
        opacity: 0.8;
    }
    100% {
        transform: translateY(-20vh) rotate(720deg) scale(0.5);
        opacity: 0;
    }
}

@keyframes pulseGlow {
    0% {
        box-shadow: 0 0 5px currentColor;
        transform: scale(1);
    }
    100% {
        box-shadow: 0 0 15px currentColor, 0 0 25px currentColor;
        transform: scale(1.2);
    }
}

@keyframes twinkle {
    0%, 100% {
        opacity: 0.3;
        filter: brightness(1);
    }
    50% {
        opacity: 1;
        filter: brightness(1.8);
    }
}

/* 入場動畫 */
.usage-guide-container > * {
    opacity: 0;
    animation: fadeInSequence 0.6s ease-out forwards;
}

.usage-guide-container > *:nth-child(1) { animation-delay: 0.1s; }
.usage-guide-container > *:nth-child(2) { animation-delay: 0.2s; }
.usage-guide-container > *:nth-child(3) { animation-delay: 0.3s; }

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

* {
    scroll-behavior: smooth;
}
