/**
 * 磁检测仪器网页版 - 工业风格样式
 * 模拟真实工业设备的金属质感、3D效果和仪表盘风格
 */

/* ==================== 设备外壳 ==================== */
.device-container {
    position: relative;
    width: 100%;
    max-width: 1400px;
    min-height: 900px;
    height: auto;
    margin: 20px auto;
    padding-bottom: 80px;
    background: var(--dark-gray);
    border-radius: 20px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    overflow: visible;
}

/* 橙色装饰边角 */
.corner-decoration {
    position: absolute;
    width: 150px;
    height: 150px;
    background: linear-gradient(135deg, var(--primary-orange) 0%, #e85d11 100%);
    pointer-events: none;
    z-index: 1;
}

.corner-decoration::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 50%);
}

.corner-decoration.top-left {
    top: 0;
    left: 0;
    clip-path: polygon(0 0, 100% 0, 0 100%);
}

.corner-decoration.top-right {
    top: 0;
    right: 0;
    clip-path: polygon(100% 0, 100% 100%, 0 0);
}

.corner-decoration.bottom-left {
    bottom: 0;
    left: 0;
    clip-path: polygon(0 0, 0 100%, 100% 100%);
}

.corner-decoration.bottom-right {
    bottom: 0;
    right: 0;
    clip-path: polygon(100% 0, 100% 100%, 0 100%);
}

