:root {
    --text-dark: #2c2116;
    --text-light: #4a3a2a;
    --text-muted: #6b5842;
    --accent-gold: #8c7353;
    --border-color: rgba(140, 115, 83, 0.4);
    --glass-bg: rgba(228, 220, 206, 0.6);
    --glass-border: rgba(140, 115, 83, 0.2);
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Noto Serif SC', serif;
    /* Parchment background with subtle noise */
    background-color: #dfd8c8;
    background-image: 
        url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.08'/%3E%3C/svg%3E"),
        radial-gradient(circle at 50% 50%, #e6e0d3 0%, #bcaea0 100%);
    background-attachment: fixed;
    color: var(--text-dark);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    overflow-x: hidden;
}

body::after {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    box-shadow: inset 0 0 120px rgba(0,0,0,0.15);
    pointer-events: none;
    z-index: 9999;
}

h1, h2, h3, h4, .nav-links a {
    font-family: 'Cinzel', 'Noto Serif SC', serif;
}

/* Nav */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1.2rem 2rem;
    background: rgba(223, 216, 200, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.3rem 0;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: 0;
    left: 50%;
    background-color: var(--accent-gold);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.nav-links a:hover::after, .nav-links a.active::after {
    width: 100%;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--accent-gold);
}

.nav-links a.btn-login {
    border: 1px solid var(--accent-gold);
    padding: 0.4rem 1.2rem;
    border-radius: 4px;
    background: transparent;
    transition: all 0.3s ease;
    margin-left: 1rem;
}

.nav-links a.btn-login::after {
    display: none;
}

.nav-links a.btn-login:hover {
    background: var(--accent-gold);
    color: var(--text-dark);
}

/* Hero Section */
.hero {
    padding-top: 100px;
    min-height: 85vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
}

.hero-image-container {
    width: 90vw;
    max-width: 1100px;
    margin: 2rem auto;
    position: relative;
}

.hero-image-container img {
    width: 100%;
    border-radius: 4px;
    box-shadow: 0 15px 40px rgba(20, 15, 10, 0.2);
    border: 1px solid #a89a85;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.hero-image-container img:hover {
    transform: scale(1.015);
}

.brand-core {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    padding: 3rem 4rem;
    margin: -5rem auto 4rem;
    max-width: 800px;
    position: relative;
    z-index: 10;
    border-radius: 6px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
}

.brand-core::before {
    content: '';
    position: absolute;
    top: 8px; left: 8px; right: 8px; bottom: 8px;
    border: 1px solid rgba(140, 115, 83, 0.3);
    pointer-events: none;
    border-radius: 4px;
}

.motto {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    letter-spacing: 4px;
}

.motto-en {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    color: var(--accent-gold);
    letter-spacing: 3px;
    text-transform: uppercase;
}

.divider {
    color: var(--accent-gold);
    font-size: 1.5rem;
    margin: 1.5rem 0;
    opacity: 0.7;
}

.vision {
    font-size: 1.15rem;
    color: var(--text-light);
    line-height: 1.8;
    margin: 0;
}

/* Supported Claws Section */
.supported-claws {
    padding: 2rem 2rem 6rem;
    max-width: 1200px;
    margin: 0 auto;
}

.agent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}

.agent-item {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 1.5rem 1rem;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 5px 20px rgba(0,0,0,0.04);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.agent-item::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 100%;
    height: 3px;
    background: var(--accent-gold);
    transform: scaleX(0);
    transition: transform 0.4s ease;
    transform-origin: center;
}

.agent-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(20, 15, 10, 0.1);
    background: linear-gradient(135deg, rgba(238, 233, 222, 0.8) 0%, rgba(220, 212, 197, 0.5) 100%);
}

.agent-item:hover::after {
    transform: scaleX(1);
}

.agent-item img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    border-radius: 12px;
    background: transparent;
    padding: 2px;
    box-shadow: none;
    border: none;
    transition: all 0.5s ease;
}

.agent-item img.official-logo {
    filter: sepia(1) hue-rotate(345deg) saturate(1.5) brightness(0.85) contrast(1.2);
    opacity: 0.85;
}

.agent-item:hover img.official-logo {
    filter: sepia(0.2) hue-rotate(345deg) saturate(1.2) brightness(1) contrast(1.1);
    opacity: 1;
    transform: translateY(-3px) scale(1.1);
}

.agent-item span {
    font-size: 1rem;
    color: var(--text-dark);
    font-weight: 600;
    letter-spacing: 0.5px;
    font-family: 'Cinzel', 'Noto Serif SC', serif;
}

/* Modules Section */
.modules {
    padding: 6rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 4rem;
    color: var(--text-dark);
    position: relative;
    letter-spacing: 2px;
}

.section-title small {
    display: block;
    font-size: 1.2rem;
    color: var(--accent-gold);
    margin-top: 0.5rem;
    font-weight: 400;
    letter-spacing: 4px;
}

