/* ========================================
   酒店客房智能客控系统 - 样式表
   布局分区：
     PC：  顶部状态栏 + 左下/右下热点触发展示区
     移动：底部一体化操作栏
   ======================================== */

/* === 全局重置 === */
*, *::before, *::after {
    margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
                 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    overflow: hidden;
    background: #0d0d1a;
    color: #fff;
    -webkit-font-smoothing: antialiased;
}

/* ========================================
   全景容器（全屏）
   ======================================== */
#pano-container {
    width: 100vw; height: 100vh;
    position: relative; overflow: hidden;
}
#pano { width: 100%; height: 100%; cursor: grab; }
#pano:active { cursor: grabbing; }

/* ========================================
   加载指示器
   ======================================== */
#loading {
    position: fixed; inset: 0;
    background: #0d0d1a;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    z-index: 200;
    transition: opacity 0.5s ease;
}
#loading.hidden { opacity: 0; pointer-events: none; }
.spinner {
    width: 48px; height: 48px;
    border: 3px solid rgba(255,255,255,.12);
    border-top-color: #a78bfa;
    border-radius: 50%;
    animation: spin .8s linear infinite;
    margin-bottom: 16px;
}
#loading p { color: rgba(255,255,255,.55); font-size: 14px; letter-spacing: 1px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ========================================
   坐标拾取（PC，左上角，可隐藏）
   ======================================== */
#coords-display {
    position: fixed; top: 64px; left: 16px;
    background: rgba(10,10,30,.88);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(167,139,250,.3);
    border-radius: 12px; padding: 10px 14px;
    font-size: 13px; color: rgba(255,255,255,.75);
    z-index: 150; min-width: 130px;
    display: none;   /* 默认隐藏 */
    transition: border-color .2s;
}
#coords-display.visible { display: flex; flex-direction: column; gap: 4px; }
#coords-display:hover { border-color: rgba(167,139,250,.6); }
.coord-row { display: flex; align-items: center; gap: 8px; }
.coord-tag { font-size: 11px; color: rgba(167,139,250,.6); width: 30px; letter-spacing: .5px; }
#coords-display b { color: #a78bfa; font-family: 'Courier New', monospace; font-size: 14px; }
#coord-copy {
    font-size: 11px; color: rgba(255,255,255,.35);
    text-align: right; margin-top: 4px; cursor: pointer;
    transition: color .2s;
}
#coords-display:hover #coord-copy { color: rgba(167,139,250,.8); }
#coords-display.copied #coord-copy { color: #4ade80; }

/* 中心准星 */
#coord-crosshair {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 100;
    display: none;
}
#coords-display.visible ~ #coord-crosshair,
body:not(.is-mobile) #coords-display.visible ~ #coord-crosshair { display: block; }

.cross-ring {
    width: 50px; height: 50px;
    border: 2px solid rgba(167,139,250,.35);
    border-radius: 50%;
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
}
.cross-h, .cross-v {
    position: absolute;
    background: rgba(167,139,250,.45);
}
.cross-h {
    width: 20px; height: 2px;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
}
.cross-v {
    width: 2px; height: 20px;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
}
.cross-dot {
    width: 6px; height: 6px;
    background: #a78bfa;
    border-radius: 50%;
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
}

/* ========================================
   灯光叠加层（演示模式）
   ======================================== */
#light-overlay {
    position: absolute; inset: 0;
    pointer-events: none; z-index: 5;
    transition: opacity .6s ease;
}
.light-overlay-off { opacity: 0; background: transparent; }
.light-overlay-on   { opacity: 1; background: rgba(0,0,0,.55); }

/* ========================================
   顶部状态栏（PC 端）
   ======================================== */
#top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed; top: 0; left: 0; right: 0;
    height: 50px;
    background: rgba(10,10,25,.05);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255,255,255,.07);
    z-index: 150;
    padding: 0 20px;
    /* 移动端隐藏 */
    display: none;
}

body:not(.is-mobile) #top-bar { display: flex; }

