/* ============================================
   UT 超声波声束可视化仿真工具 - 样式表
   明亮工程风格：浅灰白背景 + 白色面板 + 蓝色强调
   ============================================ */

/* ---------- 全局重置 ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ---------- 全局range滑块样式（Safari/Chrome/Firefox兼容） ---------- */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: #d1d5db;
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #3b82f6;
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #3b82f6;
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
input[type="range"]::-moz-range-track {
  height: 4px;
  background: #d1d5db;
  border-radius: 2px;
}

:root {
  --bg: #f5f7fa;
  --panel-bg: #ffffff;
  --border: #e4e8ef;
  --border-light: #eef1f6;
  --text: #2c3e50;
  --text-secondary: #7a8a9e;
  --text-muted: #a0aec0;
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --primary-light: #dbeafe;
  --primary-bg: #eff6ff;
  --red: #ef4444;
  --red-light: #fee2e2;
  --green: #10b981;
  --green-light: #d1fae5;
  --purple: #8b5cf6;
  --purple-light: #ede9fe;
  --orange: #f59e0b;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --sidebar-width: 360px;
  --topbar-height: 64px;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

/* ---------- 登录页 ---------- */
.login-screen {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #2d5a87 0%, #2d5a87 45%, #1a3a5c 100%);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 9999;
  padding: 30px 20px;
  overflow-y: auto;
}

.login-layout {
  display: flex;
  gap: 24px;
  align-items: stretch;
  max-width: 1400px;
  width: 100%;
}

.login-col {
  flex: 1;
  min-width: 0;
}

.login-col-center {
  flex: 0 0 580px;
}

.login-col-left,
.login-col-right {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (max-width: 1000px) {
  .login-layout {
    flex-direction: column;
    align-items: center;
  }
  .login-col {
    width: 100%;
    max-width: 500px;
  }
  .login-col-center {
    flex: none;
    max-width: 380px;
  }
}

.login-box {
  background: #fff;
  border-radius: 28px;
  padding: 64px 60px;
  width: 580px;
  text-align: center;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
}

.login-studio {
  font-family: 'Ma Shan Zheng', 'STKaiti', 'KaiTi', cursive;
  font-size: 24px;
  font-weight: 700;
  color: #e8c86a;
  background: #2d5a87;
  padding: 10px 28px;
  border-radius: 12px;
  display: inline-block;
  margin: 0 auto 20px;
  letter-spacing: 4px;
  box-shadow: 0 4px 14px rgba(30, 58, 95, 0.4);
  border: 3px solid #f5e6a3;
}

.login-logo {
  width: 120px;
  height: 120px;
  background: linear-gradient(135deg, #2d5a87, #2d5a87);
  color: #fff;
  border-radius: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 48px;
  font-weight: 900;
  letter-spacing: 4px;
  text-indent: 4px;
  text-shadow: 0 2px 6px rgba(0,0,0,0.25);
  box-shadow: 0 8px 24px rgba(30,58,95,0.45), inset 0 0 0 3px #f5e6a3;
  margin: 0 auto 28px;
}

.login-box h2 {
  font-size: 32px;
  color: var(--text);
  margin-bottom: 12px;
}

.login-sub {
  color: var(--text-secondary);
  font-size: 18px;
  margin-bottom: 36px;
}

.login-box input[type="text"],
.login-box input[type="password"] {
  width: 100%;
  padding: 18px 22px;
  border: 2px solid var(--border);
  border-radius: 16px;
  font-size: 18px;
  outline: none;
  transition: border-color 0.2s;
  margin-bottom: 20px;
  box-sizing: border-box;
}

.login-box input:focus {
  border-color: #2d5a87;
}

.login-remember {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 28px;
  cursor: pointer;
  text-align: left;
}

.login-remember input {
  cursor: pointer;
}

.login-box button {
  width: 100%;
  padding: 18px;
  background: linear-gradient(135deg, #2d5a87, #2d5a87);
  color: #fff;
  border: none;
  border-radius: 16px;
  font-size: 22px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.login-box button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(245, 230, 163, 0.45);
}

.login-error {
  color: var(--red);
  font-size: 13px;
  margin-top: 12px;
  min-height: 18px;
}

.login-register-tip {
  text-align: center;
  font-size: 13px;
  color: var(--text-light);
  margin-top: 16px;
}
.login-register-tip a {
  color: var(--blue);
  text-decoration: none;
  cursor: pointer;
}
.login-register-tip a:hover {
  text-decoration: underline;
}

/* 登录页联系开发者卡片 */
.login-contact-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 24px;
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  text-align: center;
  height: 100%;
  box-sizing: border-box;
}
.login-contact-qr {
  width: 300px;
  height: 300px;
  border-radius: 16px;
  flex-shrink: 0;
  object-fit: cover;
}
.login-contact-info {
  flex: 1;
  text-align: center;
}
.login-contact-info h3 {
  font-size: 22px;
  color: #1f2937;
  margin-bottom: 12px;
}
.login-contact-info p {
  font-size: 16px;
  color: #6b7280;
  line-height: 1.8;
  margin: 0;
}
.login-contact-wechat {
  margin-top: 16px !important;
  font-size: 20px !important;
  font-weight: 700 !important;
  color: #4f46e5 !important;
}
.login-contacts-list {
  margin-top: 20px;
  width: 100%;
}
.login-contacts-title {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 10px;
  font-weight: 600;
}
.login-contact-item {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  margin-bottom: 6px;
  background: #f3f4f6;
  border-radius: 10px;
  font-size: 15px;
}
.login-contact-item .contact-label {
  font-weight: 600;
  color: #374151;
}
.login-contact-item .contact-value {
  font-family: monospace;
  color: #4f46e5;
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
}
.login-contact-item.qq .contact-value { font-size: 13px; }
.login-contact-item.qq .contact-label::before {
  content: "🐧 ";
}
.login-contact-item.wechat .contact-label::before {
  content: "💬 ";
}
.login-contact-note {
  margin-top: 14px;
  font-size: 12px;
  color: #ef4444;
  line-height: 1.6;
  background: #fef2f2;
  padding: 10px 14px;
  border-radius: 10px;
  border-left: 3px solid #ef4444;
}

/* 双二维码并排 */
.qr-row {
  display: flex;
  gap: 16px;
  justify-content: center;
  align-items: flex-start;
}
.qr-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.login-contact-qr-small {
  width: 165px;
  height: 165px;
  border-radius: 12px;
  flex-shrink: 0;
  object-fit: cover;
  border: 2px solid #e5e7eb;
}
.qr-label {
  font-size: 13px;
  font-weight: 700;
  color: #374151;
}

/* 登录页功能介绍卡片 */
.login-feature-card {
  background: rgba(255, 255, 255, 0.97);
  border-radius: 24px;
  padding: 40px 36px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}
.feature-header {
  text-align: center;
  margin-bottom: 24px;
}
.feature-badge {
  display: inline-block;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  padding: 10px 24px;
  border-radius: 28px;
  font-size: 17px;
  font-weight: 600;
}
.feature-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 26px;
}
.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.feature-icon {
  font-size: 34px;
  flex-shrink: 0;
  margin-top: 2px;
}
.feature-title {
  font-size: 19px;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 6px;
}
.feature-desc {
  font-size: 15px;
  color: #6b7280;
  line-height: 1.7;
}
.pricing-section {
  border-top: 1px solid #e5e7eb;
  padding-top: 24px;
  overflow: hidden;
}
.pricing-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.pricing-title span:first-child {
  font-size: 19px;
  font-weight: 700;
  color: #1f2937;
}
.pricing-note {
  display: none;
}
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
  overflow: hidden;
  align-items: stretch;
}
.price-card {
  background: #f8fafc;
  border-radius: 10px;
  padding: 16px 6px 12px;
  text-align: center;
  position: relative;
  border: 2px solid transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
}
.price-card.popular {
  border-color: #ef4444;
  background: linear-gradient(135deg, #fff5f5, #fef2f2);
  padding-top: 28px;
  position: relative;
  overflow: visible;
}
.price-tag {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #ff6b35, #f7931e);
  color: #fff;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 8px;
  font-weight: 700;
  white-space: nowrap;
  z-index: 10;
  box-shadow: 0 2px 6px rgba(255, 107, 53, 0.4);
}
.price-name {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 6px;
  font-weight: 600;
}
.price-card.popular .price-name {
  color: #ef4444;
}
.price-original {
  font-size: 17px;
  font-weight: 800;
  color: #ef4444;
  text-decoration: none;
  border: 2px solid #ef4444;
  border-radius: 6px;
  padding: 3px 8px;
  display: inline-block;
  margin-bottom: 4px;
  background: #fef2f2;
  line-height: 1.3;
  white-space: nowrap;
}
.price-card.popular .price-original {
  border-color: #ef4444;
  color: #ef4444;
  background: #fef2f2;
  font-size: 17px;
  padding: 3px 8px;
}
.price-now {
  display: none;
}
.pricing-footer {
  text-align: center;
  font-size: 14px;
  color: #6b7280;
  padding-top: 14px;
  border-top: 1px dashed #e5e7eb;
}

/* 倒计时 */
.countdown-bar {
  display: none;
}
@keyframes countdownPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.3); }
  50% { box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
}
.countdown-label {
  font-size: 14px;
  font-weight: 700;
  color: #dc2626;
  white-space: nowrap;
}
.countdown-timer {
  display: flex;
  align-items: center;
  gap: 4px;
}
.cd-box {
  background: #1f2937;
  color: #fff;
  border-radius: 6px;
  padding: 4px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 42px;
}
.cd-box b {
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  font-family: 'Courier New', monospace;
}
.cd-box i {
  font-size: 10px;
  font-style: normal;
  color: #9ca3af;
  margin-top: 2px;
}
.cd-box.cd-sec b {
  color: #f87171;
  animation: secBlink 1s step-end infinite;
}
@keyframes secBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.cd-sep {
  color: #dc2626;
  font-size: 18px;
  font-weight: 800;
  animation: sepBlink 1s step-end infinite;
}
@keyframes sepBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.login-feature-tip {
  font-size: 12px;
  color: #2563eb;
  background: #eff6ff;
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 16px;
}

