/* tlgr.tw — Telegram 網頁版繁體中文導引
   給電腦新手看的教學站，視覺獨立於 sean.cat。 */

:root {
  --blue: #229ED9;
  --blue-d: #1b87ba;
  --grad-1: #2AABEE;
  --grad-2: #229ED9;
  --ok: #2ea36b;
  --bg: #eef3f8;
  --surface: #ffffff;
  --surface-2: #f5f9fc;
  --text: #17222d;
  --muted: #5c6b79;
  --border: #e0e8f0;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 8px 30px rgba(20, 55, 90, .09);
  --shadow-sm: 0 2px 10px rgba(20, 55, 90, .06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang TC",
    "Microsoft JhengHei", "Noto Sans TC", "Hiragino Sans TC", "Heiti TC", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1620;
    --surface: #172230;
    --surface-2: #1d2a3a;
    --text: #e8eff5;
    --muted: #9fb0c0;
    --border: #2a3949;
    --shadow: 0 8px 30px rgba(0, 0, 0, .35);
    --shadow-sm: 0 2px 10px rgba(0, 0, 0, .25);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--blue-d); }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 62px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .2px; }
.brand svg { width: 30px; height: 30px; flex: none; }
.brand b { font-size: 19px; }
.brand span { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.brand .stack { display: flex; flex-direction: column; line-height: 1.15; }
.nav-spacer { flex: 1; }
.nav-link {
  font-size: 15px; font-weight: 600; color: var(--muted);
  text-decoration: none; padding: 8px 12px; border-radius: 10px;
}
.nav-link:hover { color: var(--text); background: var(--surface-2); }
@media (max-width: 600px) { .nav-link.hide-sm { display: none; } }

/* language switcher 繁/简 */
.lang-switch {
  display: inline-flex; gap: 2px; margin-left: 4px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 3px;
}
.lang-switch a {
  font-size: 13.5px; font-weight: 700; color: var(--muted);
  text-decoration: none; padding: 5px 12px; border-radius: 999px; line-height: 1;
}
.lang-switch a:hover { color: var(--text); }
.lang-switch a[aria-current="page"] { background: var(--blue); color: #fff; }

/* 俗稱/關鍵字小註 in hero */
.aka {
  margin: 18px 0 0; font-size: 14px; color: rgba(255,255,255,.9);
  background: rgba(255,255,255,.12); border-radius: 12px;
  padding: 10px 14px; display: inline-block;
}
.aka b { color: #fff; }

/* ---------- hero ---------- */
.hero {
  background: linear-gradient(150deg, var(--grad-1), var(--grad-2));
  color: #fff;
  padding: 56px 0 68px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 90% at 85% -10%, rgba(255,255,255,.22), transparent 60%);
  pointer-events: none;
}
.hero .wrap { position: relative; z-index: 1; }
.hero h1 {
  font-size: clamp(30px, 6.4vw, 44px);
  line-height: 1.25;
  margin: 0 0 14px;
  font-weight: 850;
  letter-spacing: .3px;
}
.hero p.lead {
  font-size: clamp(16px, 3.6vw, 19px);
  margin: 0 0 28px;
  color: rgba(255, 255, 255, .94);
  max-width: 34em;
}
.cta {
  display: inline-flex; align-items: center; gap: 10px;
  background: #fff; color: var(--blue-d);
  font-weight: 800; font-size: 18px;
  padding: 15px 26px; border-radius: 999px;
  text-decoration: none; border: none; cursor: pointer;
  box-shadow: 0 10px 26px rgba(0, 40, 70, .22);
  transition: transform .12s ease, box-shadow .12s ease;
}
.cta:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(0, 40, 70, .28); }
.cta:active { transform: translateY(0); }

.badges {
  list-style: none; margin: 26px 0 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 8px 18px;
}
.badges li { display: flex; align-items: center; gap: 7px; font-size: 14.5px; font-weight: 600; color: rgba(255,255,255,.96); }
.badges .ck {
  width: 20px; height: 20px; flex: none; border-radius: 999px;
  background: rgba(255, 255, 255, .22);
  display: grid; place-items: center; font-size: 12px;
}

/* ---------- section ---------- */
section { padding: 48px 0; }
.section-title {
  font-size: clamp(22px, 5vw, 28px);
  font-weight: 800; margin: 0 0 6px; letter-spacing: .3px;
}
.section-sub { color: var(--muted); margin: 0 0 26px; font-size: 16px; }

/* card */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 22px;
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 16px; }

.safe-card { display: flex; gap: 16px; align-items: flex-start; }
.safe-card .ic { font-size: 30px; line-height: 1; flex: none; }
.safe-card h3 { margin: 2px 0 8px; font-size: 18px; }
.safe-card p { margin: 0 0 8px; color: var(--muted); font-size: 15.5px; }
.safe-card p:last-child { margin-bottom: 0; }
.safe-card strong { color: var(--text); }

/* ---------- tabs ---------- */
.picker-hint {
  background: var(--surface-2);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px; margin-bottom: 18px;
  font-size: 15px; color: var(--muted);
}
.picker-hint b { color: var(--text); }

