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

:root {
  --primary: #2563eb;
  --primary-light: #dbeafe;
  --primary-dark: #1d4ed8;
  --accent: #5b8def;
  --bg: #eef4ff;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-solid: #ffffff;
  --border: rgba(37, 99, 235, 0.08);
  --border-strong: rgba(37, 99, 235, 0.14);
  --text: #0f1e3a;
  --text-secondary: #5a6b85;
  --text-muted: #94a3b8;
  --success: #16a34a;
  --warning: #d97706;
  --danger: #dc2626;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow: 0 1px 3px rgba(15, 30, 58, 0.04), 0 1px 2px rgba(15, 30, 58, 0.03);
  --shadow-md: 0 6px 18px rgba(15, 30, 58, 0.06), 0 2px 6px rgba(15, 30, 58, 0.03);
  --shadow-lg: 0 18px 40px rgba(15, 30, 58, 0.10), 0 8px 18px rgba(15, 30, 58, 0.05);
  --blur: saturate(180%) blur(18px);
}

body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(91, 141, 239, 0.28), transparent 60%),
    radial-gradient(ellipse 60% 50% at 90% 100%, rgba(124, 58, 237, 0.18), transparent 55%),
    radial-gradient(ellipse 70% 60% at 5% 90%, rgba(37, 99, 235, 0.16), transparent 60%),
    linear-gradient(180deg, #f6f9ff 0%, #eef4ff 100%);
  background-attachment: fixed;
  color: var(--text);
  font-size: 14px;
  height: 100vh;
  overflow: hidden;
  letter-spacing: 0.1px;
}

#app { height: 100vh; display: flex; flex-direction: column; }

/* ===== 顶部栏 ===== */
.topbar {
  height: 64px;
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  flex-shrink: 0;
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.logo-icon { font-size: 26px; }
.logo-text {
  font-size: 18px; font-weight: 700; color: var(--text);
  background: linear-gradient(135deg, #1d4ed8 0%, #5b8def 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.topbar-right { display: flex; gap: 12px; align-items: center; }
.search-box { display: flex; gap: 6px; }
.search-box input {
  padding: 8px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  font-size: 13px;
  width: 220px;
  outline: none;
  background: rgba(255, 255, 255, 0.7);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  transition: all 0.15s;
}
.search-box input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); width: 260px; background: #fff; }
.search-box button {
  padding: 8px 18px;
  border: none;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: white;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}
.search-box button:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35); }

/* ===== 布局 ===== */
.main-layout { display: flex; flex: 1; overflow: hidden; gap: 16px; padding: 16px 20px 20px; }

/* ===== 侧边栏 ===== */
.sidebar {
  width: 260px;
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  flex-shrink: 0;
  box-shadow: var(--shadow-md);
}
.module-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}
.module-card:hover { background: rgba(91, 141, 239, 0.08); transform: translateX(2px); }
.module-card.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.10) 0%, rgba(91, 141, 239, 0.08) 100%);
  border-color: rgba(37, 99, 235, 0.25);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.10);
}
.module-icon { font-size: 24px; flex-shrink: 0; }
.module-title { font-weight: 600; font-size: 14px; }
.module-desc { font-size: 11px; color: var(--text-secondary); margin-top: 2px; line-height: 1.4; }

.sidebar-stats {
  margin-top: auto;
  padding: 16px 14px;
  border-top: 1px solid var(--border);
}
.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 12px;
}
.stat-label { color: var(--text-secondary); }
.stat-value { font-weight: 600; color: var(--primary); }

/* ===== 备案信息 ===== */
.sidebar-icp {
  padding: 10px 14px 14px;
  text-align: center;
  font-size: 11px;
}
.sidebar-icp a {
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.3px;
  transition: color 0.15s;
}
.sidebar-icp a:hover {
  color: var(--primary);
  text-decoration: underline;
}

