/* 3D 打印成本报价系统 - 通用样式 */
* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: #222;
  background: #f5f6f8;
  line-height: 1.6;
}

a { color: #1b6ef3; text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  background: #1f2733;
  color: #fff;
}
.topbar .brand { font-weight: 600; letter-spacing: .5px; }
.topbar nav a { color: #cfd8e3; margin-left: 14px; font-size: 14px; }
.topbar nav a:hover { color: #fff; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 20px 16px 48px; }
.wrap.narrow { max-width: 640px; }

.card {
  background: #fff;
  border: 1px solid #e3e6ea;
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 16px;
}

h1 { font-size: 20px; margin: 0 0 14px; }
h2 { font-size: 17px; margin: 22px 0 10px; }
h3 { font-size: 15px; margin: 0 0 8px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { border-bottom: 1px solid #eceef1; padding: 9px 10px; text-align: left; vertical-align: middle; }
th { background: #fafbfc; font-weight: 600; color: #555; white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.total td { font-weight: 600; background: #f8fbf7; }

.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid #1b6ef3;
  background: #1b6ef3;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}
.btn:hover { text-decoration: none; opacity: .92; }
.btn.ghost { background: #fff; color: #1b6ef3; }
.btn.danger { background: #fff; border-color: #e04b4b; color: #e04b4b; }
.btn.sm { padding: 4px 10px; font-size: 13px; }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; font-size: 14px; }
.flash.error { background: #fdecec; border: 1px solid #f5c2c2; color: #a12b2b; }
.flash.ok { background: #ecf8ee; border: 1px solid #bfe3c6; color: #226b34; }

label { display: block; font-size: 13px; color: #555; margin-bottom: 4px; }
input[type=text], input[type=password], input[type=number], input[type=file], textarea, select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d5dae1;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}
select { height: 38px; }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: #1b6ef3; box-shadow: 0 0 0 3px rgba(27,110,243,.12);
}

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { margin-bottom: 12px; }
.hint { font-size: 12px; color: #8b94a1; margin-top: 3px; }
.row-actions { display: flex; gap: 12px; align-items: center; margin-top: 18px; }
.muted { color: #8b94a1; font-size: 13px; }
.mono { font-family: Consolas, Monaco, monospace; font-size: 12.5px; word-break: break-all; }
.inline-form { display: inline; }
.row-inline { display: flex; gap: 10px; align-items: center; margin: 10px 0 18px; flex-wrap: wrap; }
.row-inline input[type=text], .row-inline input[type=number] { flex: 1 1 160px; }
.inline-edit { display: flex; gap: 8px; align-items: center; }
.inline-edit input[type=text], .inline-edit input[type=number] { flex: 1 1 100px; }
.dur { display: flex; gap: 8px; }
.dur input[type=number] { flex: 1 1 auto; }
.dur select { flex: 0 0 84px; width: 84px; }

/* H5 报价页 */
.h5 { background: #f2f4f7; min-height: 100vh; }
.h5 .hero {
  background: linear-gradient(135deg, #1f2733, #33425a);
  color: #fff;
  padding: 26px 18px 24px;
}
.h5 .hero .tag { font-size: 12px; opacity: .7; letter-spacing: 1px; }
.h5 .hero h1 { font-size: 20px; margin: 6px 0 4px; color: #fff; }
.h5 .hero .spec { font-size: 13px; color: #c3ccd8; }
.h5 .hero .price {
  margin-top: 16px;
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -1px;
}
.h5 .hero .price small { font-size: 15px; font-weight: 400; margin-left: 4px; }
.h5 .hero .range { font-size: 13px; color: #c3ccd8; margin-top: 4px; }
.h5 .body { padding: 14px; }
.h5 .card { border-radius: 12px; }
.h5 .kv { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed #eceef1; font-size: 14px; }
.h5 .kv:last-child { border-bottom: none; }
.h5 .kv span:last-child { font-variant-numeric: tabular-nums; }
.h5 .foot { text-align: center; font-size: 12px; color: #98a1ae; padding: 10px 0 24px; }
.badge { display: inline-block; padding: 1px 7px; border-radius: 10px; font-size: 12px; background: #eef3ff; color: #1b6ef3; }
.badge.gray { background: #eef0f3; color: #6b7480; }
.badge.warn { background: #fff4e5; color: #a15c07; }

/* 图片 */
.thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 14px; }
.thumb {
  width: 120px;
  border: 1px solid #e3e6ea;
  border-radius: 8px;
  padding: 6px;
  background: #fafbfc;
  text-align: center;
}
.thumb img {
  width: 100%;
  height: 88px;
  object-fit: cover;
  border-radius: 5px;
  display: block;
  margin-bottom: 6px;
  background: #eef0f3;
}
.thumb form { margin: 0; }
.thumb-name {
  font-size: 11px;
  color: #8b94a1;
  line-height: 1.3;
  margin-bottom: 6px;
  word-break: break-all;
  max-height: 30px;
  overflow: hidden;
}

img.mini {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
  background: #eef0f3;
}
span.mini.none {
  display: inline-block;
  width: 52px;
  height: 52px;
  line-height: 52px;
  text-align: center;
  border-radius: 6px;
  background: #f1f3f5;
  color: #a6aeb8;
  font-size: 12px;
}

.h5 .gallery {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 0 12px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.h5 .gallery a { flex: 0 0 auto; scroll-snap-align: start; }
.h5 .gallery img {
  height: 230px;
  width: auto;
  max-width: 82vw;
  object-fit: cover;
  border-radius: 12px;
  background: #e8ebef;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
}

/* H5 分享列表 */
.search-bar { display: flex; gap: 8px; }
.search-bar input[type=search] {
  flex: 1;
  padding: 9px 12px;
  border-radius: 20px;
  border: none;
  font-size: 14px;
  font-family: inherit;
  background: rgba(255, 255, 255, .92);
}
.search-bar .btn { border-radius: 20px; background: #1b6ef3; border-color: #1b6ef3; }

.item-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
  color: #222;
}
.item-card:hover { text-decoration: none; box-shadow: 0 2px 10px rgba(0, 0, 0, .1); }
.item-thumb {
  width: 74px;
  height: 74px;
  flex: 0 0 74px;
  object-fit: cover;
  border-radius: 9px;
  background: #eef0f3;
}
.item-thumb.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #a6aeb8;
  font-size: 12px;
}
.item-main { flex: 1; min-width: 0; }
.item-name {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.item-sub { font-size: 12px; color: #8b94a1; margin-bottom: 6px; }
.item-price { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 12.5px; }
.price-cost { color: #8b94a1; }
.price-sell strong { color: #e8542f; font-size: 18px; }
.item-arrow { color: #c6ccd4; font-size: 22px; padding-left: 2px; }

/* H5 计算步骤 */
.step { padding: 10px 0; border-bottom: 1px dashed #eceef1; }
.step:last-child { border-bottom: none; }
.step-name { font-size: 14px; font-weight: 600; }
.step-formula {
  font-family: Consolas, Monaco, monospace;
  font-size: 12.5px;
  color: #1b6ef3;
  background: #f5f8ff;
  border-radius: 5px;
  padding: 3px 7px;
  display: inline-block;
  margin: 4px 0;
}
.step-sub { font-size: 13px; color: #555; }
.step.total .step-sub strong { font-size: 17px; color: #e8542f; }

@media (max-width: 720px) {
  .grid, .grid.three { grid-template-columns: 1fr; }
  .wrap { padding: 14px 12px 40px; }
  .hide-sm { display: none; }
  table { font-size: 13px; }
  th, td { padding: 8px 6px; }
}
