* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    min-height: 100vh;
    height: 100vh;
    background: #000;
    overflow: hidden;
    font-family: "微软雅黑", sans-serif;
    position: relative;
}

/* PC端默认：占满全屏 */
.main-view {
    width: 100%;
    height: 100%;
    position: relative;
}

#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    pointer-events: none;
}

/* 中心圆点 */
#center-dot-container {
    position: absolute;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    z-index: 100;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
#center-image {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.8);
    transition: border-color 0.3s ease;
}

/* 圆环通用样式 */
[id^="outer-ring"] {
    position: absolute;
    border-radius: 50%;
    background: #000;
    box-shadow: inset 0 0 0 2px rgba(255,255,255,0.8);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(0deg);
    transition: box-shadow 0.3s ease;
    cursor: grab;
    pointer-events: all;
}
[id^="outer-ring"]:active { cursor: grabbing; }
[id^="outer-ring"]:hover {
    box-shadow: inset 0 0 0 2px #ffd700;
}
[id^="outer-ring"]:hover > div {
    background: #ffd700;
}
[id^="outer-ring"]:hover .dir-text,
[id^="outer-ring"]:hover .zodiac-text {
    color: #ffd700;
}

/* 手机拖拽激活高亮 */
[id^="outer-ring"].ring-active {
    box-shadow: inset 0 0 0 2px #ffd700;
}
[id^="outer-ring"].ring-active > div {
    background: #ffd700;
}
[id^="outer-ring"].ring-active .dir-text,
[id^="outer-ring"].ring-active .zodiac-text {
    color: #ffd700;
}

/* 4等分短线 */
.line-left,
.line-right,
.line-top,
.line-bottom {
    position: absolute;
    background: rgba(255,255,255,0.8);
    transition: background 0.3s ease;
    pointer-events: none;
}
.line-left  { width: calc(50% - 25px); height: 2px; top: 50%; left: 0;  transform: translateY(-50%); }
.line-right { width: calc(50% - 25px); height: 2px; top: 50%; right: 0; transform: translateY(-50%); }
.line-top   { height: calc(50% - 25px); width: 2px; left: 50%; top: 0;  transform: translateX(-50%); }
.line-bottom{ height: calc(50% - 25px); width: 2px; left: 50%; bottom: 0; transform: translateX(-50%); }

/* 放射线段 */
.line-2 {
    position: absolute;
    width: 2px;
    height: 50%;
    background: rgba(255,255,255,0.8);
    left: 50%;
    top: 50%;
    transform-origin: center top;
    transform: translateX(-50%);
    transition: background 0.3s ease;
    pointer-events: none;
}

/* 文字样式 */
.dir-text {
    position: absolute;
    color: #fff;
    font-size: 16px;
    pointer-events: none;
    left: 50%;
    background: transparent !important;
    user-select: none;
}
.zodiac-text {
    position: absolute;
    color: #FFFFFF;
    font-size: 14px;
    font-weight: bold;
    left: 50%;
    transition: color 0.3s ease;
    pointer-events: none;
    width: 40px;
    text-align: center;
    background-color: transparent !important;
}
.dir-text, .zodiac-text {
  white-space: nowrap !important;
  overflow: hidden;
  text-overflow: ellipsis;
  width: auto;
  min-width: 0;
}

#rings-container{
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transform-origin: center center;
}

/* ========== 控制面板基础样式 ========== */
#control-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(0,0,0,0.65);
    border-radius: 12px;
    pointer-events: auto;
}
#control-panel button {
    padding: 6px 12px;
    border: 1px solid rgba(255,255,255,0.6);
    background: transparent;
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
}
#control-panel button:hover {
    border-color: #ffd700;
    color: #ffd700;
}
#control-panel label {
    color: #fff;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
#scale-slider {
    width: 110px;
}

/* ====================== 媒体查询：区分电脑/手机【核心】 ====================== */
/* PC端：悬浮fixed布局（维持你原来的效果） */
@media (min-width:641px) {
    #control-panel {
        position: fixed;
        bottom: max(16px, env(safe-area-inset-bottom));
        left: 50%;
        transform: translateX(-50%);
        z-index: 100000;
        max-width: calc(100vw - 24px);
    }
}

/* 手机端 ≤640px：上下分区！！ */
@media (max-width:640px) {
    /* 上区域95%高度：罗盘画面 */
    .main-view {
        height: 92vh;
        width:100%;
        position: relative;
    }
    /* 重点改动：不再static，改用absolute钉死底部，隔绝重排干扰 */
    #control-panel {
        position: absolute;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 100%;
        height: 8vh;
        border-radius:0;
        background:#000;
        gap:8px;
        padding:0 12px;
        justify-content: center;
    }
    #control-panel button {
        padding:4px 8px;
        font-size:13px;
    }
    #control-panel label {
        font-size:13px;
    }
    #scale-slider {
        width:80px;
        padding:0;
        margin:0 4px;
    }
}

body {
    overflow:hidden !important;
}