/* 场景切换标签 */
#scene-tabs { display: flex; gap: 4px; align-items: center; }

.scene-tab {
    background: transparent;
    border: 1px solid rgba(255,255,255,.2);
    color: rgba(255,255,255,.6);
    font-size: 12px; padding: 3px 10px;
    border-radius: 20px; cursor: pointer;
    transition: all .2s;
}
.scene-tab:hover { background: rgba(255,255,255,.1); color: rgba(255,255,255,.85); }
.scene-tab.active {
    background: rgba(167,139,250,.35);
    border-color: rgba(167,139,250,.8);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 0 12px rgba(167,139,250,.4);
}

.tab-divider { width: 1px; height: 16px; background: rgba(255,255,255,.1); margin: 0 12px; }

/* 设备状态组 */
#status-group {
    display: flex; align-items: center; gap: 0;
}

.dev-item {
    display: flex; align-items: center; gap: 6px;
    font-size: 13px; color: rgba(255,255,255,.6);
}

.dev-icon { font-size: 15px; }

.dev-state {
    padding: 1px 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 500;
    transition: all .3s ease;
    cursor: pointer;
}
.dev-state:hover { opacity: .8; }
.dev-state.off {
    background: rgba(255,255,255,.07);
    color: rgba(255,255,255,.35);
}
.dev-state.on {
    background: rgba(255,200,80,.18);
    color: #ffd050;
}

/* 方案标题 */
.scheme-title {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 1px;
    white-space: nowrap;
    text-shadow: 0 0 10px rgba(167,139,250,.5);
}

/* 灯带亮度控制 */
.strip-levels {
    display: flex;
    gap: 4px;
    align-items: center;
}
.strip-level {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 8px;
    background: rgba(255,255,255,.06);
    color: rgba(255,255,255,.4);
    cursor: pointer;
    transition: all .2s;
    border: 1px solid transparent;
}
.strip-level:hover {
    background: rgba(255,255,255,.12);
    color: rgba(255,255,255,.7);
}
.strip-level.active {
    background: rgba(167,139,250,.25);
    border-color: rgba(167,139,250,.5);
    color: #a78bfa;
}

/* 坐标工具切换按钮 */
#top-bar-right { display: flex; gap: 8px; align-items: center; }

#btn-toggle-coords {
    background: rgba(167,139,250,.15);
    border: 1px solid rgba(167,139,250,.3);
    color: rgba(167,139,250,.8);
    font-size: 12px; padding: 4px 12px;
    border-radius: 8px; cursor: pointer;
    transition: all .2s;
}
#btn-toggle-coords:hover {
    background: rgba(167,139,250,.25);
    color: #a78bfa;
}

/* ========================================
   底部展示区（PC，热点触发滑入）
   ======================================== */
#bottom-panel {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 160;
    display: none;   /* 默认隐藏 */
    transform: translateY(100%);
    transition: transform .4s cubic-bezier(.34,1.4,.64,1);
    /* 背景透明，不遮挡全景 */
    background: rgba(8,8,20,.05);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255,255,255,.06);
    padding: 16px 24px calc(16px + env(safe-area-inset-bottom, 0)) 24px;
    align-items: stretch;
    gap: 0;
}

/* 显示状态 */
#bottom-panel.panel-visible {
    display: flex;
    transform: translateY(0);
}

body:not(.is-mobile) #bottom-panel { display: flex; }

/* 底部栏整体背景（半透明，不遮挡全景） */

/* 左区：设备图 + 说明 */
#bottom-panel-left {
    display: flex; flex-direction: column;
    align-items: center; gap: 6px;
    min-width: 140px; max-width: 160px;
}

#panel-device-title {
    font-size: 13px; font-weight: 600;
    color: rgba(255,255,255,.85);
    letter-spacing: .5px;
}

#panel-device-img {
    height: 90px; width: auto;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,.4);
}

#panel-device-desc {
    font-size: 11px; color: rgba(255,255,255,.4);
    text-align: center; line-height: 1.4;
}

