* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft JhengHei', 'Segoe UI', sans-serif;
    color: #ffffff;
    overflow-x: hidden;
    background: #090A0F;
}

/* Language Toggle */
.lang-toggle {
    position: fixed;
    top: 30px;
    right: 40px;
    z-index: 1000;
}

.lang-btn {
    background: rgba(74, 158, 255, 0.15);
    backdrop-filter: blur(15px);
    border: 2px solid rgba(74, 158, 255, 0.4);
    color: #ffffff;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 20px rgba(74, 158, 255, 0.15);
    position: relative;
    overflow: hidden;
}

.lang-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(74, 158, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.lang-btn:hover::before {
    width: 300px;
    height: 300px;
}

.lang-btn:hover {
    background: rgba(74, 158, 255, 0.3);
    border-color: rgba(74, 158, 255, 0.8);
    transform: translateY(-2px);
    box-shadow: 0 6px 30px rgba(74, 158, 255, 0.4);
}

.lang-btn span {
    position: relative;
    z-index: 1;
}

/* Layout */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
    position: relative;
    z-index: 1;
}

/* Header */
header {
    padding: 80px 0 60px;
    text-align: center;
    animation: fadeInDown 1s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h1 {
    font-size: 36px;
    font-weight: 300;
    margin-bottom: 20px;
    letter-spacing: 4px;
    background: linear-gradient(135deg, #ffffff 0%, #4A9EFF 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 40px rgba(74, 158, 255, 0.3);
    animation: glow 3s ease-in-out infinite;
}

@keyframes glow {

    0%,
    100% {
        filter: drop-shadow(0 0 20px rgba(74, 158, 255, 0.4));
    }

    50% {
        filter: drop-shadow(0 0 40px rgba(74, 158, 255, 0.6));
    }
}

.tagline {
    font-size: 16px;
    font-weight: 300;
    margin-bottom: 12px;
    color: #B8D4FF;
    opacity: 0;
    animation: fadeIn 1s ease-out forwards;
}

.tagline:nth-child(3) {
    animation-delay: 0.2s;
}

.tagline:nth-child(4) {
    animation-delay: 0.4s;
}

.tagline:nth-child(5) {
    animation-delay: 0.6s;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* Sections */
.section {
    margin-bottom: 100px;
}

h2 {
    font-size: 22px;
    font-weight: 400;
    margin-bottom: 50px;
    text-align: center;
    background: linear-gradient(135deg, #4A9EFF 0%, #00D4FF 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    padding-bottom: 15px;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #4A9EFF, transparent);
    border-radius: 2px;
}

/* Apps Grid */
.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 35px;
    margin-bottom: 70px;
}

.app-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(74, 158, 255, 0.2);
    border-radius: 20px;
    padding: 35px 30px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(74, 158, 255, 0.15) 0%, transparent 70%);
    opacity: 0;
    transition: all 0.6s ease;
    transform: scale(0);
}

.app-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(74, 158, 255, 0.1) 0%, rgba(0, 212, 255, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.app-card:hover {
    transform: translateY(-15px) scale(1.02);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(74, 158, 255, 0.6);
    box-shadow: 0 25px 60px rgba(74, 158, 255, 0.3), 0 0 40px rgba(74, 158, 255, 0.2);
}

.app-card:hover::before {
    opacity: 1;
    transform: scale(1);
}

.app-card:hover::after {
    opacity: 1;
}

.app-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
}

.app-title-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.app-subtitle {
    font-size: 13px;
    color: #4A9EFF;
    letter-spacing: 0.03em;
}

.app-tagline {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
}

.app-icon {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    background: linear-gradient(135deg, rgba(74, 158, 255, 0.25), rgba(0, 212, 255, 0.25));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 8px 20px rgba(74, 158, 255, 0.2);
}

.app-icon::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, rgba(74, 158, 255, 0.4), rgba(0, 212, 255, 0.4));
    border-radius: 16px;
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: -1;
}

.app-card:hover .app-icon {
    background: linear-gradient(135deg, rgba(74, 158, 255, 0.4), rgba(0, 212, 255, 0.4));
    transform: scale(1.1) rotate(-5deg);
    box-shadow: 0 12px 30px rgba(74, 158, 255, 0.4);
}

.app-card:hover .app-icon::before {
    opacity: 1;
}

.app-name {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 0;
    color: #4A9EFF;
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.app-card:hover .app-name {
    color: #00D4FF;
    transform: translateX(5px);
}

.app-description {
    font-size: 15px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.75);
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.app-card:hover .app-description {
    color: rgba(255, 255, 255, 0.95);
}

/* Links Grid */
.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 70px;
}

