/* ===========================================================
   创亿数码器材租赁 · Apple 风格设计系统
   =========================================================== */

:root {
  --blue:   #0071e3;
  --blue-d: #0077ed;
  --green:  #34c759;
  --orange: #ff9500;
  --red:    #ff3b30;
  --gray:   #86868b;
  --ink:    #1d1d1f;
  --line:   #d2d2d7;
  --bg:     #f5f5f7;
  --radius: 18px;
}

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
               "Helvetica Neue", "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "微软雅黑", sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.011em;
}

::selection { background: rgba(0,113,227,.18); }

/* ---------- 卡片 ---------- */
.card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid rgba(0,0,0,.05);
  box-shadow: 0 1px 2px rgba(0,0,0,.03), 0 4px 14px rgba(0,0,0,.03);
}
.card-hover { transition: transform .35s cubic-bezier(.28,.11,.32,1), box-shadow .35s cubic-bezier(.28,.11,.32,1); }
.card-hover:hover { transform: translateY(-2px); box-shadow: 0 2px 6px rgba(0,0,0,.05), 0 12px 32px rgba(0,0,0,.07); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 20px; border-radius: 980px;
  font-size: 14px; font-weight: 500; line-height: 1.2;
  cursor: pointer; border: 1px solid transparent; white-space: nowrap;
  transition: background-color .22s ease, color .22s ease, border-color .22s ease, opacity .22s ease, transform .12s ease;
  -webkit-tap-highlight-color: transparent; text-decoration: none;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-d); }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: #fafafa; border-color: #b9b9bf; }
.btn-soft { background: rgba(0,113,227,.08); color: var(--blue); }
.btn-soft:hover { background: rgba(0,113,227,.14); }
.btn-danger { background: rgba(255,59,48,.08); color: var(--red); }
.btn-danger:hover { background: rgba(255,59,48,.15); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-xs { padding: 4px 11px; font-size: 12px; border-radius: 980px; }
.btn[disabled], .btn.is-disabled { opacity: .4; pointer-events: none; }

/* ---------- 表单 ---------- */
.fld {
  width: 100%; padding: 11px 14px;
  border: 1px solid var(--line); border-radius: 12px;
  font-size: 15px; color: var(--ink); background: #fff;
  transition: border-color .2s ease, box-shadow .2s ease;
  appearance: none; -webkit-appearance: none;
}
.fld:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(0,113,227,.12); }
.fld::placeholder { color: #b0b0b6; }
textarea.fld { min-height: 88px; resize: vertical; line-height: 1.6; }
select.fld {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%2386868b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 38px;
}
.lbl { display: block; font-size: 13px; font-weight: 500; color: var(--gray); margin-bottom: 6px; }

/* ---------- 徽章 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 980px;
  font-size: 12px; font-weight: 500; line-height: 1.5; white-space: nowrap;
}
.badge-green  { background: rgba(52,199,89,.12);  color: #248a3d; }
.badge-blue   { background: rgba(0,113,227,.10);  color: #0057b8; }
.badge-orange { background: rgba(255,149,0,.14);  color: #b25f00; }
.badge-red    { background: rgba(255,59,48,.11);  color: #d70015; }
.badge-gray   { background: rgba(0,0,0,.055);     color: #6e6e73; }
.badge-dark   { background: rgba(0,0,0,.10);      color: #3a3a3c; }

/* ---------- 导航 ---------- */
.nav-blur {
  background: rgba(255,255,255,.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0,0,0,.07);
}
.nav-link {
  position: relative; font-size: 14px; color: #424245; padding: 6px 2px;
  transition: color .2s ease; text-decoration: none;
}
.nav-link:hover { color: var(--ink); }
.nav-link.active { color: var(--ink); font-weight: 500; }
.nav-link.active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -13px;
  height: 2px; background: var(--ink); border-radius: 2px;
}

/* 移动端底部 Tab */
.tabbar {
  background: rgba(255,255,255,.86);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid rgba(0,0,0,.07);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 0 6px; font-size: 10px; color: #8e8e93; text-decoration: none;
  transition: color .2s ease; -webkit-tap-highlight-color: transparent;
}
.tab-item.active { color: var(--blue); }
.tab-item svg { width: 22px; height: 22px; }