/* ---------- 顶部栏按钮 ---------- */
.topbar-btn {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  margin-left: 8px;
}

.topbar-btn:hover {
  border-color: #2d5a87;
  color: var(--primary);
}

/* ---------- 管理员后台模态框 ---------- */
.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}

.admin-panel {
  position: relative;
  background: #fff;
  border-radius: 14px;
  width: 720px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.admin-header h2 {
  font-size: 17px;
  color: var(--text);
}

.admin-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  font-size: 18px;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.admin-close:hover {
  background: var(--border);
}

.admin-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.admin-section {
  margin-bottom: 24px;
}

.admin-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* 账号列表 */
.user-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.user-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--bg);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.user-info {
  flex: 1;
}

.user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.user-meta {
  font-size: 12px;
  color: var(--text-secondary);
}

.user-actions {
  display: flex;
  gap: 6px;
}

.status {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
  margin-left: 8px;
}

.status-admin { background: #ede9fe; color: #7c3aed; }
.status-active { background: #dcfce7; color: #16a34a; }
.status-expired { background: #fee2e2; color: #dc2626; }

/* 编辑表单 */
.edit-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.form-row label {
  width: 140px;
  font-size: 13px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.form-row input[type="text"],
.form-row input[type="date"] {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  outline: none;
}

.form-row input:focus {
  border-color: #2d5a87;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px 12px;
  flex: 1;
  max-height: 160px;
  overflow-y: auto;
  padding: 8px;
  background: var(--bg);
  border-radius: 6px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.form-msg {
  font-size: 13px;
}

.btn {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn:hover {
  border-color: #2d5a87;
  color: var(--primary);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: #2d5a87;
}

.btn-primary:hover {
  background: #2563eb;
  color: #fff;
}

.btn-danger {
  color: var(--red);
  border-color: #fecaca;
}

.btn-danger:hover {
  background: #fef2f2;
  color: #dc2626;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.import-export {
  display: flex;
  gap: 10px;
}

.empty-tip {
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
  padding: 20px;
}

.hidden {
  display: none !important;
}

/* ---------- 主应用布局 ---------- */
.app {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* ---------- 顶部标题栏 ---------- */
.topbar {
  height: var(--topbar-height);
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
  box-shadow: var(--shadow);
  z-index: 10;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, #2d5a87, #2d5a87);
  color: #fff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 2px;
  text-indent: 2px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.25);
  box-shadow: 0 4px 12px rgba(30,58,95,0.4);
  flex-shrink: 0;
}

.title-group h1 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.title-group p {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.topbar-right {
  display: flex;
  gap: 12px;
  align-items: center;
}

.info-tag {
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--bg);
  padding: 6px 14px;
  border-radius: 20px;
  white-space: nowrap;
}

.info-tag b {
  color: var(--primary);
  font-weight: 600;
}

/* ---------- 主体 ---------- */
.main {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* ---------- 左侧面板 ---------- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 14px;
  flex-shrink: 0;
  scrollbar-width: thin;
  scrollbar-color: #c5cdda transparent;
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: #c5cdda;
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: #a0aec0;
}

/* ---------- 面板卡片 ---------- */
.panel {
  background: var(--panel-bg);
  border-radius: 12px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid var(--border-light);
}

.panel-header {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}

.panel-header:hover {
  background: var(--bg);
}

.panel-icon {
  font-size: 16px;
  margin-right: 10px;
}

.panel-title {
  flex: 1;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.panel-arrow {
  color: var(--text-muted);
  font-size: 12px;
  transition: transform 0.2s;
}

.panel.collapsed .panel-arrow {
  transform: rotate(-90deg);
}

.panel.collapsed .panel-body {
  display: none;
}

.panel-body {
  padding: 4px 16px 16px;
}

/* ---------- 表单元素 ---------- */
.form-group {
  margin-bottom: 14px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 500;
}

.form-group select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text);
  background: #fff;
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a8a9e' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.form-group select:focus {
  border-color: #2d5a87;
}

.form-group input[type="range"] {
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--border);
  border-radius: 2px;
  outline: none;
  margin-top: 4px;
}

.form-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.4);
  transition: transform 0.15s;
}

.form-group input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.val-blue {
  color: var(--primary);
  font-weight: 600;
}

.val-red {
  color: var(--red);
  font-weight: 600;
}

.val-green {
  color: var(--green);
  font-weight: 600;
}

.val-purple {
  color: var(--purple);
  font-weight: 600;
}

.val-bold {
  font-weight: 600;
  color: var(--text);
}

/* ---------- 按钮组 ---------- */
.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.btn-chip {
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 500;
}

.btn-chip:hover {
  border-color: #2d5a87;
  color: var(--primary);
  background: var(--primary-bg);
}

.btn-chip.active {
  background: var(--primary);
  border-color: #2d5a87;
  color: #fff;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.35);
}

/* 晶片形状切换 */
.crystal-shape-toggle {
  display: inline-flex;
  margin-left: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}

.shape-btn {
  padding: 3px 8px;
  border: none;
  background: #fff;
  color: var(--text-secondary);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 500;
}

.shape-btn:hover {
  background: var(--primary-bg);
  color: var(--primary);
}

.shape-btn.active {
  background: var(--primary);
  color: #fff;
}

/* 探头位置精确控制 */
.probe-x-display {
  display: inline-block;
  margin-left: 4px;
}

.probe-zero-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 4px;
}

.probe-x-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0 6px;
}

