/**
 * 探极通联 - MNTL 模拟对讲机通联系统样式
 * ============================================================================
 * 设计风格：专业 SDR 软件风格，深色主题，硬件风格按钮
 * 创建时间：2026-05-24
 * 作者：BD1CFC
 * ============================================================================
 */

/* ========== 全局变量 ========== */
:root {
  /* 主题色 */
  --bg-primary: #0a0e17;
  --bg-secondary: #111820;
  --bg-panel: #1a2332;
  --bg-input: #0d1117;
  
  /* 强调色 */
  --accent-primary: #00ff88;
  --accent-secondary: #00d4ff;
  --accent-danger: #ff4757;
  --accent-warning: #ffc107;
  
  /* 文本色 */
  --text-primary: #e8eaed;
  --text-secondary: #9aa0a6;
  --text-muted: #5f6368;
  
  /* 状态色 */
  --success: #00d26a;
  --warning: #ffa726;
  --danger: #ff4757;
  --info: #2196f3;
  
  /* 边框 */
  --border-color: #2d3748;
  --border-radius: 4px;
  
  /* 阴影 */
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.5);
  
  /* 字体 */
  --font-mono: 'Courier New', 'Consolas', monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
}

/* ========== 全局样式 ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow: hidden;
  height: 100vh;
}

/* ========== 主布局 ========== */
.mntl-container {
  display: grid;
  grid-template-rows: 60px 1fr 40px;
  height: 100vh;
  gap: 2px;
  background: var(--bg-primary);
}

/* ========== 顶部导航栏 ========== */
.mntl-header {
  background: var(--bg-panel);
  border-bottom: 2px solid var(--accent-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  box-shadow: var(--shadow-md);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 30px;
}

.logo {
  font-size: 24px;
  font-weight: bold;
  color: var(--accent-primary);
  text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.callsign-display {
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--accent-secondary);
  padding: 8px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
}

.header-center {
  display: flex;
  align-items: center;
  gap: 20px;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg-input);
  border-radius: var(--border-radius);
  font-size: 14px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.status-dot.online {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
}

.status-dot.offline {
  background: var(--text-muted);
}

.status-dot.tx {
  background: var(--danger);
  box-shadow: 0 0 12px var(--danger);
  animation: pulse-fast 0.5s infinite;
}

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

@keyframes pulse-fast {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.2); }
}

.header-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

/* ========== 主内容区 ========== */
.mntl-main {
  display: grid;
  grid-template-columns: 300px 1fr 350px;
  gap: 2px;
  overflow: hidden;
}

