/* 快递取件码 · 移动端极简样式（白底 / 主色 #07c160） */

:root {
  --green: #07c160;
  --green-dark: #06ad56;
  --green-soft: #eafaf1;
  --red: #e54d42;
  --red-soft: #fdecea;
  --text: #14181f;
  --sub: #8a8f99;
  --line: #eceef1;
  --page: #ffffff;
  --radius: 16px;
}

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

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--page);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Noto Sans CJK SC', 'Microsoft YaHei',
    system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom);
}

button,
input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  border: 0;
  background: none;
  cursor: pointer;
}

a {
  color: var(--green);
  text-decoration: none;
}

.hidden {
  display: none !important;
}

/* ------------------------------- 顶部区域 ------------------------------- */

.header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #fff;
  padding: calc(env(safe-area-inset-top) + 10px) 14px 0;
  border-bottom: 1px solid var(--line);
}

.idcode-row {
  display: flex;
  gap: 10px;
}

.idcode-btn {
  flex: 1;
  height: 52px;
  border-radius: 14px;
  background: var(--green);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  letter-spacing: 0.5px;
  transition: transform 0.08s ease, background 0.15s ease;
}

.idcode-btn:active {
  transform: scale(0.97);
  background: var(--green-dark);
}

.idcode-btn svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.tabs {
  display: flex;
  gap: 6px;
  background: #f4f5f7;
  border-radius: 12px;
  padding: 4px;
  margin: 12px 0 10px;
}

.tab {
  flex: 1;
  height: 36px;
  border-radius: 9px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--sub);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.tab.active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(20, 24, 31, 0.08);
}

.tab .count {
  font-size: 12px;
  font-weight: 600;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 20px;
  padding: 0 6px;
  min-width: 18px;
  text-align: center;
}

/* -------------------------------- 列表 -------------------------------- */

.list {
  padding: 12px 14px 16px;
  max-width: 620px;
  margin: 0 auto;
}

.foot {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--sub);
  padding: 6px 0 calc(100px + env(safe-area-inset-bottom));
}

.foot a {
  color: var(--sub);
  padding: 6px 4px;
}

.group-title {
  font-size: 13px;
  color: var(--sub);
  font-weight: 600;
  margin: 16px 2px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.group-title::before {
  content: '';
  width: 3px;
  height: 12px;
  border-radius: 2px;
  background: var(--green);
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px 16px 10px;
  margin-bottom: 10px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(20, 24, 31, 0.03);
}

.code {
  font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 46px;
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: 1.5px;
  word-break: break-all;
  user-select: all;
  transition: color 0.15s ease;
}

.code:active {
  color: var(--green);
}

.card.done .code {
  color: #c3c7ce;
  text-decoration: line-through;
  text-decoration-thickness: 3px;
}

.station {
  font-size: 17px;
  font-weight: 600;
  margin-top: 8px;
}

.meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 5px;
  font-size: 13px;
  color: var(--sub);
}

.badge-red {
  background: var(--red-soft);
  color: var(--red);
  border-radius: 6px;
  padding: 1px 7px;
  font-size: 12px;
  font-weight: 600;
}

.actions {
  display: flex;
  justify-content: flex-end;
  gap: 18px;
  border-top: 1px solid #f5f6f8;
  margin-top: 11px;
  padding: 9px 0 2px;
  font-size: 13.5px;
  color: var(--sub);
}

.actions button {
  padding: 2px 0;
  color: var(--sub);
}

.actions button.primary {
  color: var(--green);
  font-weight: 600;
}

.actions button.danger {
  color: var(--red);
}

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

.empty {
  text-align: center;
  color: var(--sub);
  padding: 70px 20px;
  font-size: 14px;
}

.empty .big {
  font-size: 40px;
  margin-bottom: 10px;
  opacity: 0.35;
}

/* -------------------------------- FAB -------------------------------- */

.fab {
  position: fixed;
  right: 18px;
  bottom: calc(22px + env(safe-area-inset-bottom));
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(7, 193, 96, 0.35);
  z-index: 30;
}

.fab:active {
  transform: scale(0.94);
}

.fab svg {
  width: 26px;
  height: 26px;
}

/* ------------------------------ 底部抽屉 ------------------------------ */