.probe-arrow-btn {
  width: 36px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text-secondary);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.probe-arrow-btn:hover {
  border-color: #2d5a87;
  color: var(--primary);
  background: var(--primary-bg);
}

.probe-arrow-btn:active {
  transform: scale(0.95);
}

.probe-x-input {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  text-align: center;
  outline: none;
  transition: border-color 0.15s;
  min-width: 0;
}

.probe-x-input:focus {
  border-color: #2d5a87;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.probe-x-slider {
  width: 100%;
  margin: 4px 0;
}

.probe-step-select {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

.step-btn {
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  color: var(--text-secondary);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
}

.step-btn:hover {
  border-color: #2d5a87;
  color: var(--primary);
}

.step-btn.active {
  background: var(--primary);
  border-color: #2d5a87;
  color: #fff;
}

/* ---------- 材料信息 ---------- */
.material-info {
  background: var(--bg);
  border-radius: 8px;
  padding: 10px 14px;
  margin-top: 4px;
}

.mat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 13px;
  color: var(--text-secondary);
}

/* ---------- 试块库分类 ---------- */
.block-category {
  margin-bottom: 8px;
}

.block-category:last-child {
  margin-bottom: 0;
}

.cat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s;
  user-select: none;
}

.cat-header:hover {
  background: var(--bg);
}