/* ==================== 金属按钮 ==================== */
.metal-button {
    position: relative;
    background: linear-gradient(180deg, #4a4a4a 0%, #2a2a2a 100%);
    border: 2px solid #1a1a1a;
    color: #888;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -1px 0 rgba(0, 0, 0, 0.5);
    transition: all 0.15s ease;
}

.metal-button:hover {
    background: linear-gradient(180deg, #5a5a5a 0%, #3a3a3a 100%);
    box-shadow: 
        0 6px 12px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset 0 -1px 0 rgba(0, 0, 0, 0.5);
}

.metal-button:active {
    background: linear-gradient(180deg, #2a2a2a 0%, #4a4a4a 100%);
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.3),
        inset 0 2px 4px rgba(0, 0, 0, 0.5);
    transform: translateY(2px);
}

.metal-button.active {
    background: linear-gradient(180deg, var(--primary-orange) 0%, #e85d11 100%);
    color: white;
    box-shadow: 
        0 4px 8px rgba(255, 107, 26, 0.4),
        0 0 20px rgba(255, 107, 26, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* ==================== LED指示灯 ==================== */
.led-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #333;
    box-shadow: 
        inset 0 1px 3px rgba(0, 0, 0, 0.5),
        0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
}

.led-indicator::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
}

.led-indicator.on {
    background: radial-gradient(circle, #ff6b1a 0%, #e85d11 70%);
    box-shadow: 
        0 0 10px var(--primary-orange),
        0 0 20px rgba(255, 107, 26, 0.5),
        inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

.led-indicator.green.on {
    background: radial-gradient(circle, #00ff00 0%, #00cc00 70%);
    box-shadow: 
        0 0 10px #00ff00,
        0 0 20px rgba(0, 255, 0, 0.5);
}

.led-indicator.red.on {
    background: radial-gradient(circle, #ff0000 0%, #cc0000 70%);
    box-shadow: 
        0 0 10px #ff0000,
        0 0 20px rgba(255, 0, 0, 0.5);
}

/* ==================== 旋钮控制 ==================== */
.rotary-knob {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #6a6a6a, #3a3a3a 40%, #2a2a2a);
    border: 6px solid var(--primary-orange);
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.3),
        inset 0 2px 5px rgba(0, 0, 0, 0.5),
        inset 0 -2px 5px rgba(255, 255, 255, 0.1);
    cursor: pointer;
    position: relative;
    transition: transform 0.3s ease;
}

.rotary-knob::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 16px;
    background: white;
    border-radius: 2px;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

.rotary-knob::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: radial-gradient(circle, #4a4a4a 0%, #2a2a2a 70%);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.rotary-knob:active {
    transform: scale(0.98);
}

/* ==================== 螺丝装饰 ==================== */
.screw {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: radial-gradient(circle, #666 0%, #444 50%, #333 100%);
    box-shadow: 
        inset 0 2px 5px rgba(0, 0, 0, 0.5),
        0 1px 0 rgba(255, 255, 255, 0.1);
    position: absolute;
}

.screw::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 2px;
    background: #222;
    box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.5);
}

/* ==================== 数码显示屏 ==================== */
.digital-display {
    background: #000;
    color: #0f0;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    padding: 8px 12px;
    border-radius: 4px;
    box-shadow: 
        inset 0 2px 8px rgba(0, 0, 0, 0.8),
        0 1px 0 rgba(255, 255, 255, 0.1);
    text-shadow: 0 0 5px #0f0;
    letter-spacing: 2px;
}

.digital-display.red {
    color: #f00;
    text-shadow: 0 0 5px #f00;
}

.digital-display.yellow {
    color: #ff0;
    text-shadow: 0 0 5px #ff0;
}

/* ==================== 仪表盘 ==================== */
.gauge {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, #3a3a3a 0%, #1a1a1a 70%);
    border: 4px solid #4a4a4a;
    box-shadow: 
        inset 0 2px 10px rgba(0, 0, 0, 0.5),
        0 2px 8px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.gauge-value {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-orange);
    text-shadow: 0 0 10px rgba(255, 107, 26, 0.5);
}

.gauge-unit {
    font-size: 12px;
    color: #888;
    margin-top: 4px;
}

/* ==================== 金属面板 ==================== */
.metal-panel {
    background: linear-gradient(180deg, #4a4a4a 0%, #3a3a3a 50%, #2a2a2a 100%);
    border: 1px solid #1a1a1a;
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    padding: 16px;
    border-radius: 4px;
}

/* ==================== 开关按钮 ==================== */
.toggle-switch {
    position: relative;
    width: 60px;
    height: 30px;
    background: #2a2a2a;
    border-radius: 15px;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    transition: background 0.3s ease;
}

.toggle-switch::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    background: linear-gradient(180deg, #6a6a6a 0%, #4a4a4a 100%);
    border-radius: 50%;
    box-shadow: 
        0 2px 5px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: left 0.3s ease;
}

.toggle-switch.on {
    background: var(--primary-orange);
    box-shadow: 
        inset 0 2px 5px rgba(0, 0, 0, 0.3),
        0 0 10px rgba(255, 107, 26, 0.3);
}

.toggle-switch.on::before {
    left: 33px;
}

/* ==================== 滑块控制 ==================== */
.slider-control {
    position: relative;
    width: 100%;
    height: 6px;
    background: #2a2a2a;
    border-radius: 3px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.slider-control input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: transparent;
    position: absolute;
    top: 0;
    left: 0;
}

.slider-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: linear-gradient(180deg, #6a6a6a 0%, #4a4a4a 100%);
    border: 2px solid var(--primary-orange);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.slider-control input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: linear-gradient(180deg, #6a6a6a 0%, #4a4a4a 100%);
    border: 2px solid var(--primary-orange);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

/* ==================== 品牌标识 ==================== */
.brand-logo {
    font-size: 32px;
    font-weight: bold;
    font-style: italic;
    color: #666;
    text-shadow: 
        2px 2px 0 #888,
        -1px -1px 0 #444,
        0 2px 5px rgba(0, 0, 0, 0.5);
    letter-spacing: 3px;
}

/* ==================== 金属纹理背景 ==================== */
.brushed-metal {
    background: 
        linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.05) 50%, transparent 100%),
        linear-gradient(180deg, #3a3a3a 0%, #2a2a2a 100%);
    background-size: 3px 100%, 100% 100%;
}

/* ==================== 状态栏 ==================== */
.status-bar {
    background: linear-gradient(180deg, #2a2a2a 0%, #1a1a1a 100%);
    border-bottom: 1px solid #000;
    box-shadow: 
        0 2px 5px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #888;
    font-size: 14px;
}

/* ==================== 数据指示灯组 ==================== */
.indicator-group {
    display: flex;
    gap: 12px;
    align-items: center;
}

.indicator-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #888;
}

/* ==================== 3D凸起效果 ==================== */
.raised-3d {
    box-shadow: 
        0 4px 6px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        inset 0 -1px 0 rgba(0, 0, 0, 0.5);
}

.depressed-3d {
    box-shadow: 
        inset 0 2px 5px rgba(0, 0, 0, 0.5),
        0 1px 0 rgba(255, 255, 255, 0.1);
}

/* ==================== 发光效果 ==================== */
.glow-orange {
    box-shadow: 
        0 0 10px rgba(255, 107, 26, 0.5),
        0 0 20px rgba(255, 107, 26, 0.3),
        0 0 30px rgba(255, 107, 26, 0.1);
}

.glow-green {
    box-shadow: 
        0 0 10px rgba(0, 255, 0, 0.5),
        0 0 20px rgba(0, 255, 0, 0.3);
}

.glow-red {
    box-shadow: 
        0 0 10px rgba(255, 0, 0, 0.5),
        0 0 20px rgba(255, 0, 0, 0.3);
}

/* ==================== 动画效果 ==================== */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.pulse {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

.blink {
    animation: blink 1s step-end infinite;
}
