/* ============================================================
   Kaopu (靠谱榜) — shared styles
   Color: green theme (52c41a) complementing redblack's red
   ============================================================ */
:root {
  --bg: #0e0f13;
  --bg-2: #15171f;
  --card: #1a1d24;
  --card-hover: #20232c;
  --border: #2a2f3a;
  --text: #e6e8ee;
  --text-dim: #9ba3b4;
  --text-soft: #6c7382;
  --primary: #52c41a;
  --primary-soft: rgba(82, 196, 26, 0.12);
  --primary-dim: rgba(82, 196, 26, 0.5);
  --accent: #5b8def;
  --warn: #faad14;
  --danger: #ff4d4f;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  line-height: 1.6;
  font-size: 14px;
  min-height: 100vh;
}
html { background-color: var(--bg); }
body { padding: 0 0 64px 0; position: relative; min-height: 100vh; background: transparent; }

/* Bing daily wallpaper background.
   Uses a fixed full-viewport layer behind everything; a soft dark overlay
   keeps card text readable. Toggle on/off via [data-bg="off"]. */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-color: var(--bg);
  background-image: var(--bg-image, none);
  background-size: cover; background-position: center;
  background-repeat: no-repeat;
  z-index: -2;
  transition: background-image 0.6s ease-in-out;
}
body::after {
  content: '';
  position: fixed; inset: 0;
  background: linear-gradient(180deg, rgba(14,15,19,0.85) 0%, rgba(14,15,19,0.65) 100%);
  z-index: -1;
  pointer-events: none;
}
body[data-bg="off"]::before { display: none; }
body[data-bg="off"]::after { display: none; }