.cat-arrow {
  color: var(--text-muted);
  font-size: 11px;
  transition: transform 0.2s;
}

.block-category.collapsed .cat-arrow {
  transform: rotate(-90deg);
}

.block-category.collapsed .cat-body {
  display: none;
}

.cat-body {
  padding: 2px 4px 6px;
}

.block-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 2px;
}

.block-item:hover {
  background: var(--primary-bg);
  color: var(--primary);
}

.block-item.active {
  background: var(--primary-bg);
  color: var(--primary);
  border-color: var(--primary-light);
  font-weight: 600;
}

/* ---------- 开关 ---------- */
.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 13px;
  color: var(--text);
  border-bottom: 1px solid var(--border-light);
}

.toggle-row:last-child {
  border-bottom: none;
}

.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #cbd5e1;
  border-radius: 22px;
  transition: 0.25s;
}

.slider:before {
  content: "";
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.25s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.switch input:checked + .slider {
  background: var(--primary);
}

.switch input:checked + .slider:before {
  transform: translateX(18px);
}

/* ---------- 实时数值 ---------- */
.value-grid {
  font-size: 13px;
}

.val-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-light);
}

.val-row:last-child {
  border-bottom: none;
}

.val-row span:first-child {
  font-size: 12.5px;
}

.val-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}

/* ---------- 操作按钮 ---------- */
.action-panel {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  background: var(--panel-bg);
}

.btn-primary, .btn-secondary {
  flex: 1;
  padding: 11px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-primary {
  background: linear-gradient(135deg, #2d5a87, #2d5a87);
  color: #fff;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.35);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.45);
}

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border-light);
  border-color: var(--primary-light);
  color: var(--primary);
}

.sidebar-footer {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  padding: 8px 0 16px;
}

/* ---------- 画布区域（上下分栏） ---------- */
.canvas-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg);
}

.block-section {
  flex: 1.4;
  position: relative;
  overflow: hidden;
  min-height: 0;
}

#mainCanvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}

#mainCanvas.panning {
  cursor: grabbing;
}

#mainCanvas.probe-hover {
  cursor: grab;
}

.canvas-hint {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(44, 62, 80, 0.75);
  color: #fff;
  padding: 7px 18px;
  border-radius: 20px;
  font-size: 12px;
  pointer-events: none;
  backdrop-filter: blur(4px);
  white-space: nowrap;
}

/* ---------- A扫区域 ---------- */
.ascan-section {
  flex: 1;
  display: flex;
  border-top: 2px solid var(--border);
  min-height: 0;
  background: #1a1a2e;
}

