/* === 海康机器人AMR 表单样式 === */

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

:root {
  --primary: #0050b3;
  --primary-light: #1e6bdc;
  --primary-dark: #003a85;
  --bg: #f5f7fb;
  --card-bg: #ffffff;
  --text: #1a1a1a;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --border: #e5e7eb;
  --border-focus: #1e6bdc;
  --danger: #dc2626;
  --success: #10b981;
  --radius: 12px;
  --shadow-sm: 0 1px 3px rgba(0, 80, 179, .06);
  --shadow: 0 6px 24px rgba(0, 80, 179, .08);
}

html, body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
               "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
}

/* === 顶部 banner === */
.banner {
  background: linear-gradient(135deg, #003a85 0%, #1e6bdc 60%, #0050b3 100%);
  color: #fff;
  padding: 36px 20px 48px;
  position: relative;
  overflow: hidden;
}
.banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 80% 20%, rgba(255,255,255,.18) 0%, transparent 40%),
    radial-gradient(circle at 10% 80%, rgba(255,255,255,.10) 0%, transparent 40%);
}
.banner-inner { max-width: 720px; margin: 0 auto; position: relative; }

.logo-row { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; }
.logo-dot {
  width: 28px; height: 28px;
  background: #fff;
  border-radius: 6px;
  position: relative;
}
.logo-dot::after {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  background: var(--primary);
  border-radius: 3px;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
}
.logo-text { font-weight: 700; font-size: 18px; letter-spacing: 1px; }
.logo-sub  { font-size: 13px; opacity: .85; margin-left: 4px; }

.banner-title {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 1px;
  text-shadow: 0 2px 6px rgba(0, 0, 0, .15);
  margin-bottom: 8px;
}
.banner-sub {
  font-size: 14px;
  opacity: .9;
}

/* === 卡片 === */
.card {
  background: var(--card-bg);
  max-width: 720px;
  margin: -24px auto 16px;
  padding: 22px 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative;
  z-index: 1;
}

/* === 简介 === */
.intro p {
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.7;
}
.tags {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.tag {
  background: #e6f0ff;
  color: var(--primary);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}

/* === 表单字段 === */
.form { padding-bottom: 24px; }

.field { margin-bottom: 18px; }

.field-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.req { color: var(--danger); margin-right: 2px; }

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 15px;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(30, 107, 220, .15);
}

.field textarea { resize: vertical; min-height: 100px; }

.field select {
  background: #fff url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path fill='%236b7280' d='M4 6l4 4 4-4z'/></svg>") no-repeat right 12px center / 14px;
  padding-right: 36px;
}

.field-hint {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
  min-height: 16px;
}
.field-hint.err { color: var(--danger); }
.field-hint.ok  { color: var(--success); }

.city-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
@media (max-width: 480px) {
  .city-row { grid-template-columns: 1fr; }
}

/* === 提交按钮 === */
.submit-btn {
  display: block;
  width: 100%;
  border: none;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  padding: 14px 20px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 6px;
  box-shadow: 0 4px 14px rgba(0, 80, 179, .25);
  transition: transform .15s, box-shadow .2s, opacity .2s;
  text-align: center;
  text-decoration: none;
}
.submit-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 8px rgba(0, 80, 179, .25);
}
.submit-btn:disabled { opacity: .6; cursor: not-allowed; }

.btn-secondary {
  background: #fff;
  color: var(--primary);
  border: 1.5px solid var(--primary);
  box-shadow: none;
  margin-top: 16px;
}

.legal {
  text-align: center;
  font-size: 12px;
  color: var(--text-light);
  margin-top: 14px;
  line-height: 1.5;
}

/* === 成功页 / 下载 === */
.hidden { display: none !important; }

.success {
  text-align: center;
}
.success-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}
.success-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.success-sub {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 22px;
}

.download-card {
  display: flex;
  align-items: center;
  background: linear-gradient(180deg, #f0f6ff 0%, #fff 100%);
  border: 1.5px solid #d6e6ff;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 12px;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  transition: transform .15s, box-shadow .2s, border-color .2s;
}
.download-card:hover, .download-card:active {
  border-color: var(--primary-light);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(30, 107, 220, .15);
}
.dl-icon {
  width: 48px; height: 48px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  flex-shrink: 0;
}
.dl-info { flex: 1; text-align: left; }
.dl-name { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.dl-meta { font-size: 12px; color: var(--text-muted); }
.dl-arrow {
  font-size: 22px;
  color: var(--primary);
  margin-left: 8px;
}

/* === 页脚 === */
.footer {
  text-align: center;
  padding: 24px 20px 40px;
  font-size: 12px;
  color: var(--text-light);
}

/* === Toast === */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, .82);
  color: #fff;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 9999;
  animation: toast-in .15s ease-out;
  max-width: 80%;
}
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, -45%); }
  to   { opacity: 1; transform: translate(-50%, -50%); }
}

/* === 字段级错误态 === */
.field input.invalid,
.field select.invalid,
.field textarea.invalid {
  border-color: var(--danger);
  background: #fef2f2;
}

/* === 后台页特有 === */
.admin-body {
  background: #eef2f8;
  min-height: 100vh;
}
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-box {
  background: #fff;
  padding: 32px 24px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  width: 100%;
  max-width: 380px;
}
.login-title {
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 4px;
}
.login-sub {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 24px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.toolbar select,
.toolbar button {
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
}
.toolbar select:focus { outline: none; border-color: var(--primary-light); }

.btn-export {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary) !important;
}
.btn-export:hover { background: var(--primary-light); }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.stat-card {
  background: #f0f6ff;
  border-radius: 8px;
  padding: 12px 14px;
}
.stat-num {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
}
.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.table-wrap {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  max-height: 65vh;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
  min-width: 1100px;
}
th, td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
th {
  background: #f8fafc;
  font-weight: 600;
  color: var(--text-muted);
  position: sticky;
  top: 0;
  z-index: 2;
}
tbody tr:hover { background: #f9fafb; }
td.industry-tag {
  background: #e6f0ff;
  color: var(--primary);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  text-align: center;
}

.admin-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
}
.admin-header-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-dark);
}
.admin-header-meta {
  font-size: 13px;
  color: var(--text-muted);
}
.admin-header-meta a, .admin-header-meta button {
  color: var(--danger);
  margin-left: 12px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 13px;
}

.admin-main {
  max-width: 1280px;
  margin: 20px auto;
  padding: 0 20px;
}
