@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --bg-page: #FFFFFF;
  --bg-subtle: #F9FAFB;
  --bg-card: #FFFFFF;
  --bg-elevated: #F3F4F6;
  
  --line-subtle: #E5E7EB;
  --line-medium: #D1D5DB;
  --line-strong: #111827;
  
  --text-main: #111827;
  --text-secondary: #4B5563;
  --text-muted: #6B7280;
  --text-dim: #9CA3AF;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background-color: var(--bg-page);
  color: var(--text-main);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  overflow-x: hidden;
  background-color: var(--bg-page);
  color: var(--text-main);
  min-height: 100vh;
}

/* Minimalist Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #F3F4F6;
}
::-webkit-scrollbar-thumb {
  background: #D1D5DB;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #9CA3AF;
}

/* Monospace Engine */
.font-mono-tech {
  font-family: 'JetBrains Mono', monospace;
}

/* Subtle Technical Hairline Background */
.hairline-grid-light {
  background-size: 40px 40px;
  background-image: 
    linear-gradient(to right, rgba(0, 0, 0, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
}

/* Clean Corporate Card */
.tech-card {
  background-color: #FFFFFF;
  border: 1px solid var(--line-subtle);
  transition: all 0.2s ease;
}

.tech-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.04);
}

/* Clean Professional Badges */
.badge-clean {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  background: #F3F4F6;
  border: 1px solid var(--line-subtle);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background-color: #111827;
  color: #FFFFFF;
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.01em;
  border: 1px solid #111827;
  transition: all 0.2s ease;
  min-height: 44px;
}

.btn-primary:hover {
  background-color: #000000;
  border-color: #000000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background-color: #FFFFFF;
  color: #111827;
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.01em;
  border: 1px solid var(--line-medium);
  transition: all 0.2s ease;
  min-height: 44px;
}

.btn-secondary:hover {
  border-color: #111827;
  background-color: #F9FAFB;
  transform: translateY(-1px);
}

/* Clean Editorial Imagery */
.img-editorial {
  filter: contrast(102%) brightness(98%);
  transition: transform 0.4s ease;
}
.group:hover .img-editorial {
  transform: scale(1.02);
}

/* Table Design */
.table-responsive-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line-subtle);
  background: #FFFFFF;
}

.table-tech {
  width: 100%;
  border-collapse: collapse;
}

.table-tech th {
  background: #F9FAFB;
  padding: 1rem 1.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--line-medium);
  border-right: 1px solid var(--line-subtle);
  text-align: left;
}
.table-tech th:last-child {
  border-right: none;
}

.table-tech td {
  padding: 1.15rem 1.25rem;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--line-subtle);
  border-right: 1px solid var(--line-subtle);
  color: var(--text-secondary);
  transition: background 0.15s ease;
}
.table-tech td:last-child {
  border-right: none;
}

.table-tech tr:hover td {
  background: #F3F4F6;
  color: #111827;
}

/* =========================================================
   OFF-CANVAS SIDE DRAWER FOR RWD
   右側 Sidebar — 從右滑入，backdrop 點擊關閉
   ========================================================= */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.drawer-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(88vw, 420px);
  background-color: #FFFFFF;
  border-left: 1px solid #e5e5e5;
  box-shadow: -16px 0 48px rgba(0, 0, 0, 0.18);
  z-index: 9999;
  transform: translateX(100%);
  transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  will-change: transform;
  /* iOS safe area */
  padding-right: env(safe-area-inset-right, 0px);
}

.drawer-backdrop.active .drawer-panel {
  transform: translateX(0);
}

/* Standard Center Modals (CoA & Form Confirmation) */
.modal-backdrop {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  transform: scale(0.96) translateY(10px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.active .modal-content {
  transform: scale(1) translateY(0);
}

/* Responsive Input Protections */
input, select, textarea {
  font-size: 14px !important;
  border-radius: 0px !important;
}

/* Language Dropdown */
.lang-dropdown-menu {
  animation: fadeInDown 0.15s ease-out;
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

button, a, input, select {
  min-height: 44px;
}

@media (max-width: 640px) {
  .hero-title {
    font-size: 2.15rem !important;
    line-height: 1.18 !important;
  }
}