/* 分隔线 */
#bottom-panel-divider {
    width: 1px;
    background: rgba(255,255,255,.08);
    margin: 0 20px;
    flex-shrink: 0;
}

/* 右区：三键开关 */
#bottom-panel-right {
    position: relative;
    display: flex; align-items: center; justify-content: center;
}

#switch-panel-img {
    height: 100px; width: auto;
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(0,0,0,.5);
    display: block;
}

/* 三个透明热区 */
.switch-zone {
    position: absolute; top: 0; height: 100%;
    cursor: pointer;
    border-radius: 10px;
    transition: background .15s ease;
    -webkit-tap-highlight-color: transparent;
}
.switch-zone:nth-child(2) { left: 0;      width: 33%; }
.switch-zone:nth-child(3) { left: 33%;   width: 34%; }
.switch-zone:nth-child(4) { right: 0;    width: 33%; }
.switch-zone:hover { background: rgba(255,255,255,.06); }
.switch-zone.on { background: rgba(255,200,80,.12); box-shadow: inset 0 0 18px rgba(255,200,80,.18); }

/* ========================================
   桌面端开关面板（旧，隐藏）
   ======================================== */
#switch-panel { display: none !important; }

/* ========================================
   产品说明浮层（PC）
   ======================================== */
#info-panel {
    position: fixed; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(12,12,28,.96);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 20px;
    padding: 28px; min-width: 320px; max-width: 90vw;
    z-index: 300; box-shadow: 0 24px 64px rgba(0,0,0,.6);
    animation: fadeIn .25s ease;
}

@keyframes fadeIn { from { opacity: 0; transform: translate(-50%,-48%); } to { opacity: 1; transform: translate(-50%,-50%); } }

#info-panel.hidden { display: none !important; }

.close-btn {
    position: absolute; top: 14px; right: 16px;
    background: none; border: none; color: rgba(255,255,255,.4);
    font-size: 24px; cursor: pointer; line-height: 1;
    transition: color .2s;
}
.close-btn:hover { color: rgba(255,255,255,.8); }

.panel-content { display: flex; flex-direction: column; gap: 14px; }
#panel-title { font-size: 18px; font-weight: 700; color: #fff; letter-spacing: .5px; }
#panel-desc  { font-size: 14px; color: rgba(255,255,255,.6); line-height: 1.6; }

.panel-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.action-btn {
    flex: 1; padding: 10px 16px;
    border-radius: 12px; border: none;
    font-size: 14px; font-weight: 500;
    cursor: pointer; transition: all .2s;
    min-width: 110px;
}
.action-btn.on    { background: rgba(255,200,80,.18); color: #ffd050; border: 1px solid rgba(255,200,80,.3); }
.action-btn.off   { background: rgba(255,255,255,.06); color: rgba(255,255,255,.5); border: 1px solid rgba(255,255,255,.1); }
.action-btn.curtain-open  { background: rgba(102,126,234,.18); color: #a78bfa; border: 1px solid rgba(102,126,234,.3); }
.action-btn.curtain-close { background: rgba(255,255,255,.06); color: rgba(255,255,255,.5); border: 1px solid rgba(255,255,255,.1); }

/* 背景遮罩 */
#overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.65);
    z-index: 250;
    transition: opacity .3s ease;
}
#overlay.hidden { opacity: 0; pointer-events: none; }

/* ========================================
   热点样式（区分漫游圆形 / 设备方形）
   ======================================== */

/* ── 通用热点基础 ── */
.hotspot {
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: transform .25s, box-shadow .25s;
}
.hotspot:hover { transform: scale(1.15); }
.hotspot-anchor {
    display: flex; align-items: center; justify-content: center;
    position: relative;
}

/* ── 漫游标记：圆形三层嵌套 ── */
.hotspot-circle {
    width: 56px; height: 56px;
    animation: navPulse 2.5s ease-in-out infinite;
}
.hotspot-circle .hotspot-anchor {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: rgba(167,139,250,.15);
    border: 2px solid rgba(167,139,250,.4);
    box-shadow: 0 0 0 0 rgba(167,139,250,.4);
}
@keyframes navPulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(167,139,250,.3); }
    50%      { box-shadow: 0 0 0 12px rgba(167,139,250,0); }
}
.nav-ring {
    position: absolute; border-radius: 50%; border-style: solid;
}
.nav-ring-1 {
    width: 30px; height: 30px;
    border-color: rgba(167,139,250,.7);
    border-width: 1.5px;
    top: 50%; left: 50%;
    transform: translate(-50%,-50%);
}
.nav-ring-2 {
    width: 42px; height: 42px;
    border-color: rgba(167,139,250,.4);
    border-width: 1px;
    top: 50%; left: 50%;
    transform: translate(-50%,-50%);
}
.nav-ring-3 {
    width: 54px; height: 54px;
    border-color: rgba(167,139,250,.2);
    border-width: 0.5px;
    top: 50%; left: 50%;
    transform: translate(-50%,-50%);
}

