/* 电磁零域 (EMC0.com) 独立全屏工具套件样式表 - 零外部依赖 */
:root {
  --navy: #0B1B3D;
  --navy-light: #152C5B;
  --navy-table: #07456F;
  --cyan: #00B8B0;
  --cyan-bright: #00D2C4;
  --cyan-soft: #E6FAF9;
  --blue-btn: #2B85FF;
  --blue-btn-hover: #1A73E8;
  --bg: #F3F6FA;
  --surface: #FFFFFF;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;
  --text: #1E293B;
  --text-muted: #64748B;
  --text-light: #94A3B8;
  --green-bg: #E6F4EA;
  --green-text: #137333;
  --green-border: #A8DAB5;
  --red-bg: #FCE8E6;
  --red-text: #C5221F;
  --red-border: #F6AEA9;
  --amber-bg: #FEF7E0;
  --amber-text: #B06000;
  --amber-border: #FDE293;
  --sidebar-collapsed: 68px;
  --sidebar-expanded: 242px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(11, 27, 61, 0.06), 0 1px 2px rgba(11, 27, 61, 0.04);
  --shadow-md: 0 8px 24px rgba(11, 27, 61, 0.08);
  --shadow-lg: 0 20px 50px rgba(11, 27, 61, 0.22);
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button, input, select { font-family: inherit; }

/* ========== 自动收纳侧边栏 ========== */
.emc0-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-collapsed);
  background: var(--navy);
  color: #E2E8F0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: width 0.22s cubic-bezier(0.25, 0.8, 0.25, 1), box-shadow 0.22s ease;
  overflow: hidden;
  user-select: none;
}

@media (min-width: 900px) {
  .emc0-sidebar:hover,
  body.sidebar-pinned .emc0-sidebar {
    width: var(--sidebar-expanded);
    box-shadow: 6px 0 28px rgba(11, 27, 61, 0.22);
  }
  .emc0-sidebar:hover .sb-label,
  body.sidebar-pinned .emc0-sidebar .sb-label,
  .emc0-sidebar:hover .sb-section-title,
  body.sidebar-pinned .emc0-sidebar .sb-section-title,
  .emc0-sidebar:hover .sb-pin-btn,
  body.sidebar-pinned .emc0-sidebar .sb-pin-btn {
    opacity: 1;
    pointer-events: auto;
  }
}

.sb-brand {
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 14px;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}
.sb-brand-link {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  flex: 1;
}
.sb-logo-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}
.sb-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  white-space: nowrap;
}
.sb-brand-en {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #FFFFFF;
}
.sb-brand-en span { color: var(--cyan-bright); }
.sb-brand-cn {
  font-size: 11px;
  color: #94A3B8;
  letter-spacing: 1.5px;
  margin-top: 2px;
}

.sb-label {
  opacity: 0;
  transition: opacity 0.16s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sb-pin-btn {
  opacity: 0;
  pointer-events: none;
  background: rgba(255,255,255,0.08);
  border: none;
  color: #CBD5E1;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, opacity 0.16s;
}
.sb-pin-btn:hover { background: rgba(255,255,255,0.16); color: #FFF; }
body.sidebar-pinned .sb-pin-btn { background: var(--cyan); color: var(--navy); }

.sb-nav {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 10px;
}
.sb-nav::-webkit-scrollbar { width: 4px; }
.sb-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }

.sb-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #64748B;
  padding: 10px 10px 6px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.16s ease;
}

.sb-item {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 42px;
  padding: 0 12px;
  border-radius: 9px;
  color: #CBD5E1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  margin-bottom: 4px;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  font-size: 13.5px;
  font-weight: 500;
}
.sb-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
}
.sb-item.active {
  background: linear-gradient(90deg, rgba(0, 210, 196, 0.22), rgba(0, 210, 196, 0.08));
  color: var(--cyan-bright);
  box-shadow: inset 3px 0 0 var(--cyan-bright);
}
.sb-item svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.sb-sub-item {
  height: 36px;
  font-size: 13px;
  color: #94A3B8;
}
.sb-sub-item.active {
  background: rgba(255,255,255,0.1);
  color: #FFFFFF;
  box-shadow: none;
}