/* ===== 主内容区 ===== */
.content {
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px;
  background: rgba(255, 255, 255, 0.55);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

/* ===== 面包屑 ===== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 18px;
  font-size: 13px;
  flex-wrap: wrap;
}
.breadcrumb-item {
  cursor: pointer;
  color: var(--primary);
  padding: 4px 10px;
  border-radius: 6px;
  transition: all 0.15s;
}
.breadcrumb-item:hover { background: var(--primary-light); }
.breadcrumb-sep { color: var(--text-muted); }
.breadcrumb-current { color: var(--text); font-weight: 500; padding: 4px 10px; }

/* ===== 文件/文件夹网格 ===== */
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.file-card {
  background: rgba(255, 255, 255, 0.85);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  box-shadow: var(--shadow);
}
.file-card:hover {
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  background: #fff;
}
.file-icon { font-size: 36px; flex-shrink: 0; }
.file-info { min-width: 0; flex: 1; }
.file-name {
  font-weight: 500;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-meta { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ===== 文件列表表格 ===== */
.file-table {
  width: 100%;
  background: rgba(255, 255, 255, 0.85);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.file-table th {
  background: rgba(248, 250, 252, 0.6);
  padding: 12px 18px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.3px;
}
.file-table td {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.file-table tr { cursor: pointer; transition: background 0.15s; }
.file-table tr:hover { background: rgba(91, 141, 239, 0.06); }
.file-table tr:last-child td { border-bottom: none; }

/* ===== 视图切换（列表/网格） ===== */
.view-btn {
  border: none;
  background: transparent;
  padding: 6px 14px;
  font-size: 13px;
  color: var(--text-secondary);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.view-btn:hover { background: var(--primary-light); color: var(--primary); }
.view-btn.active { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25); }
.view-btn.active:hover { background: var(--primary-dark); color: #fff; }

/* ===== 工具卡片 ===== */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}
.tool-card {
  background: rgba(255, 255, 255, 0.85);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  cursor: pointer;
  transition: all 0.25s;
  box-shadow: var(--shadow);
}
.tool-card:hover {
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}
.tool-card-icon { font-size: 44px; margin-bottom: 14px; }
.tool-card-title { font-size: 17px; font-weight: 600; margin-bottom: 8px; }
.tool-card-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }

/* ===== 表单 ===== */
.form-section {
  background: rgba(255, 255, 255, 0.85);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.form-section-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text);
}
.form-group label .required { color: var(--danger); }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  font-size: 13px;
  outline: none;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.85);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  transition: all 0.15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
  background: #fff;
}
.form-textarea { resize: vertical; min-height: 88px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; }

/* ===== 按钮 ===== */
.btn {
  padding: 9px 22px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35); }
