/* app.jerry.com.tw 入口頁
   注意：站根沒有放寬 CSP（style-src 'self'），所以樣式只能放這支外部檔，
   頁面裡不要出現 inline style 或 inline script。 */

:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #1c2027;
  --muted: #6b7480;
  --line: #e4e7eb;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .05);
  --shadow-hover: 0 4px 10px rgba(16, 24, 40, .07), 0 18px 40px rgba(16, 24, 40, .10);
  --radius: 18px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --panel: #171a21;
    --text: #e8eaef;
    --muted: #9aa3ad;
    --line: #272b35;
    --shadow: 0 1px 2px rgba(0, 0, 0, .5);
    --shadow-hover: 0 10px 30px rgba(0, 0, 0, .55);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 520px at 12% -8%, rgba(59, 130, 246, .10), transparent 60%),
    radial-gradient(900px 480px at 92% 4%, rgba(244, 114, 182, .10), transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", "Noto Sans TC", "PingFang TC",
    "Microsoft JhengHei", sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; }

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--panel);
  padding: 10px 14px;
  border-radius: 0 0 10px 0;
  border: 1px solid var(--line);
}
.skip:focus { left: 0; z-index: 10; }

.hero {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(40px, 8vw, 76px) 22px 10px;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.9rem, 4.6vw, 2.6rem);
  line-height: 1.2;
  letter-spacing: -.01em;
  font-weight: 800;
}

/* 站名旁的小圖示：和 favicon 同一顆記號，讓瀏覽器分頁、桌面捷徑、頁面看起來是同一套 */
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 12px;
}

.brand-mark {
  flex: 0 0 auto;
  width: clamp(38px, 8vw, 48px);
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(16, 24, 40, .18);
}

.lede {
  margin: 0;
  max-width: 52ch;
  color: var(--muted);
  font-size: .98rem;
}

main {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 26px 22px 8px;
  flex: 1;
}

.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 16px;
}

.grid > li { display: flex; }

.card {
  display: flex;
  gap: 16px;
  width: 100%;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.card:hover,
.card:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: var(--tint);
}

.card:focus-visible {
  outline: 2px solid var(--tint);
  outline-offset: 2px;
}

.icon {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--tint-soft);
  color: var(--tint);
}

.icon svg { width: 22px; height: 22px; }

.text {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.name {
  font-weight: 700;
  font-size: 1.04rem;
  line-height: 1.35;
}

.desc {
  color: var(--muted);
  font-size: .89rem;
  line-height: 1.65;
}

.foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  /* 卡片說明長短不一；把標籤／路徑推到底部，同一排的卡片才會對齊 */
  margin-top: auto;
  padding-top: 8px;
}

.tag {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--tint-soft);
  color: var(--tint);
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
}

.path {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .78rem;
  letter-spacing: .01em;
  white-space: nowrap;
}

.foot-note {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 22px 34px;
  color: var(--muted);
  font-size: .82rem;
}

.foot-note p { margin: 0; }

.foot-note a {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.foot-note a:hover { color: var(--text); }

/* 卡片配色 */
.t-amber  { --tint: #b45309; --tint-soft: #fef3c7; }
.t-rose   { --tint: #be123c; --tint-soft: #ffe4e6; }
.t-emerald{ --tint: #047857; --tint-soft: #d1fae5; }
.t-indigo { --tint: #4338ca; --tint-soft: #e0e7ff; }
.t-sky    { --tint: #0369a1; --tint-soft: #e0f2fe; }
.t-slate  { --tint: #475569; --tint-soft: #e9edf2; }
.t-cyan   { --tint: #0e7490; --tint-soft: #cffafe; }
.t-teal   { --tint: #0f766e; --tint-soft: #ccfbf1; }
.t-violet { --tint: #6d28d9; --tint-soft: #ede9fe; }

@media (prefers-color-scheme: dark) {
  .t-amber  { --tint: #fbbf24; --tint-soft: #3a2a10; }
  .t-rose   { --tint: #fb7185; --tint-soft: #3c1620; }
  .t-emerald{ --tint: #34d399; --tint-soft: #0f2f28; }
  .t-indigo { --tint: #a5b4fc; --tint-soft: #1e1f3d; }
  .t-sky    { --tint: #7dd3fc; --tint-soft: #102c3d; }
  .t-slate  { --tint: #cbd5e1; --tint-soft: #232932; }
  .t-cyan   { --tint: #67e8f9; --tint-soft: #0c2b33; }
  .t-teal   { --tint: #5eead4; --tint-soft: #0d2f2c; }
  .t-violet { --tint: #c4b5fd; --tint-soft: #241a3d; }
}

@media (prefers-reduced-motion: reduce) {
  .card { transition: none; }
  .card:hover { transform: none; }
}

@media (max-width: 420px) {
  .card { padding: 16px; gap: 12px; }
  .foot { flex-direction: column; align-items: flex-start; gap: 4px; }
}
