:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --bg: #eef1f6;
  --card: #ffffff;
  --text: #1f2937;
  --text-sub: #6b7280;
  --line: #e5e7eb;
  --green: #16a34a;
  --green-bg: #ecfdf5;
  --red: #dc2626;
  --red-bg: #fef2f2;
}

[v-cloak] { display: none; }
body.hidden { display: none; }

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  justify-content: center;
  min-height: 100vh;
}

/* 手机壳容器：移动端全宽，PC 上限制为手机宽度 */
.phone {
  width: 100%;
  max-width: 420px;
  min-height: 100vh;
  background: #f8fafc;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.12);
  position: relative;
  display: flex;
  flex-direction: column;
}

/* 顶部 banner */
.banner {
  position: relative;
  width: 100%;
  height: 180px;
  overflow: hidden;
  background: #334155;
}
.banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.banner-mask {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.05) 0%, rgba(15, 23, 42, 0.65) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 20px 20px 16px;
}
.banner-title {
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}
.banner-sub {
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  margin-top: 4px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Tab 栏 */
.tabs {
  display: flex;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.tab {
  flex: 1;
  text-align: center;
  padding: 14px 0;
  font-size: 15px;
  color: var(--text-sub);
  cursor: pointer;
  position: relative;
  user-select: none;
}
.tab.active {
  color: var(--primary);
  font-weight: 600;
}
.tab.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 32px;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--primary);
}

/* 内容区 */
.content {
  padding: 16px;
  flex: 1;
}

/* 表单卡片 */
.form-card {
  background: var(--card);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.field-label {
  font-size: 14px;
  color: var(--text);
  margin-bottom: 8px;
  font-weight: 500;
}
.field-label .hint {
  font-weight: 400;
  font-size: 12px;
  color: var(--text-sub);
}
.input {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 14px;
  font-size: 15px;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.input::placeholder { color: #9ca3af; }

.btn {
  width: 100%;
  height: 46px;
  border: none;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 14px;
  transition: background .15s;
}
.btn:active { background: var(--primary-dark); }

.error-text {
  color: var(--red);
  font-size: 12px;
  margin-top: 8px;
  display: none;
}
.error-text.show { display: block; }

/* 编号分段输入 */
.code-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
}
.code-seg {
  height: 54px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
  user-select: none;
}
.code-seg.letters { flex: 0 0 72px; }
.code-seg.digits { flex: 1; }
.code-seg.placeholder { color: #9ca3af; font-weight: 400; font-size: 14px; letter-spacing: 0; }
.code-seg.active { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
.code-dash { font-size: 22px; color: var(--text-sub); font-weight: 600; }

/* 虚拟键盘 */
.kb-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  z-index: 100;
  display: none;
  align-items: flex-end;
  justify-content: center;
}
.kb-mask.show { display: flex; }
.kb-panel {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 16px 16px 0 0;
  padding: 12px 12px 20px;
  animation: kb-up .2s ease;
}
@keyframes kb-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.kb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 10px;
}
.kb-title { font-size: 14px; font-weight: 600; color: var(--text); }
.kb-close {
  border: none;
  background: #f1f5f9;
  color: var(--text-sub);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.kb-close:active { background: #e2e8f0; }
.kb-grid { display: grid; gap: 8px; }
.kb-grid.letters { grid-template-columns: repeat(7, 1fr); }
.kb-grid.numbers { grid-template-columns: repeat(3, 1fr); }
.kb-key {
  height: 46px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}
.kb-key:active { background: #e2e8f0; }
.kb-key.fn { background: #eef2ff; color: var(--primary); font-size: 14px; }
.kb-key.fn:active { background: #dbeafe; }
.kb-key.span { grid-column: span 2; }

/* 结果区 */
.result-title {
  font-size: 13px;
  color: var(--text-sub);
  margin: 20px 0 10px;
}
.result-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.result-card {
  background: var(--card);
  border-radius: 14px;
  padding: 6px 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  overflow: hidden;
}
.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.result-book-name {
  font-size: 18px;
  font-weight: 700;
  flex: 1;
  margin-right: 10px;
}
.badge {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.badge.in { color: var(--green); background: var(--green-bg); }
.badge.out { color: var(--red); background: var(--red-bg); }

.row {
  display: flex;
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
}
.row:last-child { border-bottom: none; }
.row .key {
  width: 80px;
  flex-shrink: 0;
  color: var(--text-sub);
  font-size: 14px;
}
.row .value {
  flex: 1;
  font-size: 14px;
  color: var(--text);
  text-align: right;
  word-break: break-all;
}

.empty {
  background: var(--card);
  border-radius: 14px;
  padding: 40px 16px;
  text-align: center;
  color: var(--text-sub);
  font-size: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.empty .icon { font-size: 40px; margin-bottom: 10px; opacity: .6; }

.footnote {
  text-align: center;
  color: #9ca3af;
  font-size: 12px;
  padding: 16px 0 24px;
}
