:root {
    --primary-color: #0076a8;
    --text-color: #333333;
    --tag-2025: #21b3b3;
    --tag-2026: #6f42c1;
    --tag-2027: #d81b60;
    --bg-white: #ffffff;
    --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --font-family: 'Noto Sans TC', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    color: var(--text-color);
    background-color: #f7f9fc;
    overflow-x: hidden;
    /* font-family 已經由 base.css 統一設定了更完整的備用字型 */
}

/* Preloader Screen */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #ffffff;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.6s cubic-bezier(0.23, 1, 0.32, 1), visibility 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.preloader.loaded {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.preloader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 40px;
}

.preloader-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #5a3b94;
    letter-spacing: 2px;
}

.spinner {
    position: relative;
    width: 60px;
    height: 60px;
}

.spinner span {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 1px solid #0076a8;
    animation: ripple 2.4s cubic-bezier(0.1, 0.5, 0.3, 1) infinite;
    box-sizing: border-box;
    opacity: 0;
}

.spinner span:nth-child(1) {
    animation-delay: 0s;
}

.spinner span:nth-child(2) {
    border-color: #6f42c1;
    animation-delay: 0.8s;
}

.spinner span:nth-child(3) {
    animation-delay: 1.6s;
}

@keyframes ripple {
    0% {
        width: 0;
        height: 0;
        opacity: 0.8;
    }
    100% {
        width: 60px;
        height: 60px;
        opacity: 0;
    }
}

/* Header */
.header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    padding: 30px 40px;
}

.logo {
    display: flex;
    align-items: center;
    color: white;
}

.logo-img {
    height: 35px; /* Adjust as needed */
    margin-right: 10px;
    filter: brightness(0); /* Forces color to #080403 dark black */
    object-fit: contain;
}

.logo-img:last-child {
    margin-right: 0;
    margin-left: 10px; /* Kept a small margin between them */
    height: 45px; /* Adjust relative size if GVM logo needs to be taller/shorter */
}

/* Hero Section */
.hero {
    position: relative;
    height: 70vh;
    min-height: 500px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: white;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center bottom;
}





.hero-characters {
    position: absolute;
    left: -2%;
    bottom: 0;
    height: 75%; 
    max-width: 55vw; /* Prevent it from overlapping the center text on tablets */
    z-index: 5;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.hero-characters img {
    height: 100%;
    width: 100%;
    object-fit: contain;
    object-position: bottom left;
}

.hero-content {
    z-index: 10;
    padding: 0 20px;
    margin-top: -20vh; /* Moved further up from -10vh */
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1); /* Smooth positioning */
}