.tabs {
  display: inline-flex; padding: 5px; gap: 4px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px; margin-bottom: 22px;
}
.tab {
  appearance: none; border: none; cursor: pointer;
  font-family: inherit; font-size: 16px; font-weight: 700;
  color: var(--muted); background: transparent;
  padding: 10px 22px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 8px;
  transition: background .15s ease, color .15s ease;
}
.tab[aria-selected="true"] {
  background: var(--blue); color: #fff;
  box-shadow: 0 4px 12px rgba(34, 158, 217, .35);
}
.tab-badge {
  font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 999px;
  background: rgba(255, 255, 255, .25);
}
.tab[aria-selected="false"] .tab-badge { background: var(--ok); color: #fff; }

.panel[hidden] { display: none; }

/* ---------- steps ---------- */
.step { position: relative; padding-left: 62px; padding-bottom: 30px; }
.step:last-child { padding-bottom: 0; }
.step::before {
  content: ""; position: absolute; left: 22px; top: 46px; bottom: 0;
  width: 2px; background: var(--border);
}
.step:last-child::before { display: none; }
.step .num {
  position: absolute; left: 0; top: 0;
  width: 46px; height: 46px; border-radius: 999px;
  background: var(--blue); color: #fff;
  display: grid; place-items: center;
  font-size: 20px; font-weight: 800;
  box-shadow: 0 5px 14px rgba(34, 158, 217, .35);
}
.step h3 { margin: 8px 0 10px; font-size: 19px; }
.step p { margin: 0 0 12px; }
.step .emoji-lead { font-size: 20px; margin-right: 4px; }

/* device / tip callouts */
.note {
  display: flex; gap: 11px; align-items: flex-start;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 15px;
  margin: 0 0 12px; font-size: 15px; color: var(--muted); line-height: 1.65;
}
.note .tag { font-size: 18px; flex: none; }
.note b { color: var(--text); }
.note.warn { background: color-mix(in srgb, #f0b429 14%, var(--surface)); border-color: color-mix(in srgb, #f0b429 40%, var(--border)); }

/* open-web button (inside steps) */
.open-btn {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--blue); color: #fff; text-decoration: none;
  font-weight: 700; font-size: 16px;
  padding: 12px 20px; border-radius: 12px;
  box-shadow: 0 5px 14px rgba(34, 158, 217, .3);
  transition: transform .12s ease, background .12s ease;
}
.open-btn:hover { background: var(--blue-d); transform: translateY(-1px); }
.open-btn .ext { font-size: 13px; opacity: .8; }

/* language one-click buttons */
.lang-grid { display: grid; gap: 10px; margin: 6px 0 4px; }
.lang-btn {
  display: flex; align-items: center; gap: 14px;
  text-decoration: none; color: var(--text);
  background: var(--surface); border: 2px solid var(--border);
  border-radius: 14px; padding: 14px 16px;
  transition: border-color .12s ease, transform .12s ease, box-shadow .12s ease;
}
.lang-btn:hover { border-color: var(--blue); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.lang-btn .flag { font-size: 30px; flex: none; }
.lang-btn .body { flex: 1; min-width: 0; }
.lang-btn .body b { display: block; font-size: 16.5px; }
.lang-btn .body small { color: var(--muted); font-size: 13px; word-break: break-all; }
.lang-btn .go { color: var(--blue); font-weight: 800; font-size: 22px; flex: none; }

.method-label {
  display: inline-block; font-size: 13px; font-weight: 800;
  color: var(--blue-d); background: color-mix(in srgb, var(--blue) 12%, var(--surface));
  padding: 3px 11px; border-radius: 999px; margin: 4px 0 10px;
}

kbd {
  font-family: var(--font); font-weight: 700; font-size: 13.5px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-bottom-width: 2px; border-radius: 7px; padding: 2px 8px;
  color: var(--text); white-space: nowrap;
}

/* ---------- FAQ ---------- */
.faq-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); margin-bottom: 10px; overflow: hidden;
}
.faq-item summary {
  cursor: pointer; list-style: none; padding: 16px 46px 16px 18px;
  font-weight: 700; font-size: 16.5px; position: relative;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%);
  font-size: 24px; font-weight: 400; color: var(--blue); transition: transform .2s ease;
}
.faq-item[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq-item .ans { padding: 0 18px 18px; color: var(--muted); font-size: 15.5px; line-height: 1.75; }
.faq-item .ans p { margin: 0 0 8px; }
.faq-item .ans p:last-child { margin-bottom: 0; }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 32px 0 40px;
  font-size: 13.5px; color: var(--muted); line-height: 1.7;
}
.site-footer .wrap > p { margin: 0 0 10px; }
.site-footer .disclaimer {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 16px;
}
.site-footer .disclaimer p { margin: 0; }
.site-footer .disclaimer p[lang="en"] {
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--border);
  color: var(--muted); font-size: 12.5px; line-height: 1.6;
}
.site-footer a { color: var(--blue-d); }
.site-footer .copy { opacity: .8; }