/* ── 设备标记：方形浅色 ── */
.hotspot-square {
    width: 42px; height: 42px;
    background: rgba(10,10,30,.5);
    border: 1.5px solid rgba(167,139,250,.4);
    border-radius: 10px;
    backdrop-filter: blur(6px);
    box-shadow: 0 4px 16px rgba(0,0,0,.4);
    animation: hotspotPulse 2.5s ease-in-out infinite;
}
@keyframes hotspotPulse {
    0%,100% { box-shadow: 0 4px 16px rgba(0,0,0,.4), 0 0 0 0 rgba(167,139,250,.2); }
    50%      { box-shadow: 0 4px 16px rgba(0,0,0,.4), 0 0 0 6px rgba(167,139,250,0); }
}

.hotspot-icon { font-size: 20px; line-height: 1; }

.hotspot-tooltip {
    display: none;
    position: absolute; bottom: calc(100% + 8px);
    left: 50%; transform: translateX(-50%);
    background: rgba(10,10,30,.9);
    border: 1px solid rgba(167,139,250,.3);
    color: rgba(255,255,255,.8);
    font-size: 11px; white-space: nowrap;
    padding: 3px 8px; border-radius: 6px;
    pointer-events: none;
}
.hotspot-square:hover .hotspot-tooltip { display: block; }

/* 漫游标记的tooltip显示在下方 */
.nav-tooltip {
    bottom: auto;
    top: calc(100% + 8px);
}
.hotspot-circle:hover .nav-tooltip { display: block; }

/* 移动端热点稍大 */
body.is-mobile .hotspot-circle { width: 64px; height: 64px; }
body.is-mobile .hotspot-square  { width: 50px; height: 50px; }

/* ========================================
   反馈提示
   ======================================== */
#toast {
    position: fixed; bottom: 180px; left: 50%;
    transform: translateX(-50%);
    background: rgba(20,20,40,.9);
    backdrop-filter: blur(10px);
    color: rgba(255,255,255,.85);
    font-size: 13px; padding: 8px 18px;
    border-radius: 20px; border: 1px solid rgba(255,255,255,.1);
    z-index: 400; pointer-events: none;
    opacity: 0; transition: opacity .25s;
    white-space: nowrap;
}
#toast.show { opacity: 1; }

/* ========================================
   📱 移动端（≤768px）
   ======================================== */
body.is-mobile #top-bar,
body.is-mobile #bottom-panel,
body.is-mobile #coords-display,
body.is-mobile #switch-panel { display: none !important; }

body.is-mobile #mobile-bar {
    position: fixed; bottom: 0; left: 0; right: 0;
    z-index: 200;
    background: rgba(8,8,18,.05);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255,255,255,.08);
    padding: 0 0 env(safe-area-inset-bottom, 0) 0;
    display: flex; flex-direction: column;
    align-items: center;
}