.ascan-screen {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.ascan-title {
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #a0aec0;
  background: #16162a;
  border-bottom: 1px solid #2d2d44;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ascan-tool-btn {
  background: #2d3748;
  color: #e2e8f0;
  border: 1px solid #4a5568;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
}
.ascan-tool-btn:hover {
  background: #4a5568;
  border-color: #63b3ed;
}
.ascan-tool-btn.active {
  background: #3182ce;
  border-color: #63b3ed;
  color: #fff;
}

#ascanCanvas {
  flex: 1;
  display: block;
  width: 100%;
  min-height: 0;
  height: 0;
}

.ascan-readouts {
  display: flex;
  gap: 16px;
  padding: 4px 12px;
  font-size: 11px;
  color: #a0aec0;
  background: #16162a;
  border-top: 1px solid #2d2d44;
  flex-wrap: wrap;
}

.ascan-readouts b {
  color: #63b3ed;
  font-weight: 600;
}

.ascan-alarm {
  margin-left: auto;
  font-weight: 600;
}

.ascan-alarm.alarm-on {
  color: #fc8181;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* A扫参数面板 */
.ascan-controls {
  width: 240px;
  flex-shrink: 0;
  background: #16162a;
  border-left: 1px solid #2d2d44;
  padding: 10px 12px;
  overflow-y: auto;
}

.ascan-ctrl-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
  color: #a0aec0;
}

.ascan-ctrl-row label {
  width: 72px;
  flex-shrink: 0;
  font-size: 11px;
}

.ascan-ctrl-row input[type="range"] {
  flex: 1;
  min-width: 0;
  accent-color: #4299e1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: #2d2d44;
  border-radius: 2px;
  outline: none;
}

.ascan-ctrl-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #4299e1;
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.ascan-ctrl-row input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #4299e1;
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.ascan-ctrl-row input[type="range"]::-moz-range-track {
  height: 4px;
  background: #2d2d44;
  border-radius: 2px;
}

.ascan-ctrl-row input[type="number"],
.ascan-ctrl-row select {
  flex: 1;
  min-width: 0;
  padding: 3px 6px;
  border: 1px solid #2d2d44;
  border-radius: 4px;
  background: #1a1a2e;
  color: #e2e8f0;
  font-size: 11px;
  outline: none;
}

.ascan-ctrl-row input[type="number"]:focus,
.ascan-ctrl-row select:focus {
  border-color: #4299e1;
}

.ascan-ctrl-row span {
  width: 36px;
  text-align: right;
  font-size: 11px;
  color: #63b3ed;
  flex-shrink: 0;
}

.ascan-ctrl-row input[type="checkbox"] {
  accent-color: #4299e1;
}

.canvas-zoom {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: var(--shadow);
  pointer-events: none;
  backdrop-filter: blur(4px);
}

/* ---------- 响应式 ---------- */
@media (max-width: 1200px) {
  .topbar-right {
    display: none;
  }
}

@media (max-width: 900px) {
  .sidebar {
    width: 300px;
  }
  :root {
    --sidebar-width: 300px;
  }
}

/* ========== 新手引导 ========== */
.guide-top-btn {
  background: linear-gradient(135deg, #2d5a87 0%, #2d5a87 45%, #1a3a5c 100%);
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  margin-right: 8px;
  transition: all 0.2s;
  white-space: nowrap;
}
.guide-top-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.teaching-panel {
  position: fixed;
  top: 0;
  right: -400px;
  width: 380px;
  height: 100vh;
  background: #fff;
  box-shadow: -4px 0 20px rgba(0,0,0,0.1);
  z-index: 10000;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
}
.teaching-panel.open {
  right: 0;
}
.teaching-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e5e7eb;
  background: linear-gradient(135deg, #2d5a87 0%, #2d5a87 45%, #1a3a5c 100%);
  color: #fff;
}
.teaching-panel-title {
  font-size: 16px;
  font-weight: 600;
}
.teaching-close-btn {
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.teaching-close-btn:hover {
  background: rgba(255,255,255,0.35);
}
.teaching-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

/* 案例列表 */
.teaching-category {
  margin-bottom: 20px;
}
.teaching-cat-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}
.teaching-cat-name {
  font-size: 15px;
  font-weight: 600;
  color: #1f2937;
}
.teaching-cat-desc {
  font-size: 12px;
  color: #9ca3af;
}
.teaching-case-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.teaching-case-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  background: #fafafa;
}
.teaching-case-item:hover {
  border-color: #667eea;
  background: #f0f4ff;
  transform: translateX(-2px);
}
.teaching-case-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #667eea;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}
.teaching-case-info {
  flex: 1;
  min-width: 0;
}
.teaching-case-title {
  font-size: 14px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 2px;
}
.teaching-case-desc {
  font-size: 12px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.teaching-case-steps {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 2px;
}
.teaching-case-arrow {
  color: #9ca3af;
  font-size: 16px;
  flex-shrink: 0;
}

/* 步骤讲解 */
.teaching-step-header {
  margin-bottom: 16px;
}
.teaching-step-case-title {
  font-size: 15px;
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 8px;
}
.teaching-step-progress {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 6px;
}
.teaching-step-progress-bar {
  height: 4px;
  background: #e5e7eb;
  border-radius: 2px;
  overflow: hidden;
}
.teaching-step-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #667eea, #764ba2);
  border-radius: 2px;
  transition: width 0.3s;
}
.teaching-step-content {
  flex: 1;
  margin-bottom: 16px;
}
.teaching-step-text {
  font-size: 14px;
  line-height: 1.8;
  color: #374151;
  background: #f9fafb;
  padding: 14px;
  border-radius: 10px;
  border-left: 3px solid #667eea;
}
.teaching-step-wait {
  margin-top: 12px;
  padding: 10px 14px;
  background: #fef3c7;
  border-radius: 8px;
  font-size: 13px;
  color: #92400e;
  animation: waitPulse 1.5s ease-in-out infinite;
}
@keyframes waitPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
.teaching-step-nav {
  display: flex;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}
