/**
 * 访客介绍区（guest intro）
 *
 * 用于三个"访客还没进站"的页面：邀请码验证页、网站维护页、访问受限页。
 * 布局：左右两侧各一个图片轮播，中间是原来的内容卡片。
 * 窄屏（手机）改为纵向堆叠，顺序为 左图 → 卡片 → 右图，
 * 保证小屏访客也能看到介绍，而不是被整块挤掉。
 */

/* ---------------- 三栏骨架 ---------------- */
.gi-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
    width: 100%;
    max-width: 1180px;
}

/* 中间内容卡片：不设固定宽，由左右两侧挤压后自适应。
   给个 min-width 防止窄屏被压成一条。 */
.gi-main {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 560px;
}

/* ---------------- 侧边轮播 ---------------- */
.gi-side {
    flex: 0 0 230px;
    width: 230px;
}

.gi-car {
    position: relative;
    width: 100%;
    /* 3:4 竖版比例。用 padding 撑高而不是写死 height ——
       管理员换成横图时也不会被拉伸成怪比例（图片自身 object-fit: cover 兜底）。 */
    padding-top: 133.33%;
    background: #eef1f5;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .07);
}

.gi-car-item {
    position: absolute;
    inset: 0;
    opacity: 0;
    /* 只过渡 opacity：transform 在多图快速切换时会引起重排抖动 */
    transition: opacity .5s ease;
    cursor: zoom-in;
}

.gi-car-item.gi-on {
    opacity: 1;
    z-index: 1;
}

.gi-car-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 箭头与指示点：默认透明，鼠标移入才显形 ——
   静态展示时保持画面干净，需要切换时又能立刻看到控件。 */
.gi-car-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, .35);
    color: #fff;
    font-size: 14px;
    opacity: 0;
    transition: opacity .25s;
}

.gi-car-prev { left: 8px; }
.gi-car-next { right: 8px; }

.gi-car:hover .gi-car-arrow,
.gi-car-arrow:focus {
    opacity: 1;
}

.gi-car-arrow:hover {
    background: rgba(0, 0, 0, .55);
}

.gi-car-dots {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 9px;
    z-index: 3;
    text-align: center;
    line-height: 1;
}

.gi-car-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin: 0 3px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .5);
    transition: background .25s, width .25s;
}

.gi-car-dot.gi-dot-on {
    background: #fff;
    width: 16px;
    border-radius: 3px;
}

/* ---------------- 卡片内的文字介绍 ---------------- */
.gi-box {
    margin: 0 0 18px;
    background: #fafbfc;
    border: 1px solid #eef1f5;
    border-radius: 8px;
    padding: 14px 16px 12px;
    text-align: left;
}

.gi-text {
    font-size: 13px;
    color: #6b7488;
    line-height: 1.9;
}

/* 可查询内容标签：告诉访客"在这里能查到什么" */
.gi-tags {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.gi-tag {
    font-size: 12px;
    color: #1e6fd9;
    background: #eaf2fd;
    border-radius: 4px;
    padding: 3px 8px;
    line-height: 1.6;
    white-space: nowrap;
}

/* ---------------- 大图查看器 ---------------- */
.gi-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, .88);
    display: flex;
    align-items: center;
    justify-content: center;
}

.gi-lightbox img {
    max-width: 92%;
    max-height: 92%;
    border-radius: 6px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
}

.gi-lb-close {
    position: absolute;
    top: 20px;
    right: 24px;
    color: #fff;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    opacity: .75;
}

.gi-lb-close:hover { opacity: 1; }

.gi-lb-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 34px;
    line-height: 1;
    cursor: pointer;
    opacity: .7;
    width: 46px;
    text-align: center;
}

.gi-lb-arrow:hover { opacity: 1; }
.gi-lb-prev { left: 16px; }
.gi-lb-next { right: 16px; }

.gi-lb-count {
    position: absolute;
    bottom: 22px;
    left: 0;
    right: 0;
    text-align: center;
    color: rgba(255, 255, 255, .8);
    font-size: 13px;
}

/* ---------------- 窄屏：纵向堆叠 ---------------- */
@media (max-width: 900px) {
    .gi-stage {
        flex-direction: column;
        gap: 14px;
    }
    /* 用 order 保证顺序为 左图 → 卡片 → 右图，
       否则 DOM 里卡片在前，图片会跑到下面。 */
    .gi-side-left  { order: 1; }
    .gi-main       { order: 2; }
    .gi-side-right { order: 3; }

    .gi-side {
        flex: 0 0 auto;
        width: 100%;
        max-width: 420px;
    }

    /* 手机上竖版图太高会占满整屏，改成横幅比例更省地方 */
    .gi-car { padding-top: 46%; }
    .gi-car-item img { object-fit: cover; }

    /* 触屏没有 hover，箭头要常驻，否则根本点不到 */
    .gi-car-arrow { opacity: .9; }
}

@media (max-width: 480px) {
    .gi-car { padding-top: 56%; }
    .gi-stage { gap: 12px; }
}

/* ---------------- 夜间模式 ----------------
   三个页面都引了 theme.js，主题切换会写 <html data-theme>；
   这里跟同一套机制，保证框架页与访客页的深浅一致。 */
[data-theme="dark"] .gi-car {
    background: #23262e;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .4);
}
[data-theme="dark"] .gi-car-arrow {
    background: rgba(255, 255, 255, .18);
}
[data-theme="dark"] .gi-car-arrow:hover {
    background: rgba(255, 255, 255, .3);
}
[data-theme="dark"] .gi-box {
    background: #23262e;
    border-color: #2f333d;
}
[data-theme="dark"] .gi-text {
    color: #a8b0bd;
}
[data-theme="dark"] .gi-tag {
    color: #7fb0f5;
    background: #263243;
}

/* 关闭动画（prefers-reduced-motion）：部分用户对动效敏感 */
@media (prefers-reduced-motion: reduce) {
    .gi-car-item { transition: none; }
}