/* Slightly translucent cards/header when bg is on */
body:not([data-bg="off"]) .card,
body:not([data-bg="off"]) .detail-main,
body:not([data-bg="off"]) .detail-side,
body:not([data-bg="off"]) .filterbar,
body:not([data-bg="off"]) .item-card,
body:not([data-bg="off"]) .login-box {
  background-color: rgba(20, 23, 31, 0.92);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
body:not([data-bg="off"]) .header {
  background-color: rgba(14, 15, 19, 0.88) !important;
}
body:not([data-bg="off"]) .hero {
  background: transparent;
}
body:not([data-bg="off"]) .hero h1 {
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}
body:not([data-bg="off"]) .field input,
body:not([data-bg="off"]) .field textarea,
body:not([data-bg="off"]) .field select,
body:not([data-bg="off"]) .filterbar input,
body:not([data-bg="off"]) .filterbar select {
  background-color: rgba(20, 23, 31, 0.7);
}
body:not([data-bg="off"]) .skeleton {
  background: linear-gradient(90deg, rgba(26, 29, 36, 0.82) 0%, rgba(40, 43, 53, 0.85) 50%, rgba(26, 29, 36, 0.82) 100%);
}

/* Credit + toggle */
.bg-credit {
  position: fixed; right: 8px; bottom: 4px;
  font-size: 10px; color: rgba(255, 255, 255, 0.45);
  padding: 2px 6px; border-radius: 4px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  z-index: 50;
  max-width: 60vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  pointer-events: auto;
}
.bg-credit a { color: inherit; text-decoration: underline; }

.bg-toggle {
  position: fixed; left: 10px; bottom: 8px;
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(20, 23, 31, 0.7); border: 1px solid var(--border);
  color: var(--text-dim); cursor: pointer; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  z-index: 50; padding: 0; line-height: 1;
  transition: background 0.15s, color 0.15s;
}
.bg-toggle:hover { color: var(--text); background: rgba(82, 196, 26, 0.3); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }

/* ---- Header ---- */
.header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(14, 15, 19, 0.92);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}
.header-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 24px;
}
.brand {
  font-size: 20px; font-weight: 800; letter-spacing: 1px;
  background: linear-gradient(90deg, #52c41a, #95de64);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  flex-shrink: 0;
}
.nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.nav a {
  padding: 6px 14px;
  color: var(--text-dim); border-radius: 6px;
  font-size: 14px; transition: background 0.15s, color 0.15s;
}
.nav a:hover { background: var(--bg-2); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--primary-soft); color: var(--primary); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 600;
  border: 1px solid var(--border); cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
  text-decoration: none;
  background: var(--card); color: var(--text);
}
.btn:hover { background: var(--card-hover); text-decoration: none; }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: linear-gradient(135deg, #52c41a, #95de64);
  color: #0e0f13; border: none;
  box-shadow: 0 2px 8px rgba(82, 196, 26, 0.3);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(82, 196, 26, 0.5);
  color: #0e0f13;
}
.btn-danger {
  background: linear-gradient(135deg, #ff4d4f, #ff7a4d);
  color: #fff; border: none;
}
.btn-ghost {
  background: transparent; border: 1px solid var(--border);
}

/* ---- Container ---- */
.container {
  max-width: 1200px; margin: 0 auto; padding: 24px 20px 60px;
}
.container.narrow { max-width: 720px; }

/* ---- Hero (home page) ---- */
.hero {
  position: relative;
  background:
    radial-gradient(ellipse 60% 50% at 50% 0%, rgba(82, 196, 26, 0.18) 0%, transparent 60%),
    var(--bg);
  padding: 60px 20px 40px;
  text-align: center;
}
.hero h1 {
  font-size: 56px; font-weight: 800; letter-spacing: 2px;
  margin-bottom: 12px;
  background: linear-gradient(90deg, #52c41a 0%, #95de64 60%, #b7eb8f 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .sub { font-size: 18px; color: var(--text-dim); margin-bottom: 24px; }
.hero .stats {
  display: inline-flex; gap: 20px;
  padding: 12px 24px;
  background: rgba(82, 196, 26, 0.06);
  border: 1px solid rgba(82, 196, 26, 0.2);
  border-radius: 999px;
  font-size: 13px; color: var(--text-dim);
  margin-bottom: 24px;
}
.hero .stats strong { color: var(--primary); font-weight: 700; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero .badge-pill {
  display: inline-block; padding: 4px 14px;
  background: var(--primary-soft); color: var(--primary);
  border: 1px solid rgba(82, 196, 26, 0.35);
  border-radius: 999px;
  font-size: 12px; font-weight: 500;
  margin-bottom: 16px;
}

/* ---- Section ---- */
.section { margin: 40px 0; }
.section-title {
  font-size: 22px; font-weight: 700;
  margin-bottom: 16px; padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.section-title .more {
  font-size: 13px; font-weight: 400; color: var(--text-dim);
}

/* ---- Card grid (team/job) ---- */
.grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  display: flex; flex-direction: column; gap: 10px;
  position: relative;
  overflow: hidden;
}
.card:hover {
  border-color: var(--primary-dim);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(82, 196, 26, 0.12);
}
.card-head { display: flex; align-items: center; gap: 10px; }
.card-title { font-size: 16px; font-weight: 600; flex: 1; min-width: 0; }
.card-title a { color: var(--text); }
.card-title a:hover { color: var(--primary); text-decoration: none; }
.card-meta {
  display: flex; gap: 8px; font-size: 12px;
  color: var(--text-dim); flex-wrap: wrap;
}
.card-meta .tag {
  background: var(--bg-2);
  padding: 2px 8px; border-radius: 4px;
}
.card-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.card-tag {
  font-size: 11px;
  padding: 2px 8px;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 4px;
}
.card-desc {
  font-size: 13px; color: var(--text-dim);
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-foot {
  margin-top: auto;
  padding-top: 10px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: var(--text-dim);
}
.status-pill {
  display: inline-block; padding: 2px 10px;
  border-radius: 999px; font-size: 11px; font-weight: 600;
}
.status-verified, .status-open {
  background: var(--primary-soft); color: var(--primary);
}
.status-pending {
  background: rgba(250, 173, 20, 0.12); color: var(--warn);
}

/* ---- Filter bar (list pages) ---- */
.filterbar {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-bottom: 16px; align-items: center;
}
.filterbar input[type="search"], .filterbar select {
  padding: 8px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
}
.filterbar input[type="search"] { flex: 1; min-width: 200px; }
.filterbar input[type="search"]:focus, .filterbar select:focus { border-color: var(--primary); }

/* ---- Form (apply/post) ---- */
.form { display: flex; flex-direction: column; gap: 14px; }
.form-row {
  display: flex; gap: 12px; flex-wrap: wrap;
}
.field { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 4px; }
.field label {
  font-size: 12px; color: var(--text-dim); font-weight: 500;
}
.field label .req { color: var(--danger); }
.field input, .field textarea, .field select {
  padding: 10px 14px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--primary);
}
.field textarea { resize: vertical; min-height: 80px; }
.field .hint { font-size: 11px; color: var(--text-soft); }

.hp-trap {
  position: absolute; left: -9999px; top: 0; width: 1px; height: 1px;
  overflow: hidden;
}
.hp-trap input { width: 1px; height: 1px; padding: 0; border: 0; }

.alert {
  padding: 12px 16px; border-radius: 8px;
  font-size: 13px;
  display: none;
}
.alert.show { display: block; }
.alert.success {
  background: var(--primary-soft); color: var(--primary);
  border: 1px solid var(--primary-dim);
}
.alert.error {
  background: rgba(255, 77, 79, 0.12); color: #ff8086;
  border: 1px solid rgba(255, 77, 79, 0.3);
}

/* ---- Detail page ---- */
.detail-grid {
  display: grid; gap: 24px;
  grid-template-columns: 1fr 320px;
}
@media (max-width: 800px) { .detail-grid { grid-template-columns: 1fr; } }

.detail-main {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 28px;
}
.detail-main h1 { font-size: 28px; margin-bottom: 12px; }
.detail-main h2 {
  font-size: 16px; font-weight: 600; margin: 24px 0 8px;
  color: var(--primary);
}
.detail-main p, .detail-main li {
  font-size: 14px; color: var(--text); margin-bottom: 8px;
}
.detail-main ul { padding-left: 24px; }

.detail-side {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 20px; height: fit-content;
}
.detail-side h3 {
  font-size: 14px; font-weight: 600; margin-bottom: 12px;
  color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px;
}
.contact-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.contact-row:last-child { border-bottom: none; }
.contact-row .label { color: var(--text-dim); }
.contact-row .value { font-weight: 600; }

/* ---- Image carousel (team detail) ---- */
.thumbs {
  display: grid; gap: 8px;
  grid-template-columns: repeat(3, 1fr);
  max-height: 110px; overflow: hidden;
  margin: 16px 0;
}
.thumb {
  background: var(--bg-2) center/cover no-repeat;
  border-radius: 8px; aspect-ratio: 4/3;
  cursor: pointer; transition: transform 0.15s;
  border: 1px solid var(--border);
}
.thumb:hover { transform: scale(1.05); }
.thumb-more {
  background: var(--bg-2);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim); font-size: 14px; font-weight: 600;
  border: 1px dashed var(--border);
}

/* ---- Empty state ---- */
.empty {
  text-align: center; padding: 60px 20px;
  color: var(--text-dim);
}
.empty .emoji { font-size: 48px; margin-bottom: 12px; }

/* ---- Footer ---- */
.footer {
  text-align: center; padding: 40px 20px;
  color: var(--text-dim); font-size: 13px;
  border-top: 1px solid var(--border);
  margin-top: 60px;
}
.footer a { color: var(--accent); }
.footer .links { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ---- Toast ---- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  padding: 12px 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 14px; z-index: 200;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  display: none;
}
.toast.show { display: block; animation: toast-in 0.2s ease-out; }
.toast.success { border-color: var(--primary); color: var(--primary); }
.toast.error { border-color: var(--danger); color: #ff8086; }
@keyframes toast-in {
  from { transform: translateX(-50%) translateY(20px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

/* ---- Lightbox ---- */
.lightbox {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.92);
  display: none; align-items: center; justify-content: center;
  flex-direction: column;
}
.lightbox.show { display: flex; }
.lightbox img {
  max-width: 90vw; max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
}
.lightbox .lb-close, .lightbox .lb-prev, .lightbox .lb-next {
  position: absolute;
  background: rgba(255,255,255,0.1);
  border: none; color: #fff; cursor: pointer;
  width: 48px; height: 48px; border-radius: 50%;
  font-size: 24px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.lightbox .lb-close:hover, .lightbox .lb-prev:hover, .lightbox .lb-next:hover {
  background: rgba(255,255,255,0.2);
}
.lightbox .lb-close { top: 24px; right: 24px; }
.lightbox .lb-prev { left: 24px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-next { right: 24px; top: 50%; transform: translateY(-50%); }
.lightbox .lb-counter {
  margin-top: 16px; color: var(--text-dim); font-size: 14px;
}

/* ---- Mobile ---- */
@media (max-width: 600px) {
  .hero h1 { font-size: 36px; }
  .hero .sub { font-size: 15px; }
  .hero .stats { font-size: 12px; padding: 10px 16px; gap: 12px; }
  .header-inner { gap: 12px; flex-wrap: wrap; }
  .nav { order: 3; width: 100%; gap: 0; }
  .nav a { padding: 6px 10px; font-size: 13px; }
  .detail-main { padding: 18px; }
  .detail-main h1 { font-size: 22px; }
  .container { padding: 16px 14px 40px; }
  .grid { grid-template-columns: 1fr; }
}

/* ---- Skeleton ---- */
.skeleton {
  background: linear-gradient(90deg, var(--card) 0%, var(--card-hover) 50%, var(--card) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 8px;
  height: 14px;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
