/* ===== 甘肃模具平台 在线下单系统 - 全局样式 ===== */

* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #1f6feb;
  --primary-dark: #1656b8;
  --bg: #f4f6f9;
  --card-bg: #ffffff;
  --text: #1f2329;
  --text-light: #6b7280;
  --border: #e5e7eb;
  --danger: #e5484d;
  --radius: 12px;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* ---------- 顶部栏 ---------- */
.topbar {
  background: linear-gradient(135deg, #1f6feb, #1656b8);
  color: #fff;
  padding: 18px 16px 16px;
  text-align: center;
}
.topbar .brand { font-size: 19px; font-weight: 700; letter-spacing: .5px; }
.topbar .sub { font-size: 12px; opacity: .9; margin-top: 4px; }

/* ---------- 下单页 ---------- */
.page-order .container {
  max-width: 640px;
  margin: 0 auto;
  padding: 14px 14px 40px;
}
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.card-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
  padding-left: 8px;
  border-left: 3px solid var(--primary);
}
.req { color: var(--danger); }

/* 类型卡片 */
.type-cards { display: flex; gap: 10px; }
.type-card { flex: 1; position: relative; cursor: pointer; }
.type-card input { position: absolute; opacity: 0; }
.tc-inner {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 8px;
  text-align: center;
  transition: all .2s;
}
.tc-icon { font-size: 26px; }
.tc-name { font-size: 15px; font-weight: 600; margin-top: 6px; }
.tc-desc { font-size: 11px; color: var(--text-light); margin-top: 2px; }
.type-card input:checked + .tc-inner {
  border-color: var(--primary);
  background: #eef4ff;
}

/* 分段选择 */
.seg {
  display: flex;
  background: #f0f2f5;
  border-radius: 8px;
  padding: 3px;
}
.seg-item {
  flex: 1; text-align: center; padding: 8px 0;
  font-size: 14px; cursor: pointer; border-radius: 6px;
  transition: all .2s; color: var(--text-light);
}
.seg-item input { display: none; }
.seg-item:has(input:checked) {
  background: #fff; color: var(--primary); font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

/* 字段 */
.field { margin-bottom: 12px; }
.field:last-child { margin-bottom: 0; }
.field label {
  display: block; font-size: 13px; color: var(--text-light);
  margin-bottom: 6px;
}
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 12px; font-size: 15px;
  border: 1px solid var(--border); border-radius: 8px;
  background: #fff; outline: none; transition: border-color .2s;
  font-family: inherit;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--primary);
}
.field textarea { resize: vertical; }

/* 文件上传 */
.file-wrap { position: relative; }
.file-wrap input[type=file] {
  padding: 9px; font-size: 13px;
}
.file-tip { font-size: 12px; color: var(--text-light); margin-top: 6px; }

