:root {
  --bg: #05070A;
  --glass: #11161D;
  --blue: #00A8FF;
  --blue-light: #38BDF8;
  --yellow: #DFFF00;
  --text: #F5F7FA;
  --text-muted: #9AA4B2;
  --radius: 14px;
  --border: rgba(0, 168, 255, 0.18);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans TC", -apple-system, BlinkMacSystemFont, "PingFang TC", "Microsoft JhengHei", sans-serif;
  line-height: 1.6;
  padding-bottom: 84px; /* 底部固定業務欄空間 */
}

a { color: inherit; text-decoration: none; }

/* ---------------- Header ---------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: rgba(5, 7, 10, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  font-weight: 700;
  white-space: nowrap;
}
.brand .emoji { font-size: 22px; }
.brand .divider { color: var(--blue); }

.header-nav a {
  margin-left: 20px;
  color: var(--text-muted);
  font-size: 14px;
  transition: color .2s;
}
.header-nav a:hover { color: var(--blue-light); }

/* ---------------- Hero ---------------- */
.hero {
  padding: 64px 24px 48px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(0, 168, 255, 0.15), transparent 60%);
}

.hero-badges {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  border: 1px solid var(--border);
  background: var(--glass);
  color: var(--text-muted);
}
.badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 8px var(--yellow);
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}

.hero h1 {
  font-size: clamp(28px, 5vw, 46px);
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.hero h1 .emoji { font-size: clamp(28px, 5vw, 42px); }
.hero h1 .accent { color: var(--blue-light); }
.hero h1 .divider { color: var(--blue); font-weight: 400; }

.hero p.sub {
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 28px;
  font-size: 15px;
}

/* ---------------- 搜尋列 ---------------- */
.search-bar {
  max-width: 920px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}

.search-bar input,
.search-bar select {
  background: #0B0F14;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  flex: 1 1 140px;
}
.search-bar input:focus,
.search-bar select:focus {
  outline: none;
  border-color: var(--blue);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: 8px;
  border: none;
  background: var(--blue);
  color: #05070A;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: background .2s, transform .1s;
}
.btn:hover { background: var(--blue-light); }
.btn:active { transform: scale(0.97); }
.btn.outline {
  background: transparent;
  border: 1px solid var(--blue);
  color: var(--blue-light);
}

/* ---------------- 篩選 chips ---------------- */
.filter-chips {
  max-width: 920px;
  margin: 14px auto 0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.chip {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  background: transparent;
}
.chip.active {
  border-color: var(--blue);
  color: var(--blue-light);
  background: rgba(0, 168, 255, 0.08);
}

/* ---------------- 物件卡片 ---------------- */
.listing-grid {
  max-width: 1160px;
  margin: 40px auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .2s, border-color .2s;
  display: flex;
  flex-direction: column;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--blue);
}

.card-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  background: #0B0F14;
}

.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }

.card-title {
  font-size: 15px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-meta {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.price {
  font-size: 20px;
  font-weight: 800;
  margin-top: auto;
}
.price .sign { color: var(--blue-light); font-size: 15px; margin-right: 2px; }
.price .num { color: var(--yellow); }
.price .unit { color: var(--text-muted); font-size: 13px; font-weight: 400; margin-left: 3px; }

/* ---------------- 詳情頁 ---------------- */
.detail-wrap {
  max-width: 960px;
  margin: 32px auto;
  padding: 0 24px;
}
.detail-gallery img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: 8px;
  object-fit: cover;
  max-height: 480px;
}
.detail-info {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 20px;
}
.detail-info h1 { margin: 0 0 12px; font-size: 24px; }
.detail-tags { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.detail-tags span {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(0, 168, 255, 0.1);
  border: 1px solid var(--border);
  color: var(--blue-light);
}
.detail-desc { color: var(--text-muted); white-space: pre-wrap; margin-top: 16px; }

/* ---------------- 底部固定業務欄 ---------------- */
.agent-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 60;
  background: rgba(17, 22, 29, 0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.agent-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}
.agent-info .avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--blue);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  color: #05070A;
  flex-shrink: 0;
}
.agent-actions { display: flex; gap: 8px; }
.agent-actions .btn { padding: 9px 16px; font-size: 13px; }

/* ---------------- 空狀態 / loading ---------------- */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

/* ---------------- 後台 ---------------- */
.admin-shell { max-width: 1100px; margin: 32px auto; padding: 0 24px; }
.admin-card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.admin-login-box {
  max-width: 380px;
  margin: 100px auto;
  padding: 32px;
}
.admin-login-box input {
  width: 100%;
  padding: 12px;
  margin: 8px 0 16px;
  background: #0B0F14;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 15px;
}
.qr-box { text-align: center; margin: 20px 0; }
.qr-box img { background: #fff; padding: 12px; border-radius: 8px; }

table.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.admin-table th, table.admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
table.admin-table th { color: var(--text-muted); font-weight: 600; }
.status-pill {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
}
.status-pill.available { background: rgba(223,255,0,0.12); color: var(--yellow); }
.status-pill.rented { background: rgba(255,255,255,0.06); color: var(--text-muted); }

@media (max-width: 640px) {
  .site-header { padding: 12px 16px; }
  .header-nav { display: none; }
  .agent-bar { flex-direction: column; align-items: stretch; }
  .agent-actions { justify-content: stretch; }
  .agent-actions .btn { flex: 1; }
}