.sb-footer {
  padding: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}
.sb-user-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: background 0.15s;
  margin-bottom: 6px;
}
.sb-user-box:hover { background: rgba(255, 255, 255, 0.12); }
.sb-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--cyan);
  color: var(--navy);
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sb-user-meta {
  min-width: 0;
  flex: 1;
}
.sb-user-name {
  font-size: 13px;
  font-weight: 600;
  color: #FFF;
  line-height: 1.2;
}
.sb-user-sub {
  font-size: 11px;
  color: var(--cyan-bright);
  line-height: 1.2;
  margin-top: 2px;
}

/* ========== 移动端顶栏与抽屉 ========== */
.emc0-mobile-bar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 900;
  height: 54px;
  background: var(--navy);
  color: #FFF;
  padding: 0 14px;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}
.mobile-menu-btn {
  background: rgba(255,255,255,0.1);
  border: none;
  color: #FFF;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.mobile-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
}
.mobile-auth-btn {
  background: var(--cyan);
  color: var(--navy);
  border: none;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.emc0-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(11, 27, 61, 0.55);
  z-index: 950;
}

@media (max-width: 899px) {
  .emc0-mobile-bar { display: flex; }
  .emc0-sidebar {
    width: var(--sidebar-expanded);
    transform: translateX(-100%);
    transition: transform 0.24s ease;
  }
  .emc0-sidebar .sb-label,
  .emc0-sidebar .sb-section-title { opacity: 1; }
  .emc0-sidebar .sb-pin-btn { display: none; }
  body.mobile-drawer-open .emc0-sidebar { transform: translateX(0); }
  body.mobile-drawer-open .emc0-backdrop { display: block; }
}

/* ========== 主工作区 ========== */
.emc0-main {
  margin-left: var(--sidebar-collapsed);
  min-height: 100vh;
  transition: margin-left 0.22s cubic-bezier(0.25, 0.8, 0.25, 1);
  display: flex;
  flex-direction: column;
}
@media (min-width: 900px) {
  body.sidebar-pinned .emc0-main {
    margin-left: var(--sidebar-expanded);
  }
}
@media (max-width: 899px) {
  .emc0-main { margin-left: 0; }
}