/* ========== 左侧面板 ========== */
.panel-left {
  background: var(--bg-panel);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-header {
  padding: 12px 16px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.room-list {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.room-item {
  padding: 12px;
  margin-bottom: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all 0.2s;
}

.room-item:hover {
  border-color: var(--accent-primary);
  background: rgba(0, 255, 136, 0.05);
}

.room-item.active {
  border-color: var(--accent-primary);
  background: rgba(0, 255, 136, 0.1);
  box-shadow: 0 0 8px rgba(0, 255, 136, 0.3);
}

.room-name {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.room-info {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  justify-content: space-between;
}

.room-users {
  color: var(--accent-primary);
}

/* ========== 中央主区域 ========== */
.panel-center {
  background: var(--bg-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
  padding: 30px;
  position: relative;
}

/* 频率显示 */
.frequency-display {
  width: 100%;
  max-width: 600px;
  background: var(--bg-input);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.freq-label {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.freq-value {
  font-family: var(--font-mono);
  font-size: 64px;
  font-weight: bold;
  color: var(--accent-primary);
  text-shadow: 0 0 20px rgba(0, 255, 136, 0.6);
  letter-spacing: 4px;
}

.freq-unit {
  font-size: 24px;
  color: var(--accent-secondary);
  margin-left: 8px;
}

.freq-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 15px;
}

.freq-btn {
  padding: 8px 16px;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
}

.freq-btn:hover {
  border-color: var(--accent-primary);
  background: rgba(0, 255, 136, 0.1);
}

/* 波形图 */
.waveform-container {
  width: 100%;
  max-width: 800px;
  height: 150px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  overflow: hidden;
}

.waveform-canvas {
  width: 100%;
  height: 100%;
}

/* PTT 按钮 */
.ptt-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.ptt-button {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: linear-gradient(145deg, #2a3441, #1a2332);
  border: 3px solid var(--border-color);
  box-shadow: 
    8px 8px 20px rgba(0, 0, 0, 0.6),
    -8px -8px 20px rgba(255, 255, 255, 0.05),
    inset 0 0 30px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: all 0.1s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  user-select: none;
  position: relative;
}

.ptt-button:hover {
  transform: scale(1.02);
}

.ptt-button:active,
.ptt-button.active {
  background: linear-gradient(145deg, #ff4757, #c73e54);
  border-color: var(--accent-danger);
  box-shadow: 
    inset 8px 8px 20px rgba(0, 0, 0, 0.4),
    inset -8px -8px 20px rgba(255, 71, 87, 0.3),
    0 0 40px rgba(255, 71, 87, 0.6);
  transform: scale(0.98);
}

.ptt-icon {
  font-size: 48px;
  margin-bottom: 10px;
}

.ptt-label {
  font-size: 20px;
  font-weight: bold;
  color: var(--text-primary);
}

.ptt-hint {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 10px;
}

/* ========== 右侧面板 ========== */
.panel-right {
  background: var(--bg-panel);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.online-users {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
}

.user-item {
  display: flex;
  align-items: center;
  padding: 10px;
  margin-bottom: 6px;
  background: var(--bg-input);
  border-radius: var(--border-radius);
  border-left: 3px solid transparent;
  transition: all 0.2s;
}

.user-item.tx {
  border-left-color: var(--accent-danger);
  background: rgba(255, 71, 87, 0.1);
}

.user-item.rx {
  border-left-color: var(--success);
}

.user-callsign {
  flex: 1;
  font-weight: 600;
  font-family: var(--font-mono);
}

.user-status {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 3px;
  background: var(--bg-secondary);
}

.user-status.tx {
  color: var(--accent-danger);
  background: rgba(255, 71, 87, 0.2);
}

/* ========== 底部状态栏 ========== */
.mntl-footer {
  background: var(--bg-panel);
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  font-size: 12px;
  color: var(--text-secondary);
}

.footer-left,
.footer-center,
.footer-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.s-meter {
  display: flex;
  align-items: center;
  gap: 8px;
}

.s-meter-bar {
  width: 200px;
  height: 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 2px;
  overflow: hidden;
}

.s-meter-fill {
  height: 100%;
  background: linear-gradient(90deg, 
    #00ff00 0%, 
    #00ff00 60%, 
    #ffff00 60%, 
    #ffff00 80%, 
    #ff0000 80%, 
    #ff0000 100%);
  transition: width 0.1s;
}

/* ========== 滚动条 ========== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-input);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ========== 按钮通用样式 ========== */
.btn {
  padding: 8px 16px;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
  font-weight: 500;
}

.btn:hover {
  border-color: var(--accent-primary);
  background: rgba(0, 255, 136, 0.1);
}

.btn-primary {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: var(--bg-primary);
}

.btn-primary:hover {
  background: #00cc6a;
  box-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

.btn-danger {
  background: var(--accent-danger);
  border-color: var(--accent-danger);
  color: white;
}

/* ========== 输入框 ========== */
.input {
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  color: var(--text-primary);
  font-size: 14px;
  transition: all 0.2s;
}

.input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 8px rgba(0, 255, 136, 0.3);
}

/* ========== 日志区域 ========== */
.log-container {
  max-height: 200px;
  overflow-y: auto;
  padding: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  font-family: var(--font-mono);
  font-size: 12px;
}

.log-item {
  padding: 4px 0;
  border-bottom: 1px solid var(--border-color);
}

.log-time {
  color: var(--text-muted);
  margin-right: 10px;
}

.log-info { color: var(--accent-secondary); }
.log-success { color: var(--success); }
.log-warning { color: var(--warning); }
.log-error { color: var(--danger); }

/* ========== 响应式 ========== */
@media (max-width: 1400px) {
  .mntl-main {
    grid-template-columns: 250px 1fr 300px;
  }
}

@media (max-width: 1024px) {
  .mntl-main {
    grid-template-columns: 1fr;
  }
  
  .panel-left,
  .panel-right {
    display: none;
  }
}