/* 移动端顶部栏 */
body.is-mobile #mobile-top-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(8,8,24,.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255,255,255,.08);
    position: fixed; top: 0; left: 0; right: 0;
    z-index: 200;
}
.mobile-scheme-name {
    font-size: 12px;
    font-weight: 600;
    color: rgba(167,139,250,.9);
    letter-spacing: .5px;
    text-align: center;
}
.mobile-top-scenes {
    display: flex; gap: 16px; align-items: center;
}
.mobile-scene-text {
    font-size: 13px;
    color: rgba(255,255,255,.4);
    cursor: pointer;
    transition: all .2s;
    padding: 2px 4px;
}
.mobile-scene-text:hover { color: rgba(255,255,255,.7); }
.mobile-scene-text.active {
    color: #fff;
    font-weight: 600;
}

/* 拖拽条 */
#mobile-drag-handle {
    width: 36px; height: 4px;
    background: rgba(255,255,255,.2);
    border-radius: 2px;
    margin: 8px auto 4px;
}

/* 开关图 */
#mobile-switch-wrap {
    display: flex; justify-content: center;
    padding: 2px 16px 0;
    position: relative; width: 100%;
}

#mobile-panel-img {
    height: 75px; width: auto;
    border-radius: 12px;
    filter: brightness(.5);
    transition: filter .4s ease;
    box-shadow: 0 4px 16px rgba(0,0,0,.5);
}

/* 热区 */
.mobile-zone {
    position: absolute; top: 2px;
    height: calc(100% - 2px);
    cursor: pointer; border-radius: 10px;
    transition: background .15s ease;
    -webkit-tap-highlight-color: transparent; z-index: 2;
}
/* 三区均分，padding 16px×2 */
.mobile-zone:nth-child(2) { left: 16px;  width: calc(33.333% - 22px); }
.mobile-zone:nth-child(3) { left: 50%;   width: calc(33.333% - 22px); transform: translateX(-50%); }
.mobile-zone:nth-child(4) { right: 16px; width: calc(33.333% - 22px); }
.mobile-zone.on {
    background: rgba(255,200,80,.15);
    box-shadow: inset 0 0 14px rgba(255,200,80,.2);
}

/* 状态行 */
#mobile-status-row {
    display: flex; justify-content: space-around;
    padding: 8px 16px 10px;
    width: 100%;
}

.mobile-status-item {
    display: flex; flex-direction: column;
    align-items: center; gap: 4px; flex: 1;
}

.mobile-dot {
    width: 8px; height: 8px; border-radius: 50%;
    transition: all .35s ease;
}
.mobile-dot.off { background: rgba(255,255,255,.15); }
.mobile-dot.on  {
    background: #ffd050;
    box-shadow: 0 0 8px rgba(255,208,80,.9);
}

.mobile-status-name {
    font-size: 11px; color: rgba(255,255,255,.35);
    letter-spacing: .3px; transition: color .35s;
}

/* 移动端灯带 */
.mobile-strip-item {
    flex-direction: row !important;
    gap: 6px !important;
}
.mobile-strip-levels {
    display: flex; gap: 3px; align-items: center;
}
.m-strip-level {
    font-size: 9px; padding: 2px 5px;
    background: rgba(255,255,255,.06);
    color: rgba(255,255,255,.4);
    border-radius: 6px; cursor: pointer;
    transition: all .2s;
}
.m-strip-level:hover,
.m-strip-level.active {
    background: rgba(167,139,250,.25);
    color: #a78bfa;
}
.mobile-status-item.on .mobile-status-name { color: rgba(255,210,80,.9); }

/* 移动端浮层：底部抽屉 */
body.is-mobile #overlay { background: rgba(0,0,0,.7); }

body.is-mobile #info-panel {
    position: fixed; top: auto; left: 0; right: 0; bottom: 0;
    transform: none;
    border-radius: 20px 20px 0 0;
    max-height: 60vh; overflow-y: auto;
    padding: 20px 20px calc(20px + env(safe-area-inset-bottom,0));
    animation: slideUp .3s ease;
    width: 100%; min-width: unset;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* 移动端热点更大 */
body.is-mobile .hotspot {
    width: 50px; height: 50px; font-size: 26px;
}
