/* ==========================================================================
   data.iphubs.cn 订单查询后台
   配色取自录屏还原（原录像整体被压暗约 50%，已按 2 倍还原）：
   主色金棕 #c2a24b / 侧栏板岩 #3d424e / 支付成功橄榄 #8f9d3f / 金额金棕 #c8973f
   ========================================================================== */

:root {
  --gold: #c2a24b;
  --gold-dark: #b08f3c;
  --gold-soft: #f7f0da;
  --side: #3d424e;
  --side-deep: #363b46;
  --bg: #f4f5f7;
  --line: #e8e8e8;
  --line-soft: #f2f2f2;
  --text: #333;
  --text-2: #555;
  --muted: #999;
  --ok: #8f9d3f;
  --amount: #c8973f;
  --danger: #c0392b;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
}

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

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

/* ============================ 登录页 ============================ */
.login-view {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f7f7f7;
  z-index: 10;
}

.login-box {
  width: 360px;
  max-width: 80vw;
  display: flex;
  flex-direction: column;
  padding-bottom: 8vh;
}

.login-title {
  margin: 0 0 26px;
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 6px;
  text-align: center;
  color: var(--gold);
}

.lg-field {
  position: relative;
  height: 46px;
  margin-bottom: 18px;
}

.lg-field input {
  width: 100%;
  height: 100%;
  padding: 0 14px 0 50px;
  font-size: 15px;
  color: var(--text);
  background: #fff;
  border: 1px solid #e2e2e2;
  border-radius: 8px;
  outline: none;
  transition: border-color .15s;
}

.lg-field input::placeholder { color: #b9b9b9; }
.lg-field input:focus { border-color: var(--gold); }

.lg-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  color: var(--gold);
  pointer-events: none;
}

.lg-submit {
  height: 46px;
  margin-top: 10px;
  border: 0;
  border-radius: 6px;
  background: var(--gold);
  color: #fff;
  font-size: 16px;
  letter-spacing: 4px;
  transition: background .15s;
}

.lg-submit:hover { background: var(--gold-dark); }
.lg-submit:disabled { opacity: .7; cursor: default; }

.lg-error {
  min-height: 18px;
  margin: 10px 0 0;
  font-size: 13px;
  text-align: center;
  color: var(--danger);
}