.btn-secondary { background: rgba(255, 255, 255, 0.8); color: var(--text); border: 1px solid var(--border-strong); }
.btn-secondary:hover { background: #fff; border-color: var(--primary); color: var(--primary); }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-lg { padding: 12px 36px; font-size: 14px; }
.btn-sm { padding: 5px 14px; font-size: 12px; }
.btn-group { display: flex; gap: 10px; }

/* ===== 页面标题 ===== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.page-title {
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, #1d4ed8 0%, #5b8def 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  letter-spacing: -0.3px;
}
.page-subtitle { font-size: 13px; color: var(--text-secondary); margin-top: 6px; letter-spacing: 0.2px; }

/* ===== 空状态 ===== */
.empty-state {
  text-align: center;
  padding: 72px 20px;
  color: var(--text-muted);
}
.empty-state-icon { font-size: 56px; margin-bottom: 18px; opacity: 0.5; }
.empty-state-text { font-size: 14px; }

/* ===== 文件类型图标颜色 ===== */
.icon-pdf { color: #dc2626; }
.icon-word { color: #2563eb; }
.icon-excel { color: #16a34a; }
.icon-ppt { color: #d97706; }
.icon-image { color: #7c3aed; }
.icon-dwg { color: #dc2626; }
.icon-folder { color: #d97706; }

/* ===== 模态弹窗 ===== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 30, 58, 0.4);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}
.modal-overlay.show { display: flex; }
.modal-content {
  background: rgba(255, 255, 255, 0.96);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 1400px;
  height: 90vh;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.modal-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  font-weight: 600;
  font-size: 16px;
  gap: 8px;
  background: rgba(255, 255, 255, 0.5);
}
.modal-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.modal-header-btn {
  border: none;
  background: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 4px 12px;
  border-radius: 8px;
  line-height: 1;
  transition: all 0.15s;
}
.modal-header-btn:hover { background: rgba(91, 141, 239, 0.12); color: var(--primary); }
.modal-close {
  border: none;
  background: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: 8px;
  transition: all 0.15s;
}
.modal-close:hover { background: rgba(220, 38, 38, 0.10); color: var(--danger); }
.modal-body {
  flex: 1;
  overflow: auto;
  padding: 0;
  min-height: 0;
}
.modal-body > iframe,
.modal-body > img {
  display: block;
  width: 100%;
  height: 100%;
  border: none;
}
.modal-body > img {
  object-fit: contain;
  max-height: 100%;
  background: #1e293b;
}

/* 沉浸式全屏（点击右上角 ⛶ 按钮触发） */
.modal-overlay.fullscreen { padding: 0; }
.modal-overlay.fullscreen .modal-content {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  border-radius: 0;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: rgba(15, 30, 58, 0.92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: white;
  padding: 14px 22px;
  border-radius: 999px;
  font-size: 13px;
  z-index: 2000;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.25s;
  pointer-events: none;
  box-shadow: 0 10px 30px rgba(15, 30, 58, 0.25);
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ===== 上传进度弹窗 ===== */
.upload-modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 30, 58, 0.4);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  z-index: 1100;
  justify-content: center;
  align-items: center;
}
.upload-modal-overlay.show { display: flex; }
.upload-modal-content {
  background: rgba(255, 255, 255, 0.96);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.upload-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 15px;
}
.upload-modal-body {
  flex: 1;
  overflow: auto;
  padding: 20px;
}
.upload-target-info {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  padding: 8px 12px;
  background: var(--bg);
  border-radius: 6px;
}
.upload-progress-section {
  margin-bottom: 16px;
}
.upload-progress-bar-container {
  width: 100%;
  height: 24px;
  background: var(--bg);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.upload-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-dark));
  border-radius: 12px;
  transition: width 0.2s ease;
  position: relative;
}
.upload-progress-bar::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: upload-shimmer 1.5s infinite;
}
@keyframes upload-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.upload-progress-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}
.upload-file-list {
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 12px;
}
.upload-file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.upload-file-item:last-child { border-bottom: none; }
.upload-file-icon { font-size: 18px; flex-shrink: 0; }
.upload-file-info { flex: 1; min-width: 0; }
.upload-file-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}
.upload-file-size {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.upload-file-status {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}
.upload-file-status.uploading { color: var(--primary); }
.upload-file-status.done { color: var(--success); }
.upload-file-status.failed { color: var(--danger); }
.upload-status-msg {
  padding: 10px 14px;
  background: var(--bg);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
}

/* ===== Tab 切换 ===== */
.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 24px;
  background: rgba(255, 255, 255, 0.5);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  width: fit-content;
}
.tab {
  padding: 9px 22px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: 999px;
  transition: all 0.2s;
}
.tab:hover { color: var(--text); }
.tab.active {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

/* ===== 计算结果卡片 ===== */
.result-card {
  background: rgba(240, 253, 244, 0.7);
  border: 1px solid rgba(187, 247, 208, 0.6);
  border-radius: var(--radius);
  padding: 22px;
  margin-top: 16px;
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}
.result-card.warn {
  background: rgba(254, 252, 232, 0.7);
  border-color: rgba(254, 240, 138, 0.6);
}
.result-card.fail {
  background: rgba(254, 242, 242, 0.7);
  border-color: rgba(254, 202, 202, 0.6);
}
.result-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.result-row {
  display: flex;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px dashed rgba(15, 30, 58, 0.08);
}
.result-row:last-child { border-bottom: none; }
.result-label { color: var(--text-secondary); }
.result-value { font-weight: 600; font-family: "Consolas", monospace; }

/* ===== 支吊架验算结果 - 居中布局 + 行高亮 ===== */
.hc-result-wrapper {
  max-width: 860px;
  margin: 16px auto 0;
}
.hc-result-wrapper .result-card {
  padding: 18px 22px;
}
.hc-result-wrapper .result-row {
  cursor: pointer;
  transition: background 0.12s, padding 0.12s;
  padding: 7px 10px;
  border-radius: 6px;
  margin: 0 -10px;
  border-bottom: 1px dashed rgba(15, 30, 58, 0.08);
}
.hc-result-wrapper .result-row:hover {
  background: rgba(91, 141, 239, 0.06);
}
.hc-result-wrapper .result-row.selected {
  background: rgba(91, 141, 239, 0.12);
  border-left: 3px solid var(--accent);
  padding-left: 7px;
}

/* ===== 支吊架验算 - 左右布局 ===== */
/* 左侧参数输入面板 + 右侧验算结果面板 */
.hc-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: 16px;
  align-items: start;
  margin-top: 12px;
}
.hc-input-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.hc-input-panel > .form-section {
  margin: 0;
}
.hc-result-panel {
  min-width: 0;
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  padding-right: 4px;
}
/* 结果区为空时隐藏（避免空 div 占位） */
.hc-result-panel:empty {
  display: none;
}
/* 左侧面板为空、或结果区为空时，让另一侧占满 */
.hc-layout:has(.hc-result-panel:empty) {
  grid-template-columns: 1fr;
}
/* 结果区在左右布局下不再限制 860px 居中 */
.hc-layout .hc-result-wrapper {
  max-width: none;
  margin: 0;
}
/* 响应式：窄屏回到上下结构 */
@media (max-width: 1100px) {
  .hc-layout {
    grid-template-columns: 1fr;
  }
  .hc-result-panel {
    position: static;
    max-height: none;
    overflow-y: visible;
  }
}

.hc-load-explain {
  background: rgba(248, 250, 252, 0.7);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin: 8px 0;
  font-size: 12px;
  line-height: 1.8;
  color: var(--text-secondary);
}
.hc-load-explain b { color: #1e40af; }
.hc-load-explain .formula {
  font-family: "Consolas", monospace;
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  color: #be123c;
}

/* ===== 工具栏 ===== */
.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
  align-items: center;
  flex-wrap: wrap;
}

/* ===== 上传区域 ===== */
.upload-zone {
  border: 2px dashed rgba(37, 99, 235, 0.25);
  border-radius: var(--radius);
  padding: 48px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: rgba(255, 255, 255, 0.5);
}
.upload-zone:hover { border-color: var(--primary); background: rgba(91, 141, 239, 0.05); }
.upload-zone.dragover { border-color: var(--primary); background: var(--primary-light); }
.upload-zone-icon { font-size: 40px; margin-bottom: 14px; }
.upload-zone-text { font-size: 14px; color: var(--text-secondary); }

/* ===== 生成的方案文档 ===== */
.generated-doc {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px;
  max-width: 920px;
  margin: 0 auto;
  line-height: 1.85;
  box-shadow: var(--shadow);
}
.generated-doc h1 { font-size: 26px; text-align: center; margin-bottom: 10px; }
.generated-doc h2 { font-size: 19px; margin: 28px 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.generated-doc h3 { font-size: 16px; margin: 18px 0 10px; }
.generated-doc p { margin-bottom: 14px; text-indent: 2em; }
.generated-doc table { width: 100%; border-collapse: collapse; margin: 14px 0; }
.generated-doc th, .generated-doc td { border: 1px solid var(--border); padding: 10px 14px; font-size: 13px; }
.generated-doc th { background: rgba(91, 141, 239, 0.06); font-weight: 600; }

/* ===== 加载动画 ===== */
.loading {
  text-align: center;
  padding: 48px;
  color: var(--text-muted);
}
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(37, 99, 235, 0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 14px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .sidebar { width: 60px; padding: 14px 8px; }
  .module-info, .sidebar-stats { display: none; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .main-layout { padding: 12px; gap: 12px; }
  .content { padding: 20px; }
}

/* ===== 权限控制相关 ===== */
.readonly-banner {
  background: linear-gradient(135deg, rgba(254, 243, 199, 0.6) 0%, rgba(253, 230, 138, 0.4) 100%);
  border: 1px solid rgba(252, 211, 77, 0.5);
  color: #92400e;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}
.admin-badge.active {
  background: rgba(220, 252, 231, 0.8);
  color: var(--success);
  border: 1px solid rgba(134, 239, 172, 0.5);
}
.admin-badge.inactive {
  background: rgba(241, 245, 249, 0.8);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

#adminStatus {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 12px;
  border-left: 1px solid var(--border);
  margin-left: 4px;
}

/* ===== 应力比颜色标记 ===== */
.result-pass { color: var(--success); font-weight: 600; }
.result-warn { color: var(--warning); font-weight: 600; }
.result-fail { color: var(--danger); font-weight: 700; }

/* ===== 数据表 ===== */
.data-table th, .data-table td {
  border: 1px solid var(--border);
}
.data-table tr:nth-child(even) {
  background: rgba(91, 141, 239, 0.04);
}