.teaching-nav-btn {
  flex: 1;
  padding: 10px;
  border: 1px solid #d1d5db;
  background: #fff;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  color: #374151;
}
.teaching-nav-btn:hover:not(:disabled) {
  border-color: #667eea;
  color: #667eea;
}
.teaching-nav-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.teaching-nav-btn.teaching-next-btn {
  background: linear-gradient(135deg, #2d5a87 0%, #2d5a87 45%, #1a3a5c 100%);
  color: #fff;
  border: none;
  flex: 1.5;
}
.teaching-nav-btn.teaching-next-btn:hover {
  opacity: 0.9;
  color: #fff;
}
.teaching-nav-btn.teaching-exit-btn {
  flex: 0.8;
  color: #dc2626;
  border-color: #fca5a5;
}
.teaching-nav-btn.teaching-exit-btn:hover {
  background: #fef2f2;
  color: #dc2626;
  border-color: #dc2626;
}

/* 完成页面 */
.teaching-finish {
  text-align: center;
  padding: 40px 20px;
}
.teaching-finish-icon {
  font-size: 56px;
  margin-bottom: 16px;
}
.teaching-finish-title {
  font-size: 22px;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 8px;
}
.teaching-finish-text {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 24px;
}
.teaching-finish-actions {
  display: flex;
  gap: 10px;
}

/* 高亮闪烁 */
.teaching-highlight {
  position: fixed;
  border: 3px solid #667eea;
  border-radius: 8px;
  pointer-events: none;
  z-index: 9998;
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.1), 0 0 20px rgba(102,126,234,0.5);
  animation: highlightPulse 1.5s ease-in-out infinite;
}
@keyframes highlightPulse {
  0%, 100% {
    border-color: #667eea;
    box-shadow: 0 0 0 9999px rgba(0,0,0,0.1), 0 0 20px rgba(102,126,234,0.5);
  }
  50% {
    border-color: #764ba2;
    box-shadow: 0 0 0 9999px rgba(0,0,0,0.15), 0 0 30px rgba(118,75,162,0.7);
  }
}

/* ========== 自定义工件编辑器 ========== */
.custom-section-title {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin: 14px 0 8px;
  padding-top: 10px;
  border-top: 1px solid #e5e7eb;
}
.custom-holes-list,
.custom-slots-list {
  margin-bottom: 8px;
}
.custom-item {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 8px;
}
.custom-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}
.custom-remove-btn {
  width: 22px;
  height: 22px;
  border: none;
  background: #fee2e2;
  color: #dc2626;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.custom-remove-btn:hover {
  background: #fecaca;
}
.custom-item-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}
.custom-item-row:last-child {
  margin-bottom: 0;
}
.custom-item-row label {
  font-size: 11px;
  color: #6b7280;
  min-width: 28px;
}
.custom-item-row input {
  width: 50px;
  padding: 4px 6px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 12px;
}
.custom-empty {
  font-size: 12px;
  color: #9ca3af;
  text-align: center;
  padding: 8px;
}
.custom-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
.custom-actions .btn {
  flex: 1;
  padding: 8px;
  font-size: 12px;
}
.custom-saved-list {
  display: none;
  margin-top: 10px;
  max-height: 200px;
  overflow-y: auto;
}
.custom-saved-list.show {
  display: block;
}
.custom-saved-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  margin-bottom: 6px;
}
.custom-saved-name {
  font-size: 13px;
  font-weight: 600;
  color: #1f2937;
}
.custom-saved-meta {
  font-size: 11px;
  color: #6b7280;
  margin-top: 2px;
}
.custom-saved-time {
  font-size: 10px;
  color: #9ca3af;
  margin-top: 2px;
}

