:root {
    --primary-blue: #005bac;
    --secondary-blue: #0077cc;
    --light-blue: #e6f2ff;
    --dark-blue: #003d7a;
    --accent-green: #00a896;
    --accent-orange: #ff6b35;
    --accent-purple: #6a4c93;
    --accent-teal: #118ab2;
    --accent-cyan: #06d6a0;
    --accent-red: #e63946;
    --text-dark: #333;
    --text-light: #f8f9fa;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    --transition: all 0.4s ease;

    /* 统一根字体，确保各页面使用 rem 单位时在移动端表现一致
       与 generation.css 中的 :root font-size 保持一致，避免不同页面在小屏上大小不一致 */
    font-size: clamp(14px, 2vw, 16px);
}

/* Ensure page title on small screens matches SeFMol behavior */
@media (max-width: 768px) {
    .page-title h1 {
        /* match generation.css mobile rule so all pages have same small-screen size */
        font-size: clamp(1.5rem, 5vw, 2rem) !important;
        line-height: 1.1;
    }
}

/* Some templates use .page-header instead of .page-title (e.g. admet.html).
   Ensure .page-header h1 also uses the same mobile sizing. */
@media (max-width: 768px) {
    .page-header h1 {
        font-size: clamp(1.5rem, 5vw, 2rem) !important;
        line-height: 1.1;
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

body {
    background: linear-gradient(135deg, #f0f7ff, #e1eeff);
    color: var(--text-dark);
    min-height: 100vh;
    padding: 0;
    overflow-x: hidden;
}

/* 确保背景层不拦截点击事件 */
.card-background {
    pointer-events: none;  /* 关键属性：允许点击穿透 */
}

/* 主要宽度优化 */
.container, .header-content, .footer-content {
    max-width: 1800px;
    margin: 0 auto;
    padding: 0 40px;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, var(--primary-blue), var(--dark-blue));
    color: white;
    padding: 1rem 5%;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 100;
    transition: all 0.3s ease;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

/* Navigation Bar Styles */
.navbar {
    display: flex;
    align-items: center;
    width: 100%;
    overflow: hidden; /* 限制横向滚动只出现在内部可滚动元素（如 .nav-links） */
}

.nav-links {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-links li {
    margin: 0 12px;
    position: relative;
}

.nav-right {
    margin-left: auto;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-size: 1.15rem;
    font-weight: 500;
    padding: 8px 15px;
    border-radius: 4px;
    transition: all 0.3s ease;
    position: relative;
    display: inline-block;
}

/* --- 改进导航外观：胶囊按钮、自动缩放 --- */
.nav-links {
    gap: 10px;
    justify-content: center; /* 居中显示 */
}

.nav-link {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    padding: clamp(6px, 1.2vw, 10px) clamp(10px, 2.4vw, 18px);
    border-radius: 999px; /* 胶囊形 */
    font-size: clamp(0.95rem, 2.2vw, 1.05rem);
    white-space: nowrap; /* 不换行 */
    box-shadow: none;
}

.nav-link.active {
    background: rgba(255,255,255,0.18);
    border-color: rgba(255,255,255,0.2);
}

.nav-link:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background-color: var(--accent-cyan);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 70%;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .header-content {
        flex-direction: column;
        text-align: center;
        padding: 1rem 0;
    }

    .navbar {
        margin-top: 1.5rem;
        margin-bottom: 1rem;
    }

    .nav-links li {
        margin: 0 15px;
    }
}

@media (max-width: 768px) {
    /* 小屏时保持单行，允许横向滚动以保证所有按钮可访问 */
    .nav-links {
        flex-direction: row;
        align-items: center;
        flex-wrap: nowrap; /* 不换行，保持一行 */
        overflow-x: auto; /* 可横向滚动 */
        -webkit-overflow-scrolling: touch; /* iOS 平滑滚动 */
        padding: 6px 8px;
        gap: 8px;
        max-width: 100%; /* 防止强制扩展宽度导致父容器溢出 */
        justify-content: flex-start; /* 从左开始，用户可滑动 */
    }

    .nav-links li {
        margin: 0;
        flex: 0 0 auto;
    }

    /* 防止右侧项把行推开 */
    .nav-right {
        margin-left: 0;
    }

    /* 隐藏滚动条但保留滚动行为（现代浏览器） */
    .nav-links::-webkit-scrollbar { height: 6px; }
    .nav-links::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 3px; }
}

/* 桌面及大屏恢复原始导航布局：logo 左，导航右，单行显示 */
@media (min-width: 769px) {
    .header-content {
        flex-direction: row;
        text-align: left;
        align-items: center;
    }

    /* 导航在右侧并且不滚动 */
    .nav-links {
        justify-content: flex-end !important;
        overflow-x: visible !important;
        gap: 12px;
        flex-wrap: nowrap;
    }

    .nav-links li {
        margin: 0 12px;
    }

    /* 保持右侧项推动其到最右 */
    .nav-right {
        margin-left: auto;
    }

    /* 让 .navbar 使用默认布局，不截断内容 */
    .navbar {
        overflow: visible;
        width: auto; /* 允许 navbar 与 logo 同行、不占满整行 */
        display: flex;
        align-items: center;
        justify-content: flex-end;
    }

    /* 微调胶囊样式在大屏的大小 */
    .nav-link {
        padding: 8px 14px;
        font-size: 1.05rem;
    }
}

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

.logo {
    width: 70px;
    height: 70px;
    border-radius: 8px;  /* 从圆形改为圆角矩形 */
    overflow: hidden;  /* 确保图片不会超出容器 */
}

.logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;  /* 保持图片比例 */
}

/* 响应式调整 */
@media (max-width: 768px) {
    .logo {
        width: 50px;
        height: 50px;
    }
}

.logo i {
    font-size: 32px;
    color: var(--primary-blue);
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-text h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.brand-text p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-top: 4px;
}

/* Hero Section */
.hero {
    background: url('https://images.unsplash.com/photo-1532094349884-543bc11b234d?ixlib=rb-4.0.3&auto=format&fit=crop&w=1950&q=80') center/cover;
    min-height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 3rem;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(0, 91, 172, 0.85), rgba(0, 61, 122, 0.9));
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    padding: 2rem;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transform: translateY(0);
    transition: transform 0.5s ease, box-shadow 0.5s ease;
}

