/* ── 全局 ─────────────────────────────────────── */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  background: #f5f6fa;
  color: #333;
  line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
  min-height: 100vh;
}

/* ── 标题 ─────────────────────────────────────── */
.header {
  text-align: center;
  padding: 20px 0 16px;
}

.header h1 {
  font-size: 22px;
  font-weight: 600;
  color: #2c3e50;
}

.header p {
  font-size: 13px;
  color: #7f8c8d;
  margin-top: 4px;
}

/* ── 卡片通用 ─────────────────────────────────── */
.card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: #555;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ── 扫码区域 ─────────────────────────────────── */
#reader {
  width: 100% !important;
  border: none !important;
}

#reader video {
  border-radius: 8px;
}

#reader__dashboard_section_csr span {
  font-size: 12px !important;
}

.scan-hint {
  font-size: 12px;
  color: #e67e22;
  text-align: center;
  margin-top: 8px;
  line-height: 1.5;
}

/* ── 手动输入 ─────────────────────────────────── */
.input-group {
  display: flex;
  gap: 8px;
}

.input-group input {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}

.input-group input:focus {
  border-color: #3498db;
}

.btn {
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-primary {
  background: #3498db;
  color: #fff;
}

.btn-primary:active {
  background: #2980b9;
}

.btn-success {
  background: #27ae60;
  color: #fff;
}

.btn-success:active {
  background: #219a52;
}

.btn-secondary {
  background: #ecf0f1;
  color: #555;
}

.btn-secondary:active {
  background: #d5dbdb;
}

.btn-block {
  width: 100%;
  margin-top: 10px;
}

/* ── 结果展示 ─────────────────────────────────── */
.result-card {
  display: none;
  border-left: 4px solid #27ae60;
}

.result-card.error {
  border-left-color: #e74c3c;
}

.result-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
}

.result-item:last-child {
  border-bottom: none;
}

.result-label {
  font-size: 14px;
  color: #7f8c8d;
}

.result-value {
  font-size: 16px;
  font-weight: 600;
  color: #2c3e50;
  font-family: "SF Mono", Monaco, monospace;
}

.result-value.highlight {
  color: #e74c3c;
  font-size: 20px;
}

.result-doc-id {
  font-size: 12px;
  color: #95a5a6;
  margin-bottom: 10px;
  word-break: break-all;
}

/* ── 状态提示 ─────────────────────────────────── */
.status-msg {
  text-align: center;
  padding: 40px 20px;
  color: #7f8c8d;
}

.status-msg .icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.status-msg p {
  font-size: 14px;
}

/* ── 加载动画 ─────────────────────────────────── */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── 页脚 ─────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 20px;
  font-size: 11px;
  color: #bdc3c7;
}

/* ── 动画 ─────────────────────────────────────── */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.3s ease-out;
}
