/* 收货信息本 · 暖橙浅色主题 */

* { box-sizing: border-box; margin: 0; padding: 0; }

/* 关键：hidden 属性必须压过 display:flex 等类样式，否则弹窗会一直显示 */
[hidden] { display: none !important; }

:root {
  --primary: #e1761f;          /* 主色：暖橙 */
  --primary-dark: #c25f10;
  --primary-light: #fff2e6;    /* 浅橙底 */
  --text: #2f2620;             /* 暖黑 */
  --muted: #9a8a7b;
  --line: #f3e7da;
  --bg: #fbf5ef;               /* 暖米白 */
  --card: #fffdfb;
  --danger: #c94b3f;
  --ok: #3f8b5a;
  --ok-light: #e9f4ec;
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; cursor: pointer; }

/* ---------- 顶栏 ---------- */
.topbar {
  background: linear-gradient(135deg, #eda04f 0%, #e1761f 55%, #d1670e 100%);
  color: #fff;
  padding: 14px 16px;
}
.topbar-inner {
  max-width: 720px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
}
.title { font-size: 17px; font-weight: 600; letter-spacing: .5px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.state-tag {
  font-size: 12px; padding: 2px 10px; border-radius: 6px;
  background: rgba(255,255,255,.22); color: #fff;
}
.state-tag.unlocked { background: #fff4e2; color: #a95a10; font-weight: 600; }
.admin-btn {
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.65);
  color: #fff; border-radius: 999px; padding: 4px 14px; font-size: 13px;
}
.admin-btn:active { background: rgba(255,255,255,.22); }
.icon-btn {
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.5);
  color: #fff; border-radius: 999px; padding: 3px 10px; font-size: 12px;
}
.icon-btn:active { background: rgba(255,255,255,.22); }

/* ---------- 页面 ---------- */
.page { max-width: 720px; margin: 0 auto; padding: 14px 16px calc(120px + env(safe-area-inset-bottom)); }

/* 提示条 */
.banner {
  background: #fff6e8; border: 1px solid #f6ddb8; color: #9a5a12;
  border-radius: 12px; padding: 12px 14px; font-size: 13px; line-height: 1.6;
  margin-bottom: 12px;
}
.banner.error { background: #fdecea; border-color: #f2c9c4; color: #a8382c; }

/* ---------- 搜索 ---------- */
.search-wrap {
  display: flex; align-items: center; background: var(--card); border-radius: 999px;
  padding: 0 16px; height: 44px; box-shadow: 0 1px 8px rgba(190,140,90,.10);
}
.search-icon { font-size: 14px; opacity: .55; margin-right: 8px; }
.search-input { flex: 1; border: none; outline: none; font-size: 15px; background: transparent; color: var(--text); }
/* 隐藏浏览器原生搜索清除按钮，避免出现两个 ✕（保留页面自定义的 ✕） */
.search-input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }
.search-input::placeholder { color: #c3b3a4; }
.search-clear { border: none; background: transparent; color: #c3b3a4; font-size: 15px; padding: 4px 6px; }

/* ---------- 筛选 chips ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; border: none; background: var(--card); color: #7d6b5b;
  border-radius: 999px; padding: 7px 16px; font-size: 13px;
  box-shadow: 0 1px 6px rgba(190,140,90,.08);
}
.chip.on { background: var(--primary); color: #fff; font-weight: 500; }

.count-line { font-size: 12px; color: var(--muted); padding: 6px 2px 10px; }

/* ---------- 列表 ---------- */
.list { display: flex; flex-direction: column; gap: 10px; }
.card {
  background: var(--card); border-radius: 14px; padding: 14px 16px;
  box-shadow: 0 1px 8px rgba(190,140,90,.09); cursor: pointer;
  border: 1px solid #f7ece0;
}
.card:active { background: #fdf8f3; }

/* 骨架屏：等数据时的占位卡片 */
.sk-card { cursor: default; pointer-events: none; }
.sk {
  display: block; border-radius: 6px;
  background: linear-gradient(90deg, #f4ece2 25%, #faf4ec 37%, #f4ece2 63%);
  background-size: 400% 100%;
  animation: sk-shimmer 1.2s ease-in-out infinite;
}
.sk-avatar { width: 38px; height: 38px; border-radius: 12px; flex-shrink: 0; }
.sk-line { height: 13px; margin-bottom: 6px; }
.sk-sm { height: 10px; }
.sk-pill { width: 52px; height: 20px; border-radius: 999px; flex-shrink: 0; }
@keyframes sk-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}
.card-head { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 38px; height: 38px; border-radius: 12px; flex-shrink: 0;
  background: var(--primary-light); color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 600;
}
.card-main { flex: 1; min-width: 0; }
.card-name { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-city { font-size: 12px; color: var(--muted); margin-top: 1px; }

/* 定位图标（地址针） */
.ico-pin {
  width: 13px; height: 13px; vertical-align: -2px;
  color: #8a7a6c;
}
.city-line .ico-pin { width: 14px; height: 14px; vertical-align: -2.5px; }

/* 可收货 / 不收货 状态标记 */
.pill { font-size: 11px; padding: 3px 9px; border-radius: 999px; flex-shrink: 0; font-weight: 500; }
.pill-open { background: var(--ok-light); color: var(--ok); }
.pill-off { background: #f4efea; color: #a2928a; }

.card-sub {
  font-size: 12.5px; color: var(--muted); margin-top: 8px;
  padding-left: 48px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.card-admin { display: flex; gap: 16px; margin-top: 10px; padding-left: 48px; }
.card-admin button { border: none; background: transparent; font-size: 13px; color: var(--primary); padding: 2px 0; }
.card-admin button.danger { color: var(--danger); }

/* 空态 */
.empty { text-align: center; color: var(--muted); font-size: 14px; padding: 80px 24px; line-height: 1.8; }

/* 悬浮新增 */
.fab {
  position: fixed; right: 20px; bottom: calc(28px + env(safe-area-inset-bottom));
  width: 54px; height: 54px; border-radius: 50%; border: none;
  background: linear-gradient(135deg, #f0943a, #d96a12); color: #fff; font-size: 28px; line-height: 1;
  box-shadow: 0 8px 20px rgba(217,106,18,.35);
}
.fab:active { background: var(--primary-dark); }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(47,38,32,.45);
  display: flex; align-items: flex-end; justify-content: center; z-index: 50;
}
@media (min-width: 560px) { .modal-mask { align-items: center; } }
.modal {
  position: relative; background: #fffdfb; width: 100%; max-width: 560px;
  border-radius: 20px 20px 0 0; padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  max-height: 88vh; overflow-y: auto;
}
@media (min-width: 560px) { .modal { border-radius: 20px; } }
.modal-title { font-size: 17px; font-weight: 600; }
.modal-sub { font-size: 13px; color: var(--muted); margin-top: 6px; }
.modal-actions { display: flex; gap: 12px; margin-top: 18px; }
.modal-close {
  position: absolute; top: 10px; right: 10px; border: none;
  width: 32px; height: 32px; border-radius: 50%;
  background: #f2e9de; color: #5d4c3e; font-size: 15px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  z-index: 2; box-shadow: 0 1px 5px rgba(47, 38, 32, .15);
}
.modal-close:active { background: #e7dac9; color: #2f2620; }

/* 按钮 */
.btn { flex: 1; border: none; border-radius: 999px; padding: 11px 0; font-size: 15px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:active { background: var(--primary-dark); }
.btn-plain { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
.btn-danger { background: #fff; color: var(--danger); border: 1px solid #f0c4c9; }

/* 口令 */
.pwd-input {
  width: 100%; height: 44px; border: 1px solid #ecdccb; border-radius: 10px;
  padding: 0 14px; font-size: 15px; margin-top: 16px; outline: none;
}
.pwd-input:focus { border-color: var(--primary); }
.pwd-error { color: var(--danger); font-size: 12px; margin-top: 8px; }

/* 表单 */
.modal-form { padding-bottom: 0; }
.form { margin-top: 12px; }
.form-row { display: flex; align-items: center; min-height: 46px; border-bottom: 1px solid var(--line); }
.form-label { width: 66px; flex-shrink: 0; font-size: 14px; color: #7d6b5b; }
.req { color: var(--danger); font-style: normal; }
.form-input {
  flex: 1; border: none; outline: none; font-size: 15px; color: var(--text);
  text-align: right; background: transparent; min-width: 0;
}
.form-input::placeholder { color: #c3b3a4; }
.privacy-tip { font-size: 12px; color: var(--muted); margin-top: 14px; line-height: 1.6; }

/* ---------- 详情：状态条 ---------- */
.status-banner {
  border-radius: 14px; padding: 14px 16px; margin-bottom: 14px; color: #fff;
}
.status-banner.sb-open { background: linear-gradient(135deg, #4d9a67, #357d4f); }
.status-banner.sb-closed { background: linear-gradient(135deg, #c48a5a, #a86f45); }
.sb-title { font-size: 18px; font-weight: 700; letter-spacing: .5px; }
.sb-sub { font-size: 12.5px; opacity: .92; margin-top: 3px; }

/* ---------- 详情：标题与城市 ---------- */
.detail-head { display: flex; align-items: center; gap: 10px; padding-right: 30px; flex-wrap: wrap; }
.detail-head .modal-title { font-size: 18px; }
.city-line { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

/* ---------- 详情：收货时间卡 ---------- */
.time-card {
  background: var(--card); border: 1px solid #f5e8da; border-radius: 14px;
  padding: 6px 14px 14px; margin-top: 14px;
}
.t-row { display: flex; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.t-row:last-of-type { border-bottom: none; }
.t-label { width: 66px; flex-shrink: 0; font-size: 13px; color: var(--muted); }
.t-value { flex: 1; font-size: 14.5px; font-weight: 500; }
.t-value.t-ok { color: var(--ok); }
.t-value.t-no { color: #b07a5a; }

/* 七天日历条 */
.week-strip { display: flex; gap: 6px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; }
.week-strip::-webkit-scrollbar { display: none; }
.ws-day {
  flex: 1; min-width: 52px; background: var(--ok-light); border-radius: 10px;
  padding: 7px 4px; text-align: center;
}
.ws-day.ws-off { background: #f5f0eb; }
.ws-dow { font-size: 11.5px; font-weight: 600; color: #3f6b4e; }
.ws-off .ws-dow { color: #a89a8e; }
.ws-date { font-size: 10px; color: var(--muted); line-height: 1.5; }
.ws-text { font-size: 10.5px; color: #3f6b4e; margin-top: 2px; }
.ws-off .ws-text { color: #b3a598; }

/* ---------- 详情：要求卡片 ---------- */
.detail-reqs { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.req-card {
  background: var(--card); border-radius: 14px; padding: 12px 14px;
  border: 1px solid #f5e8da;
}
.req-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2px; }
.req-card-title {
  font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 6px;
  background: var(--primary-light); color: #b0600f;
}
.req-cold .req-card-title { background: #e8f2fa; color: #23668f; }
.req-nar .req-card-title { background: #f7ecf4; color: #8a4a72; }
.req-line { font-size: 14px; padding: 8px 0; border-bottom: 1px dashed var(--line); line-height: 1.6; }
.req-line:last-child { border-bottom: none; }
.req-line.hot { color: #c0392b; font-weight: 600; }

/* 要求编辑块 */
.req-editor { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.req-block { border-radius: 12px; padding: 10px 12px; border-left: 3px solid transparent; }
.req-gen { background: #fdf6ee; border-left-color: #d99a5b; }
.req-cold { background: #f2f8fc; border-left-color: #4d8db3; }
.req-nar { background: #fbf3f8; border-left-color: #a56c8e; }
.req-title { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.req-gen .req-title { color: #a9631c; }
.req-cold .req-title { color: #23668f; }
.req-nar .req-title { color: #8a4a72; }
.req-textarea {
  width: 100%; border: none; outline: none; resize: none; min-height: 60px;
  font-size: 14px; line-height: 1.7; color: var(--text); font-family: inherit;
  background: transparent;
}
.req-textarea::placeholder { color: #bfae9e; }

/* 要求徽章 */
.badges { display: flex; gap: 6px; margin-top: 8px; padding-left: 48px; flex-wrap: wrap; }
.badge { font-size: 11px; padding: 2px 9px; border-radius: 6px; }
.badge-gen { background: #fdf1e3; color: #a9631c; }
.badge-cold { background: #e8f2fa; color: #23668f; }
.badge-nar { background: #f7ecf4; color: #8a4a72; }

.d-time { font-size: 12px; margin-top: 12px; }
.muted { color: var(--muted); }

/* ---------- 统计看板 ---------- */
.stats-body { margin-top: 14px; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-cell {
  background: var(--primary-light); border-radius: 12px; padding: 12px 14px;
}
.stat-num { font-size: 22px; font-weight: 700; color: var(--primary); line-height: 1.3; }
.stat-label { font-size: 12px; color: #9a7350; margin-top: 2px; }
.stat-section { margin-top: 18px; }
.stat-section-title { font-size: 13px; font-weight: 600; color: #6b5948; margin-bottom: 9px; }
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; font-size: 13px; }
.bar-name { width: 92px; flex-shrink: 0; color: #7d6b5b; }
.bar-track { flex: 1; height: 8px; background: #f6ece2; border-radius: 999px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: linear-gradient(90deg, #f3ab63, #e1761f); border-radius: 999px; }
.bar-num { width: 26px; text-align: right; color: var(--muted); font-size: 12px; }
.stats-tip { font-size: 12px; margin-top: 16px; line-height: 1.6; }

/* ---------- 编辑人员账号 ---------- */
.user-list { margin-top: 12px; }
.u-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 0; border-bottom: 1px solid var(--line);
}
.u-main { flex: 1; min-width: 0; }
.u-name { font-size: 14.5px; font-weight: 500; }
.u-pwd { font-size: 12px; color: var(--muted); margin-top: 1px; }
.u-acts { display: flex; gap: 10px; flex-shrink: 0; }
.u-acts button { border: none; background: transparent; color: var(--primary); font-size: 12px; padding: 2px 0; }
.u-acts button.danger { color: var(--danger); }
.user-add-btn { margin-top: 16px; width: 100%; }

/* ---------- 批量导入导出 ---------- */
.tool-group { margin-top: 16px; }
.tool-title { font-size: 13px; font-weight: 600; color: #6b5948; margin-bottom: 8px; }
.tool-btn {
  display: block; width: 100%; text-align: left;
  background: var(--primary-light); color: #a95a10;
  border: none; border-radius: 10px; padding: 11px 14px;
  font-size: 14px; margin-bottom: 8px;
}
.tool-btn:active { background: #ffe9d2; }
.tool-btn-primary { background: var(--primary); color: #fff; }
.tool-btn-primary:active { background: var(--primary-dark); }
.tool-steps {
  margin: 0 0 10px 18px; font-size: 12.5px; color: var(--muted); line-height: 1.8;
}
.tool-result {
  margin-top: 6px; font-size: 13px; color: #6b5948;
  background: var(--ok-light); border-radius: 10px; padding: 10px 12px; line-height: 1.6;
}

/* 轻提示 */
.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%);
  background: rgba(47,38,32,.88); color: #fff; font-size: 13px;
  padding: 9px 18px; border-radius: 999px; z-index: 99; white-space: nowrap;
}
