/* ==========================================================
   全局公共样式：主题变量 / 基础 / 公共组件（头部、轮播、底部、弹窗）
   ========================================================== */

/* ---------- 主题变量 ---------- */
:root {
    /* 品牌色 */
    --brand: #1fb37c;          /* 主绿 */
    --brand-dark: #198f63;     /* 绿深 */
    --primary: #409eff;        /* 主蓝 */
    --primary-bg: #ecf5ff;     /* 蓝底 */
    --primary-border: #d9ecff; /* 蓝浅边框 */
    --danger: #e74c3c;         /* 红 */
    --red: #f56c6c;
    --orange: #f0801a;
    /* 文字 */
    --text-1: #303133;         /* 主文字 */
    --text-2: #606266;         /* 常规文字 */
    --text-3: #909399;         /* 次要文字 */
    /* 边框与背景 */
    --border: #dcdfe6;
    --border-light: #e4e7ed;
    --bg-gray: #f2f2f2;
    --white: #fff;
}

/* ---------- 基础 ---------- */
* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
    color: var(--text-2);
    background: var(--white);
}

/* 滚动条 */
body::-webkit-scrollbar { width: 5px; background-color: transparent; }
body::-webkit-scrollbar-thumb { border-radius: 10px; background: rgba(0, 0, 0, .5); }

/* ---------- 通用工具：文本截断 ---------- */
/* 单行省略 */
.ellipsis,
#index .box .advantage .item .title,
#index .box .advantage .item .desc,
#index .box .process .left .title,
#index .box .propaganda .text .title,
#index .box .propaganda .text .slogan,
#index .box .propaganda .text .desc,
#case .content .item .flex .box .info .name,
#case .content .item .flex .box .info .size,
#caseDetail .box .content .title,
#caseDetail .box .content .item p,
#news .box .content .item .position .title,
#scene .item .top .text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 多行截断（两行） */
#index .box .news .item .title,
#index .box .news .item .desc,
#index .box .process .left .desc,
#index .box .team .item .text,
#team .item .text {
    display: -webkit-box;
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

/* 多行截断（三行） */
#index .box .process .right p,
#news .box .content .item .position .desc {
    display: -webkit-box;
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

/* ---------- 通用工具：标签 ---------- */
.tag,
#index .box .team .item .tag,
#team .item .tag,
#index .box .news .item .desc span {
    display: inline-block;
    box-sizing: border-box;
    white-space: nowrap;
    font-size: 12px;
    color: var(--primary);
    background: var(--primary-bg);
    border: 1px solid var(--primary-border);
    border-radius: 4px;
}

/* 小号标签 */
#index .box .team .item .tag,
#team .item .tag,
#index .box .news .item .desc span {
    height: 20px;
    padding: 0 5px;
    line-height: 19px;
}

/* 中号标签 */
#caseDetail .box .content .item .tag {
    height: 24px;
    padding: 0 8px;
    line-height: 22px;
}

/* 大号标签 */
#news .box .content .item .position .bottom .tag,
#scene .item .top .tag {
    height: 32px;
    padding: 0 10px;
    line-height: 30px;
}

/* ---------- 通用区块标题（中文标题 + 英文副标题） ---------- */
#index .box .common-title,
#culture .content .item .common-title {
    border-bottom: 1px solid var(--border);
    text-align: center;
}

#index .box .common-title .cn,
#culture .content .item .common-title .cn {
    display: inline-block;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--brand);
    font-size: 30px;
    color: var(--text-1);
}

#index .box .en,
#culture .content .item .en {
    padding: 8px 0 20px;
    font-size: 15px;
    color: var(--text-2);
    text-align: center;
}

/* ---------- 通用 Tab 切换（带边框样式） ---------- */
#about .tab,
#sceneDetail .box .tab {
    display: flex;
    justify-content: center;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 20px;
}

#about .tab .item,
#sceneDetail .box .tab .item {
    padding: 0 20px;
    font-size: 14px;
    border: 1px solid var(--border-light);
    margin: 0 -1px -1px 0;
    cursor: pointer;
    line-height: 40px;
    height: 40px;
}

