/* ============================================================
   VR2WLE 網站 - 全域樣式
   設計風格：業餘無線電 現代感、深色主題（午夜藍）、琥珀色點綴
   ============================================================ */
:root {
  --bg: #0b1020;
  --bg-2: #0f172a;
  --surface: #111b2e;
  --surface-2: #172036;
  --border: #1e2944;
  --text: #e6edf7;
  --text-muted: #97a7c7;
  --accent: #f59e0b;      /* 琥珀色：電台調諧指示燈 */
  --accent-2: #fbbf24;
  --green: #10b981;
  --red: #ef4444;
  --blue: #3b82f6;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 8px 24px rgba(0,0,0,0.3);
  --maxw: 1200px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC", "Microsoft JhengHei", "Noto Sans CJK TC", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(245,158,11,0.08), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(59,130,246,0.07), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; transition: opacity .15s ease; }
a:hover { opacity: 0.85; text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }

/* ---------- Header & 導航 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(11,16,32,0.82);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  max-width: var(--maxw); margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand {
  display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-logo {
  width: 42px; height: 42px; border-radius: 10px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  display: grid; place-items: center; color: #1e1300;
  font-family: var(--font-mono); font-weight: 900; font-size: 14px;
  box-shadow: 0 4px 12px rgba(245,158,11,0.25);
}
.brand-logo-img {
  width: 42px; height: 42px; border-radius: 10px;
  object-fit: contain; object-position: center;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.18);
  flex: 0 0 auto;
}
.brand-title { font-size: 18px; font-weight: 700; letter-spacing: 0.5px; }
.brand-sub { font-size: 12px; color: var(--text-muted); }
.nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.nav a {
  color: var(--text); padding: 8px 12px; border-radius: var(--radius-sm);
  font-size: 14px;
}
.nav a:hover { background: var(--surface-2); color: var(--accent-2); text-decoration: none; }
.nav a.active { background: rgba(245,158,11,0.12); color: var(--accent-2); }

.mobile-toggle { display: none; background: transparent; border: 0; color: var(--text); cursor: pointer; font-size: 22px; }

/* ---------- Language selector (dropdown) ---------- */
.lang-select-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.lang-label {
  color: var(--text-muted);
  font-size: 13px;
  white-space: nowrap;
}
.lang-select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 28px 7px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2397a7c7' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 30px;
}
.lang-select:hover { border-color: var(--accent); }
.lang-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245,158,11,0.15);
}
.lang-select option {
  background: var(--bg-2);
  color: var(--text);
}

/* ---------- Container ---------- */
main.page { max-width: var(--maxw); margin: 0 auto; padding: 28px 20px 60px; }
.page-title {
  font-size: 26px; margin: 0 0 8px; letter-spacing: 0.5px;
  display: flex; align-items: center; gap: 12px;
}
.page-title .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(245,158,11,0.15);
  animation: blink 2s infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 4px rgba(245,158,11,0.15); }
  50% { opacity: 0.5; box-shadow: 0 0 0 8px rgba(245,158,11,0.05); }
}
.page-subtitle { color: var(--text-muted); margin: 0 0 24px; }

/* ---------- Cards / surfaces ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 20px; }
.row { display: flex; gap: 20px; flex-wrap: wrap; }
.row > * { flex: 1 1 280px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: var(--radius-sm); border: 1px solid transparent;
  cursor: pointer; font-size: 14px; font-weight: 600; transition: all .15s ease;
  background: var(--surface-2); color: var(--text);
}
.btn:hover { transform: translateY(-1px); border-color: var(--border); background: #1c2944; }
.btn-primary {
  background: linear-gradient(135deg, var(--accent), #d97706);
  color: #1e1300; border-color: rgba(0,0,0,0.1);
}
.btn-primary:hover { filter: brightness(1.05); background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.btn-danger { background: #3f1d24; color: #fecaca; border-color: #7f1d1d; }
.btn-danger:hover { background: #51232b; }
.btn-success { background: #0f3a2d; color: #a7f3d0; border-color: #065f46; }
.btn-success:hover { background: #134e3b; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ---------- Form ---------- */
input, select, textarea {
  background: var(--bg-2); border: 1px solid var(--border); color: var(--text);
  padding: 9px 12px; border-radius: var(--radius-sm);
  font-size: 14px; font-family: inherit; width: 100%; outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245,158,11,0.15);
}
textarea { resize: vertical; min-height: 80px; }
label {
  display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; margin-top: 12px;
}
label:first-child { margin-top: 0; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 14px; }

/* ---------- Tables ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; overflow-x: auto; display: block; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table th { color: var(--text-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.table tr:hover td { background: var(--surface-2); }

/* ---------- Hero (首頁) ---------- */
.hero {
  display: grid; grid-template-columns: 1.1fr 0.9fr 1fr; gap: 24px; align-items: center;
  padding: 40px 0 20px;
}
.hero-logo-wrap {
  display: flex; align-items: center; justify-content: center;
  background: #fff;
  border-radius: var(--radius);
  padding: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  aspect-ratio: 1 / 1;
  max-width: 100%;
}
.hero-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}
.hero-text-col h1 {
  font-size: 40px; margin: 0 0 14px; line-height: 1.15; letter-spacing: 0.5px;
  background: linear-gradient(135deg, #fff 0%, var(--accent-2) 80%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-text-col p { color: var(--text-muted); font-size: 17px; margin: 0 0 24px; max-width: 520px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-illustration {
  border-radius: var(--radius); padding: 22px;
  background: linear-gradient(135deg, rgba(245,158,11,0.08), rgba(59,130,246,0.06));
  border: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 13px; line-height: 1.9;
  color: var(--text-muted);
}
.hero-illustration .tag { color: var(--accent); }
.hero-illustration .val { color: #cbd5e1; }

/* ---------- Stats ---------- */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px;
  margin: 28px 0 12px;
}
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px;
}
.stat-label { color: var(--text-muted); font-size: 13px; margin-bottom: 8px; }
.stat-value { font-size: 28px; font-weight: 800; font-family: var(--font-mono); color: var(--text); }
.stat-foot { color: var(--text-muted); font-size: 12px; margin-top: 4px; }

