:root {
  --bg: #0b0f14;
  --panel: #0f1722;
  --text: #e8eef7;
  --muted: #a9b4c2;
  --brand: #e31e24;
  --brand-light: #ff4d4f;
  --brand-dark: #a80f14;
  --brand-rgba: rgba(227, 30, 36, 0.15);
  --line: #223043;
  --max: 1100px;
  --glow: 0 0 10px rgba(227, 30, 36, 0.3);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', 'Noto Sans TC', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

.code-font {
  font-family: 'Fira Code', 'Roboto Mono', monospace;
}

a { color: inherit; text-decoration: none; transition: all 0.2s ease; }
a:hover { color: var(--brand-light); }

.container { max-width: var(--max); margin: 0 auto; padding: 0 18px; }

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 15, 20, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.nav { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; }

.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; }
.brand .mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: conic-gradient(from 210deg, var(--brand), var(--brand-light) 30%, #2a3340 70%, var(--brand));
  box-shadow: 0 0 15px var(--brand-rgba);
  position: relative;
}

.brand .mark::after {
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
}

.brand small { display: block; color: var(--muted); font-weight: 500; font-size: 0.75rem; }

.menu { display: flex; gap: 20px; font-weight: 600; font-size: 0.95rem; }
.menu a { color: var(--muted); position: relative; padding: 4px 0; }
.menu a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--brand);
  transition: width 0.3s ease;
}
.menu a:hover { color: var(--text); }
.menu a:hover::after { width: 100%; }

.hero {
  position: relative;
  padding: 80px 0 60px;
  background: radial-gradient(circle at 70% 30%, rgba(227, 30, 36, 0.05), transparent 40%),
              linear-gradient(to bottom, #0b0f14, #080b10);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(rgba(34, 48, 67, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 48, 67, 0.1) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(circle at center, black, transparent 80%);
}

.hero-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 40px; align-items: center; position: relative; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }

.h-title { font-size: clamp(2rem, 5vw, 3rem); line-height: 1.1; margin: 0 0 20px; font-weight: 900; letter-spacing: -0.02em; }
.h-sub { color: var(--muted); font-size: 1.125rem; line-height: 1.6; margin: 0 0 30px; }

.badges { display: flex; flex-wrap: wrap; gap: 12px; margin: 30px 0; }
.badge {
  background: rgba(15, 23, 34, 0.8);
  border: 1px solid var(--line);
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  gap: 8px;
}
.badge span { color: var(--brand); font-family: 'Fira Code', monospace; }

.panel {
  background: rgba(15, 23, 34, 0.9);
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
  position: relative;
}

.panel::before {
  content: '';
  position: absolute;
  top: 10px;
  right: 10px;
  width: 8px;
  height: 8px;
  background: var(--brand);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 0 rgba(227, 30, 36, 0.7); }
  70% { transform: scale(1.1); opacity: 0.8; box-shadow: 0 0 0 10px rgba(227, 30, 36, 0); }
  100% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 0 rgba(227, 30, 36, 0); }
}

.panel .p-body { padding: 24px; }
.panel .p-body h3 { margin: 0 0 12px; font-size: 1.25rem; font-weight: 800; border-left: 3px solid var(--brand); padding-left: 12px; }
.panel img { display: block; width: 100%; height: auto; filter: grayscale(0.2); transition: filter 0.3s; }
.panel:hover img { filter: grayscale(0); }

.section { padding: 60px 0; }
.section h2 { font-size: 2rem; font-weight: 900; margin: 0 0 30px; display: flex; align-items: center; gap: 15px; }
.section h2::after { content: ''; flex: 1; height: 1px; background: var(--line); }

.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
@media (max-width: 900px) { .grid3 { grid-template-columns: 1fr; } }

.card {
  background: linear-gradient(145deg, rgba(21, 28, 40, 0.8), rgba(15, 23, 34, 0.8));
  border: 1px solid var(--line);
  padding: 30px;
  border-radius: 20px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-8px);
  border-color: var(--brand-rgba);
  box-shadow: 0 15px 30px rgba(0,0,0,0.3), 0 0 0 1px var(--brand-rgba);
}

.card h3 { margin: 0 0 15px; font-size: 1.25rem; font-weight: 800; color: var(--text); }
.card p { color: var(--muted); line-height: 1.6; margin: 0; }

.kv { display: flex; flex-wrap: wrap; gap: 15px; margin-top: 30px; }
.pill {
  background: rgba(227, 30, 36, 0.05);
  border: 1px solid var(--brand-rgba);
  color: var(--text);
  padding: 10px 20px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.9rem;
}
.pill b { color: var(--brand); margin-right: 4px; }

.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 900px) { .gallery { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .gallery { grid-template-columns: 1fr; } }

.gallery img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid var(--line);
  filter: brightness(0.8);
  transition: all 0.4s;
}
.gallery img:hover { filter: brightness(1.1); transform: scale(1.02); box-shadow: 0 10px 30px rgba(0,0,0,0.4); }

.footer { padding: 60px 0 40px; background: #06080b; border-top: 1px solid var(--line); margin-top: 80px; }
.footer .cols { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 60px; }
@media (max-width: 900px) { .footer .cols { grid-template-columns: 1fr; } }

.footer h4 { color: var(--text); margin-bottom: 20px; font-weight: 800; }
.footer p, .footer .muted { color: var(--muted); line-height: 1.8; font-size: 0.95rem; }

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(15, 23, 34, 0.5);
}

.table th, .table td { padding: 18px; text-align: left; border-bottom: 1px solid var(--line); }
.table th { background: rgba(15, 23, 34, 0.8); color: var(--text); font-weight: 800; text-transform: uppercase; font-size: 0.8rem; letter-spacing: 0.05em; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: rgba(227, 30, 36, 0.02); }

.note { font-size: 0.875rem; color: var(--muted); font-style: italic; margin-top: 15px; }

/* Custom Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #334455; }
