/* ============================================
   ai.cnhans.cn 全平台响应式CSS
   断点: Mobile <600px | Tablet 600-1200px | PC >1200px | Touch >1920px
   ============================================ */

/* === 基础复位 === */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{font-size:16px;-webkit-text-size-adjust:100%}
body{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;background:#0a0a0a;color:#eee;line-height:1.6;overflow-x:hidden;transition:background .3s,color .3s}

/* === 暗色/亮色主题 === */
body.light-mode{background:#f2f2f2;color:#333}
body.light-mode .main{background:#e8e8e8}
body.light-mode .menu a{background:rgba(255,255,255,.85);color:#333}
body.light-mode .menu a:hover,
body.light-mode .menu a.active{background:#fff;color:#1a3a5c}
body.light-mode .float-btn{background:rgba(255,255,255,.85);color:#333;box-shadow:0 2px 8px rgba(0,0,0,.15)}
body.light-mode .float-btn:hover{background:#fff}
body.light-mode .mode-switcher{background:rgba(255,255,255,.9);border-color:#ddd}
body.light-mode .mode-switcher button{color:#666;border-color:#ddd}
body.light-mode .mode-switcher button.active{background:#1a3a5c;color:#fff}
body.light-mode .hamburger span{background:#333}
body.light-mode .nav-overlay{background:rgba(255,255,255,.95)}
body.light-mode .nav-overlay a{color:#333}
body.light-mode .swiper-box{border-left-color:#ddd}

/* === 主容器 - 响应式 === */
.main{width:100%;max-width:1920px;min-height:100vh;margin:0 auto;position:relative;background:url("../images/bg.jpg") center/cover no-repeat #0a0a0a;overflow:hidden}

/* === 模式切换器 === */
.mode-switcher{position:fixed;top:10px;right:10px;z-index:10000;display:flex;gap:4px;background:rgba(0,0,0,.85);border-radius:8px;padding:4px;border:1px solid rgba(255,255,255,.15)}
.mode-switcher button{padding:6px 12px;border:1px solid transparent;border-radius:6px;background:0 0;color:#aaa;cursor:pointer;font-size:12px;white-space:nowrap;transition:all .2s;min-height:32px}
.mode-switcher button.active{background:rgba(255,255,255,.15);color:#fff;border-color:rgba(255,255,255,.3)}
.mode-switcher button:hover{color:#fff}
.mode-switcher .theme-toggle{background:rgba(255,255,255,.1);border-radius:50%;width:32px;height:32px;padding:4px;font-size:16px;line-height:1}
@media(max-width:600px){.mode-switcher{top:auto;bottom:70px;right:5px;gap:2px;padding:3px}.mode-switcher button{padding:4px 8px;font-size:11px;min-height:28px}}

/* === 汉堡菜单按钮 === */
.hamburger{display:none;position:fixed;top:12px;left:12px;z-index:10001;width:44px;height:44px;background:rgba(0,0,0,.7);border:1px solid rgba(255,255,255,.2);border-radius:8px;cursor:pointer;flex-direction:column;align-items:center;justify-content:center;gap:5px;padding:10px}
.hamburger span{display:block;width:22px;height:2px;background:#fff;border-radius:1px;transition:all .3s}
.hamburger.open span:nth-child(1){transform:rotate(45deg) translate(5px,5px)}
.hamburger.open span:nth-child(2){opacity:0}
.hamburger.open span:nth-child(3){transform:rotate(-45deg) translate(5px,-5px)}
@media(max-width:1200px){.hamburger{display:flex}}

/* === 移动端导航遮罩 === */
.nav-overlay{display:none;position:fixed;inset:0;z-index:9999;background:rgba(0,0,0,.95);flex-direction:column;align-items:center;justify-content:center;gap:20px}
.nav-overlay.open{display:flex}
.nav-overlay a{font-size:22px;color:#fff;text-decoration:none;padding:12px 24px;border-radius:8px;transition:all .2s}
.nav-overlay a:hover,.nav-overlay a.active{background:rgba(255,255,255,.1)}
.nav-overlay .close-btn{position:absolute;top:20px;right:20px;width:44px;height:44px;background:0 0;border:none;color:#fff;font-size:28px;cursor:pointer}

/* === LOGO === */
.logo{position:absolute;left:20px;top:15px;z-index:10}
.logo img{max-width:180px;height:auto}
@media(max-width:1200px){.logo{left:60px;top:10px}.logo img{max-width:120px}}
@media(max-width:600px){.logo img{max-width:90px}}

/* === 菜单 (PC端) === */
.menu{position:absolute;left:20px;top:120px;width:220px;z-index:10}
.menu li{text-align:center;border-radius:8px;box-shadow:0 0 15px rgba(0,0,0,.4);margin:10px 0;overflow:hidden}
.menu a{background:rgba(21,48,74,.7);font-size:20px;line-height:50px;color:rgba(255,255,255,.7);font-weight:300;display:block;text-decoration:none;transition:all .3s}
.menu a:hover,.menu a.active{background:rgba(21,48,74,1);color:#fff}
@media(max-width:1200px){.menu{display:none}}
@media(min-width:1920px){.menu{left:40px;top:140px}.menu a{font-size:24px;line-height:60px}}

/* === Swiper 图片区 === */
.swiper-box{width:100%;max-width:calc(100% - 280px);height:100vh;position:absolute;right:0;top:0;border-left:1px solid rgba(255,255,255,.1)}
@media(max-width:1200px){.swiper-box{max-width:100%;height:100vh;border-left:none}}
@media(max-width:600px){.swiper-box{height:60vh}.swiper-box .mySwiper2{height:75%}.swiper-box .mySwiper{height:25%}}

/* === Swiper 箭头导航 === */
.swiper-nav-btn{position:absolute;top:50%;transform:translateY(-50%);z-index:100;width:44px;height:44px;background:rgba(0,0,0,.5);border:1px solid rgba(255,255,255,.2);border-radius:50%;color:#fff;font-size:20px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .2s;-webkit-tap-highlight-color:transparent}
.swiper-nav-btn:hover{background:rgba(0,0,0,.8);border-color:rgba(255,255,255,.5)}
.swiper-nav-prev{left:10px}
.swiper-nav-next{right:10px}
@media(max-width:600px){.swiper-nav-btn{width:40px;height:40px;font-size:16px}}

/* === 浮动功能按钮组 === */
.float-btns{position:fixed;right:12px;bottom:80px;z-index:9998;display:flex;flex-direction:column;gap:8px}
.float-btn{width:44px;height:44px;border-radius:50%;background:rgba(0,0,0,.7);border:1px solid rgba(255,255,255,.15);color:#fff;font-size:18px;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .2s;-webkit-tap-highlight-color:transparent;touch-action:manipulation}
.float-btn:hover{background:rgba(0,0,0,.9);transform:scale(1.05)}
.float-btn:active{transform:scale(.95)}
.float-btn .tooltip{display:none;position:absolute;right:54px;background:rgba(0,0,0,.85);color:#fff;padding:4px 10px;border-radius:4px;font-size:12px;white-space:nowrap}
.float-btn:hover .tooltip{display:block}
@media(max-width:600px){.float-btns{right:6px;bottom:120px;gap:6px}.float-btn{width:40px;height:40px;font-size:16px}}

/* === 字体大小调整 === */
body.font-sm{font-size:14px}
body.font-md{font-size:16px}
body.font-lg{font-size:18px}
body.font-xl{font-size:20px}

/* === 返回顶部 === */
.back-to-top{opacity:0;visibility:hidden;transition:all .3s}
.back-to-top.visible{opacity:1;visibility:visible}

/* === 长按菜单 === */
.context-menu{display:none;position:fixed;z-index:99999;background:rgba(30,30,30,.95);border:1px solid rgba(255,255,255,.15);border-radius:10px;padding:6px 0;min-width:140px;box-shadow:0 4px 20px rgba(0,0,0,.5)}
.context-menu.show{display:block}
.context-menu button{display:block;width:100%;padding:10px 16px;border:none;background:0 0;color:#ccc;font-size:14px;text-align:left;cursor:pointer;transition:all .2s}
.context-menu button:hover{background:rgba(255,255,255,.1);color:#fff}
.light-mode .context-menu{background:rgba(255,255,255,.95);border-color:#ddd}
.light-mode .context-menu button{color:#333}
.light-mode .context-menu button:hover{background:rgba(0,0,0,.05)}

/* === 图片模态框 === */
.img-modal{display:none;position:fixed;inset:0;z-index:99999;background:rgba(0,0,0,.95);flex-direction:column;align-items:center;justify-content:center}
.img-modal.open{display:flex}
.img-modal img{max-width:95vw;max-height:85vh;object-fit:contain;border-radius:4px}
.img-modal .modal-close{position:absolute;top:16px;right:16px;width:44px;height:44px;background:rgba(255,255,255,.1);border:none;border-radius:50%;color:#fff;font-size:24px;cursor:pointer}
.img-modal .modal-nav{position:absolute;top:50%;transform:translateY(-50%);width:44px;height:44px;background:rgba(255,255,255,.1);border:none;border-radius:50%;color:#fff;font-size:20px;cursor:pointer}
.img-modal .modal-prev{left:10px}
.img-modal .modal-next{right:10px}
.img-modal .modal-counter{position:absolute;bottom:20px;color:rgba(255,255,255,.6);font-size:14px}

/* === 响应式图片 === */
img{max-width:100%;height:auto}
.swiper-slide img{object-fit:cover;width:100%;height:100%}

/* === 打印样式 === */
@media print{
  .mode-switcher,.float-btns,.hamburger,.nav-overlay,.swiper-nav-btn,.context-menu,.img-modal{display:none!important}
  .menu{display:block!important;position:static;width:100%}
  .swiper-box{position:static;width:100%;height:auto;border:none}
  .logo{position:static}
  body{background:#fff;color:#000;font-size:12pt}
  .main{background:#fff!important;max-width:100%}
  .swiper-slide{page-break-inside:avoid}
}

/* === 触摸优化 === */
@media(hover:none){
  .menu a:hover{background:rgba(21,48,74,.7)}
  .menu a:active{background:rgba(21,48,74,1)}
  .float-btn:hover{background:rgba(0,0,0,.7);transform:none}
  .float-btn:active{background:rgba(0,0,0,.9);transform:scale(.95)}
}

/* === 动画 === */
@keyframes fadeInUp{from{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}
.animate-in{animation:fadeInUp .4s ease-out}

/* === 加载指示器 === */
.loading-indicator{display:none;position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);z-index:99999;width:40px;height:40px;border:3px solid rgba(255,255,255,.2);border-top-color:#fff;border-radius:50%;animation:spin .8s linear infinite}
.loading-indicator.show{display:block}
@keyframes spin{to{transform:translate(-50%,-50%) rotate(360deg)}}

/* === bg 背景图 WebP 协商 2026-10-29（不支持时自动回落 jpg）=== */
.main{background-image:image-set(url("/statics/aiphoto/images/bg.webp") type("image/webp"),url("/statics/aiphoto/images/bg.jpg") type("image/jpeg"))}