/* 提交按钮 */
.btn-submit {
  display: block; width: 100%; padding: 14px;
  background: var(--primary); color: #fff; border: none;
  border-radius: var(--radius); font-size: 16px; font-weight: 600;
  cursor: pointer; transition: background .2s;
  text-decoration: none; text-align: center;
}
.btn-submit:hover, .btn-submit:active { background: var(--primary-dark); }
.btn-submit:disabled { background: #9bb6e0; cursor: not-allowed; }
.btn-block { display: block; width: 100%; }
.agree { text-align: center; font-size: 12px; color: var(--text-light); margin-top: 12px; }

/* Toast */
.toast {
  position: fixed; left: 50%; top: 30%; transform: translate(-50%, -50%);
  background: rgba(0,0,0,.82); color: #fff; padding: 12px 20px;
  border-radius: 8px; font-size: 14px; opacity: 0; pointer-events: none;
  transition: opacity .25s; z-index: 999; max-width: 80%; text-align: center;
}
.toast.show { opacity: 1; }

/* 成功页 */
.success-box { text-align: center; padding: 24px 0; }
.success-icon { font-size: 56px; }
.success-box h2 { font-size: 20px; margin: 12px 0 8px; }
.success-tip { font-size: 14px; color: var(--text-light); margin-bottom: 18px; }
.order-card {
  background: #fff; border-radius: var(--radius); padding: 16px;
  text-align: left; box-shadow: 0 1px 3px rgba(0,0,0,.04); margin-bottom: 18px;
}
.order-card .row {
  display: flex; justify-content: space-between; padding: 8px 0;
  border-bottom: 1px solid var(--border); font-size: 14px;
}
.order-card .row:last-child { border-bottom: none; }
.order-card .row span { color: var(--text-light); }
.success-note { font-size: 12px; color: var(--text-light); margin-bottom: 20px; }

/* ---------- 后台 ---------- */
.page-admin { background: var(--bg); min-height: 100vh; }
.login-box {
  max-width: 360px; margin: 8vh auto 0; background: #fff;
  padding: 32px 28px; border-radius: 16px; box-shadow: 0 4px 20px rgba(0,0,0,.06);
}
.login-box h2 { text-align: center; font-size: 20px; margin-bottom: 24px; }
.login-box h2 small { font-size: 13px; color: var(--text-light); font-weight: 400; display: block; margin-top: 6px; }
.alert { padding: 10px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 14px; }
.alert-error { background: #fdeaea; color: var(--danger); }

/* 后台顶栏 */
.admin-topbar {
  background: #fff; border-bottom: 1px solid var(--border);
  padding: 0 20px; display: flex; align-items: center; justify-content: space-between;
  height: 56px; position: sticky; top: 0; z-index: 50;
}
.admin-topbar .title { font-size: 16px; font-weight: 700; }
.admin-topbar .title small { font-size: 12px; color: var(--text-light); font-weight: 400; margin-left: 8px; }
.admin-topbar .actions a {
  font-size: 13px; color: var(--text-light); text-decoration: none; margin-left: 16px;
}
.admin-topbar .actions a:hover { color: var(--primary); }

.admin-wrap { max-width: 1180px; margin: 0 auto; padding: 20px; }

/* 筛选栏 */
.filter-bar {
  background: #fff; border-radius: var(--radius); padding: 14px;
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px;
}
.filter-bar select, .filter-bar input {
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; outline: none; font-family: inherit;
}
.filter-bar input[type=text] { flex: 1; min-width: 160px; }
.btn {
  padding: 8px 14px; border: none; border-radius: 8px; font-size: 14px;
  cursor: pointer; text-decoration: none; display: inline-block;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-outline { background: #fff; border: 1px solid var(--border); color: var(--text); }
.btn-success { background: #2ba471; color: #fff; }
.btn-danger { background: #fff; border: 1px solid #f3c4c5; color: var(--danger); }

/* 表格 */
.table-card { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
  background: #f7f8fa; text-align: left; padding: 12px 14px;
  font-weight: 600; color: var(--text-light); border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td { padding: 12px 14px; border-bottom: 1px solid var(--border); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafbfc; }
.tag { display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 12px; }
.tag-新订单 { background: #eef4ff; color: var(--primary); }
.tag-已联系 { background: #fff7e6; color: #d48806; }
.tag-加工中 { background: #e6f7ff; color: #096dd9; }
.tag-已完成 { background: #e8f8ef; color: #2ba471; }
.tag-已取消 { background: #f5f5f5; color: #999; }
.empty { text-align: center; padding: 50px 0; color: var(--text-light); }

/* 分页 */
.pager { display: flex; gap: 8px; justify-content: center; padding: 20px 0; flex-wrap: wrap; }
.pager a, .pager span {
  padding: 7px 12px; border-radius: 8px; font-size: 14px; text-decoration: none;
  border: 1px solid var(--border); color: var(--text);
}
.pager a:hover { background: #f0f2f5; }
.pager .cur { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 详情页 */
.detail-head {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px;
}
.detail-head h2 { font-size: 18px; }
.detail-head .no { color: var(--text-light); font-size: 13px; }
.detail-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px;
  background: #fff; border-radius: var(--radius); padding: 20px 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04); margin-bottom: 16px;
}
.detail-item { display: flex; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.detail-item .k { width: 92px; color: var(--text-light); flex-shrink: 0; }
.detail-item .v { flex: 1; word-break: break-all; }
.detail-full { grid-column: 1 / -1; }
.detail-item:last-child { border-bottom: none; }
.detail-actions {
  background: #fff; border-radius: var(--radius); padding: 18px 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04); display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
}
.detail-actions form { display: inline-flex; gap: 8px; align-items: center; font-size: 14px; }
.detail-actions select, .detail-actions input {
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; font-family: inherit;
}
.note-box {
  background: #fff; border-radius: var(--radius); padding: 18px 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04); margin-top: 16px;
}
.note-box label { font-size: 14px; color: var(--text-light); display: block; margin-bottom: 8px; }
.note-box textarea { width: 100%; padding: 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; resize: vertical; font-family: inherit; }
.back-link { font-size: 14px; color: var(--text-light); text-decoration: none; }
.back-link:hover { color: var(--primary); }

@media (max-width: 640px) {
  .detail-grid { grid-template-columns: 1fr; gap: 0; }
  .admin-wrap { padding: 12px; }
  .filter-bar input[type=text] { min-width: 100%; }
  table { font-size: 13px; }
  thead th, tbody td { padding: 9px 10px; }
  .hide-sm { display: none; }
}

/* ===== SaaS: 平台首页商家列表 ===== */
.merchant-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px; max-width: 1180px; margin: 0 auto; padding: 20px;
}
.merchant-card {
  background: #fff; border-radius: 12px; padding: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06); transition: box-shadow .2s;
  text-decoration: none; color: var(--text); display: block;
}
.merchant-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.12); }
.merchant-card .mc-name { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.merchant-card .mc-cat { font-size: 12px; color: var(--primary); margin-bottom: 8px; }
.merchant-card .mc-desc { font-size: 13px; color: var(--text-light); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.merchant-card .mc-btn { margin-top: 12px; text-align: center; }

/* 首页统计横幅 */
.home-banner {
  background: linear-gradient(135deg, #c00e0e, #a00b0b); color: #fff;
  padding: 32px 16px; text-align: center;
}
.home-banner h1 { font-size: 24px; margin-bottom: 6px; }
.home-banner p { font-size: 14px; opacity: .9; margin-bottom: 20px; }
.home-stats { display: flex; gap: 24px; justify-content: center; flex-wrap: wrap; }
.home-stat { text-align: center; }
.home-stat .hs-num { font-size: 28px; font-weight: 700; }
.home-stat .hs-label { font-size: 12px; opacity: .85; margin-top: 2px; }

/* 商家详情页 */
.merchant-info { max-width: 800px; margin: 0 auto; padding: 20px; }
.merchant-info h2 { font-size: 22px; margin-bottom: 8px; }
.merchant-info .mi-cat { color: var(--primary); font-size: 14px; margin-bottom: 12px; }
.merchant-info .mi-profile { background: #fff; border-radius: 12px; padding: 20px; margin-bottom: 16px;
  line-height: 1.8; font-size: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.merchant-info .mi-contact { background: #fff; border-radius: 12px; padding: 20px; margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04); }

/* 数据看板 */
.dashboard-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px; max-width: 1180px; margin: 0 auto;
}
.dash-card {
  background: #fff; border-radius: 12px; padding: 24px; text-align: center;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.dash-num { font-size: 36px; font-weight: 700; color: var(--primary); }
.dash-label { font-size: 14px; color: var(--text-light); margin-top: 6px; }
.dash-card.green .dash-num { color: #2ba471; }
.dash-card.orange .dash-num { color: #d48806; }

/* 企业状态标签 */
.tag-待审核 { background: #fff7e6; color: #d48806; }
.tag-已通过 { background: #e8f8ef; color: #2ba471; }
.tag-已冻结 { background: #f5f5f5; color: #999; }
.tag-已驳回 { background: #fdeaea; color: var(--danger); }

/* 注册页 */
.register-box { max-width: 480px; margin: 4vh auto; background: #fff;
  border-radius: 16px; padding: 32px 28px; box-shadow: 0 4px 20px rgba(0,0,0,.06); }
.register-box h2 { text-align: center; font-size: 20px; margin-bottom: 6px; }
.register-box .sub { text-align: center; font-size: 13px; color: var(--text-light); margin-bottom: 24px; }
.alert-success { background: #e8f8ef; color: #2ba471; }

/* 设置页 */
.settings-grid { max-width: 700px; margin: 0 auto; }
.settings-section { background: #fff; border-radius: 12px; padding: 24px; margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.settings-section h3 { font-size: 16px; font-weight: 600; margin-bottom: 16px;
  padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.settings-section .hint { font-size: 12px; color: var(--text-light); margin-top: 6px; }
