/* ============================================================
 * style.css - 融翼通公共样式
 * 全局基础样式 + 通用组件
 * ============================================================ */

/* ====== 重置与全局 ====== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  background: #f5f7fa;
  color: #333;
  line-height: 1.6;
}
a { color: #1a73e8; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ====== Header 导航栏 ====== */
.header {
  background: linear-gradient(135deg, #1a73e8, #0d47a1);
  color: #fff;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.header h1 { font-size: 18px; font-weight: 600; }
.header a {
  color: rgba(255,255,255,0.85);
  font-size: 14px;
  transition: opacity 0.2s;
  padding: 4px 12px;
  border-radius: 4px;
}
.header a:hover { color: #fff; background: rgba(255,255,255,0.1); text-decoration: none; opacity: 1; }

/* ====== 容器 ====== */
.container { max-width: 1200px; margin: 0 auto; padding: 24px; }
.main-container { max-width: 1200px; margin: 0 auto; padding: 24px; }

/* ====== 按钮 ====== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: #1a73e8; color: #fff; }
.btn-primary:hover:not(:disabled) { background: #1557b0; box-shadow: 0 2px 8px rgba(26,115,232,0.3); }
.btn-secondary { background: #e8eaf6; color: #3949ab; }
.btn-secondary:hover:not(:disabled) { background: #c5cae9; }
.btn-danger { background: #fce4ec; color: #c62828; }
.btn-danger:hover:not(:disabled) { background: #ffcdd2; }
.btn-success { background: #e6f4ea; color: #2e7d32; }
.btn-success:hover:not(:disabled) { background: #c8e6c9; }

/* ====== 表格 ====== */
.table-wrap {
  overflow-x: auto;
  max-height: 450px;
  overflow-y: auto;
  border: 1px solid #eef0f4;
  border-radius: 10px;
  background: #fff;
}
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  color: #444;
  background: #f5f7fa;
  border-bottom: 2px solid #e0e0e0;
  position: sticky;
  top: 0;
  z-index: 1;
  white-space: nowrap;
}
td {
  padding: 9px 14px;
  border-bottom: 1px solid #f0f0f0;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
tr:hover td { background: #fafbfe; }
.null-val { color: #ccc; font-style: italic; }

/* ====== 模态框 ====== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}
.modal-overlay.active { display: flex; }
.modal {
  background: #fff;
  border-radius: 14px;
  padding: 28px;
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: modalIn 0.2s ease-out;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(-16px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal h3 { margin: 0 0 20px; font-size: 18px; color: #333; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* 模态框增强版（dialog风格） */
.modal-dialog {
  background: #fff;
  border-radius: 14px;
  width: 90%;
  max-width: 720px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  animation: modalIn 0.2s ease-out;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid #eee;
}
.modal-header h3 { margin: 0; font-size: 17px; color: #333; }
.modal-body { padding: 22px 24px; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 24px;
  border-top: 1px solid #eee;
  background: #fafafa;
  border-radius: 0 0 14px 14px;
}

/* ====== 表单 ====== */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px 18px;
}
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block;
  font-size: 13px;
  color: #555;
  margin-bottom: 5px;
  font-weight: 500;
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #ddd;
  border-radius: 7px;
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fff;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: #1a73e8;
  outline: none;
  box-shadow: 0 0 0 3px rgba(26,115,232,0.12);
}
.form-group textarea { resize: vertical; min-height: 60px; }

/* ====== 工具栏 ====== */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 14px 18px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  flex-wrap: wrap;
}
.toolbar select,
.toolbar input {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
}
.toolbar input { flex: 1; min-width: 200px; }

/* ====== 加载状态 ====== */
.loading {
  text-align: center;
  padding: 60px;
  color: #aaa;
  font-size: 15px;
}

/* ====== 标签/徽章 ====== */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
}
.badge-blue { background: #e8f0fe; color: #1967d2; }
.badge-green { background: #e6f4ea; color: #137333; }
.badge-orange { background: #fff3e0; color: #e65100; }
.badge-red { background: #fce4ec; color: #c62828; }
.badge-gray { background: #f0f0f0; color: #888; }

/* ====== Tab标签栏 ====== */
.nav-tab-bar {
  background: #fff;
  border-bottom: 2px solid #e0e0e0;
  display: flex;
  gap: 0;
  overflow-x: auto;
  padding: 0 16px;
  margin-bottom: 20px;
  border-radius: 10px 10px 0 0;
}
.nav-tab {
  padding: 12px 22px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  color: #666;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
  font-weight: 500;
}
.nav-tab:hover { color: #1a73e8; background: #f0f4ff; }
.nav-tab.active {
  color: #1a73e8;
  border-bottom-color: #1a73e8;
  font-weight: 700;
  background: #f8faff;
}

/* Tab按钮 */
.tab-bar { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tab-btn {
  padding: 7px 16px;
  border: 1px solid #ddd;
  border-radius: 20px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  color: #555;
  transition: all 0.15s;
}
.tab-btn.active { background: #1a73e8; color: #fff; border-color: #1a73e8; }
.tab-btn:hover:not(.active) { background: #f0f4ff; border-color: #bbb; }

/* ====== 分页 ====== */
.pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  background: #fff;
  border-radius: 0 0 10px 10px;
  border-top: 1px solid #eee;
}
.pagination button {
  padding: 6px 14px;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s;
}
.pagination button:hover:not(:disabled) { background: #f0f4ff; border-color: #1a73e8; color: #1a73e8; }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }
.pagination button.active { background: #1a73e8; color: #fff; border-color: #1a73e8; }
.pagination span { font-size: 13px; color: #888; }

/* ====== 信息网格 ====== */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px 24px;
}
.info-item { display: flex; align-items: baseline; gap: 8px; padding: 4px 0; }
.info-item .label { color: #888; font-size: 13px; min-width: 90px; flex-shrink: 0; }
.info-item .value { color: #333; font-size: 14px; font-weight: 500; word-break: break-all; }
.info-item .null { color: #ccc; font-style: italic; }

/* ====== 企业标题区 ====== */
.company-title {
  background: #fff;
  border-radius: 10px;
  padding: 24px 28px;
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.company-title h2 { font-size: 24px; color: #1a73e8; margin-bottom: 8px; word-break: break-all; }
.company-title .meta { font-size: 13px; color: #888; display: flex; flex-wrap: wrap; gap: 6px 16px; }

/* ====== 上传区域 ====== */
.upload-zone {
  border: 2px dashed #ccc;
  border-radius: 10px;
  padding: 30px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  color: #888;
}
.upload-zone:hover { border-color: #1a73e8; background: #f0f7ff; color: #1a73e8; }
.upload-zone.dragover { border-color: #1a73e8; background: #e8f0fe; }

/* ====== Lightbox 图片预览 ====== */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.78);
  z-index: 99999;
  align-items: center;
  justify-content: center;
}
.lightbox.active { display: flex; }
.lightbox img {
  max-width: 95vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.4);
}

/* ====== 阶段Tab ====== */
.stage-tab {
  padding: 11px 26px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  color: #666;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  font-weight: 500;
  white-space: nowrap;
}
.stage-tab:hover { color: #1a73e8; background: #f0f4ff; }
.stage-tab.active { color: #1a73e8; border-bottom-color: #1a73e8; font-weight: 700; background: #f8faff; }

/* 子模块切换 */
.sub-module-toggle {
  padding: 5px 14px;
  border: 1px solid #ddd;
  border-radius: 16px;
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  color: #666;
  transition: all 0.15s;
}
.sub-module-toggle.active { background: #1a73e8; color: #fff; border-color: #1a73e8; }
.sub-module-toggle:hover:not(.active) { background: #f0f4ff; }

/* ====== 响应式 ====== */
@media (max-width: 768px) {
  .header { padding: 12px 16px; }
  .container, .main-container { padding: 16px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .toolbar input { min-width: auto; }
  .form-grid { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr; }
  .modal, .modal-dialog { width: 95%; margin: 10px; }
  table { font-size: 12px; }
  th, td { padding: 7px 10px; }
}

/* ====== 滚动条美化 ====== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #aaa; }

/* ====== 选择文本 ====== */
::selection { background: #1a73e8; color: #fff; }
