/* 主要布局样式 - SciAll医学科研工具箱 */

/* 重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
}

/* 容器宽度设置 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}

/* ========== 响应式断点设计 - 三视图标准 ========== */

/* 默认：手机端 (0px - 767px) */
.grid {
    display: grid;
    gap: 20px;
    grid-template-columns: 1fr;
}

/* iPad端：768px - 1023px */
@media (min-width: 768px) and (max-width: 1023px) {
    .container {
        padding: 0 30px;
        max-width: 900px;
    }
    
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* PC端：1024px+ */
@media (min-width: 1024px) {
    .container {
        padding: 0 40px;
        max-width: 1200px;
    }
    
    .grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 手机端详细调整 */
@media (max-width: 767px) {
    .container {
        padding: 0 15px;
    }
    
    .grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* 通用布局类 */
.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flex-column {
    display: flex;
    flex-direction: column;
}

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

/* 间距工具类 */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

/* 宽度工具类 */
.w-full { width: 100%; }
.w-auto { width: auto; }

.max-w-sm { max-width: 24rem; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.max-w-xl { max-width: 36rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-4xl { max-width: 56rem; }

/* 隐藏/显示工具类 */
.hidden { display: none; }
.visible { visibility: visible; }
.invisible { visibility: hidden; }

/* 响应式显示控制 */
@media (max-width: 767px) {
    .hidden-mobile { display: none !important; }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .hidden-tablet { display: none !important; }
}

@media (min-width: 1024px) {
    .hidden-desktop { display: none !important; }
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: var(--text-inverse);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 10000;
    box-shadow: 0 4px 12px var(--shadow-medium);
}

.back-to-top:hover {
    background-color: var(--primary-dark);
    transform: translateY(0) scale(1.1);
    box-shadow: 0 6px 20px var(--shadow-strong);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

@media (max-width: 767px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
} 