/* ============== 全局 ============== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  color: #1f2937;
  background: #f5f7fb;
  font-size: 14px;
  line-height: 1.5;
}
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }

/* ============== 容器 ============== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
}

/* ============== 顶部 ============== */
.app-header {
  background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
  color: #fff;
  padding: 20px 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}
.app-header-inner {
  display: flex;
  align-items: center;
  gap: 14px;
}
.app-logo {
  height: 44px;
  width: auto;
  background: #fff;
  border-radius: 8px;
  padding: 4px 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  flex-shrink: 0;
}
.app-title h1 {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
}
.app-title .subtitle {
  font-size: 12px;
  opacity: 0.85;
  margin-top: 4px;
}
.app-nav {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.app-nav a {
  color: #fff;
  background: rgba(255,255,255,0.15);
  padding: 4px 12px;
  border-radius: 14px;
  font-size: 12px;
}
.app-nav a:hover { background: rgba(255,255,255,0.25); text-decoration: none; }

/* ============== Tab 栏 ============== */
.tab-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  background: #fff;
  padding: 8px;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  margin-bottom: 16px;
  scrollbar-width: thin;
}
.tab-bar .tab {
  flex-shrink: 0;
  padding: 8px 14px;
  background: #f1f5f9;
  color: #475569;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
}
.tab-bar .tab:hover { background: #e2e8f0; }
.tab-bar .tab.active {
  background: #2563eb;
  color: #fff;
  box-shadow: 0 2px 6px rgba(37,99,235,0.35);
}
.tab-bar .tab.submitted {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}
.tab-bar .tab.submitted.active {
  background: #16a34a;
  color: #fff;
  border-color: transparent;
}
.tab-bar .tab .tab-name {
  font-size: 11px;
  opacity: 0.85;
  margin-left: 6px;
}
.tab-bar .tab .tab-check {
  display: inline-block;
  margin-left: 4px;
  font-size: 12px;
  font-weight: 700;
}
.tab-bar .tab.active .tab-name { opacity: 0.95; }

/* ============== 卡片 ============== */
.card {
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  margin-bottom: 14px;
}
.card h2 {
  font-size: 16px;
  margin-bottom: 12px;
  color: #111827;
  font-weight: 600;
}
.card .candidate-meta {
  font-size: 13px;
  color: #64748b;
}
.card .candidate-meta span { margin-right: 14px; }

/* ============== 表单 ============== */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.form-row label {
  display: block;
  font-size: 12px;
  color: #475569;
  margin-bottom: 4px;
  font-weight: 500;
}
.form-row input[type=text],
.form-row textarea,
.form-row select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}
.form-row input[type=text]:focus,
.form-row textarea:focus,
.form-row select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.form-row textarea { resize: vertical; min-height: 60px; }

.veto-block {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
  margin-bottom: 12px;
}
.veto-block input[type=checkbox] { margin-top: 3px; }
.veto-block label { font-weight: 600; color: #b91c1c; cursor: pointer; }
.veto-block .veto-hint { font-size: 12px; color: #991b1b; margin-top: 2px; }

/* ============== 评分表 ============== */
.scoring-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: fixed;
}
.scoring-table th,
.scoring-table td {
  padding: 10px 8px;
  border: 1px solid #e5e7eb;
  vertical-align: top;
  word-wrap: break-word;
}
.scoring-table .section-header th {
  background: #f1f5f9;
  color: #1e40af;
  font-weight: 600;
  font-size: 13px;
  text-align: left;
}
.scoring-table .section-header.section-disabled th {
  background: #f3f4f6;
  color: #9ca3af;
}
.scoring-table .section-header .lock-tag {
  display: inline-block;
  margin-left: 12px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 400;
  color: #6b7280;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 10px;
}
.scoring-table tr.item-disabled td {
  background: #f9fafb;
  color: #9ca3af;
}
.scoring-table tr.item-disabled .item-name,
.scoring-table tr.item-disabled .item-criteria {
  color: #9ca3af;
}
.scoring-table tr.item-disabled input[type=number] {
  background: #f3f4f6;
  color: #9ca3af;
  cursor: not-allowed;
}
.scoring-table .item-name {
  font-weight: 600;
  color: #1f2937;
  width: 18%;
  text-align: center;
  vertical-align: middle;
}
.scoring-table .item-name .item-name-title {
  font-size: 15px;
  font-weight: 700;
  color: #1e40af;
  margin-bottom: 4px;
}
.scoring-table .item-name .item-max {
  display: inline-block;
  font-size: 11px;
  color: #6b7280;
  font-weight: 400;
  background: #f1f5f9;
  padding: 1px 6px;
  border-radius: 8px;
}
.scoring-table .item-criteria {
  color: #4b5563;
  font-size: 12px;
  line-height: 1.7;
  width: 67%;
}
.scoring-table .item-criteria .level {
  margin-bottom: 6px;
  padding: 4px 8px;
  background: #f9fafb;
  border-radius: 4px;
  border-left: 3px solid #93c5fd;
}
.scoring-table .item-criteria .level:last-child { margin-bottom: 0; }
.scoring-table .item-input {
  text-align: center;
  vertical-align: middle;
  width: 15%;
}
.scoring-table .item-input input {
  width: 64px;
  padding: 6px 4px;
  text-align: center;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 600;
  color: #2563eb;
  background: #fff;
  -moz-appearance: textfield;
}
.scoring-table .item-input input::-webkit-outer-spin-button,
.scoring-table .item-input input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.scoring-table .item-input input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37,99,235,0.15);
}

