/* 亮仔核对助手 · 网页版公共样式 */

:root {
  --blue: #2277dd;
  --blue-d: #1657a6;
  --green: #39b54a;
  --red: #dd3333;
  --purple: #9922bb;
  --bg: #f2f3f5;
  --card: #fff;
  --text: #1f2329;
  --muted: #8a8f99;
  --line: #e5e7eb;
  --r: 12px;
}

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}

/* ---------- 顶栏（网页版没有微信自带导航，自己做一条） ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px;
  padding-top: calc(14px + env(safe-area-inset-top));
  background: var(--blue);
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}

.topbar .back {
  color: #fff;
  text-decoration: none;
  font-size: 15px;
  font-weight: 400;
  opacity: 0.95;
  padding: 2px 6px 2px 0;
}

.topbar .back::before {
  content: "‹ ";
}

.topbar .title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 12px;
}

/* ---------- 卡片 ---------- */

.card {
  background: var(--card);
  border-radius: var(--r);
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.h {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 600;
}

.h.sub {
  font-size: 13.5px;
  font-weight: 400;
  color: var(--muted);
}

.tip {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

/* ---------- 按钮 ---------- */

.row {
  display: flex;
  flex-wrap: wrap;
  margin: 8px -4px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  margin: 4px;
  padding: 10px 14px;
  border: 0;
  border-radius: 9px;
  background: var(--blue);
  color: #fff;
  font: inherit;
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
}

.btn:active {
  filter: brightness(0.9);
}

.btn.sm {
  min-height: 34px;
  padding: 6px 10px;
  margin: 0;
  font-size: 13.5px;
}

.btn.red { background: var(--red); }
.btn.purple { background: var(--purple); }

.btn.ghost {
  background: #eef1f5;
  color: var(--text);
}

.btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.btn.on {
  background: var(--blue-d);
  box-shadow: inset 0 0 0 2px #fff;
}

.btn .sub {
  display: block;
  margin-top: 1px;
  font-size: 11px;
  font-weight: 400;
  opacity: 0.92;
}

.btn.pick {
  flex-direction: column;
  min-width: 118px;
}

/* ---------- 表单 ---------- */

input[type="text"],
input[type="number"],
input[type="search"],
input[type="password"],
textarea {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid #cbd0d6;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

textarea {
  width: 100%;
  resize: vertical;
  line-height: 1.6;
}

input[type="number"] { width: 74px; }
input.prefix { width: 92px; }

input:focus,
textarea:focus {
  border-color: var(--blue);
  outline: 2px solid rgba(34, 119, 221, 0.3);
  outline-offset: 1px;
}

/* ---------- 规格行 ---------- */

.cfg {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  margin: 8px 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.cfg label {
  margin-left: 6px;
  color: var(--muted);
  font-size: 13.5px;
}

.cfg .del {
  margin-left: auto;
}

/* ---------- 节号网格 ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
  margin-top: 10px;
}

.num {
  min-height: 44px;
  padding: 6px 2px;
  border: 0;
  border-radius: 8px;
  background: #eceef1;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  word-break: break-all;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
}

.num:active {
  filter: brightness(0.92);
}

.num.on {
  background: var(--green);
  color: #fff;
  font-weight: 600;
}

@media (max-width: 340px) {
  .grid { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- 首页入口 ---------- */

.entry {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 16px 14px;
  border-radius: var(--r);
  background: var(--card);
  color: var(--text);
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  touch-action: manipulation;
}

.entry:active {
  background: #eef4ff;
}

.entry .ico {
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #eef4ff;
  font-size: 22px;
}

.entry .txt {
  flex: 1;
  min-width: 0;
}

.entry .txt b {
  display: block;
  font-size: 16.5px;
}

.entry .txt small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12.5px;
}

.entry .arrow {
  color: #c2c6cc;
  font-size: 20px;
}

/* ---------- 空状态 ---------- */

.empty {
  padding: 28px 10px;
  color: var(--muted);
  font-size: 13.5px;
  text-align: center;
}

/* ---------- 提示条 ---------- */

.banner {
  margin-bottom: 12px;
  padding: 11px 13px;
  border: 1px solid #ffd591;
  border-radius: 10px;
  background: #fff7e6;
  color: #8a5a00;
  font-size: 13px;
  line-height: 1.6;
}

/* ---------- 技术标准查询 ---------- */

.searchbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.searchbar input {
  flex: 1;
  min-height: 44px;
  font-size: 15px;
}

.searchbar .btn {
  flex: 0 0 auto;
  margin: 0;
}

.std {
  margin-bottom: 10px;
  padding: 13px 14px;
  border-radius: var(--r);
  background: var(--card);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  touch-action: manipulation;
}

.std:active {
  background: #f7f9fc;
}

.std.open {
  border: 1px solid #cfe2fa;
  box-shadow: 0 2px 10px rgba(34, 119, 221, 0.14);
}

.std-code {
  color: var(--blue);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.std-name {
  margin-top: 3px;
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.4;
}

.std-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.tag {
  padding: 2px 8px;
  border-radius: 20px;
  background: #eef1f5;
  color: #5a6169;
  font-size: 11.5px;
}

.tag.ok {
  background: #e7f7ea;
  color: #1f7a33;
}

.tag.bad {
  background: #fdeaea;
  color: #b3261e;
}

.std-b {
  margin-top: 11px;
  padding-top: 11px;
  border-top: 1px solid var(--line);
}

.kv {
  display: flex;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 13.5px;
  line-height: 1.6;
}

.kv:last-child {
  margin-bottom: 0;
}

.kv b {
  flex: 0 0 62px;
  color: var(--muted);
  font-weight: 400;
}

.kv span {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

/* ---------- 标准管理（admin） ---------- */

.ed {
  margin-bottom: 12px;
  padding: 13px 14px;
  border-radius: var(--r);
  background: var(--card);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.ed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.ed-no {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.ed-tools {
  display: flex;
  gap: 6px;
}

.ed-tools .btn {
  min-width: 36px;
}

.f {
  display: block;
  margin-bottom: 9px;
}

.f:last-child {
  margin-bottom: 0;
}

.f > span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12.5px;
}

.f > span em {
  font-style: normal;
  opacity: 0.75;
}

.f input,
.f textarea {
  width: 100%;
}

.f2 {
  display: flex;
  gap: 9px;
}

.f2 .f {
  flex: 1;
  min-width: 0;
}

/* ---------- 轻提示 ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(40px + env(safe-area-inset-bottom));
  z-index: 50;
  padding: 10px 18px;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 14px;
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