.hero-text {
    flex: 1;
    padding-right: 2rem;
}

.hero-image {
    flex: 0 0 400px;
}

.molecular-visualization {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.hero h2 {
    font-size: 3.2rem;
    font-weight: 800;
    margin-bottom: 1.2rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.hero p {
    font-size: 1.5rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    font-weight: 300;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

/* Features Introduction Section */
.features-intro {
    background-color: var(--light-blue);
    padding: 60px 0;
    margin-bottom: 40px;
}

.features-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.feature-item {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
    text-align: center;
}

.feature-item.with-image {
    display: flex;
    align-items: center;
    text-align: left;
}

.feature-icon {
    flex: 0 0 60px;
    margin-right: 1.5rem;
    color: var(--primary-blue);
    font-size: 2rem;
}

.feature-content {
    flex: 1;
    padding-right: 1.5rem;
}

.feature-image {
    flex: 0 0 150px;
}

.feature-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.feature-item:hover {
    transform: translateY(-5px);
}

.feature-item i {
    font-size: 3rem;
    color: var(--primary-blue);
    margin-bottom: 20px;
}

.feature-item h3 {
    font-size: 1.5rem;
    color: var(--dark-blue);
    margin-bottom: 15px;
}

.feature-item p {
    color: #555;
    line-height: 1.6;
}

/* Main Content */
.container {
    padding: 0 40px 50px;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

.section-title h2 {
    font-size: 2.5rem;
    color: var(--dark-blue);
    font-weight: 700;
    display: inline-block;
    padding: 0 20px;
    background: linear-gradient(to right, var(--light-blue), transparent, var(--light-blue));
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 5px;
    background: var(--accent-green);
    border-radius: 2px;
}

/* Responsive adjustments for feature items */
@media (max-width: 768px) {
    .features-list {
        grid-template-columns: 1fr;
    }

    .feature-item {
        padding: 20px;
    }

    .feature-item i {
        font-size: 2.5rem;
    }
}

@media (max-width: 992px) {
    .hero-content {
        flex-direction: column;
        text-align: center;
    }

    .hero-text {
        padding-right: 0;
        margin-bottom: 2rem;
    }

    .hero-image {
        flex: 0 0 300px;
        margin: 0 auto;
    }

    .feature-item.with-image {
        flex-direction: column;
        text-align: center;
    }

    .feature-icon {
        margin-right: 0;
        margin-bottom: 1rem;
    }

    .feature-content {
        padding-right: 0;
        margin-bottom: 1rem;
    }

    .feature-image {
        margin: 0 auto;
    }
}

/* Feature Cards Grid - 4列 + 宽卡布局 */
.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-top: 2rem;
}

/* 一体化开发宽卡：横跨全行 */
.card-wide {
    grid-column: 1 / -1;
}

/* 宽卡内部横向布局 */
.card-wide-inner {
    display: flex;
    align-items: center;
    padding: 30px 35px;
    gap: 40px;
    height: 100%;
}

/* 左侧：图标 + 标题，固定宽度，居中对齐 */
.card-wide-left {
    flex: 0 0 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
}

.card-wide-left .card-title {
    margin-bottom: 0;
    white-space: nowrap;
}

/* 竖向分隔线 */
.card-wide-divider {
    width: 1px;
    align-self: stretch;
    background: rgba(0, 91, 172, 0.15);
    flex-shrink: 0;
}

/* 右侧：描述文字 + 按钮水平排成一行，整体垂直居中 */
.card-wide-right {
    flex: 1;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 30px;
}

.card-wide .card-description {
    flex: 1;
    font-size: 1.1rem;
    line-height: 1.7;
    color: #555;
    margin: 0;
}

.card-wide .card-link {
    flex-shrink: 0;
    white-space: nowrap;
}

/* 响应式：中等屏幕 2列 */
@media (max-width: 1200px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .card-wide {
        grid-column: 1 / -1;
    }
}

/* 响应式：小屏幕 1列，宽卡改为竖排 */
@media (max-width: 768px) {
    .features-grid {
        grid-template-columns: 1fr;
    }
    .card-wide-inner {
        flex-direction: column;
        text-align: center;
        padding: 25px 20px;
        gap: 20px;
    }
    .card-wide-divider {
        width: 80%;
        height: 1px;
        align-self: auto;
    }
    .card-wide-left {
        flex: 0 0 auto;
    }
    .card-wide-right {
        flex-direction: column;
        align-items: center;
        gap: 16px;
    }
}

.feature-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

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

.card-header {
    padding: 25px 25px 20px;
    position: relative;
    z-index: 2;
}

.card-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    font-size: 36px;
    color: white;
}

.card-1 .card-icon {
    background: linear-gradient(135deg, var(--accent-green), #00c9a7);
}

.card-2 .card-icon {
    background: linear-gradient(135deg, var(--accent-orange), #ff8c42);
}

.card-3 .card-icon {
    background: linear-gradient(135deg, var(--accent-purple), #8a6bbd);
}

.card-4 .card-icon {
    background: linear-gradient(135deg, var(--accent-teal), #118ab2);
}

.card-5 .card-icon {
    background: linear-gradient(135deg, var(--accent-cyan), #06d6a0);
}

.card-6 .card-icon {
    background: linear-gradient(135deg, var(--accent-red), #e63946);
}

.card-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--dark-blue);
}

.card-content {
    padding: 0 25px 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-description {
    color: #555;
    line-height: 1.7;
    margin-bottom: 25px;
    flex-grow: 1;
    font-size: 1.1rem;
}

.card-link {
    display: inline-block;
    padding: 14px 32px;
    background: var(--primary-blue);
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: var(--transition);
    align-self: flex-start;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.card-link:hover {
    background: var(--dark-blue);
    transform: translateY(-2px);
}

.card-link:hover i {
    transform: translateX(3px);
}

.card-link i {
    margin-left: 8px;
    font-size: 1rem;
    transition: transform 0.3s ease;
}

.status-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    z-index: 3;
}

.status-available {
    background-color: var(--accent-green);
    color: white;
}

.status-development {
    background-color: var(--accent-orange);
    color: white;
}

.card-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.03;
    z-index: 1;
}

.card-1 .card-background {
    background: var(--accent-green);
}

.card-2 .card-background {
    background: var(--accent-orange);
}

.card-3 .card-background {
    background: var(--accent-purple);
}

.card-4 .card-background {
    background: var(--accent-teal);
}

.card-5 .card-background {
    background: var(--accent-cyan);
}

.card-6 .card-background {
    background: var(--accent-red);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 18px 28px;
    background: #333;
    color: white;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.5s ease;
    z-index: 1000;
    max-width: 400px;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-title {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 1.2rem;
}

.toast-title i {
    margin-right: 10px;
    font-size: 22px;
}

.toast.success .toast-title i {
    color: var(--accent-green);
}

.toast.info .toast-title i {
    color: var(--accent-orange);
}

/* Footer */
.footer {
    background: var(--dark-blue);
    color: var(--text-light);
    padding: 50px 5% 30px;
    margin-top: 5rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 50px;
}

.footer-section h3 {
    font-size: 1.5rem;
    margin-bottom: 25px;
    position: relative;
    padding-bottom: 12px;
}

.footer-section h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--accent-green);
    border-radius: 2px;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 15px;
}

.footer-links a {
    color: #ccc;
    text-decoration: none;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
}

.footer-links a:hover {
    color: white;
    transform: translateX(5px);
}

.footer-links a i {
    font-size: 1rem;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.contact-item {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    font-size: 1.1rem;
}

.contact-item i {
    margin-top: 4px;
    font-size: 1.3rem;
    color: var(--accent-green);
}

.social-links {
    display: flex;
    gap: 20px;
    margin-top: 25px;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 50%;
    transition: var(--transition);
}

.social-links a:hover {
    background: var(--accent-green);
    transform: translateY(-3px);
}

/* 添加链接交互效果 */
.card-link {
    cursor: pointer;
    transition: all 0.3s ease !important;
}

.card-link:hover {
    background: var(--dark-blue);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.card-link:active {
    transform: translateY(1px) scale(0.98);
}

/* 光标指示 */
.card-link {
    cursor: pointer;
}

/* 提升链接和内容容器的层级 */
.card-content {
    position: relative;
    z-index: 2;
}

/* 添加链接交互效果 */
.card-link {
    cursor: pointer; /* 确保鼠标变为手型 */
    transition: all 0.3s ease !important; /* 强制过渡效果 */
}

.card-link:hover {
    background: var(--dark-blue);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.card-link:active {
    transform: translateY(1px) scale(0.98);
}

/* 光标指示 */
.card-link {
    cursor: pointer;
}

/* 提升链接和内容容器的层级 */
.card-content {
    position: relative;  /* 创建新的层叠上下文 */
    z-index: 2;         /* 确保高于背景层 */
}

/* Team Members Styles */
@media (max-width: 480px) {
    .team-member {
        flex: 0 0 100%;
    }
}

/* ==========================
   Mobile-first / small screen
   ========================== */
@media (max-width: 768px) {
    /* Narrow containers and larger tap targets */
    .container, .header-content, .footer-content {
        padding-left: 16px;
        padding-right: 16px;
    }

    .header {
        padding: 0.8rem 16px;
    }

    .brand-text h1 {
        font-size: 1.4rem;
    }

    .brand-text p {
        font-size: 0.95rem;
    }

    /* Hero adjustments for small screens */
    .hero {
        min-height: 320px;
        padding: 20px 0;
        margin-bottom: 2rem;
        background-position: center top;
    }

    .hero-content {
        max-width: 100%;
        display: flex;
        flex-direction: column;
        padding: 1rem;
        align-items: center;
        text-align: center;
    }

    .hero-text {
        padding-right: 0;
    }

    .hero-image {
        width: 100%;
        max-width: 360px;
        margin-top: 0.5rem;
    }

    .hero h2 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
        line-height: 1.5;
    }

    /* Features & cards stack vertically, enlarge buttons for touch */
    .features-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .feature-item, .feature-card {
        padding: 16px;
    }

    .card-icon {
        width: 64px;
        height: 64px;
        font-size: 28px;
    }

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

    .card-description {
        font-size: 1rem;
    }

    /* 使卡片按钮更易点按：占满宽度、居中 */
    .card-link {
        display: block;
        width: 100%;
        text-align: center;
        padding: 14px 18px;
        font-size: 1rem;
        align-self: stretch;
        border-radius: 10px;
    }

    /* Toast 在移动端居中显示、宽度自适应 */
    .toast {
        left: 50%;
        right: auto;
        transform: translateX(-50%) translateY(100px);
        bottom: 16px;
        max-width: calc(100% - 32px);
    }

    .toast.show {
        transform: translateX(-50%) translateY(0);
    }

    /* 缩小页脚的间距 */
    .footer {
        padding: 30px 16px 24px;
    }
}

/* 超小屏（较旧手机或窄视窗）再收敛一下 */
@media (max-width: 420px) {
    .brand-text h1 {
        font-size: 1.15rem;
    }

    .brand-text p {
        display: none; /* 节省纵向空间 */
    }

    .logo {
        width: 44px;
        height: 44px;
    }

    .hero h2 {
        font-size: 1.6rem;
    }

    .card-icon {
        width: 56px;
        height: 56px;
    }

    /* 微调卡片内边距 */
    .card-content {
        padding: 12px;
    }
}

/* Accessibility: increase hit-targets on very small devices */
@media (max-width: 360px) {
    .card-link {
        padding: 16px 14px;
        font-size: 1rem;
    }
}