/* ---------- 分段控件 ---------- */
.seg { display: inline-flex; background: rgba(118,118,128,.10); border-radius: 10px; padding: 2px; gap: 2px; }
.seg a {
  padding: 5px 13px; border-radius: 8px; font-size: 13px; color: #3a3a3c;
  text-decoration: none; transition: background .22s ease, box-shadow .22s ease; white-space: nowrap;
}
.seg a.active { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.10); font-weight: 500; color: var(--ink); }

/* ---------- 表格 ---------- */
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.tbl thead th {
  text-align: left; font-size: 12px; font-weight: 500; color: var(--gray);
  padding: 10px 14px; border-bottom: 1px solid #ededf0; white-space: nowrap;
}
.tbl tbody td { padding: 13px 14px; border-bottom: 1px solid #f4f4f6; vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background .18s ease; }
.tbl tbody tr:hover { background: #fbfbfd; }

.mono { font-family: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 0; }

/* ---------- 日历时间轴 ---------- */
.cal-wrap { overflow: auto; -webkit-overflow-scrolling: touch; }
.cal { border-collapse: separate; border-spacing: 0; }
.cal th, .cal td { padding: 0; }
.cal .sn-col {
  position: sticky; left: 0; z-index: 3; background: #fff;
  min-width: 168px; max-width: 168px; width: 168px;
  border-right: 1px solid #ececef; padding: 8px 12px;
}
.cal thead .sn-col { z-index: 5; }
.cal thead th { position: sticky; top: 0; background: #fff; z-index: 2; }
.cal .day {
  width: 34px; min-width: 34px; height: 40px;
  border-right: 1px solid #f4f4f6; border-bottom: 1px solid #f4f4f6;
  text-align: center; position: relative;
}
.cal .day.weekend { background: #fafafa; }
.cal .day.today   { background: rgba(0,113,227,.06); box-shadow: inset 0 0 0 1px rgba(0,113,227,.22); }
.cal .dhead { font-size: 11px; color: var(--gray); font-weight: 400; padding: 6px 0 8px; }
.cal .dhead .dow { display: block; font-size: 10px; color: #b0b0b6; margin-top: 1px; }
.cal .dhead.today-h { color: var(--blue); font-weight: 600; }
.bar {
  position: absolute; inset: 7px 0; display: flex; align-items: center;
  font-size: 11px; color: #fff; overflow: hidden; white-space: nowrap;
}
.bar.s { border-radius: 999px 0 0 999px; margin-left: 3px; padding-left: 8px; }
.bar.e { border-radius: 0 999px 999px 0; margin-right: 3px; }
.bar.s.e { border-radius: 999px; }

/* ---------- 其他 ---------- */
.thumb { object-fit: cover; background: #f5f5f7; }
.ph {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, #f7f7f9 0%, #ededf0 100%); color: #c7c7cc;
}
.hr { height: 1px; background: #ededf0; border: 0; }
.link { color: var(--blue); text-decoration: none; }
.link:hover { text-decoration: underline; }

.sheet-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.32); z-index: 60;
  opacity: 0; pointer-events: none; transition: opacity .3s ease;
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
}
.sheet {
  position: fixed; z-index: 61; background: #fff;
  left: 50%; top: 50%; transform: translate(-50%, -46%) scale(.97);
  width: min(560px, calc(100vw - 32px)); max-height: 86vh; overflow-y: auto;
  border-radius: 22px; opacity: 0; pointer-events: none;
  transition: opacity .3s ease, transform .34s cubic-bezier(.28,.11,.32,1);
  box-shadow: 0 24px 70px rgba(0,0,0,.22);
}
.sheet.open, .sheet-mask.open { opacity: 1; pointer-events: auto; }
.sheet.open { transform: translate(-50%, -50%) scale(1); }

@media (max-width: 640px) {
  .sheet {
    top: auto; bottom: 0; left: 0; transform: translateY(24px);
    width: 100%; max-width: 100%; border-radius: 22px 22px 0 0; max-height: 92vh;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .sheet.open { transform: translateY(0); }
}

.fade-up { animation: fadeUp .5s cubic-bezier(.28,.11,.32,1) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
}