#about .tab .item { font-size: 22px; font-weight: 700; }

#about .tab .tab-active,
#sceneDetail .box .tab .tab-active {
    color: var(--primary);
    border-bottom-color: var(--white);
}

/* ---------- 通用内容切换 ---------- */
#about .content .item,
#culture .content .item,
#sceneDetail .box .content .item { display: none; }

#case .content .item { display: none; flex-wrap: wrap; }

#about .content .content-active,
#case .content .content-active,
#culture .content .content-active,
#news .box .content .content-active,
#sceneDetail .box .content .content-active { display: block !important; }

/* ---------- 页面主容器 ---------- */
#about, #appointment, #case, #caseDetail, #contact, #culture,
#news, #scene, #sceneDetail, #team, #strategyDetail {
    padding: 50px 0;
}

#news, #sceneDetail, #strategyDetail { background: var(--bg-gray); }

/* ==========================================================
   头部
   ========================================================== */
#header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100000;
    background: var(--white);
}

#header .header-top { display: flex; align-items: center; flex-wrap: wrap; }

.header-top .search { display: flex; align-items: center; justify-content: center; }

.header-top .search .btn {
    background: #f5f7fa;
    color: var(--text-3);
    border: 1px solid var(--border);
    padding: 0 20px;
    white-space: nowrap;
    height: 40px;
    display: flex;
    align-items: center;
    font-size: 14px;
}

.header-top .search .btn img { height: 18px; width: 18px; }
.header-top .search .btn .icon { height: 14px; width: 14px; margin-right: 5px; }

.header-top .search input {
    height: 42px;
    border: 1px solid var(--border);
    border-right: none;
    border-left: none;
    font-size: 14px;
    width: 30vh;
    padding-left: 10px;
    box-sizing: border-box;
    outline: none;
}

#header .header-bottom {
    background: var(--brand);
    height: 50px;
    display: flex;
    justify-content: center;
}

.header-bottom .nav { line-height: 50px; display: flex; justify-content: center; }
.header-bottom .nav .item { text-align: center; }

.header-bottom .nav .item a {
    text-decoration: none;
    color: var(--white);
    display: block;
    font-size: 15px;
}

.header-bottom .nav .item:hover { background: var(--brand-dark); }
.header-bottom .nav .active { background: var(--brand-dark) !important; }

/* 移动端侧边栏 */
.sidebar-btn {
    position: fixed;
    left: 15px;
    bottom: 30px;
    color: #fff;
    font-weight: bold;
    font-size: 30px;
    display: none;
    justify-content: center;
    align-items: center;
    width: 55px;
    height: 55px;
    background-color: rgb(0, 122, 255);
    border-radius: 45px;
    box-shadow: 0 1px 5px 2px rgba(0, 0, 0, .3);
}

.sidebar-mask {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100vw;
    height: 100vh;
    display: none;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background-color: rgba(0, 0, 0, .95);
    display: flex;
    flex-direction: column;
}

.sidebar.active { transform: translateX(0); }

.sidebar-header { padding: 25px 20px 20px; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.sidebar-title { color: #fff; font-size: 24px; font-weight: 300; letter-spacing: 1px; }

.nav-menu { flex: 1; padding: 20px 0; overflow-y: auto; }

.nav-item {
    display: block;
    color: rgba(255, 255, 255, .85);
    padding: 18px 25px;
    text-decoration: none;
    font-size: 18px;
    transition: all .2s ease;
    border-left: 4px solid transparent;
}

.nav-item.active {
    background-color: rgba(102, 126, 234, .1);
    color: #fff;
    border-left-color: #667eea;
}

/* ==========================================================
   轮播图
   ========================================================== */
.banner-carousel {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f5f5f5;
    margin-top: 150px;
}

.carousel-container {
    height: 450px;
    width: 100%;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, .1);
}

.carousel { display: flex; transition: transform .5s ease-in-out; }
.carousel-slide { min-width: 100%; position: relative; }
.carousel-slide img { height: 450px; width: 100%; display: block; object-fit: cover; }

.slide-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, .7));
    color: #fff;
    padding: 20px;
}