.emc0-topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.topbar-title-group h1 {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--cyan-soft);
  color: #007A74;
}
.topbar-sub {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: var(--text-muted);
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.emc0-container {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 22px 28px 44px;
  flex: 1;
}
@media (max-width: 899px) {
  .emc0-topbar { padding: 12px 16px; }
  .emc0-container { padding: 16px 14px 36px; }
}

/* ========== 通用组件 ========== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  margin-bottom: 18px;
}
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.card-title {
  margin: 0;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  display: inline-block;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn:hover { background: #F8FAFC; border-color: #94A3B8; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary {
  background: var(--navy);
  border-color: var(--navy);
  color: #FFF;
}
.btn-primary:hover { background: var(--navy-light); border-color: var(--navy-light); }
.btn-accent {
  background: var(--cyan);
  border-color: var(--cyan);
  color: var(--navy);
}
.btn-accent:hover { background: var(--cyan-bright); border-color: var(--cyan-bright); }
.btn-blue {
  background: var(--blue-btn);
  border-color: var(--blue-btn);
  color: #FFF;
}
.btn-blue:hover { background: var(--blue-btn-hover); border-color: var(--blue-btn-hover); }
.btn-danger-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--red-text);
  padding: 5px 8px;
}
.btn-danger-ghost:hover { background: var(--red-bg); border-color: var(--red-border); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 960px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.field { display: flex; flex-direction: column; gap: 5px; }
.field label {
  font-size: 12.5px;
  font-weight: 600;
  color: #475569;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.field label .hint { font-weight: 400; color: var(--text-light); font-size: 11.5px; }

.input-group {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #FFF;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input-group:focus-within {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0, 184, 176, 0.15);
}
.input-group input,
.input-group select {
  border: none;
  outline: none;
  padding: 8px 10px;
  font-size: 14px;
  color: var(--text);
  background: transparent;
}
.input-group input {
  flex: 1;
  min-width: 0;
  font-family: var(--font-mono);
}
.input-group select {
  border-left: 1px solid var(--border);
  background: #F8FAFC;
  color: var(--navy);
  font-weight: 600;
  cursor: pointer;
  padding: 0 8px;
}
.input-addon {
  display: flex;
  align-items: center;
  padding: 0 10px;
  background: #F8FAFC;
  border-left: 1px solid var(--border);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.plain-input, .plain-select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--text);
  background: #FFF;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.plain-input:focus, .plain-select:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(0, 184, 176, 0.15);
}

/* ========== Tabs / 分段控件 ========== */
.seg-tabs {
  display: inline-flex;
  background: #E9EEF5;
  padding: 4px;
  border-radius: 10px;
  gap: 4px;
  flex-wrap: wrap;
}
.seg-tab {
  border: none;
  background: transparent;
  color: #475569;
  padding: 7px 16px;
  border-radius: 7px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.seg-tab.active {
  background: #FFF;
  color: var(--navy);
  box-shadow: 0 2px 6px rgba(11, 27, 61, 0.08);
}

.std-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
@media (max-width: 640px) { .std-cards { grid-template-columns: 1fr; } }
.std-card {
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  cursor: pointer;
  background: #FFF;
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.std-card:hover { border-color: #94A3B8; }
.std-card.active {
  border-color: var(--navy);
  background: linear-gradient(135deg, #F4F9FF 0%, #ECFEFC 100%);
  box-shadow: 0 4px 12px rgba(11, 27, 61, 0.08);
}
.std-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  font-size: 15px;
  color: var(--navy);
}
.std-pill {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  background: #E2E8F0;
  color: #475569;
}
.std-card.active .std-pill { background: var(--navy); color: #FFF; }
.std-card-desc { font-size: 12px; color: var(--text-muted); }

/* ========== 同步状态条 ========== */
.sync-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-radius: 10px;
  margin-bottom: 16px;
  font-size: 13px;
  flex-wrap: wrap;
}
.sync-banner.guest {
  background: #EEF6FF;
  border: 1px solid #BFDBFE;
  color: #1E3A8A;
}
.sync-banner.cloud {
  background: var(--green-bg);
  border: 1px solid var(--green-border);
  color: var(--green-text);
}
.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}
.sync-banner.guest .sync-dot { background: #3B82F6; }
.sync-banner.cloud .sync-dot { background: #16A34A; }

/* ========== RE103 表格与覆盖诊断 ========== */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
}
.re103-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
  background: #FFF;
}
.re103-table th {
  background: var(--navy-table);
  color: #FFFFFF;
  font-weight: 600;
  font-size: 13px;
  padding: 11px 12px;
  text-align: center;
  border-right: 1px solid rgba(255,255,255,0.14);
}
.re103-table th:last-child { border-right: none; }
.re103-table td {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  border-right: 1px solid var(--border);
  text-align: center;
  font-size: 13.5px;
  color: var(--text);
}
.re103-table td:last-child { border-right: none; }
.re103-table tbody tr:hover td { background: #F8FAFC; }
.re103-table td.col-name { text-align: left; font-weight: 600; color: var(--navy); }
.re103-table td.col-mono { font-family: var(--font-mono); font-size: 13px; }
.re103-table td.col-result {
  background: #E2F1DE !important;
  color: #137333;
  font-weight: 800;
  font-family: var(--font-mono);
  font-size: 15px;
}

.lib-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}
.lib-table th {
  background: #F1F5F9;
  color: var(--navy);
  font-size: 12.5px;
  font-weight: 700;
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid var(--border-strong);
}
.lib-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.ant-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 10px;
}
.ant-pick-card {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  background: #FFF;
  transition: all 0.15s;
}
.ant-pick-card:hover { border-color: #94A3B8; }
.ant-pick-card.selected {
  border-color: var(--cyan);
  background: #F2FDFC;
}
.ant-pick-card input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--navy);
  cursor: pointer;
}
.ant-pick-info { min-width: 0; flex: 1; }
.ant-pick-name { font-weight: 700; font-size: 13.5px; color: var(--navy); }
.ant-pick-meta { font-size: 12px; color: var(--text-muted); font-family: var(--font-mono); margin-top: 2px; }
.ant-pick-tag {
  display: inline-block;
  margin-top: 4px;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  background: #F1F5F9;
  color: #475569;
}
.ant-pick-tag.out { background: var(--amber-bg); color: var(--amber-text); }

/* 覆盖诊断条 */
.cov-box {
  border-radius: 10px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  background: #F8FAFC;
  margin-top: 14px;
}
.cov-box.ok { background: var(--green-bg); border-color: var(--green-border); }
.cov-box.warn { background: var(--red-bg); border-color: var(--red-border); }
.cov-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-weight: 700;
  font-size: 14px;
}
.cov-box.ok .cov-head { color: var(--green-text); }
.cov-box.warn .cov-head { color: var(--red-text); }
.cov-bar-track {
  position: relative;
  height: 14px;
  border-radius: 7px;
  background: #E2E8F0;
  overflow: hidden;
  margin: 10px 0 6px;
}
.cov-bar-seg {
  position: absolute;
  top: 0;
  bottom: 0;
}
.cov-bar-seg.covered { background: #16A34A; }
.cov-bar-seg.gap { background: #DC2626; }
.cov-axis {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}
.cov-details {
  margin-top: 8px;
  font-size: 12.5px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chip-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.chip {
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  background: #FFF;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s;
}
.chip:hover { border-color: var(--navy); color: var(--navy); background: #F1F5F9; }

/* ========== 统计结果卡片 (Tools) ========== */
.stat-box {
  background: #F8FAFC;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
}
.stat-label { font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.stat-value {
  font-size: 22px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--navy);
}
.stat-value.accent { color: #008B84; }
.stat-value.ok { color: var(--green-text); }
.stat-value.bad { color: var(--red-text); }
.stat-sub { font-size: 12px; color: var(--text-muted); margin-top: 3px; }

.tool-panel { display: none; }
.tool-panel.active { display: block; animation: fadeIn 0.18s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

.rbw-table { width: 100%; border-collapse: collapse; }
.rbw-table th, .rbw-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 13px;
}
.rbw-table th { background: #F1F5F9; color: var(--navy); font-weight: 700; }
.rbw-table tr.hit td { background: var(--cyan-soft); font-weight: 700; color: var(--navy); }

/* ========== 登录/注册弹窗 (呼应站点白底蓝按钮风格) ========== */
.emc0-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.emc0-modal-overlay.open { display: flex; }
.emc0-modal {
  background: #FFFFFF;
  width: 100%;
  max-width: 410px;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 28px 28px 24px;
  position: relative;
  animation: modalIn 0.2s ease;
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #94A3B8;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover { background: #F1F5F9; color: var(--text); }
.modal-title {
  text-align: center;
  margin: 4px 0 6px;
  font-size: 21px;
  font-weight: 700;
  color: #1E293B;
}
.modal-sub {
  text-align: center;
  margin: 0 0 22px;
  font-size: 13px;
  color: #94A3B8;
}
.auth-field { margin-bottom: 14px; }
.auth-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}
.auth-input-wrap {
  display: flex;
  align-items: center;
  border: 1px solid #CBD5E1;
  border-radius: 8px;
  padding: 0 10px;
  background: #FFF;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-input-wrap:focus-within {
  border-color: var(--blue-btn);
  box-shadow: 0 0 0 3px rgba(43, 133, 255, 0.16);
}
.auth-input-wrap input {
  border: none;
  outline: none;
  flex: 1;
  height: 40px;
  font-size: 14px;
  background: transparent;
  min-width: 0;
}
.auth-code-row { display: flex; gap: 8px; }
.auth-code-row .auth-input-wrap { flex: 1; }
.auth-code-btn {
  padding: 0 14px;
  height: 42px;
  border-radius: 8px;
  border: 1px solid var(--blue-btn);
  background: #EFF6FF;
  color: var(--blue-btn);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.auth-code-btn:hover:not(:disabled) { background: #DBEAFE; }
.auth-code-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.auth-row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: #64748B;
  margin-bottom: 18px;
}
.auth-submit {
  width: 100%;
  height: 42px;
  border: none;
  border-radius: 8px;
  background: var(--blue-btn);
  color: #FFF;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.auth-submit:hover:not(:disabled) { background: var(--blue-btn-hover); }
.auth-submit:disabled { opacity: 0.65; cursor: not-allowed; }
.auth-switch {
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
  color: #64748B;
}
.auth-switch a { color: var(--blue-btn); font-weight: 600; cursor: pointer; }
.auth-msg {
  font-size: 12.5px;
  padding: 8px 12px;
  border-radius: 8px;
  margin-bottom: 14px;
  display: none;
}
.auth-msg.error { display: block; background: var(--red-bg); color: var(--red-text); border: 1px solid var(--red-border); }
.auth-msg.success { display: block; background: var(--green-bg); color: var(--green-text); border: 1px solid var(--green-border); }

/* ========== Toast 轻提示 ========== */
.emc0-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  background: var(--navy);
  color: #FFF;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  z-index: 3000;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: all 0.22s ease;
}
.emc0-toast.show { opacity: 1; transform: translateY(0); }

.emc0-footer-note {
  text-align: center;
  font-size: 12px;
  color: var(--text-light);
  padding: 14px 20px 24px;
}


/* ========== RE103 分步向导 (Stepper & Pagination) ========== */
.re103-stepper-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 14px 18px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.re103-stepper {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 280px;
  gap: 8px;
}
.stepper-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1.5px solid transparent;
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: all 0.16s ease;
  flex: 1;
  min-width: 0;
}
.stepper-step:hover {
  background: #F8FAFC;
  border-color: var(--border);
}
.stepper-step.active {
  background: linear-gradient(135deg, #F0F9FF 0%, #ECFEFC 100%);
  border-color: var(--cyan);
}
.stepper-num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #E2E8F0;
  color: #475569;
  font-weight: 800;
  font-size: 13.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.16s ease;
}
.stepper-step.active .stepper-num {
  background: var(--navy);
  color: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(0, 184, 176, 0.22);
}
.stepper-step.done .stepper-num {
  background: #16A34A;
  color: #FFFFFF;
}
.stepper-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.stepper-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #475569;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stepper-step.active .stepper-title { color: var(--navy); }
.stepper-step.done .stepper-title { color: #166534; }
.stepper-desc {
  font-size: 11.5px;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stepper-line {
  width: 24px;
  height: 2px;
  background: var(--border-strong);
  flex-shrink: 0;
  border-radius: 2px;
}
.stepper-line.done { background: #16A34A; }

.wizard-step-pane {
  display: none;
}
.wizard-step-pane.active {
  display: block;
  animation: fadeIn 0.2s ease;
}
#re103CalcView.show-all-steps .wizard-step-pane {
  display: block;
}
#re103CalcView.show-all-steps .wizard-footer,
#re103CalcView.show-all-steps .step-context-bar {
  display: none !important;
}

.step-context-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: #F8FAFC;
  border: 1px solid var(--border);
  border-left: 4px solid var(--cyan);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 12.5px;
  color: #334155;
}
.step-context-items {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.ctx-item strong {
  color: var(--navy);
  font-family: var(--font-mono);
}
.step-context-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.wizard-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--border-strong);
  flex-wrap: wrap;
}
.wizard-footer-hint {
  font-size: 12.5px;
  color: var(--text-muted);
}
.wizard-footer-btns {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}
.btn-next {
  padding: 10px 22px;
  font-size: 14px;
  background: var(--navy);
  border-color: var(--navy);
  color: #FFFFFF;
}
.btn-next:hover {
  background: var(--navy-light);
  border-color: var(--navy-light);
}

@media (max-width: 760px) {
  .re103-stepper-bar { padding: 10px 12px; }
  .stepper-step { padding: 6px 8px; gap: 7px; }
  .stepper-desc { display: none; }
  .stepper-line { width: 12px; }
  .stepper-title { font-size: 12.5px; }
  .wizard-footer { flex-direction: column; align-items: stretch; }
  .wizard-footer-btns { margin-left: 0; width: 100%; justify-content: space-between; }
  .wizard-footer-btns .btn { flex: 1; }
}


/* ========== v1.3.0 移动端全面适配与表2/表3样式优化 ========== */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}
.emc0-main {
  min-width: 0;
  overflow-x: hidden;
}
.card-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.quick-tabs-scroll {
  margin-bottom: 18px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}
.em-std-table th,
.em-std-table td {
  border-right: 1px solid var(--border);
}
.em-std-table th:last-child,
.em-std-table td:last-child {
  border-right: none;
}
.table-footnote {
  margin: 10px 2px 0;
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.65;
}
.cov-axis-legend {
  color: var(--text-light);
}

@media (max-width: 899px) {
  .desktop-only-auth { display: none !important; }
  .emc0-topbar { padding: 12px 14px; gap: 10px; }
  .topbar-title-group h1 { font-size: 16.5px; flex-wrap: wrap; gap: 6px; }
  .topbar-sub { font-size: 12px; }
  .topbar-actions { width: 100%; justify-content: space-between; }
  #toolsQuickTabs { flex-wrap: nowrap; white-space: nowrap; }
  .card { padding: 14px; margin-bottom: 14px; }
  .card-title { font-size: 14.5px; flex-wrap: wrap; }
  .sync-banner { padding: 10px 12px; font-size: 12.5px; }
}

@media (max-width: 760px) {
  /* 修复步骤条在手机端被挤成 "1 标..." 的问题：改为圆圈在上、完整短标题在下的三列排版 */
  .re103-stepper-bar {
    padding: 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .re103-stepper {
    min-width: 0;
    width: 100%;
    gap: 4px;
    align-items: flex-start;
  }
  .stepper-step {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 8px 4px;
    gap: 6px;
    flex: 1;
    min-width: 0;
  }
  .stepper-text {
    width: 100%;
    align-items: center;
  }
  .stepper-title {
    font-size: 12px;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.25;
  }
  .stepper-desc { display: none; }
  .stepper-line {
    width: 14px;
    margin-top: 22px;
    flex-shrink: 0;
  }
  .stepper-toggle-btn {
    align-self: flex-end;
  }

  /* 修复底部"上一步 / 下一步"按钮在手机端超出右边界的问题：改为全宽上下堆叠 */
  .wizard-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-top: 14px;
    padding-top: 14px;
  }
  .wizard-footer-btns {
    margin-left: 0;
    width: 100%;
    display: flex;
    flex-direction: column-reverse;
    gap: 8px;
  }
  .wizard-footer-btns .btn,
  .wizard-footer-btns .btn-next {
    width: 100%;
    max-width: 100%;
    white-space: normal;
    text-align: center;
    padding: 11px 14px;
    font-size: 14px;
  }

  /* 修复覆盖诊断条下方坐标轴与提示语挤成三列错行的问题 */
  .cov-axis {
    flex-wrap: wrap;
    gap: 4px;
  }
  .cov-axis-edge { font-weight: 600; }
  .cov-axis-legend {
    order: 3;
    width: 100%;
    text-align: center;
    font-size: 11px;
    margin-top: 2px;
  }

  .card-toolbar { width: 100%; }
  .card-toolbar .btn { padding: 6px 10px; font-size: 12px; }
  .ant-picker-grid { grid-template-columns: 1fr; }
  .step-context-bar { padding: 10px 12px; }
  .step-context-items { gap: 8px 12px; }
  .emc0-toast { left: 16px; right: 16px; bottom: 16px; text-align: center; }
  .custom-tool-iframe { height: 560px !important; }
}
