@charset "UTF-8";

/* ============================================
   BBEdit 香港官網 - 通用樣式 common.css
   主題色：#8C89CE / #0C0A4A / #E0E0F8
   ============================================ */

:root {
  --primary: #8C89CE;
  --primary-dark: #0C0A4A;
  --primary-light: #b3b1de;
  --primary-soft: #E0E0F8;
  --accent: #0C0A4A;
  --text: #1a2233;
  --text-soft: #4a5568;
  --text-muted: #8492a6;
  --bg: #ffffff;
  --bg-soft: #f7f9fc;
  --bg-grad-start: #f4f8fd;
  --bg-grad-end: #ffffff;
  --border: #e6ecf2;
  --shadow-sm: 0 2px 8px rgba(12, 10, 74, 0.06);
  --shadow-md: 0 8px 30px rgba(12, 10, 74, 0.10);
  --shadow-lg: 0 20px 60px rgba(12, 10, 74, 0.16);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --radius-pill: 999px;
  --font-zh: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微軟雅黑", sans-serif;
  --font-en: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-zh);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 16px;
  line-height: 1.7;
  scroll-behavior: smooth;
}

a { color: var(--primary); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; display: block; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* 中英文混排 - 自動間隔 */
.mix-text en, .mix-text .en {
  margin: 0 .15em;
}

/* ============ 通用按鈕 ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .25s ease;
  white-space: nowrap;
  font-family: inherit;
}
.btn svg { width: 18px; height: 18px; }

.btn-primary {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: #fff;
  box-shadow: 0 8px 20px rgba(12, 10, 74, 0.28);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(12, 10, 74, 0.42);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--text-soft);
  border-color: var(--border);
}
.btn-ghost:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-soft);
}

/* ============ HEADER 導航 ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid rgba(224, 224, 248, 0.6);
}
.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav-brand img { width: 38px; height: 38px; }
.nav-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.nav-brand-name {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: .2px;
}
.nav-brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-en);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
  white-space: nowrap;
}
.nav-menu a {
  display: inline-block;
  padding: 8px 11px;
  color: var(--text-soft);
  font-size: 14px;
  border-radius: var(--radius-sm);
  transition: all .2s;
  white-space: nowrap;
}
.nav-menu a:hover {
  color: var(--primary);
  background: var(--primary-soft);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.nav-actions .btn { padding: 9px 18px; font-size: 14px; }

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  width: 44px;
  height: 44px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  transition: background .2s;
}
.nav-toggle:hover { background: var(--primary-soft); }
.nav-toggle span {
  position: relative;
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all .3s ease;
}
.nav-toggle span::before,
.nav-toggle span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all .3s ease;
}
.nav-toggle span::before { top: -7px; }
.nav-toggle span::after  { top:  7px; }
.nav-toggle.is-open span { background: transparent; }
.nav-toggle.is-open span::before { top: 0; transform: rotate(45deg); }
.nav-toggle.is-open span::after  { top: 0; transform: rotate(-45deg); }

/* 移動端抽屜 */
.mobile-drawer {
  position: fixed;
  top: 0; right: 0;
  width: 86%;
  max-width: 360px;
  height: 100vh;
  background: linear-gradient(160deg, #ffffff 0%, #E0E0F8 100%);
  z-index: 200;
  transform: translateX(100%);
  transition: transform .35s cubic-bezier(.22,.8,.36,1);
  box-shadow: -20px 0 60px rgba(12, 10, 74, 0.20);
  display: flex;
  flex-direction: column;
  padding: 28px 24px;
  overflow-y: auto;
}
.mobile-drawer.is-open { transform: translateX(0); }
.mobile-drawer-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 30, 55, 0.45);
  backdrop-filter: blur(4px);
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}
.mobile-drawer-mask.is-open { opacity: 1; pointer-events: auto; }

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.drawer-head .nav-brand img { width: 34px; height: 34px; }
.drawer-close {
  background: none; border: 0; cursor: pointer;
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text);
  transition: background .2s;
}
.drawer-close:hover { background: var(--primary-soft); color: var(--primary); }

.drawer-menu {
  list-style: none; margin: 18px 0 0; padding: 0;
  display: flex; flex-direction: column; gap: 4px;
}
.drawer-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: 16px;
  font-weight: 500;
  background: rgba(255,255,255,0.6);
  border: 1px solid rgba(230, 236, 242, 0.6);
  transition: all .25s;
}
.drawer-menu a:hover {
  transform: translateX(-3px);
  border-color: var(--primary);
  color: var(--primary);
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.drawer-menu a::after {
  content: "→";
  color: var(--primary);
  opacity: 0;
  transform: translateX(-6px);
  transition: all .25s;
}
.drawer-menu a:hover::after { opacity: 1; transform: translateX(0); }

.drawer-actions {
  margin-top: auto;
  padding-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.drawer-actions .btn { width: 100%; padding: 14px; font-size: 15px; }

.drawer-foot {
  margin-top: 18px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-en);
}

/* ============ FOOTER ============ */
.site-footer {
  position: relative;
  background: linear-gradient(180deg, #0C0A4A 0%, #060526 100%);
  color: #c2cad6;
  overflow: hidden;
}
.site-footer::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(140, 137, 206, 0.5), transparent);
  pointer-events: none;
}
.site-footer::after {
  content: "";
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 80%;
  max-width: 900px;
  height: 200px;
  background: radial-gradient(ellipse 50% 100% at 50% 0, rgba(140, 137, 206, 0.18), transparent 70%);
  pointer-events: none;
}
.footer-inner {
  position: relative;
  padding: 60px 24px 28px;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}
