/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0d1117;
  --bg-card: #161b22;
  --bg-elevated: #21262d;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --primary: #3fb950;
  --primary-hover: #56d364;
  --border: #30363d;
  --success: #3fb950;
  --danger: #f85149;
  --radius: 8px;
  --font: 'Noto Sans TC', 'Noto Sans SC', system-ui, -apple-system, sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

/* 移除藍色 focus 框 */
*:focus {
  outline: none !important;
}
*:focus-visible {
  outline: 1px solid var(--primary) !important;
  outline-offset: 2px;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.15s;
}
a:hover {
  color: var(--primary-hover);
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== Header ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(13, 17, 23, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 1.2rem;
}
.logo:hover {
  color: var(--text);
}

.logo-img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
}

.nav {
  display: flex;
  gap: 24px;
}

.nav-link {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
}
.nav-link:hover {
  color: var(--text);
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  transition: 0.25s;
}

/* ===== Hero ===== */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 100px 0 60px;
}

.hero-badge {
  display: inline-block;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 5px 14px;
  border-radius: 999px;
  margin-bottom: 20px;
}

.hero-title {
  font-size: clamp(2.4rem, 7vw, 3.8rem);
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 10px;
  color: var(--text);
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.hero-desc {
  font-size: 1.05rem;
  color: var(--text);
  margin-bottom: 28px;
}

.ip-box {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 18px;
  margin-bottom: 28px;
  flex-wrap: wrap;
  justify-content: center;
}

.ip-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.ip-address {
  font-family: 'Courier New', monospace;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
}

.btn-copy {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.8rem;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-family: var(--font);
  transition: background 0.15s;
}
.btn-copy:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #000;
}
.btn-copy.copied {
  background: var(--success);
  border-color: var(--success);
  color: #000;
}

.hero-btns {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.hero-note {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.15s;
  border: none;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #000;
}
.btn-primary:hover {
  background: var(--primary-hover);
  color: #000;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-full {
  width: 100%;
  padding: 14px;
}

/* ===== Sections ===== */
.section {
  padding: 70px 0;
}

.section-header {
  text-align: center;
  margin-bottom: 40px;
}

.section-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.section-title {
  font-size: clamp(1.5rem, 4vw, 1.9rem);
  font-weight: 700;
  margin-bottom: 10px;
}

.section-desc {
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto;
  font-size: 0.95rem;
}

/* ===== About ===== */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.about-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 20px;
}
.about-card h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
}
.about-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ===== Connect Info ===== */
.connect {
  background: var(--bg-card);
}

.connect-oneclick {
  max-width: 400px;
  margin: 0 auto 32px;
  text-align: center;
}
.connect-oneclick .btn {
  margin-bottom: 10px;
}

.connect-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  max-width: 800px;
  margin: 0 auto 24px;
}

.connect-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.connect-card h3 {
  font-size: 1rem;
  margin-bottom: 18px;
  color: var(--primary);
}

.connect-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.connect-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  min-width: 90px;
}

.connect-value {
  font-family: 'Courier New', monospace;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  background: var(--bg-elevated);
  padding: 4px 10px;
  border-radius: 4px;
}

.connect-note {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.btn-copy-sm {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font);
}
.btn-copy-sm:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #000;
}

.connect-tip {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ===== Rules ===== */
.rules-list {
  display: grid;
  gap: 10px;
  max-width: 680px;
  margin: 0 auto 28px;
}

.rule-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
}

.rule-num {
  flex-shrink: 0;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--primary);
  min-width: 24px;
}

.rule-item p {
  font-size: 0.9rem;
}

.rules-warning {
  text-align: center;
  background: rgba(248, 81, 73, 0.1);
  border: 1px solid rgba(248, 81, 73, 0.25);
  color: var(--danger);
  padding: 14px 20px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  max-width: 680px;
  margin: 0 auto;
}

/* ===== Join Form ===== */
.join-form {
  max-width: 480px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 32px 28px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.9rem;
}

.required {
  color: var(--primary);
}

.form-group input[type="text"],
.form-group input[type="email"] {
  width: 100%;
  padding: 12px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: var(--font);
}
.form-group input:focus {
  border-color: var(--primary);
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 5px;
}

/* Checkbox */
.checkbox-group {
  margin-bottom: 24px;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-weight: 400 !important;
  font-size: 0.85rem;
  line-height: 1.5;
  position: relative;
}

.checkbox-label input {
  position: absolute;
  opacity: 0;
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}

.checkmark {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  position: relative;
  margin-top: 2px;
}

.checkbox-label input:checked + .checkmark {
  background: var(--primary);
  border-color: var(--primary);
}

.checkbox-label input:checked + .checkmark::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: solid #000;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.form-status {
  margin-top: 16px;
  padding: 12px;
  border-radius: 6px;
  font-size: 0.9rem;
  text-align: center;
  white-space: pre-line;
}
.form-status.success {
  background: rgba(63, 185, 80, 0.12);
  border: 1px solid rgba(63, 185, 80, 0.3);
  color: var(--success);
}
.form-status.error {
  background: rgba(248, 81, 73, 0.12);
  border: 1px solid rgba(248, 81, 73, 0.3);
  color: var(--danger);
}

/* ===== Discord ===== */
.discord {
  padding-bottom: 80px;
}

.discord-card {
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 40px 28px;
}

.discord-logo {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  margin: 0 auto 16px;
  background: #fff;
  object-fit: cover;
}

.discord-card h2 {
  font-size: 1.4rem;
  margin-bottom: 6px;
}

.discord-card > p {
  color: var(--text-muted);
  margin-bottom: 20px;
  font-size: 0.95rem;
}

.discord-note {
  margin-top: 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ===== Footer ===== */
.footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 32px 0 20px;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 20px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  object-fit: cover;
}

.footer-brand strong {
  display: block;
  font-size: 0.95rem;
}

.footer-brand p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-links a {
  color: var(--text-muted);
  font-size: 0.85rem;
}
.footer-links a:hover {
  color: var(--primary);
}

.footer-bottom {
  text-align: center;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
}
.footer-bottom p {
  margin-bottom: 3px;
}
.footer-bottom code {
  color: var(--primary);
  font-family: monospace;
}

/* ===== Mobile ===== */
@media (max-width: 768px) {
  .nav {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 16px 20px;
    gap: 12px;
    transform: translateY(-130%);
    opacity: 0;
    transition: all 0.25s;
    pointer-events: none;
  }
  .nav.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .menu-toggle {
    display: flex;
  }

  .menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  .menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }
  .menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .hero {
    min-height: auto;
    padding: 110px 0 50px;
  }

  .join-form {
    padding: 24px 18px;
  }

  .footer-content {
    flex-direction: column;
    text-align: center;
  }
  .footer-brand {
    justify-content: center;
  }
  .footer-links {
    justify-content: center;
  }
}