/* 自定义缺陷管理 */
.custom-defects-list {
  margin-bottom: 8px;
}
.custom-defect-add {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}
.custom-defect-add select {
  flex: 1;
  padding: 4px 6px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 12px;
}
.custom-defect-input {
  width: 50px;
  padding: 2px 4px;
  border: 1px solid #d1d5db;
  border-radius: 3px;
  font-size: 11px;
}

/* ========== DAC曲线面板 ========== */
.dac-panel {
  background: #1a1a2e;
  border-bottom: 1px solid #2d2d44;
  border-left: 1px solid #2d2d44;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  width: 300px;
  flex-shrink: 0;
}
.dac-panel.open {
  max-height: 300px;
}
.dac-panel-header {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #63b3ed;
  background: #16162a;
}
.dac-panel-body {
  padding: 8px 12px;
}
.dac-holes-input {
  margin-bottom: 8px;
}
.dac-holes-input label {
  display: block;
  font-size: 11px;
  color: #a0aec0;
  margin-bottom: 4px;
}
.dac-holes-input input {
  width: 100%;
  padding: 4px 6px;
  background: #0f0f1a;
  border: 1px solid #2d3748;
  color: #e2e8f0;
  border-radius: 4px;
  font-size: 11px;
  box-sizing: border-box;
}
.dac-presets {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.dac-preset-label {
  font-size: 10px;
  color: #718096;
}
.dac-preset-btn {
  padding: 2px 6px;
  font-size: 10px;
  background: #2d3748;
  color: #a0aec0;
  border: 1px solid #4a5568;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.2s;
}
.dac-preset-btn:hover {
  background: #4a5568;
  color: #fff;
}
.dac-step {
  font-size: 11px;
  color: #e2e8f0;
  margin-bottom: 8px;
  padding: 6px 8px;
  background: #2d3748;
  border-radius: 4px;
  border-left: 3px solid #63b3ed;
}
.dac-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.dac-btn {
  padding: 4px 10px;
  font-size: 11px;
  border: 1px solid #4a5568;
  background: #2d3748;
  color: #e2e8f0;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}
.dac-btn:hover {
  background: #4a5568;
}
.dac-btn-primary {
  background: #3182ce;
  border-color: #63b3ed;
  color: #fff;
}
.dac-btn-primary:hover {
  background: #2c5282;
}
.dac-btn-danger {
  background: #c53030;
  border-color: #fc8181;
  color: #fff;
}
.dac-btn-danger:hover {
  background: #9b2c2c;
}
.dac-points-list {
  max-height: 80px;
  overflow-y: auto;
  margin-bottom: 6px;
}
.dac-point-item {
  font-size: 10px;
  color: #a0aec0;
  padding: 2px 0;
  border-bottom: 1px dashed #2d3748;
}
.dac-result {
  margin-top: 6px;
}
.dac-defect-result {
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}
.dac-reject {
  background: rgba(239, 68, 68, 0.2);
  color: #fc8181;
  border: 1px solid #fc8181;
}
.dac-quant {
  background: rgba(245, 158, 11, 0.2);
  color: #f6ad55;
  border: 1px solid #f6ad55;
}
.dac-assess {
  background: rgba(34, 197, 94, 0.2);
  color: #68d391;
  border: 1px solid #68d391;
}
.dac-pass {
  background: rgba(72, 187, 120, 0.15);
  color: #9ae6b4;
  border: 1px solid #68d391;
}

/* ========== 扫查覆盖工具栏 ========== */
.scan-coverage-toolbar {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  align-items: center;
  background: rgba(255, 255, 255, 0.95);
  padding: 6px 12px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  z-index: 10;
  font-size: 12px;
}
.scan-coverage-btn {
  padding: 4px 12px;
  font-size: 12px;
  border: 1px solid #cbd5e0;
  background: #fff;
  color: #2d3748;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}
.scan-coverage-btn:hover {
  background: #edf2f7;
}
.scan-coverage-btn.active {
  background: #3182ce;
  color: #fff;
  border-color: #3182ce;
}
.scan-coverage-btn.danger {
  color: #c53030;
  border-color: #fc8181;
}
.scan-coverage-percent {
  font-weight: 600;
  color: #3182ce;
  min-width: 50px;
  text-align: center;
}

/* ========== 工艺卡弹窗 ========== */
.process-card-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.process-card-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.process-card-form label {
  font-size: 12px;
  color: #4a5568;
  font-weight: 500;
}
.process-card-form input,
.process-card-form select {
  padding: 6px 8px;
  border: 1px solid #cbd5e0;
  border-radius: 4px;
  font-size: 13px;
}
.process-card-result {
  background: #f7fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  margin-top: 12px;
}
.process-card-result h4 {
  margin: 0 0 12px 0;
  color: #2d3748;
  font-size: 14px;
}
.process-card-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px dashed #e2e8f0;
  font-size: 13px;
}
.process-card-row .label {
  color: #718096;
}
.process-card-row .value {
  color: #2d3748;
  font-weight: 600;
}
.process-card-note {
  margin-top: 12px;
  padding: 8px 12px;
  background: #fffbeb;
  border-left: 3px solid #f59e0b;
  font-size: 11px;
  color: #92400e;
  border-radius: 0 4px 4px 0;
}
.custom-saved-actions {
  display: flex;
  gap: 4px;
}
.custom-saved-actions .btn {
  padding: 4px 8px;
  font-size: 11px;
}


/* ========== 参数知识提示 ========== */
.tip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #e0e7ff;
  color: #4f46e5;
  font-size: 11px;
  font-weight: 700;
  margin-left: 6px;
  cursor: pointer;
  transition: all 0.2s;
  vertical-align: middle;
  user-select: none;
  position: relative;
  z-index: 10;
  pointer-events: auto;
}
.tip-icon:hover {
  background: #4f46e5;
  color: #fff;
  transform: scale(1.15);
}
.param-tip-popup {
  position: fixed;
  z-index: 99999;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.18);
  border: 1px solid #e5e7eb;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.7;
  color: #374151;
  max-height: 400px;
  overflow-y: auto;
  animation: tipFadeIn 0.15s ease-out;
}
@keyframes tipFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.param-tip-title {
  font-weight: 700;
  font-size: 14px;
  color: #1f2937;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f3f4f6;
}
.param-tip-content {
  color: #4b5563;
}