.sheet-mask {
  position: fixed;
  inset: 0;
  background: rgba(20, 24, 31, 0.4);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.sheet-mask.show {
  opacity: 1;
  pointer-events: auto;
}

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 41;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
  transform: translateY(102%);
  transition: transform 0.24s cubic-bezier(0.32, 0.72, 0, 1);
  max-height: 92vh;
  overflow-y: auto;
}

.sheet.show {
  transform: translateY(0);
}

.sheet h2 {
  font-size: 17px;
  margin: 0 0 14px;
  font-weight: 700;
}

.field {
  margin-bottom: 12px;
}

.field label {
  display: block;
  font-size: 13px;
  color: var(--sub);
  margin-bottom: 5px;
}

.input,
textarea.input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 11px 12px;
  font-size: 16px; /* 避免 iOS 聚焦放大 */
  background: #fafbfc;
  outline: none;
}

.input:focus,
textarea.input:focus {
  border-color: var(--green);
  background: #fff;
}

textarea.input {
  min-height: 84px;
  resize: vertical;
  line-height: 1.5;
}

.btn {
  height: 48px;
  border-radius: 12px;
  background: var(--green);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn:active {
  background: var(--green-dark);
}

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

.btn.danger {
  background: var(--red-soft);
  color: var(--red);
}

.btn:disabled {
  opacity: 0.55;
}

.btn-row {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.hint {
  font-size: 12.5px;
  color: var(--sub);
  line-height: 1.55;
  margin-top: 8px;
}

/* -------------------------------- 登录门 ------------------------------- */

.gate {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.gate-box {
  width: 100%;
  max-width: 340px;
}

.gate-logo {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--green);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  line-height: 1;
  margin-bottom: 16px;
}

.gate h1 {
  font-size: 21px;
  margin: 0 0 6px;
  font-weight: 700;
}

.gate p {
  color: var(--sub);
  font-size: 13.5px;
  margin: 0 0 20px;
}

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

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(8px);
  background: rgba(20, 24, 31, 0.86);
  color: #fff;
  font-size: 13.5px;
  padding: 9px 16px;
  border-radius: 10px;
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  max-width: 78vw;
  text-align: center;
}

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

.offline-tip {
  background: #fff8e6;
  color: #8a6d1f;
  font-size: 12.5px;
  text-align: center;
  padding: 6px 12px;
}

/* ------------------------------- 设置页 ------------------------------- */

.page {
  max-width: 620px;
  margin: 0 auto;
  padding: 0 0 90px;
}

.page-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(env(safe-area-inset-top) + 12px) 14px 10px;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 10;
  border-bottom: 1px solid var(--line);
}

.page-head h1 {
  font-size: 17px;
  margin: 0;
  font-weight: 700;
  flex: 1;
}

.back {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  background: #f4f5f7;
}

.section {
  padding: 16px 14px 4px;
}

.section-title {
  font-size: 13px;
  color: var(--sub);
  font-weight: 600;
  margin: 6px 2px 10px;
}

.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid #f5f6f8;
}

.row:last-child {
  border-bottom: 0;
}

.row .label {
  font-size: 15px;
}

.row .desc {
  font-size: 12.5px;
  color: var(--sub);
  margin-top: 3px;
  line-height: 1.5;
}

.row .value {
  color: var(--sub);
  font-size: 13.5px;
  text-align: right;
  word-break: break-all;
}

.tag {
  display: inline-block;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-weight: 600;
}

.tag.gray {
  background: #f4f5f7;
  color: var(--sub);
}

.card-box {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  background: #f7f8fa;
  border-radius: 9px;
  padding: 10px 12px;
  word-break: break-all;
  line-height: 1.6;
  white-space: pre-wrap;
}

.mini-btn {
  font-size: 13px;
  color: var(--green-dark);
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 8px;
  background: var(--green-soft);
  white-space: nowrap;
  flex: none;
}

.mini-btn.gray {
  color: var(--sub);
  background: #f4f5f7;
}

/* ------------------------------- 接入指引 ------------------------------- */

.step {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.step-no {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.step-body {
  flex: 1;
  min-width: 0;
}

.step-body h3 {
  font-size: 15px;
  margin: 0 0 6px;
  font-weight: 600;
}

.step-body p {
  font-size: 13.5px;
  color: #4b5563;
  margin: 0 0 8px;
  line-height: 1.65;
}

@media (prefers-color-scheme: dark) {
  /* 页面本身保持白底（按需求），只做一处防系统强制反色的兼容 */
  :root {
    color-scheme: light;
  }
}