/* ---------- Gallery (cards grid) ---------- */
.gallery-toolbar {
  display: flex; gap: 10px; flex-wrap: wrap; justify-content: space-between; align-items: center;
  margin-bottom: 20px;
}
.gallery-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px;
}
.card-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; transition: transform .15s ease, border-color .15s ease;
}
.card-item:hover { transform: translateY(-3px); border-color: var(--accent); }
.card-item .photo {
  aspect-ratio: 4/3; background: var(--bg-2) center/contain no-repeat;
  position: relative; cursor: pointer;
}
.card-item .info { padding: 14px 16px; }
.card-item .callsign {
  font-family: var(--font-mono); font-weight: 700; font-size: 16px; color: var(--text);
  display: flex; align-items: center; justify-content: space-between;
}
.card-item .meta { color: var(--text-muted); font-size: 13px; margin-top: 4px; }
.badge {
  display: inline-block; padding: 3px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600; background: var(--surface-2); color: var(--text-muted);
}
.badge-amber { background: rgba(245,158,11,0.15); color: var(--accent-2); }
.badge-green { background: rgba(16,185,129,0.12); color: #6ee7b7; }
.badge-red { background: rgba(239,68,68,0.12); color: #fca5a5; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; background: rgba(0,0,0,0.85);
  display: none; align-items: center; justify-content: center; z-index: 100; padding: 24px;
}
.lightbox.open { display: flex; }
.lightbox img { max-width: 90vw; max-height: 90vh; border-radius: var(--radius); box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
.lightbox .close {
  position: absolute; top: 20px; right: 28px; color: #fff;
  background: rgba(255,255,255,0.08); border: 0; width: 44px; height: 44px; border-radius: 50%;
  font-size: 24px; cursor: pointer;
}
.lightbox-caption {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  color: #fff; text-align: center; font-size: 14px; background: rgba(0,0,0,0.5);
  padding: 8px 14px; border-radius: var(--radius-sm);
}

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 6px; justify-content: center; margin: 28px 0 8px; flex-wrap: wrap; }
.pagination button, .pagination span {
  min-width: 36px; padding: 8px 12px; text-align: center;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius-sm); cursor: pointer; font-size: 13px;
}
.pagination button:hover:not([disabled]) { border-color: var(--accent); color: var(--accent); }
.pagination button[disabled] { opacity: 0.4; cursor: not-allowed; }
.pagination .current { background: var(--accent); color: #1e1300; border-color: var(--accent); font-weight: 700; }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border); padding: 24px 20px 40px;
  color: var(--text-muted); font-size: 13px; text-align: center;
  margin-top: 40px;
}
.site-footer .inner { max-width: var(--maxw); margin: 0 auto; }

/* ---------- Misc ---------- */
.empty-state {
  text-align: center; padding: 60px 20px; color: var(--text-muted);
  background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius);
}
.empty-state .icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }
.hint { color: var(--text-muted); font-size: 13px; }
.inline { display: inline-flex; align-items: center; gap: 6px; }
.callout {
  padding: 14px 18px; border-left: 4px solid var(--accent);
  background: rgba(245,158,11,0.06); border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text);
}
.callout-green { border-color: var(--green); background: rgba(16,185,129,0.06); }
.callout-red { border-color: var(--red); background: rgba(239,68,68,0.06); }
.callout-blue { border-color: var(--blue); background: rgba(59,130,246,0.06); }
.flex { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.flex-between { display: flex; gap: 12px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap: 18px; }
.kbd {
  padding: 2px 6px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 12px; color: var(--text-muted);
}
.toast-wrap {
  position: fixed; top: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius-sm); padding: 12px 16px; min-width: 240px; box-shadow: var(--shadow);
  animation: slideIn .2s ease;
}
.toast-success { border-left: 4px solid var(--green); }
.toast-error   { border-left: 4px solid var(--red); }
.toast-info    { border-left: 4px solid var(--blue); }
@keyframes slideIn {
  from { transform: translateX(20px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
.search-form { display: flex; gap: 10px; align-items: stretch; }
.search-form input { flex: 1; }
.month-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.month-nav a, .month-nav button {
  padding: 6px 12px; border-radius: 999px; background: var(--surface);
  border: 1px solid var(--border); color: var(--text); font-size: 13px; cursor: pointer; text-decoration: none;
}
.month-nav a:hover, .month-nav button:hover { border-color: var(--accent); color: var(--accent); }
.month-nav .active { background: var(--accent); color: #1e1300; border-color: var(--accent); font-weight: 600; }
.search-result-section { margin-top: 26px; }
.search-result-section h3 {
  font-size: 15px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
}

/* ---------- 回應式 ---------- */
@media (max-width: 780px) {
  .nav { display: none; width: 100%; padding: 10px 0 4px; border-top: 1px solid var(--border); margin-top: 10px; }
  .nav.open { display: flex; }
  .nav a { width: 100%; }
  .mobile-toggle { display: block; }
  .hero { grid-template-columns: 1fr; padding-top: 20px; gap: 16px; }
  .hero-logo-wrap { max-width: 280px; margin: 0 auto; width: 100%; }
  .hero-text-col h1 { font-size: 30px; }
  .site-header .wrap { flex-wrap: wrap; }
  .table { font-size: 13px; }
}
