* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "Microsoft YaHei", sans-serif; background: #f5f6f8; color: #333; }

.hidden { display: none !important; }

/* 登录 */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.login-card { background: #fff; padding: 36px 32px; border-radius: 10px; box-shadow: 0 4px 24px rgba(0,0,0,.08); width: 340px; display: flex; flex-direction: column; gap: 12px; }
.login-card h1 { margin: 0; font-size: 22px; text-align: center; }
.login-card .sub { margin: 0 0 8px; text-align: center; color: #888; font-size: 13px; }
.msg { color: #d33; font-size: 13px; min-height: 18px; }

/* 主应用 */
.app header { background: #1f3b5c; color: #fff; padding: 14px 24px; display: flex; justify-content: space-between; align-items: center; }
.app header h1 { margin: 0; font-size: 18px; }
.header-right { display: flex; align-items: center; gap: 12px; font-size: 14px; }
main { max-width: 1100px; margin: 20px auto; padding: 0 16px; display: flex; flex-direction: column; gap: 16px; }

.card { background: #fff; border-radius: 8px; padding: 16px 20px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.card h2 { margin: 0 0 12px; font-size: 16px; }

.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.row:last-child { margin-bottom: 0; }
input, select, textarea { padding: 8px 10px; border: 1px solid #ccc; border-radius: 6px; font-size: 14px; }
input, select { min-width: 140px; }
textarea { flex: 1; min-width: 260px; resize: vertical; }

button { padding: 8px 16px; border: none; border-radius: 6px; cursor: pointer; font-size: 14px; }
button.primary { background: #1f6feb; color: #fff; }
button.ghost { background: #eef1f5; color: #444; }
button:disabled { opacity: .5; cursor: not-allowed; }

.muted { color: #888; font-size: 13px; }

/* 企业搜索下拉 */
.search-select { position: relative; flex: 1; min-width: 260px; }
.search-select input { width: 100%; }
.search-panel { position: absolute; top: 100%; left: 0; right: 0; z-index: 10; margin-top: 4px; background: #fff; border: 1px solid #ccc; border-radius: 6px; max-height: 240px; overflow-y: auto; box-shadow: 0 6px 16px rgba(0,0,0,.12); }
.search-panel .item { padding: 8px 10px; cursor: pointer; font-size: 14px; border-bottom: 1px solid #f0f0f0; }
.search-panel .item:hover { background: #eef4ff; }
.search-panel .item:last-child { border-bottom: none; }
.search-panel .sub { color: #999; font-size: 12px; margin-left: 6px; }
.search-panel .hint { padding: 7px 10px; color: #1f6feb; font-size: 14px; font-weight: 600; background: #eef4ff; border-bottom: 1px solid #d6e4ff; }
.search-panel .empty { padding: 8px 10px; color: #999; font-size: 13px; }

/* 识别结果卡片 */
.result-card { border: 1px solid #e0e0e0; border-radius: 8px; padding: 14px; margin-top: 8px; background: #fafbfc; }
.result-card.needs-review { border-color: #f0ad4e; background: #fffaf0; }
.result-card .hdr { font-weight: 600; margin-bottom: 8px; }
.result-card .tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; margin-right: 6px; background: #eef1f5; }
.result-card .tag.major { background: #fde8e8; color: #c00; }
.result-card .tag.warn { background: #fef0d8; color: #a70; }
.result-card ul { margin: 6px 0; padding-left: 20px; }
.result-card ul li { margin: 3px 0; }
.result-card .v-del { padding: 0 7px; margin-left: 8px; font-size: 12px; line-height: 18px; font-weight: bold; background: #e8f5e9; color: #2e7d32; border-radius: 4px; }
.result-card .v-del:hover { background: #c8e6c9; }
.result-card .v-del.wrong { background: #fde8e8; color: #c00; }
.result-card .v-del.wrong:hover { background: #f5b7b7; }
.result-card .v-del.trim { background: #e3f2fd; color: #1565c0; }
.result-card .v-del.trim:hover { background: #bbdefb; }
.result-card li.trim { list-style: none; padding: 6px 8px; background: #fafbfc; border: 1px solid #e8ecf1; border-radius: 6px; }
.result-card .subitems { margin: 6px 0 0; padding-left: 4px; }
.result-card .subitem { display: block; margin: 4px 0; font-size: 13px; color: #333; cursor: pointer; }
.result-card .subitem input { margin-right: 6px; vertical-align: middle; }
.result-card label { display: block; margin: 6px 0 2px; font-size: 13px; color: #666; }

/* 表格 */
table { width: 100%; border-collapse: collapse; margin-top: 8px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #eee; font-size: 14px; }
th { background: #f7f8fa; color: #555; }
.badge { display: inline-block; padding: 2px 6px; border-radius: 4px; font-size: 12px; background: #eef1f5; }
.badge.warn { background: #fef0d8; color: #a70; }
.badge.edit { background: #e3f2fd; color: #1565c0; }
.badge.major { background: #fde8e8; color: #c00; }
.badge.ok { background: #e6f4ea; color: #1a7f37; }
.review-section { margin-top: 8px; padding: 8px 0 2px; border-top: 1px dashed #d0d7de; display: flex; align-items: center; gap: 8px; }
.review-section .review-label { font-size: 13px; color: #57606a; font-weight: 600; }

/* 待整理草稿 */
.draft-box { margin-top: 12px; border-top: 1px dashed #d0d7de; padding-top: 10px; }
.draft-box b { font-size: 14px; }
.draft-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; margin-top: 6px; border: 1px solid #e8ecf1; border-radius: 6px; background: #fbfcfe; }
.draft-item .draft-date { flex: none; font-size: 12px; color: #888; background: #f0f2f5; padding: 2px 6px; border-radius: 4px; }
.draft-item .draft-desc { flex: 1; font-size: 14px; }
.draft-item .tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; background: #eef1f5; white-space: nowrap; }
.draft-item .tag.major { background: #fde8e8; color: #c00; }
.draft-item .tag.warn { background: #fef0d8; color: #a70; }
.draft-item .draft-actions { display: flex; gap: 6px; }

/* 企业端整改上传表单 */
.upload-form { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.upload-form textarea { width: 100%; min-height: 64px; flex: none; }
.upload-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.file-btn { display: inline-block; padding: 6px 12px; background: #eef1f5; border: 1px solid #d6dae0; border-radius: 6px; cursor: pointer; font-size: 13px; color: #444; }
.file-btn input { display: none; }

/* 顶部标签导航（电脑） */
.tabs { max-width: 1100px; margin: 16px auto 0; padding: 0 16px; display: flex; gap: 8px; }
.tab { padding: 10px 20px; background: #eef1f5; color: #555; border-radius: 8px; font-size: 15px; }
.tab:hover { background: #e2e8f0; }
.tab.active { background: #1f3b5c; color: #fff; font-weight: 600; }
.tab-panel { display: flex; flex-direction: column; gap: 16px; }

/* 手机：整体排版 + 标签导航变底部导航 */
@media (max-width: 640px) {
  /* 底部导航 */
  .tabs { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; margin: 0; padding: 0; background: #fff; border-top: 1px solid #e5e5e5; box-shadow: 0 -2px 8px rgba(0,0,0,.05); }
  .tab { flex: 1; border-radius: 0; background: transparent; color: #666; font-size: 14px; padding: 12px 0; }
  .tab.active { background: transparent; color: #1f6feb; font-weight: 600; }

  /* 标题栏 */
  .app header { padding: 12px 16px; }
  .app header h1 { font-size: 16px; }

  /* 内容区 */
  main { padding: 0 12px; margin-top: 14px; margin-bottom: 76px; }
  .card { padding: 14px; }
  .card h2 { font-size: 15px; }

  /* 输入框：全宽竖排，16px 防 iOS 聚焦缩放 */
  input, select, textarea { width: 100%; min-width: 0; font-size: 16px; padding: 10px 12px; }
  .search-select { min-width: 0; }

  /* 按钮：触控友好 */
  button { font-size: 15px; padding: 10px 14px; }

  /* 表格：横向滑动，不撑破页面 */
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  th, td { white-space: nowrap; font-size: 13px; padding: 7px 8px; }

  /* 登录卡片自适应 */
  .login-wrap { padding: 16px; }
  .login-card { width: 100%; }
}