.slide-title { font-size: 1.5rem; margin-bottom: 5px; }
.slide-description { font-size: .9rem; opacity: .9; }

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, .7);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color .3s;
    z-index: 10;
}

.carousel-btn:hover { background-color: rgba(255, 255, 255, .9); }
.prev-btn { left: 10px; }
.next-btn { right: 10px; }

.carousel-indicators {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, .5);
    cursor: pointer;
    transition: background-color .3s;
}

.indicator.active { background-color: #fff; }

/* ==========================================================
   底部
   ========================================================== */
#footer { background: #3c3a50; padding: 20px 0 5px; }

#footer .box { display: flex; align-items: center; padding-bottom: 20px; }

#footer .box .desc { color: #fcfcfc; font-size: 14px; margin: 0 0 8px; }
#footer .box .desc img { height: 14px; width: 14px; margin-right: 5px; }
#footer .code { height: 108px; width: 115px; max-width: 100%; object-fit: contain; }

#footer .bottom { display: flex; border-top: 1px solid #4e4d60; padding: 10px 0; flex-wrap: wrap; }
#footer .bottom .icp { font-size: 13px; color: #84858f; }
#footer .bottom a { text-decoration: none; font-size: 13px; color: #666; }
#footer .bottom .bottom-maker { text-align: right; }

/* ==========================================================
   弹窗（alert.js）
   ========================================================== */
.popup-mask {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, .5);
    z-index: 9998;
    display: none;
}

.popup-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 300px;
    max-width: 90%;
    background-color: #fff;
    border-radius: 2px;
    box-shadow: 0 0 20px rgba(0, 0, 0, .2);
    z-index: 9999;
    display: none;
    opacity: 0;
    transition: all .3s ease;
}

.popup-container.show { opacity: 1; animation: popupShow .3s; }

@keyframes popupShow {
    from { transform: translate(-50%, -60%); opacity: 0; }
    to { transform: translate(-50%, -50%); opacity: 1; }
}

.popup-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    font-size: 16px;
    font-weight: bold;
    color: #333;
    position: relative;
}

.popup-close {
    position: absolute;
    top: 15px;
    right: 20px;
    width: 16px;
    height: 16px;
    cursor: pointer;
    color: #999;
    font-size: 18px;
    line-height: 16px;
    text-align: center;
}

.popup-close:hover { color: #ff5722; }

.popup-content {
    padding: 20px;
    font-size: 14px;
    line-height: 1.6;
    color: #666;
    max-height: 60vh;
    overflow-y: auto;
}

.popup-footer { padding: 15px 20px; text-align: right; border-top: 1px solid #eee; }

.popup-btn {
    display: inline-block;
    padding: 6px 15px;
    margin-left: 10px;
    border-radius: 2px;
    cursor: pointer;
    font-size: 14px;
    transition: all .3s;
}

.popup-btn-primary { background-color: #1e9fff; color: #fff; border: none; }
.popup-btn-primary:hover { background-color: #0d8bf2; }
.popup-btn-default { background-color: #fff; color: #333; border: 1px solid #ddd; }
.popup-btn-default:hover { background-color: #f5f5f5; }

/* ==========================================================
   移动端适配（≤767px）
   ========================================================== */
@media (max-width: 767px) {
    /* 头部 */
    #header .header-top .mobile-center { display: flex; justify-content: center; }

    /* 轮播 */
    .banner-carousel { margin-top: 100px !important; }
    .carousel-container,
    .carousel-slide img { height: 250px !important; }

    /* 底部 */
    #footer .bottom .icp { text-align: center; }
    #footer .bottom .bottom-maker { text-align: center !important; margin-top: 5px; }

    /* 区块标题缩小 */
    #index .box .common-title .cn,
    #culture .content .item .common-title .cn { font-size: 24px; }

    /* 移动端侧边栏按钮：仅在手机端显示 */
    .sidebar-btn { display: flex; }
}
