/* 基础样式 */
* {
    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;
    background: linear-gradient(135deg, #F5F2EA 0%, #FAF9F7 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* 罗盘容器 */
.compass-container {
    position: relative;
    width: 480px;
    height: 480px;
    margin: 0 auto;
}

/* 罗盘底盘 */
.compass-base {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #FAF9F7 0%, #F5F2EA 100%);
    border: 0.5px solid #D4C4A8;
    position: relative;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.05),
        inset 0 2px 10px rgba(255, 255, 255, 0.8);
}

/* 刻度环 */
.compass-ring {
    position: absolute;
    border-radius: 50%;
    border: 0.5px dashed rgba(139, 40, 32, 0.2);
}

.compass-ring--outer {
    inset: 20px;
}

.compass-ring--inner {
    inset: 60px;
}

/* 十字轴线 */
.compass-axis {
    position: absolute;
    background: rgba(139, 40, 32, 0.1);
}

.compass-axis--horizontal {
    width: 100%;
    height: 0.5px;
    top: 50%;
}

.compass-axis--vertical {
    width: 0.5px;
    height: 100%;
    left: 50%;
}

/* 中央太极 */
.compass-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    z-index: 10;
}

.taiji {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: conic-gradient(#2A2825 0% 50%, #F5F2EA 50% 100%);
    position: relative;
    animation: rotate 24s linear infinite;
}

.taiji::before,
.taiji::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.taiji::before {
    background: #2A2825;
    margin-top: -12px;
}

.taiji::after {
    background: #F5F2EA;
    margin-top: 12px;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 四象印章 */
.seal {
    position: absolute;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #FAF9F7;
    border: 1px solid #B5B0A8;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.4s ease;
    transform: translate(-50%, -50%);
    z-index: 5;
}

.seal:hover {
    transform: translate(-50%, -50%) scale(1.15);
    border-color: #9A4B42;
    box-shadow: 0 0 20px rgba(154, 75, 66, 0.1);
}

.seal.is-active {
    background: #9A4B42;
    color: #FAF9F7;
    border-color: #9A4B42;
    box-shadow: 0 4px 15px rgba(154, 75, 66, 0.3);
}

.seal-symbol {
    font-size: 18px;
    font-weight: 500;
    line-height: 1.2;
}

.seal-name {
    font-size: 12px;
    opacity: 0.7;
    line-height: 1.2;
}

.seal-trigram {
    font-size: 14px;
    margin-top: 2px;
    line-height: 1.2;
}

/* 四象颜色 */
.seal--yong { color: #5B7A6B; } /* 春芽 - 震☳ */
.seal--kuo { color: #A8B8C8; } /* 秋月 - 兑☱ */
.seal--yan { color: #C9A9A6; } /* 夏荷 - 离☲ */
.seal--yi { color: #3A4A5A; } /* 冬墨 - 坎☵ */

.seal--yong.is-active,
.seal--kuo.is-active,
.seal--yan.is-active,
.seal--yi.is-active {
    color: #FAF9F7;
}

/* 配置面板 */
.config-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 320px;
    background: #FAF9F7;
    border-radius: 16px;
    border: 1px solid #D4C4A8;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    z-index: 20;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.config-panel.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.config-panel h3 {
    font-size: 18px;
    color: #2A2825;
    margin-bottom: 16px;
    text-align: center;
    font-weight: 500;
}

/* 档位选择器 */
.level-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.level-btn {
    padding: 8px 16px;
    border: 1px solid #D4C4A8;
    border-radius: 20px;
    background: #F5F2EA;
    color: #5B5854;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.level-btn:hover {
    background: #EBE7DD;
    border-color: #B5B0A8;
}

.level-btn.is-selected {
    background: #9A4B42;
    color: #FAF9F7;
    border-color: #9A4B42;
}

/* 配置表单 */
.config-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    color: #5B5854;
    font-weight: 500;
}

.form-group input[type="number"],
.form-group input[type="text"],
.form-group select {
    padding: 10px 12px;
    border: 1px solid #D4C4A8;
    border-radius: 8px;
    background: #FFF;
    font-size: 14px;
    color: #2A2825;
    transition: border-color 0.3s ease;
}

.form-group input[type="number"]:focus,
.form-group input[type="text"]:focus,
.form-group select:focus {
    outline: none;
    border-color: #9A4B42;
}

.form-group .unit {
    font-size: 12px;
    color: #999;
    margin-left: 8px;
}

.form-group .condition {
    font-size: 12px;
    color: #9A4B42;
    margin-top: 4px;
}

/* 开关样式 */
.toggle-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.toggle-switch {
    position: relative;
    width: 48px;
    height: 24px;
    background: #D4C4A8;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.toggle-switch.is-active {
    background: #9A4B42;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: #FFF;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toggle-switch.is-active::after {
    transform: translateX(24px);
}

/* 股份输入组 */
.shares-group {
    display: flex;
    gap: 12px;
}

.shares-group .form-group {
    flex: 1;
}

/* 操作按钮 */
.config-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    justify-content: center;
}

.btn {
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: #9A4B42;
    color: #FAF9F7;
}

.btn-primary:hover {
    background: #8B3E36;
}

.btn-secondary {
    background: #F5F2EA;
    color: #5B5854;
    border: 1px solid #D4C4A8;
}

.btn-secondary:hover {
    background: #EBE7DD;
}

/* 关闭按钮 */
.config-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.05);
    color: #5B5854;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.config-close:hover {
    background: rgba(154, 75, 66, 0.1);
    color: #9A4B42;
}

/* 遮罩层 */
.compass-container::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 15;
}

.compass-container.has-panel::before {
    opacity: 1;
    visibility: visible;
}

/* 响应式适配 - 平板端 */
@media (max-width: 1024px) {
    .compass-container {
        width: 400px;
        height: 400px;
    }
    
    .seal {
        width: 64px;
        height: 64px;
    }
    
    .seal-symbol {
        font-size: 16px;
    }
    
    .seal-name {
        font-size: 11px;
    }
    
    .seal-trigram {
        font-size: 12px;
    }
    
    .config-panel {
        width: 280px;
        padding: 20px;
    }
}

/* 响应式适配 - 移动端 */
@media (max-width: 768px) {
    .compass-container {
        width: 320px;
        height: 320px;
    }
    
    .seal {
        width: 56px;
        height: 56px;
    }
    
    .seal-symbol {
        font-size: 14px;
    }
    
    .seal-name {
        font-size: 10px;
    }
    
    .seal-trigram {
        font-size: 11px;
    }
    
    .compass-center {
        width: 40px;
        height: 40px;
    }
    
    .config-panel {
        width: 260px;
        padding: 16px;
    }
    
    .config-panel h3 {
        font-size: 16px;
    }
    
    .level-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
}

/* 响应式适配 - 小屏移动端 */
@media (max-width: 480px) {
    .compass-container {
        width: 280px;
        height: 280px;
    }
    
    .seal {
        width: 48px;
        height: 48px;
    }
    
    .seal-symbol {
        font-size: 13px;
    }
    
    .seal-name {
        font-size: 9px;
    }
    
    .seal-trigram {
        font-size: 10px;
    }
    
    .compass-center {
        width: 36px;
        height: 36px;
    }
    
    .config-panel {
        width: 240px;
        padding: 14px;
    }
    
    .shares-group {
        flex-direction: column;
        gap: 8px;
    }
}