/* ============================ 后台骨架 ============================ */
.app-view {
  display: flex;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.sidebar {
  width: 200px;
  flex: 0 0 auto;
  background: var(--side);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width .18s ease;
}

.app-view.collapsed .sidebar { width: 0; }

.side-title {
  flex: 0 0 auto;
  height: 50px;
  line-height: 50px;
  padding: 0 18px;
  font-size: 17px;
  color: #e9ecf1;
  letter-spacing: .5px;
  white-space: nowrap;
  background: var(--side-deep);
}

.side-nav { padding-top: 2px; }

.side-item {
  display: block;
  height: 46px;
  line-height: 46px;
  padding-left: 20px;
  font-size: 14px;
  color: rgba(255, 255, 255, .62);
  text-decoration: none;
  white-space: nowrap;
  transition: background .12s, color .12s;
}

.side-item:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.side-item.active { background: var(--gold); color: #fff; }

.main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
}

/* ---------------------------- 顶栏 ---------------------------- */
.topbar {
  flex: 0 0 auto;
  height: 50px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.burger {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  background: none;
  color: #444;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scenic-wrap { position: relative; }

.scenic-btn {
  height: 34px;
  max-width: 260px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  font-size: 13px;
  color: #666;
}

.scenic-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scenic-btn .chev { color: #aaa; flex: 0 0 auto; }

.scenic-panel {
  position: absolute;
  top: 40px;
  left: 0;
  width: 300px;
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 4px;
  box-shadow: 0 3px 14px rgba(0, 0, 0, .13);
  z-index: 60;
  overflow: hidden;
}

.scenic-search { border-bottom: 1px solid #f0f0f0; }

.scenic-search input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 0;
  outline: none;
  font-size: 13px;
  color: var(--text);
}

.scenic-search input::placeholder { color: #bbb; }

.scenic-list {
  margin: 0;
  padding: 6px 0;
  list-style: none;
  max-height: 260px;
  overflow-y: auto;
}

.scenic-list li {
  padding: 9px 12px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
}

.scenic-list li:hover { background: var(--gold-soft); }
.scenic-list li.active { color: var(--gold); }
.scenic-list li.empty { color: var(--muted); cursor: default; }

.topbar-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 18px;
}

.icon-btn {
  padding: 4px;
  border: 0;
  background: none;
  color: #555;
  display: flex;
  border-radius: 3px;
}

.icon-btn:hover { background: #f5f5f5; color: #111; }

.user-wrap { position: relative; }

.user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: none;
  font-size: 15px;
  color: var(--text);
}

.avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  background: #eee;
}

.caret { margin-left: 2px; }

.user-menu {
  position: absolute;
  top: 38px;
  right: 0;
  min-width: 116px;
  padding: 5px 0;
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 4px;
  box-shadow: 0 3px 14px rgba(0, 0, 0, .13);
  z-index: 60;
}

.user-menu button {
  display: block;
  width: 100%;
  padding: 9px 14px;
  border: 0;
  background: none;
  text-align: left;
  font-size: 13px;
  color: var(--text-2);
}

.user-menu button:hover { background: var(--gold-soft); color: var(--gold); }

/* ---------------------------- 内容区 ---------------------------- */
.content {
  flex: 1 1 auto;
  overflow: auto;
  background: #fff;
}

.page { padding-bottom: 40px; }

/* 首页 */
.dash-block { padding: 0 20px; }

.dash-h2 {
  margin: 18px 0 10px;
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
}

.dash-sub {
  margin-left: 8px;
  font-size: 12px;
  color: #9a9a9a;
  letter-spacing: 0.2px;
}

.dash-cards { display: flex; gap: 16px; }

.dash-card {
  flex: 1 1 0;
  min-height: 96px;
  padding: 16px 20px;
  background: #f7f7f7;
  border-radius: 2px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
}

.dc-label { font-size: 13px; color: #666; }

.dc-value {
  margin-top: 10px;
  font-size: 26px;
  line-height: 1.1;
  color: var(--text);
}

.qr-box { padding: 4px 0 10px; }

.qr-box img {
  display: block;
  width: 150px;
  height: 150px;
  border-radius: 2px;
  background: #f0f0f0;
}

.qr-caption {
  margin-top: 8px;
  font-size: 12px;
  color: #333;
  white-space: nowrap;
}

/* 筛选条 */
.filter-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px 20px 6px;
}

.f-label { font-size: 13px; color: var(--text-2); white-space: nowrap; }

.range-wrap { position: relative; }

.range-input {
  height: 34px;
  min-width: 300px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  font-size: 13px;
}

.range-input .cal { color: #bbb; flex: 0 0 auto; }
.range-input .ph { color: #b9b9b9; flex: 1 1 auto; text-align: center; }
.range-input .ph.filled { color: var(--text); }
.range-input em { color: #999; font-style: normal; flex: 0 0 auto; }
.range-wrap.open .range-input { border-color: var(--gold); }

.f-select {
  height: 34px;
  min-width: 160px;
  padding: 0 30px 0 10px;
  font-size: 13px;
  color: var(--text);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%23bbb' stroke-width='1.4'/%3E%3C/svg%3E") no-repeat right 10px center;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
}

.f-select:focus { border-color: var(--gold); }

.btn {
  height: 34px;
  padding: 0 18px;
  font-size: 13px;
  border-radius: 4px;
  border: 1px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
}

.btn-gold {
  background: var(--gold);
  border-color: var(--gold);
  color: #fff;
}

.btn-gold:hover { background: var(--gold-dark); border-color: var(--gold-dark); }

.btn-plain {
  background: #fff;
  border-color: #dcdcdc;
  color: #666;
}

.btn-plain:hover { color: var(--gold); border-color: var(--gold); }

.income-bar { padding: 6px 20px 12px; }

.income-text { font-size: 14px; color: var(--text); }
.income-text b { font-weight: 500; }

/* 分页条 */
.pager-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  padding: 9px 20px;
  background: #f7f7f7;
  font-size: 13px;
  color: var(--muted);
}

.pager-count { margin-right: 2px; }

.pager-size {
  height: 30px;
  padding: 0 26px 0 10px;
  font-size: 13px;
  color: #666;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%23bbb' stroke-width='1.4'/%3E%3C/svg%3E") no-repeat right 9px center;
  border: 1px solid #e2e2e2;
  border-radius: 4px;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
}

.pager-arrow,
.pager-item {
  min-width: 30px;
  height: 30px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 4px;
  background: #f0f0f0;
  color: #666;
  font-size: 13px;
}

.pager-arrow { background: none; color: #999; font-size: 15px; }

.pager-arrow:disabled { color: #d6d6d6; cursor: default; }
.pager-item:hover { color: var(--gold); }
.pager-item.active { background: var(--gold); color: #fff; }
.pager-item.active:hover { color: #fff; }

.pager-ellipsis { padding: 0 2px; color: #999; }

.pager-goto { display: flex; align-items: center; gap: 6px; color: var(--muted); }

.pager-goto input {
  width: 42px;
  height: 30px;
  padding: 0 4px;
  text-align: center;
  font-size: 13px;
  color: #333;
  background: #fff;
  border: 1px solid #e2e2e2;
  border-radius: 4px;
  outline: none;
}

.pager-goto input:focus { border-color: var(--gold); }

/* 表格 */
.table-title {
  margin: 16px 20px 12px;
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
}

.table-wrap { overflow-x: auto; }

.orders-table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 12px;
}

.orders-table th {
  padding: 10px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--line);
}

.orders-table td {
  padding: 12px 8px;
  color: var(--text-2);
  vertical-align: middle;
  border-bottom: 1px solid var(--line-soft);
  line-height: 1.45;
}

.orders-table tbody tr:hover td { background: #fafafa; }

.orders-table td.cell-index { color: var(--muted); text-align: center; }
.orders-table td.cell-openid { color: #8f8f8f; word-break: break-all; }
.orders-table td.cell-order { color: #777; word-break: break-all; }
.orders-table td.cell-time { color: #8f8f8f; word-break: normal; overflow-wrap: break-word; }
.orders-table td.cell-status { color: var(--ok); }
.orders-table td.cell-amount { color: var(--amount); font-weight: 600; }
.orders-table td.cell-op { color: var(--gold); }

.empty-cell {
  padding: 48px 0 !important;
  text-align: center;
  color: var(--muted);
}

/* 日期选择器 */
.cal-panel {
  position: absolute;
  top: 40px;
  left: 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 4px;
  box-shadow: 0 3px 16px rgba(0, 0, 0, .14);
}

.cal-months { display: flex; }

.cal-month { width: 244px; padding: 8px 14px 10px; }

.cal-month + .cal-month { border-left: 1px solid #f2f2f2; }

.cal-head {
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cal-title { font-size: 14px; color: var(--text); }

.cal-nav {
  padding: 0 4px;
  border: 0;
  background: none;
  color: #bbb;
  font-size: 14px;
  line-height: 1;
}

.cal-nav:hover:not(:disabled) { color: var(--gold); }
.cal-nav:disabled { color: #e6e6e6; cursor: default; }

.cal-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding: 4px 0 6px;
  font-size: 12px;
  color: #999;
  text-align: center;
  border-bottom: 1px solid #f2f2f2;
}

.cal-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  padding-top: 4px;
}

.cal-day {
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--text);
  border-radius: 50%;
  cursor: pointer;
}

.cal-day.out { color: #ccc; }
.cal-day:hover:not(.disabled) { background: #f5f5f5; }
.cal-day.between { background: var(--gold-soft); border-radius: 0; color: var(--gold-dark); }
.cal-day.selected { background: var(--gold); color: #fff; }
.cal-day.selected:hover { background: var(--gold); }
.cal-day.disabled { color: #e0e0e0; cursor: default; }

.cal-foot {
  display: flex;
  justify-content: flex-end;
  padding: 6px 14px 8px;
  border-top: 1px solid #f4f4f4;
}

.cal-clear {
  border: 0;
  background: none;
  font-size: 12px;
  color: #888;
}

.cal-clear:hover { color: var(--gold); }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 48px;
  transform: translateX(-50%);
  z-index: 999;
  padding: 9px 18px;
  border-radius: 4px;
  background: rgba(0, 0, 0, .78);
  color: #fff;
  font-size: 13px;
}

[hidden] { display: none !important; }

/* ============================ 小屏 / 手机 ============================ */
/* 手机遮罩：点空白处收起侧栏 */
.nav-mask {
  position: fixed;
  inset: 0;
  background: rgba(20, 22, 26, .38);
  z-index: 190;
}

/* 手机上提示表格可左右滑动 */
.table-hint {
  display: none;
  margin: 0 12px 8px;
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 820px) {
  html { -webkit-text-size-adjust: 100%; }
  body { overflow-x: hidden; }

  /* 侧栏改成抽屉：默认收起，点左上角三横线拉出，主区域占满屏幕 */
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 210px;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform .2s ease;
    box-shadow: 2px 0 14px rgba(0, 0, 0, .22);
    overflow-y: auto;
  }
  .app-view.mobile-nav .sidebar { transform: none; }
  .app-view.collapsed .sidebar { width: 210px; }

  .side-title { font-size: 15px; padding: 0 16px; }
  .side-item { font-size: 14px; padding-left: 18px; height: 46px; line-height: 46px; }

  .topbar { padding: 0 12px; gap: 10px; }
  .scenic-btn { max-width: 190px; font-size: 13px; }

  /* 查询条：日期一整行、状态一整行、三个按钮平分一行 */
  .filter-bar { padding: 12px 12px 6px; gap: 10px; }
  .range-wrap { flex: 1 1 100%; }
  .range-input { width: 100%; min-width: 0; }
  .f-select { flex: 1 1 100%; height: 38px; }
  .filter-bar .btn { flex: 1 1 0; min-width: 0; height: 38px; padding: 0 4px; font-size: 13px; }

  .income-bar { padding: 8px 12px 10px; }

  /* 表格：横向滑动看全部列 */
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
  }
  .orders-table { min-width: 1240px; font-size: 12px; }
  .orders-table td, .orders-table th { padding: 10px 8px; }
  .table-hint { display: block; }

  .dash-card { min-height: 82px; padding: 12px 14px; }
  .dc-value { font-size: 20px; }

  /* 日历在窄屏放不下双月，改成上下两月堆叠 */
  .cal-panel { top: 42px; width: auto; max-width: calc(100vw - 24px); }
  .cal-months { flex-wrap: wrap; justify-content: center; }
  .cal-month { width: 224px; padding: 6px 10px 8px; }
  .cal-month + .cal-month { border-left: 0; border-top: 1px solid #f2f2f2; }

  /* 分页在窄屏改成单行横向滚动，避免挤成三行 */
  .pager-bar {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    gap: 6px;
    padding: 9px 12px;
    -webkit-overflow-scrolling: touch;
  }
  .pager-count, .pager-size, .pager-arrow, .pager-item { flex: 0 0 auto; }
  .pager-goto { display: none; }
}

/* ============================ 手机（更窄） ============================ */
@media (max-width: 520px) {
  .topbar { padding: 0 10px; gap: 8px; }
  .scenic-btn { max-width: 150px; font-size: 12px; padding: 0 7px; }
  .topbar-right { gap: 8px; }
  #fsBtn { display: none; }
  .user-btn { font-size: 12px; gap: 4px; }
  .uname { max-width: 62px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .filter-bar { padding: 10px 10px 4px; gap: 9px; }
  .filter-bar .btn { font-size: 12.5px; height: 36px; }

  .income-bar { padding: 6px 10px 8px; }
  .table-title { margin: 14px 10px 8px; }
  .table-hint { margin: 0 10px 6px; }
  .dash-block { padding: 0 12px; }
  .dash-cards { gap: 10px; }
}