.result-display-wrap {
  margin: 14px 0;
  text-align: center;
}
.result-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px;
  border-radius: 18px;
  font-size: 14px;
  font-weight: 600;
}
.result-badge .result-total {
  background: rgba(255,255,255,0.55);
  padding: 2px 10px;
  border-radius: 12px;
  font-weight: 700;
}
.result-badge.result-qualified { background: #dcfce7; color: #166534; }
.result-badge.result-extend { background: #fef3c7; color: #92400e; }
.result-badge.result-reject { background: #fee2e2; color: #991b1b; }
.result-progress {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 14px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 13px;
}
.result-progress strong {
  color: #2563eb;
  margin: 0 2px;
}

.summary-row {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px 16px;
  margin: 14px 0;
}
.summary-row h3 {
  font-size: 14px;
  color: #1f2937;
  margin-bottom: 10px;
}
.summary-row .summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.summary-row .summary-grid .stat {
  padding: 8px;
  background: #f8fafc;
  border-radius: 6px;
  text-align: center;
}
.summary-row .summary-grid .stat .stat-label {
  font-size: 11px;
  color: #64748b;
  margin-bottom: 2px;
}
.summary-row .summary-grid .stat .stat-value {
  font-size: 16px;
  font-weight: 600;
  color: #1e293b;
}

/* ============== 按钮 ============== */
.btn {
  padding: 10px 22px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-primary {
  background: #2563eb;
  color: #fff;
}
.btn-primary:hover:not(:disabled) {
  background: #1d4ed8;
  box-shadow: 0 2px 6px rgba(37,99,235,0.3);
}
.btn-primary:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
}
.btn-secondary {
  background: #fff;
  color: #374151;
  border: 1px solid #d1d5db;
}
.btn-secondary:hover { background: #f3f4f6; }
.btn-danger {
  background: #fff;
  color: #b91c1c;
  border: 1px solid #fecaca;
}
.btn-danger:hover { background: #fef2f2; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

.submit-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

/* ============== 消息提示 ============== */
.msg {
  padding: 10px 14px;
  border-radius: 6px;
  margin: 10px 0;
  font-size: 14px;
}
.msg-success {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}
.msg-error {
  background: #fee2e2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
.msg-info {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

/* ============== 表格（汇总/管理） ============== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th,
.data-table td {
  padding: 8px 10px;
  border: 1px solid #e5e7eb;
  text-align: left;
  vertical-align: middle;
}
.data-table th {
  background: #f1f5f9;
  color: #1f2937;
  font-weight: 600;
  font-size: 12px;
}
.data-table tr:nth-child(even) { background: #fafafa; }
.data-table .text-right { text-align: right; }
.data-table .text-center { text-align: center; }

/* ============== 空状态 ============== */
.empty {
  padding: 30px;
  text-align: center;
  color: #94a3b8;
  font-size: 14px;
}

/* ============== 规则说明 ============== */
.rules-card {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  color: #78350f;
  margin-bottom: 12px;
  line-height: 1.7;
}
.rules-card strong { color: #92400e; }

.dept-hint {
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
  line-height: 1.5;
}
.dept-hint:empty { display: none; }

/* ============== 模态框 ============== */
.modal-mask {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  width: 90%;
  max-width: 460px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.modal h3 {
  font-size: 16px;
  margin-bottom: 12px;
  color: #111827;
}
.modal .modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

/* ============== 移动端 ============== */
@media (max-width: 720px) {
  .container { padding: 10px; }
  .form-row { grid-template-columns: 1fr; }
  .scoring-table { font-size: 12px; }
  .scoring-table .item-name { width: 26%; }
  .scoring-table .item-criteria { width: 52%; }
  .scoring-table .item-input { width: 22%; }
  .scoring-table .item-input input { width: 50px; font-size: 14px; }
  .scoring-table th,
  .scoring-table td { padding: 6px 4px; }
  .item-criteria .level { font-size: 11px; padding: 3px 4px; }
  .tab-bar .tab { padding: 6px 10px; font-size: 13px; }
  .total-display { padding: 10px 12px; }
  .total-display .total-value { font-size: 20px; }
  .data-table { font-size: 12px; }
  .data-table th, .data-table td { padding: 6px 6px; }
}