.section-title::after {
    content: '❖';
    display: block;
    font-size: 1.5rem;
    color: var(--accent-gold);
    margin-top: 1.5rem;
    opacity: 0.5;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 3rem;
}

.card {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    background: linear-gradient(135deg, rgba(234, 227, 214, 0.7) 0%, rgba(216, 207, 191, 0.4) 100%);
    border: 1px solid rgba(140, 115, 83, 0.25);
    padding: 3rem 2.5rem;
    position: relative;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    border-radius: 6px;
}

.card::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-gold);
    transform: scaleY(0);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    transform-origin: top;
}

.card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(140, 115, 83, 0.8);
    box-shadow: 0 15px 35px rgba(20, 15, 10, 0.15), 0 0 25px rgba(140, 115, 83, 0.15);
    background: linear-gradient(135deg, rgba(245, 240, 230, 0.9) 0%, rgba(228, 220, 206, 0.7) 100%);
}

.card:hover::before {
    transform: scaleY(1);
}

.card-number {
    position: absolute;
    top: -10px;
    right: 15px;
    font-size: 8rem;
    font-family: 'Cinzel', serif;
    color: rgba(140, 115, 83, 0.08);
    z-index: 0;
    pointer-events: none;
    font-weight: 700;
    line-height: 1;
    transition: color 0.4s ease;
}

.card:hover .card-number {
    color: rgba(140, 115, 83, 0.15);
}

.card-content {
    position: relative;
    z-index: 1;
}

.card h3 {
    font-size: 1.6rem;
    margin: 0;
    color: var(--text-dark);
    letter-spacing: 1px;
}

.card .sub {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--accent-gold);
    display: block;
    margin-bottom: 2rem;
    letter-spacing: 2px;
}

.func {
    font-size: 1.05rem;
    color: var(--text-dark);
    margin-bottom: 1.2rem;
    padding-bottom: 1.2rem;
    border-bottom: 1px dashed rgba(140, 115, 83, 0.3);
}

.func strong, .core strong {
    color: var(--text-muted);
    font-weight: 700;
}

.core {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.8;
}

ul.card-list {
    padding-left: 1.2rem;
    margin: 0.5rem 0 0 0;
}

ul.card-list li {
    margin-bottom: 0.5rem;
}

/* Subpages Layout */
.page-content {
    padding-top: 140px;
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 4rem;
    min-height: 70vh;
}

.page-header {
    text-align: center;
    margin-bottom: 4rem;
}

.page-title {
    font-size: 3rem;
    color: var(--text-dark);
    margin: 0;
    letter-spacing: 2px;
}

.page-subtitle {
    font-size: 1.4rem;
    color: var(--accent-gold);
    font-weight: 600;
    margin-top: 0.5rem;
    letter-spacing: 4px;
}

.page-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    padding: 0 2rem;
}

.page-text h2 {
    font-size: 1.8rem;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    border-bottom: 1px dashed rgba(140, 115, 83, 0.3);
    padding-bottom: 1rem;
}