/* ========== 配置管理弹窗 ========== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-box {
  background: #fff;
  border-radius: 14px;
  width: 90%;
  max-width: 560px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: modalFadeIn 0.2s ease-out;
}
@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  border-bottom: 1px solid #f0f0f0;
}
.modal-header h3 {
  margin: 0;
  font-size: 17px;
  color: #1f2937;
}
.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #9ca3af;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}
.modal-close:hover { color: #4b5563; }
.modal-body {
  padding: 20px 22px;
  overflow-y: auto;
  flex: 1;
}
.config-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.config-item {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px 16px;
  transition: all 0.2s;
}
.config-item:hover {
  border-color: #6366f1;
  background: #f8f7ff;
}
.config-item-name {
  font-weight: 600;
  font-size: 15px;
  color: #1f2937;
  margin-bottom: 4px;
}
.config-item-summary {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 4px;
}
.config-item-time {
  font-size: 11px;
  color: #9ca3af;
  margin-bottom: 10px;
}
.config-item-actions {
  display: flex;
  gap: 8px;
}
.config-empty {
  text-align: center;
  padding: 40px 20px;
  color: #9ca3af;
}
.config-empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}
.btn-sm {
  padding: 6px 14px;
  font-size: 13px;
}

/* ---------- 兑换码显示优化（防看错） ---------- */
.code-text {
  font-family: "Consolas", "Monaco", "Courier New", monospace;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 1.5px;
  background: #f0f4ff;
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid #d6e0ff;
  display: inline-block;
  color: #2d5a87;
  user-select: all;
}
.code-text .char-0 { color: #dc2626; font-weight: 700; }
.code-text .char-O { color: #059669; font-weight: 700; }
.code-text .char-1 { color: #2563eb; font-weight: 700; }
.code-text .char-I { color: #7c3aed; font-weight: 700; }
.code-text .char-l { color: #7c3aed; font-weight: 700; }
.code-text .char-5 { color: #d97706; font-weight: 700; }
.code-text .char-S { color: #0891b2; font-weight: 700; }
.code-text .char-2 { color: #9333ea; font-weight: 700; }
.code-text .char-Z { color: #db2777; font-weight: 700; }



/* ========== 永久卡动态火苗边框 ========== */
.price-card.popular::before {
  content: '';
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  border-radius: 12px;
  background: linear-gradient(45deg, #ff0000, #ff6b35, #f7931e, #ffcc00, #ff6b35, #ff0000, #ff6b35);
  background-size: 400% 400%;
  z-index: -1;
  animation: fireBorder 2s ease infinite;
  filter: blur(1px);
  opacity: 0.85;
}

.price-card.popular::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: 11px;
  background: linear-gradient(45deg, #ff4500, #ff6347, #ffa500, #ff4500);
  background-size: 300% 300%;
  z-index: -1;
  animation: fireBorder 1.5s ease infinite reverse;
  opacity: 0.6;
}

@keyframes fireBorder {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.price-card.popular {
  animation: fireGlow 1.5s ease-in-out infinite;
}

@keyframes fireGlow {
  0%, 100% { box-shadow: 0 0 8px rgba(255, 69, 0, 0.5), 0 0 16px rgba(255, 107, 53, 0.3); }
  50% { box-shadow: 0 0 16px rgba(255, 69, 0, 0.8), 0 0 32px rgba(255, 107, 53, 0.5); }
}
