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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: linear-gradient(135deg, #1a3a5c 0%, #2d6a9f 100%);
  min-height: 100vh;
  padding: 20px;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

/* ============================================================
   标题区
   ============================================================ */
.header {
  background: linear-gradient(135deg, #1a3a5c 0%, #2d6a9f 100%);
  color: white;
  padding: 28px 30px;
  text-align: center;
}

.header h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.subtitle {
  font-size: 13px;
  opacity: 0.85;
}

/* ============================================================
   Tab 导航
   ============================================================ */
.tab-nav {
  display: flex;
  background: #f0f4f8;
  border-bottom: 2px solid #dde3ea;
}

.tab-btn {
  flex: 1;
  padding: 14px 20px;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 500;
  color: #666;
  cursor: pointer;
  transition: all 0.25s ease;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
}

.tab-btn:hover {
  color: #2d6a9f;
  background: #e8eef5;
}

.tab-btn.active {
  color: #1a3a5c;
  font-weight: 700;
  border-bottom-color: #2d6a9f;
  background: #fff;
}

/* ============================================================
   Tab 内容区
   ============================================================ */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ============================================================
   主内容区（左右布局）
   ============================================================ */
.main-content {
  display: flex;
  min-height: 520px;
}

.left-panel {
  flex: 0 0 380px;
  padding: 24px;
  background: #f8f9fa;
  border-right: 1px solid #e9ecef;
}

.right-panel {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

/* ============================================================
   上传区域
   ============================================================ */
.upload-section {
  margin-bottom: 20px;
}

.upload-section h2 {
  font-size: 15px;
  color: #333;
  margin-bottom: 10px;
  font-weight: 600;
}

.upload-zone {
  border: 2px dashed #b0c4d8;
  border-radius: 12px;
  padding: 28px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: white;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: #2d6a9f;
  background: #eef4fb;
  transform: scale(1.01);
}

.upload-icon {
  font-size: 36px;
  margin-bottom: 8px;
}

.upload-zone p {
  color: #666;
  font-size: 13px;
  margin: 3px 0;
}

.upload-hint {
  font-size: 11px !important;
  color: #aaa !important;
}

.upload-status {
  margin-top: 8px;
  font-size: 13px;
  color: #28a745;
  font-weight: 500;
}

/* ============================================================
   按钮
   ============================================================ */
.action-buttons {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.btn {
  flex: 1;
  padding: 11px 16px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.25s ease;
  font-weight: 500;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, #1a3a5c 0%, #2d6a9f 100%);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(45, 106, 159, 0.45);
}

.btn-secondary {
  background: #e9ecef;
  color: #495057;
}

.btn-secondary:hover:not(:disabled) {
  background: #dee2e6;
}

/* ============================================================
   结果区
   ============================================================ */
.result-section {
  margin-bottom: 28px;
}

.result-section h2 {
  font-size: 15px;
  color: #333;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid #2d6a9f;
  font-weight: 600;
}

.placeholder-text {
  color: #aaa;
  font-style: italic;
  text-align: center;
  padding: 24px;
  font-size: 13px;
}

/* ============================================================
   营业执照结果卡片
   ============================================================ */
.edit-fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.edit-fields-grid.nested-grid {
  grid-template-columns: 1fr;
  margin-top: 8px;
}

.edit-field-card {
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 14px;
  border-left: 4px solid #e9ecef;
  transition: all 0.25s ease;
}

.edit-field-card.ai-extracted {
  background: #FFFDE7;
  border-left-color: #FFC107;
}

.edit-field-card.user-modified {
  background: #FFEBEE;
  border-left-color: #F44336;
}

.edit-field-card.full-width {
  grid-column: 1 / -1;
}

.edit-field-card.nested-card {
  background: #f8f9fa;
}

.edit-field-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.edit-field-label {
  font-size: 12px;
  color: #555;
  font-weight: 600;
}

.edit-field-input {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
  background: #fafafa;
  color: #333;
  transition: all 0.2s ease;
}

.edit-field-input:focus {
  outline: none;
  border-color: #2d6a9f;
  background: #fff;
}

.edit-field-input.ai-filled {
  background: #FFFDE7;
  border-color: #FFC107;
}

.edit-field-input.modified {
  background: #FFEBEE;
  border-color: #F44336;
}

.edit-field-meta {
  display: flex;
  gap: 10px;
  margin-top: 6px;
  font-size: 11px;
  color: #888;
  flex-wrap: wrap;
}

.asset-array-list {
  display: grid;
  gap: 8px;
}

.asset-array-item {
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fff;
}

.license-fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.seal-status {
  font-size: 18px;
  font-weight: 700;
  padding: 4px 0;
}

.seal-status.seal-yes {
  color: #28a745;
}

.seal-status.seal-no {
  color: #dc3545;
}

.license-field-card {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 12px 14px;
  border-left: 4px solid #2d6a9f;
}

.license-field-card .field-label {
  font-size: 11px;
  color: #888;
  margin-bottom: 4px;
}

.license-field-card .field-value {
  font-size: 14px;
  color: #222;
  font-weight: 500;
  word-break: break-all;
}

.license-field-card.full-width {
  grid-column: 1 / -1;
}

/* ============================================================
   资产公告结果
   ============================================================ */
.asset-result-card {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
  border-left: 4px solid #2d6a9f;
}

.asset-result-card .card-title {
  font-size: 13px;
  font-weight: 700;
  color: #1a3a5c;
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid #dde3ea;
}

.asset-kv-row {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 13px;
}

.asset-kv-row .kv-key {
  color: #666;
  min-width: 120px;
  flex-shrink: 0;
}

.asset-kv-row .kv-val {
  color: #222;
  word-break: break-all;
}

/* ============================================================
   表单模块：字段列表
   ============================================================ */
.fields-list {
  display: grid;
  gap: 8px;
}

.field-item {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-left: 4px solid #2d6a9f;
}

.field-item .field-name {
  font-weight: 500;
  color: #333;
  font-size: 13px;
}

.field-item .field-type {
  font-size: 11px;
  color: #999;
  background: #e9ecef;
  padding: 2px 7px;
  border-radius: 4px;
}

/* ============================================================
   表单模块：提取结果（可编辑）
   ============================================================ */
.fields-form {
  display: grid;
  gap: 10px;
}

/* 提取结果摘要统计 */
.extract-summary {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  padding: 14px 18px;
  border-radius: 8px;
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  border-left: 4px solid #2d6a9f;
  font-size: 13px;
}

.summary-item {
  font-weight: 600;
  color: #495057;
}

.summary-filled { color: #28a745; }
.summary-modified { color: #dc3545; }

.summary-legend {
  margin-left: auto;
  font-size: 12px;
  color: #6c757d;
  display: flex;
  gap: 12px;
  align-items: center;
}

.legend-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
  margin-right: 4px;
}

.legend-dot.ai { background: #FFC107; }
.legend-dot.manual { background: #F44336; }
.legend-dot.empty { background: #e9ecef; border: 1px solid #ced4da; }

/* 字段卡片样式 */
.form-field-item {
  background: #fff;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  padding: 14px;
  border-left: 5px solid #e9ecef;
  transition: all 0.25s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.form-field-item:hover {
  box-shadow: 0 3px 8px rgba(0,0,0,0.12);
}

/* AI 提取 - 黄色主题 */
.form-field-item.ai-extracted {
  background: linear-gradient(135deg, #FFFEF5 0%, #FFFDE7 100%);
  border-color: #FFE082;
  border-left-color: #FFC107;
}

/* 人工修改 - 红色主题 */
.form-field-item.user-modified {
  background: linear-gradient(135deg, #FFF5F5 0%, #FFEBEE 100%);
  border-color: #FFCDD2;
  border-left-color: #F44336;
}

/* 未找到 - 灰色主题 */
.form-field-item.field-empty {
  background: #fafbfc;
  border-color: #e1e4e8;
  border-left-color: #ced4da;
}

.form-field-item .field-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.form-field-item .field-name {
  font-weight: 600;
  color: #333;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-field-item .field-type-badge {
  font-size: 11px;
  color: #6c757d;
  background: #e9ecef;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 500;
}

.form-field-item .field-input {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #dee2e6;
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
  color: #333;
  transition: all 0.2s ease;
}

.form-field-item .field-input:focus {
  outline: none;
  border-color: #2d6a9f;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(45, 106, 159, 0.1);
}

/* AI 填充的输入框 */
.form-field-item .field-input.ai-filled {
  background: linear-gradient(135deg, #FFFEF5 0%, #FFFDE7 100%);
  border-color: #FFC107;
}

/* 人工修改的输入框 */
.form-field-item .field-input.modified {
  background: linear-gradient(135deg, #FFF5F5 0%, #FFEBEE 100%);
  border-color: #F44336;
  font-weight: 500;
}

.form-field-item .field-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  font-size: 11px;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  background: #f8f9fa;
  color: #6c757d;
  border: 1px solid #e9ecef;
}

/* 置信度徽章 */
.confidence-badge {
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.confidence-badge.high {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.confidence-badge.medium {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

.confidence-badge.low {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* 位置徽章 - 新增 */
.location-item {
  background: #e7f3ff;
  color: #0056b3;
  border-color: #bee5eb;
  font-weight: 500;
}

/* 来源文件徽章 */
.source-item {
  background: #f0f0f0;
  color: #495057;
  border-color: #dee2e6;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 状态标签 */
.modified-tag {
  font-size: 10px;
  color: #fff;
  background: #F44336;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.empty-tag {
  font-size: 10px;
  color: #6c757d;
  background: #e9ecef;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
}

/* ============================================================
   文件列表
   ============================================================ */
.file-list {
  margin-top: 8px;
}

.file-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 10px;
  background: white;
  border-radius: 6px;
  margin-bottom: 4px;
  font-size: 12px;
  border: 1px solid #e9ecef;
}

.file-item .file-name {
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}

.file-item .file-size {
  color: #aaa;
  font-size: 11px;
}

/* ============================================================
   底部导出栏
   ============================================================ */
.footer {
  padding: 18px 24px;
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
  text-align: center;
}

.btn-download {
  padding: 13px 40px;
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
}

.btn-download:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(40, 167, 69, 0.4);
}

.btn-download:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ============================================================
   Toast 提示
   ============================================================ */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #333;
  color: white;
  padding: 11px 22px;
  border-radius: 8px;
  font-size: 13px;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 9999;
  max-width: 400px;
  text-align: center;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast.error { background: #dc3545; }
.toast.success { background: #28a745; }
.toast.info { background: #2d6a9f; }

/* ============================================================
   加载动画
   ============================================================ */
.loading {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.5);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================================
   模板信息卡
   ============================================================ */
.template-info {
  background: #eef4fb;
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 14px;
  border-left: 4px solid #2d6a9f;
}

.template-info .template-type {
  font-size: 15px;
  font-weight: 700;
  color: #1a3a5c;
  margin-bottom: 4px;
}

.template-info .template-meta {
  font-size: 12px;
  color: #666;
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 900px) {
  .main-content { flex-direction: column; }
  .left-panel { flex: none; border-right: none; border-bottom: 1px solid #e9ecef; }
  .license-fields-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   登录遮罩
   ============================================================ */
.login-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #1a3a5c 0%, #2d6a9f 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.login-overlay.hidden {
  display: none;
}

.login-box {
  background: white;
  border-radius: 16px;
  padding: 40px;
  width: 380px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  text-align: center;
}

.login-logo {
  font-size: 48px;
  margin-bottom: 12px;
}

.login-box h2 {
  font-size: 18px;
  color: #1a3a5c;
  font-weight: 700;
  margin-bottom: 6px;
}

.login-subtitle {
  font-size: 13px;
  color: #888;
  margin-bottom: 28px;
}

.login-form {
  text-align: left;
}

.login-field {
  margin-bottom: 16px;
}

.login-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #333;
  margin-bottom: 6px;
}

.login-field input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.2s;
  outline: none;
  box-sizing: border-box;
}

.login-field input:focus {
  border-color: #2d6a9f;
  box-shadow: 0 0 0 3px rgba(45, 106, 159, 0.12);
}

.login-error {
  font-size: 13px;
  color: #dc3545;
  margin-bottom: 12px;
  min-height: 18px;
  text-align: center;
}

.login-btn {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, #1a3a5c 0%, #2d6a9f 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  letter-spacing: 2px;
}

.login-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(45, 106, 159, 0.45);
}

.login-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ============================================================
   Tab2：资产转让公告 - 上传区横向布局
   ============================================================ */
.asset-upload-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: #f5f8fc;
  border-bottom: 1px solid #dde3ea;
  flex-wrap: wrap;
}

.upload-zone-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 260px;
  border: 2px dashed #b0c4de;
  border-radius: 8px;
  padding: 10px 16px;
  cursor: pointer;
  background: #fff;
  font-size: 13px;
  color: #555;
  transition: border-color 0.2s, background 0.2s;
}

.upload-zone-inline:hover,
.upload-zone-inline.dragover {
  border-color: #2d6a9f;
  background: #eef4fc;
}

.upload-zone-inline .upload-icon-sm { font-size: 18px; }
.upload-zone-inline .upload-hint   { color: #aaa; font-size: 12px; }
.upload-zone-inline .upload-status { color: #2d6a9f; font-weight: 600; font-size: 12px; }

.asset-action-bar {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.btn-success {
  background: #28a745;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-success:hover:not(:disabled) { background: #218838; }
.btn-success:disabled { opacity: 0.5; cursor: not-allowed; }

/* ============================================================
   Tab2：资产转让公告 - 结构化表格样式
   ============================================================ */
.pn-wrap {
  padding: 16px 20px;
  font-size: 13px;
}

.pn-section {
  margin-bottom: 20px;
}

.pn-section-title {
  font-size: 14px;
  font-weight: 700;
  color: #1a3a5c;
  padding: 6px 12px;
  background: #eef4fc;
  border-left: 4px solid #2d6a9f;
  border-radius: 0 4px 4px 0;
  margin-bottom: 6px;
}

.pn-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #c8d8e8;
}

.pn-table th,
.pn-table td {
  border: 1px solid #c8d8e8;
  padding: 6px 8px;
  vertical-align: middle;
  font-size: 13px;
}

.pn-table th {
  background: #eef4fc;
  font-weight: 600;
  color: #1a3a5c;
  text-align: center;
  white-space: nowrap;
}

.pn-label {
  background: #f5f8fc;
  color: #444;
  font-weight: 600;
  white-space: nowrap;
  width: 120px;
}

.pn-outer-label {
  width: 36px;
  text-align: center;
  background: #eef4fc;
  font-weight: 700;
  color: #1a3a5c;
}

.pn-inner-label {
  width: 70px;
  text-align: center;
  background: #f5f8fc;
}

.pn-vertical {
  writing-mode: vertical-rl;
  letter-spacing: 4px;
  font-size: 13px;
}

.pn-center { text-align: center; }

.pn-remark-row {
  background: #fafbfc;
  color: #555;
  font-size: 12px;
  padding: 4px 8px;
}

/* 标的清单表格列宽 */
.pn-list-table th:nth-child(1) { width: 48px; }
.pn-list-table th:nth-child(2) { width: 160px; }
.pn-list-table th:nth-child(3) { min-width: 120px; }
.pn-list-table th:nth-child(4) { width: 90px; }

/* 可编辑输入框 */
.pn-input {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 13px;
  font-family: inherit;
  background: #fffde7;
  color: #333;
  resize: vertical;
  box-sizing: border-box;
  transition: border-color 0.15s, background 0.15s;
}

.pn-input:focus {
  outline: none;
  border-color: #2d6a9f;
  background: #fff;
}

.pn-input.pn-modified {
  background: #ffebee;
  border-color: #f44336;
}

/* 评估师行 */
.pn-signer-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.pn-signer-row span { display: flex; align-items: center; gap: 4px; }