.footer-brand img { width: 44px; height: 44px; }
.footer-brand-text { line-height: 1.2; }
.footer-brand-name {
  display: block;
  font-size: 20px;
  font-weight: 600;
  color: #fff;
}
.footer-brand-sub {
  display: block;
  font-size: 12px;
  color: #7e8aa0;
  font-family: var(--font-en);
  margin-top: 2px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 60px;
  align-items: center;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.footer-col h4 {
  margin: 0 0 14px;
  font-size: 14px;
  color: #fff;
  letter-spacing: .5px;
}
.footer-col p {
  margin: 0 0 10px;
  font-size: 14px;
  line-height: 1.75;
  color: #9aa5b8;
}
.footer-contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 14px;
  color: #c2cad6;
}
.footer-contact-item svg {
  width: 16px; height: 16px;
  color: var(--primary-light);
  flex-shrink: 0;
}
.footer-contact-item a { color: #c2cad6; }
.footer-contact-item a:hover { color: var(--primary-light); }

.reseller-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(140, 137, 206, 0.18);
  border: 1px solid rgba(140, 137, 206, 0.45);
  border-radius: var(--radius-pill);
  font-size: 12px;
  color: #a9c4e8;
  margin-top: 8px;
}
.reseller-badge .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 8px var(--primary);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 24px;
  font-size: 13px;
  color: #7e8aa0;
}
.footer-bottom a { color: #9aa5b8; }
.footer-bottom a:hover { color: #fff; }

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
}

/* ============ 語言切換 ============ */
.lang-switch {
  position: relative;
}
.lang-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-soft);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: all .2s;
}
.lang-trigger:hover {
  color: var(--primary-dark);
  border-color: var(--primary);
  background: var(--primary-soft);
}
.lang-trigger svg.globe { width: 16px; height: 16px; }
.lang-trigger svg.chev {
  width: 12px; height: 12px;
  transition: transform .25s;
}
.lang-switch.is-open .lang-trigger svg.chev { transform: rotate(180deg); }
.lang-trigger .label {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-weight: 600;
  letter-spacing: .5px;
}

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 40px rgba(12, 10, 74, 0.18);
  padding: 8px;
  list-style: none;
  margin: 0;
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 110;
}
.lang-switch.is-open .lang-menu {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.lang-menu li { margin: 0; }
.lang-menu a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  transition: background .2s;
}
.lang-menu a:hover { background: var(--primary-soft); color: var(--primary-dark); }
.lang-menu a.is-active {
  background: linear-gradient(135deg, #8C89CE 0%, #0C0A4A 100%);
  color: #fff;
}
.lang-menu a.is-active .lang-code,
.lang-menu a.is-active .lang-sub { color: rgba(255,255,255,.85); }
.lang-code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius: 6px;
  letter-spacing: .5px;
  flex-shrink: 0;
}
.lang-menu a.is-active .lang-code { border-color: rgba(255,255,255,.4); }
.lang-name { flex: 1; font-weight: 500; }
.lang-sub {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
  margin-top: 2px;
  font-family: var(--font-en);
}

/* 移動端抽屜中的語言切換 */
.drawer-lang {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.drawer-lang-title {
  font-family: var(--font-en);
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 10px;
  padding: 0 4px;
}
.drawer-lang-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.drawer-lang-list a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.6);
  border: 1px solid rgba(230, 236, 242, 0.6);
  border-radius: 10px;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
  transition: all .2s;
}
.drawer-lang-list a:hover {
  border-color: var(--primary);
  background: #fff;
  color: var(--primary-dark);
}
.drawer-lang-list a.is-active {
  background: linear-gradient(135deg, #8C89CE 0%, #0C0A4A 100%);
  color: #fff;
  border-color: transparent;
}
.drawer-lang-list .lang-code { border-color: var(--border); }
.drawer-lang-list a.is-active .lang-code {
  border-color: rgba(255,255,255,.4);
  color: #fff;
}

/* ============ 移動端適配 ============ */
@media (max-width: 1080px) {
  .nav-menu { display: none; }
  .nav-actions .btn { display: none; }
  .nav-toggle { display: inline-flex; }
}
@media (max-width: 520px) {
  .nav-brand-name { font-size: 15px; }
}