.subtitle {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: 3px;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.title {
    font-size: 5rem;
    font-weight: 900;
    margin-bottom: 25px;
    letter-spacing: 4px;
    line-height: 1.2;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.description {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 3px;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Cards Section */
.cards-section {
    position: relative;
    margin-top: -120px; /* Moved down by 10px from -130px */
    padding: 0 20px 60px;
    z-index: 20;
}

.cards-container {
    max-width: 1188px; /* Enlarged by approx 10% */
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.card {
    background-color: var(--bg-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.card-image {
    position: relative;
    height: 220px; /* Reverted to 210px */
    border-top: 25px solid var(--bg-white);
    border-left: 25px solid var(--bg-white);
    border-right: 25px solid var(--bg-white);
    box-sizing: border-box;
    overflow: hidden;
    background-color: #f0f4f8; /* Soft placeholder color */
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px; /* Slight rounding for a softer look */
    opacity: 0;
    transition: opacity 0.4s ease, transform 0.5s ease;
}

.card-image img.img-loaded {
    opacity: 1;
}

.card:hover .card-image img {
    transform: scale(1.05);
}

.tag {
    position: absolute;
    top: 0;
    left: 0; /* Aligns with the absolute left edge of the card */
    transform: translateY(-100%); /* Sits right on top of the text container, overlapping the image */
    padding: 4px 16px; /* Reduced vertical padding for smaller height */
    color: white;
    font-weight: 700;
    font-size: 1rem;
    z-index: 2;
}

.tag-2025 {
    background-color: var(--tag-2025);
}

.tag-2026 {
    background-color: var(--tag-2026);
}

.tag-2027 {
    background-color: var(--tag-2027);
}

.card-text {
    position: relative; /* Allows tag absolute positioning */
    padding: 30px 25px 25px 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-text h2 {
    font-size: 20px; /* Changed to fixed 21px */
    color: #5a3b94;
    margin-bottom: 10px;
    font-weight: 700;
    line-height: 1.4;
}

.card-text h2.coming-soon {
    color: #999999;
    font-size: 1.5rem;
}

.card-text p {
    font-size: 16px; /* Changed to fixed 16px */
    color: #333333;
    line-height: 1.6;
}

.center-content {
    justify-content: center;
    align-items: center;
    min-height: 150px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px 20px;
    color: #888;
    font-size: 0.85rem;
    background-color: #fff;
    margin-top: 40px;
}

/* Back to top */
.back-to-top {
    position: fixed;
    right: 28px;
    bottom: 28px;
    z-index: 200;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 50%;
    color: #ffffff;
    background: #5a3b94;
    box-shadow: 0 8px 20px rgba(51, 31, 92, 0.28);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease, background-color 0.25s ease;
}

.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.5;
    vertical-align: middle;
}

.back-to-top:hover {
    background: #0076a8;
}

.back-to-top:focus-visible {
    outline: 3px solid #21b3b3;
    outline-offset: 3px;
}

/* Animations */
body:not(.anim-ready) .animate-fade-in,
body:not(.anim-ready) .animate-slide-up {
    animation-play-state: paused !important;
}

.animate-fade-in {
    opacity: 0;
    animation: fadeIn 1.8s ease forwards;
}

.animate-slide-up {
    opacity: 0;
    transform: translateY(30px);
    animation: slideUp 1.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.delay-1 {
    animation-delay: 0.45s;
}

.delay-2 {
    animation-delay: 0.9s;
}

.animate-on-scroll {
    opacity: 0;
    transform: translateY(50px);
    transition: opacity 1.2s ease, transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Responsive */
@media (max-width: 1400px) {
    .title { font-size: 4.8rem; }
    .subtitle { font-size: 1.28rem; }
    .description { font-size: 1.38rem; }
    .hero-content { margin-left: 0; }
    .hero-characters { height: 72%; left: -3%; }
}
@media (max-width: 1300px) {
    .title { font-size: 4.8rem; }
    .subtitle { font-size: 1.28rem; }
    .description { font-size: 1.38rem; }
    .hero-content { margin-left: 0; }
    .hero-characters { height: 69%; left: -4%; }
}
@media (max-width: 1200px) {
    .title { font-size: 4.8rem; }
    .subtitle { font-size: 1.2rem; }
    .description { font-size: 1.3rem; }
    .hero-content { margin-left: 0; }
    .hero-characters { height: 64%; left: -5%; }
}
@media (max-width: 1024px) {
    .title { font-size: 4.8rem; }
    .subtitle { font-size: 1.15rem; }
    .description { font-size: 1.25rem; }
    .hero-content { margin-left: 0; }
    .hero-characters { height: 60%; left: -5%; }
}
@media (max-width: 960px) {
    .title { font-size: 4.2rem; }
    .subtitle { font-size: 1.1rem; }
    .description { font-size: 1.1rem; }
    .hero-content { margin-left: 0; margin-top: -24vh; }
    .cards-container { gap: 20px; }
    .hero-characters { height: 60%; left: -6%; }
}
@media (max-width: 840px) {
    .hero { height: 60vh; min-height: 450px; }
    .title { font-size: 4.2rem; }
    .subtitle { font-size: 1.05rem; }
    .description { font-size: 1.1rem; }
    .hero-content { margin-left: 0; margin-top: -15vh; }
    .hero-characters { height: 57%; left: -7%; }
    .cards-section { margin-top: -70px; }
    .logo-img { height: 28px; }
    .logo-img:last-child { height: 36px; }
}
@media (max-width: 768px) {
    .title { font-size: 3.5rem; }
    .subtitle { font-size: 1rem; }
    .description { font-size: 1.05rem; }
    .hero-content { margin-left: 0; margin-top: -20vh; }
    .hero-characters { height: 54%; left: -8%; }
}
@media (max-width: 640px) {
    .header { padding: 20px 25px; }
    .logo-img { height: 26px; }
    .logo-img:last-child { height: 32px; }
    .hero { height: 55vh; min-height: 400px; }
    .title { font-size: 3.2rem; }
    .subtitle { font-size: 1rem; }
    .description { font-size: 1.05rem; }
    .hero-content { margin-left: 0; margin-top: -15vh; }
    .cards-section { margin-top: -60px; padding: 0 15px 50px; }
    .card-image { height: 240px; }
    .hero-characters { height: 50%; left: -10%; }
    .back-to-top { right: 18px; bottom: 18px; width: 44px; height: 44px; }
}
@media (max-width: 480px) {
    .header { padding: 15px 20px; }
    .logo-img { height: 22px; }
    .logo-img:last-child { height: 28px; }
    .hero { height: 50vh; min-height: 420px; }
    .title { font-size: 3.4rem; margin-bottom: 18px;} 
    .subtitle { font-size: 1rem; letter-spacing: 2px; }
    .description { font-size: 1rem; letter-spacing: 2px; }
    .hero-content { margin-left: 0; margin-top: -15vh; }
    .cards-section { margin-top: -40px; }
    .card-image { height: 280px; }
    .hero-characters { height: 45%; left: -2%; }
}
@media (max-width: 400px) {
    .header { padding: 12px 15px; }
    .logo-img { height: 18px; }
    .logo-img:last-child { height: 24px; }
    .hero { height: 50vh; min-height: 370px; }
    .title { font-size: 3rem; }
    .subtitle { font-size: 0.9rem; letter-spacing: 1px; }
    .description { font-size: 0.9rem; }
    .hero-content { margin-left: 0; margin-top: -14vh; }
    .cards-section { margin-top: -30px; padding: 0 10px 30px; }
    .card-image { height: 240px; }
    .hero-characters { height: 45%; left: -2%; }
}
