/* ===== Gift Rent · 现代深色玻璃拟态主题 ===== */
:root {
  --bg: #0d1117;
  --bg-soft: #161b22;
  --glass: rgba(255, 255, 255, 0.045);
  --glass-strong: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.09);
  --border-hover: rgba(34, 211, 238, 0.45);
  --accent1: #06b6d4;          /* 青 */
  --accent2: #3b82f6;          /* 蓝 */
  --accent-grad: linear-gradient(135deg, #06b6d4, #3b82f6);
  --text: #e6edf3;
  --text-dim: #9ca7b3;
  --text-faint: #6e7681;
  --radius: 16px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
  --glow: rgba(34, 211, 238, 0.14);
}

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

[hidden] { display: none !important; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* 背景光晕 */
body {
  position: relative;
  min-height: 100vh;
  background:
    radial-gradient(900px 480px at 15% -8%, rgba(6, 182, 212, 0.10), transparent 60%),
    radial-gradient(800px 420px at 90% 0%, rgba(59, 130, 246, 0.08), transparent 55%),
    var(--bg);
  background-attachment: fixed;
}

.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* ===== 顶栏（玻璃） ===== */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg-soft);   /* 跟随主题，避免浅色主题黑字黑底 */
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand-icon {
  font-size: 22px;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  background: var(--glass-strong);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.brand-name {
  font-weight: 800; font-size: 19px; letter-spacing: 0.3px;
  background: var(--accent-grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.topbar-stats { font-size: 13px; color: var(--text-dim); }
.topbar-stats span {
  font-weight: 700; color: var(--accent1);
  background: rgba(6, 182, 212, 0.12);
  padding: 2px 8px; border-radius: 8px;
}

/* ===== Hero ===== */
.hero { padding: 46px 0 26px; text-align: center; }
.hero h1 {
  font-size: 34px; font-weight: 800; letter-spacing: -0.5px;
  background: linear-gradient(180deg, #fff, #b7c2cc);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { margin-top: 8px; color: var(--text-dim); font-size: 15px; }

/* ===== Tab（玻璃胶囊） ===== */
.tabs {
  display: flex; gap: 4px; padding: 5px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 14px; width: fit-content; margin: 0 auto 22px;
  backdrop-filter: blur(8px);
}
.tab {
  padding: 9px 22px; border: 0; border-radius: 10px;
  background: transparent; color: var(--text-dim);
  font: inherit; font-weight: 600; font-size: 14px; cursor: pointer;
  transition: all 0.18s ease;
}
.tab:hover { color: var(--text); background: var(--glass-strong); }
.tab.active {
  background: var(--accent-grad);
  color: #fff; font-weight: 700;
  box-shadow: 0 4px 18px rgba(6, 182, 212, 0.35);
}

/* ===== 筛选（玻璃输入） ===== */
.filters {
  display: flex; gap: 12px; flex-wrap: wrap;
  padding: 14px 16px; margin-bottom: 26px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
}
.field { display: flex; flex-direction: column; gap: 4px; }
.field-label {
  font-size: 11px; color: var(--text-faint);
  text-transform: uppercase; letter-spacing: 0.6px; font-weight: 600;
}
.field select, .field input {
  background: rgba(13, 17, 23, 0.6);
  color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 8px 12px; font: inherit; font-size: 13px; min-width: 160px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field select:focus, .field input:focus {
  outline: none; border-color: var(--accent1);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
}
.field-search { flex: 1; }
.field-search input { width: 100%; min-width: 220px; }

/* ===== 网格 ===== */
.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 18px;
}
.card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden; cursor: pointer;
  backdrop-filter: blur(10px);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow), 0 0 24px var(--glow);
  background: var(--glass-strong);
}
.card-media {
  aspect-ratio: 1; width: 100%;
  background: rgba(13, 17, 23, 0.5);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; font-size: 56px;
  position: relative;
}
/* 客服按钮：悬浮图片右上角 */
.cs-btn {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--border); cursor: pointer;
  background: rgba(13, 17, 23, 0.65);
  backdrop-filter: blur(4px);
  color: #fff; font-size: 15px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s ease, background 0.15s ease;
}
.cs-btn:active { transform: scale(0.88); background: var(--accent-grad); }
.card-media img {
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity 0.3s ease;
}
.card-media img.loaded { opacity: 1; }
.card-body { padding: 12px 14px 14px; }
.card-title {
  font-size: 14px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.tag {
  font-size: 11px; padding: 2px 9px; border-radius: 999px;
  background: rgba(6, 182, 212, 0.10);
  color: #8ce8f7;
  border: 1px solid rgba(6, 182, 212, 0.22);
}
.card-meta {
  display: flex; align-items: baseline; justify-content: space-between; margin-top: 10px;
}
.price { font-weight: 800; font-size: 16px; color: #67e8f9; }
.price span { font-size: 11px; font-weight: 500; color: var(--text-faint); }
.duration { font-size: 12px; color: var(--text-faint); }

/* ===== 骨架屏（玻璃 shimmer） ===== */
.skeleton {
  height: 320px; border-radius: var(--radius);
  background: linear-gradient(100deg, rgba(255,255,255,0.03) 30%, rgba(255,255,255,0.07) 50%, rgba(255,255,255,0.03) 70%);
  background-size: 200% 100%; animation: shimmer 1.4s infinite;
  border: 1px solid var(--border);
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ===== 状态区 ===== */
.state-area { text-align: center; padding: 30px 0 50px; }
.error {
  color: #ff8a80;
  background: rgba(255, 90, 80, 0.1);
  border: 1px solid rgba(255, 90, 80, 0.3);
  padding: 12px; border-radius: 12px; margin-bottom: 16px;
}
.empty { color: var(--text-faint); }
.btn-load {
  padding: 12px 34px; font: inherit; font-weight: 600; font-size: 14px;
  background: var(--accent-grad); color: #fff; border: 0; border-radius: 12px;
  cursor: pointer; box-shadow: 0 4px 20px rgba(6, 182, 212, 0.35);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.btn-load:hover { opacity: 0.92; transform: translateY(-1px); }
.loading-hint { color: var(--text-faint); }

/* ===== 模态框（玻璃） ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(5, 8, 12, 0.7);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  background: var(--bg-soft);   /* 跟随主题，避免浅色主题下黑字黑底 */
  border: 1px solid var(--border);
  border-radius: 18px;
  max-width: 460px; width: 100%; padding: 26px; position: relative;
  max-height: 88vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(16px);
}
.modal-close {
  position: absolute; top: 14px; right: 16px;
  background: var(--glass-strong); border: 1px solid var(--border);
  color: var(--text-dim); font-size: 20px; cursor: pointer; line-height: 1;
  width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center; transition: color 0.15s;
}
.modal-close:hover { color: var(--text); }
.modal-media {
  width: 100%; aspect-ratio: 1; border-radius: 14px; overflow: hidden;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center; font-size: 80px;
}
.modal-media img { width: 100%; height: 100%; object-fit: cover; }
.modal-title { font-size: 20px; font-weight: 800; margin: 16px 0 4px; }
.modal-sub { color: var(--text-faint); font-size: 12px; word-break: break-all; }
.modal-section { margin-top: 16px; }
.modal-section h4 {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.6px;
  color: var(--text-faint); margin-bottom: 8px; font-weight: 600;
}
.modal-rows { display: flex; flex-direction: column; gap: 8px; }
.modal-row {
  display: flex; justify-content: space-between; font-size: 14px;
  padding: 9px 12px; background: rgba(127, 127, 127, 0.12);  /* 中性半透明，任何主题可读 */
  border: 1px solid var(--border); border-radius: 10px;
}
.modal-row b { color: var(--text); font-weight: 600; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge-rented { background: rgba(255, 160, 60, 0.12); color: #ffb05c; border: 1px solid rgba(255, 160, 60, 0.3); }
.badge-available { background: rgba(60, 255, 170, 0.1); color: #4ade80; border: 1px solid rgba(60, 255, 170, 0.25); }

/* ===== 响应式 ===== */
@media (max-width: 640px) {
  .hero h1 { font-size: 24px; }
  .tabs { width: 100%; }
  .tab { flex: 1; }
  .field select, .field input { min-width: 0; }
  /* 手机端礼物网格 2×2 排版 */
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .card-body { padding: 8px 10px 10px; }
  .card-title { font-size: 12px; }
  .card-tags { margin-top: 5px; gap: 4px; }
  .tag { font-size: 10px; padding: 1px 6px; }
  .price { font-size: 13px; }
  .duration { font-size: 11px; }
  .filters { padding: 10px; gap: 8px; }
}