.link-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(15px);
    border: 2px solid rgba(74, 158, 255, 0.2);
    border-radius: 20px;
    padding: 35px 30px;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    display: block;
    cursor: pointer;
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.link-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(74, 158, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.link-card:hover::before {
    left: 100%;
}

.link-card::after {
    content: '\2192';
    position: absolute;
    top: 30px;
    right: 25px;
    font-size: 24px;
    color: #4A9EFF;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.link-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(74, 158, 255, 0.8);
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(74, 158, 255, 0.3);
}

.link-card:hover::after {
    opacity: 1;
    transform: translateX(0);
}

.link-title {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.link-card:hover .link-title {
    color: #4A9EFF;
}

.link-description {
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.3s ease;
}

.link-card:hover .link-description {
    color: rgba(255, 255, 255, 0.9);
}

/* Responsive Design */
@media (max-width: 968px) {
    .links-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 32px;
        letter-spacing: 3px;
        margin-bottom: 16px;
    }

    .tagline {
        font-size: 14px;
        margin-bottom: 10px;
    }

    h2 {
        font-size: 18px;
        margin-bottom: 40px;
        padding-bottom: 12px;
    }

    h2::after {
        width: 60px;
        height: 2px;
    }

    .container {
        padding: 0 20px;
    }

    .lang-toggle {
        top: 20px;
        right: 20px;
    }

    .lang-btn {
        padding: 8px 20px;
        font-size: 13px;
    }

    header {
        padding: 50px 0 35px;
    }

    .section {
        margin-bottom: 80px;
    }

    .apps-grid {
        grid-template-columns: 1fr;
        gap: 25px;
        margin-bottom: 60px;
    }

    .app-card {
        padding: 28px 25px;
    }

    .app-icon {
        width: 54px;
        height: 54px;
        font-size: 24px;
        margin-bottom: 18px;
    }

    .app-name {
        font-size: 18px;
        margin-bottom: 12px;
    }

    .app-description {
        font-size: 14px;
        line-height: 1.6;
    }

    .links-grid {
        gap: 25px;
        margin-bottom: 60px;
    }

    .link-card {
        padding: 30px 25px;
    }

    .link-card::after {
        font-size: 22px;
        top: 28px;
        right: 22px;
    }

    .link-title {
        font-size: 17px;
        margin-bottom: 9px;
    }

    .link-description {
        font-size: 13px;
    }

}

/* Reveal animation class added by main.js */
.reveal {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* Ensure container has enough height to scroll */
.app-root {
    min-height: 100vh;
    padding-bottom: 100px;
}

/* YouTube Section */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.video-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.3s ease, background 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.video-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.1);
    border-color: #007bff;
}

.video-thumbnail img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.video-info {
    padding: 1.2rem;
}

.video-title {
    color: #fff;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-channel {
    color: #888;
    font-size: 0.85rem;
}

/* Contact Section */
.contact-section {
    text-align: center;
    padding: 50px 35px;
    background: rgba(74, 158, 255, 0.05);
    border: 1px solid rgba(74, 158, 255, 0.2);
    border-radius: 25px;
    backdrop-filter: blur(10px);
    max-width: 800px;
    margin: 0 auto 100px;
}

.contact-content {
    max-width: 100%;
    padding: 0 10px;
}

.contact-text {
    font-size: 16px;
    color: #B8D4FF;
    line-height: 1.6;
    margin-bottom: 18px;
}

.contact-email-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 12px 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 14px;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
    word-break: break-all;
    max-width: 90%;
    overflow-wrap: break-word;
    position: relative;
    overflow: hidden;
}

.contact-email-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s ease;
}

.contact-email-btn:hover::before {
    left: 100%;
}

.contact-email-btn:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.5);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

/* Mobile Contact Section */
@media (max-width: 768px) {
    .contact-section {
        padding: 35px 20px;
        margin: 0 20px 70px;
        border-radius: 20px;
    }

    .contact-text {
        font-size: 14px;
        margin-bottom: 15px;
    }

    .contact-email-btn {
        font-size: 14px;
        padding: 10px 22px;
        word-break: break-all;
        max-width: 95%;
    }
}

@media (max-width: 480px) {
    .contact-section {
        padding: 28px 15px;
        margin: 0 15px 55px;
    }

    .contact-text {
        font-size: 13px;
    }

    .contact-email-btn {
        font-size: 13px;
        padding: 9px 18px;
        gap: 0.3rem;
    }
}

/* YouTube section hidden state */
.youtube-section.hidden {
    display: none;
}