.page-text p {
    font-size: 1.1rem;
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

ul.page-list {
    font-size: 1.1rem;
    color: var(--text-light);
    line-height: 1.8;
    padding-left: 1.5rem;
    margin-bottom: 2rem;
}

.service-actions {
    margin-top: 3rem;
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.btn-primary, .btn-secondary {
    font-family: 'Noto Serif SC', serif;
    font-size: 1rem;
    padding: 0.8rem 2rem;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-weight: 600;
    letter-spacing: 1px;
}

.btn-primary {
    background: var(--accent-gold);
    color: var(--text-dark);
    border: 1px solid var(--accent-gold);
    box-shadow: 0 5px 15px rgba(140, 115, 83, 0.2);
}

.btn-primary:hover {
    background: transparent;
    color: var(--accent-gold);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: var(--accent-gold);
    border: 1px solid var(--accent-gold);
}

.btn-secondary:hover {
    background: var(--accent-gold);
    color: var(--text-dark);
    transform: translateY(-2px);
}

.page-image {
    display: flex;
    justify-content: center;
    align-items: center;
}

.image-placeholder {
    width: 100%;
    aspect-ratio: 4/3;
    background: linear-gradient(135deg, rgba(234, 227, 214, 0.4) 0%, rgba(216, 207, 191, 0.2) 100%);
    border: 1px solid rgba(140, 115, 83, 0.25);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    position: relative;
    overflow: hidden;
}

.image-placeholder img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 1;
    transition: transform 0.8s ease;
}

.page-image:hover .image-placeholder img {
    transform: scale(1.05);
}

.image-placeholder::after {
    content: '';
    position: absolute;
    top: 15px; left: 15px; right: 15px; bottom: 15px;
    border: 1px solid rgba(140, 115, 83, 0.5);
    pointer-events: none;
    z-index: 2;
    transition: top 0.4s ease, left 0.4s ease, right 0.4s ease, bottom 0.4s ease;
}

.page-image:hover .image-placeholder::after {
    top: 25px; left: 25px; right: 25px; bottom: 25px;
}

.image-placeholder .icon, .image-placeholder p {
    display: none;
}

@media (max-width: 768px) {
    .page-body {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .page-title {
        font-size: 2.2rem;
    }
}

/* Footer */
footer {
    text-align: center;
    padding: 4rem 2rem;
    background: transparent;
    border-top: 1px solid var(--border-color);
    margin-top: 2rem;
    color: var(--text-muted);
    font-family: 'Cinzel', serif;
    position: relative;
    z-index: 10;
}

footer .footer-title {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin: 0.5rem 0;
    letter-spacing: 4px;
}

footer .footer-motto {
    font-size: 0.9rem;
    letter-spacing: 3px;
    color: var(--accent-gold);
}

/* Animations */
@keyframes pulse-glow {
    0% { box-shadow: 0 0 0 0 rgba(140, 115, 83, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(140, 115, 83, 0); }
    100% { box-shadow: 0 0 0 0 rgba(140, 115, 83, 0); }
}

.btn-pulse {
    animation: pulse-glow 2s infinite;
}

.fade-in {
    opacity: 0;
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in.appear {
    opacity: 1;
}

.slide-up {
    transform: translateY(30px);
}

.slide-up.appear {
    transform: translateY(0);
}

.lang-switcher-li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 1.5rem;
}

.lang-btn {
    background: none;
    border: none;
    color: var(--text-dark);
    font-family: 'Cinzel', 'Noto Serif SC', serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
    transition: color 0.3s ease;
}

.lang-btn.active, .lang-btn:hover {
    color: var(--accent-gold);
}

.lang-divider {
    color: var(--border-color);
    font-size: 0.9rem;
}

html[lang="en"] .lang-zh {
    display: none !important;
}

html[lang="zh"] .lang-en {
    display: none !important;
}

/* Responsive */
.hamburger {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 6px;
    z-index: 1005;
}

.hamburger .bar {
    width: 25px;
    height: 2px;
    background-color: var(--text-dark);
    transition: all 0.3s ease;
    border-radius: 2px;
}

@media (max-width: 768px) {
    nav {
        padding: 1rem 1.5rem;
        justify-content: flex-end;
    }
    
    .hamburger {
        display: flex;
    }
    
    .nav-links {
        position: fixed;
        right: -100%;
        top: 0;
        flex-direction: column;
        background: rgba(223, 216, 200, 0.95);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        width: 70%;
        height: 100vh;
        justify-content: center;
        align-items: center;
        transition: right 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        box-shadow: -5px 0 20px rgba(0,0,0,0.1);
        gap: 2rem;
    }

    .nav-links.active {
        right: 0;
    }
    
    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }
    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }
    
    .nav-links a.btn-login {
        margin-left: 0;
        margin-top: 1rem;
    }

    .hero {
        padding-top: 120px;
    }
    .brand-core {
        margin: -3rem 1.5rem 2rem;
        padding: 2rem 1.5rem;
    }
    .motto {
        font-size: 1.3rem;
        letter-spacing: 2px;
    }
    .motto-en {
        font-size: 0.85rem;
    }
    .vision {
        font-size: 1rem;
    }
    .modules {
        padding: 4rem 1.5rem;
    }
    .section-title {
        font-size: 2rem;
    }
    .grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .card {
        padding: 2.5rem 1.5rem;
    }
    .card-number {
        font-size: 6rem;
    }
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(20, 15, 10, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
}

.modal-content {
    background: linear-gradient(135deg, rgba(238, 233, 222, 0.95) 0%, rgba(220, 212, 197, 0.95) 100%);
    border: 1px solid var(--accent-gold);
    border-radius: 6px;
    width: 90%;
    max-width: 550px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2.5rem;
    position: relative;
    box-shadow: 0 25px 60px rgba(0,0,0,0.3);
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    text-align: center;
}

.modal.show .modal-content {
    transform: translateY(0) scale(1);
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 18px;
    color: var(--text-muted);
    font-size: 32px;
    font-weight: 300;
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
}

.close-btn:hover {
    color: var(--text-dark);
}

.modal-content h2 {
    color: var(--text-dark);
    margin-top: 0;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px dashed rgba(140, 115, 83, 0.3);
    font-size: 1.6rem;
    letter-spacing: 1px;
}

.modal-body {
    margin: 1.5rem 0 2.5rem;
    color: var(--text-light);
    font-size: 1.05rem;
    line-height: 1.8;
    text-align: left;
}

.modal-body p {
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .modal-content {
        width: 92%;
        padding: 2rem 1.5rem;
    }
    .modal-content h2 {
        font-size: 1.4rem;
    }
}
