:root {
  --paper: #f7f0e4;
  --paper-deep: #eee3d2;
  --ink: #25304a;
  --body: #20242d;
  --purple: #6e5a8d;
  --purple-deep: #51416f;
  --lavender: #d9cdea;
  --rose: #d6aaa5;
  --sage: #9eaf9d;
  --blue: #91a9c2;
  --line: rgba(37, 48, 74, .13);
  --sidebar-width: 292px;
  --shadow: 0 16px 42px rgba(52, 43, 65, .12);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--body);
  font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  font-size: 18px;
  line-height: 1.75;
}
a { color: inherit; }
button, input { font: inherit; }
.skip-link { position: fixed; z-index: 100; left: 16px; top: -80px; padding: 10px 18px; background: white; border-radius: 10px; }
.skip-link:focus { top: 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; z-index: 30;
  width: var(--sidebar-width); padding: 32px 22px 24px;
  background: #f1e8db; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 13px; padding: 0 8px 26px; border-bottom: 1px solid var(--line); }
.avatar-wrap { width: 70px; height: 70px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 22px; background: var(--lavender); overflow: hidden; }
.avatar { width: 92%; transform: translateY(6px); }
.eyebrow { margin: 0; color: var(--purple-deep); font: 900 23px/1.3 "Kosugi Maru", "Microsoft JhengHei", sans-serif; }
.brand-note { margin: 4px 0 0; font-size: 13px; line-height: 1.5; color: #6d6574; }
nav { padding-top: 25px; }
.nav-heading { margin: 22px 12px 10px; color: #84798a; font-size: 13px; font-weight: 700; letter-spacing: .14em; }
.nav-link { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 9px 13px; margin: 4px 0; border-radius: 14px; text-decoration: none; color: #574e5d; font-size: 16px; font-weight: 700; transition: .2s ease; }
.nav-link:hover, .nav-link:focus-visible { background: rgba(255,255,255,.7); color: var(--purple-deep); }
.nav-link.active { background: var(--purple-deep); color: white; box-shadow: 0 8px 22px rgba(81,65,111,.2); }
.nav-icon { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; background: rgba(255,255,255,.22); font-size: 15px; }
.nav-link:not(.active) .nav-icon { color: var(--purple-deep); background: rgba(217,205,234,.58); }
.sidebar-footer { margin-top: auto; padding: 20px 10px 0; display: flex; gap: 9px; align-items: center; color: #716879; font-size: 12px; line-height: 1.45; }
.status-dot { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: #cf9a59; box-shadow: 0 0 0 4px rgba(207,154,89,.16); }
.status-dot.ready { background: #6c9b77; box-shadow: 0 0 0 4px rgba(108,155,119,.16); }
.status-dot.error { background: #b86666; box-shadow: 0 0 0 4px rgba(184,102,102,.16); }

.main { margin-left: var(--sidebar-width); min-width: 0; }
.hero { min-height: 680px; padding: 80px clamp(34px, 7vw, 110px); position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.14fr) minmax(330px, .86fr); align-items: center; gap: 64px; background: radial-gradient(circle at 88% 14%, rgba(217,205,234,.7), transparent 32%), linear-gradient(140deg, #fbf7ef 0%, #f6efe3 55%, #ece0d3 100%); border-bottom: 1px solid var(--line); }
.hero::before, .hero::after { content: ""; position: absolute; border-radius: 50%; border: 1px solid rgba(110,90,141,.18); }
.hero::before { width: 310px; height: 310px; right: -160px; bottom: -130px; }
.hero::after { width: 160px; height: 160px; left: 39%; top: -100px; }
.hero-copy { position: relative; z-index: 2; }
.hero-kicker, .section-label { margin: 0 0 14px; color: var(--purple); font-size: 13px; font-weight: 900; letter-spacing: .22em; }
h1 { margin: 0; color: var(--ink); font: 900 clamp(50px, 5.2vw, 82px)/1.18 "Kosugi Maru", "Microsoft JhengHei", sans-serif; letter-spacing: .02em; }
h1 span { color: var(--purple-deep); position: relative; display: inline-block; }
h1 span::after { content: ""; position: absolute; left: 3%; right: -2%; bottom: -3px; height: 13px; border-radius: 50%; background: var(--rose); opacity: .48; transform: rotate(-1deg); z-index: -1; }
.hero-description { max-width: 720px; margin: 30px 0; color: #4e4b54; font-size: 18px; line-height: 1.8; }
.hero-actions { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.primary-action { display: inline-flex; align-items: center; gap: 18px; padding: 13px 21px; border-radius: 14px; color: white; background: var(--purple-deep); text-decoration: none; font-size: 17px; font-weight: 700; box-shadow: 0 10px 25px rgba(81,65,111,.25); }
.primary-action:hover { transform: translateY(-2px); }
.updated-text { margin: 0; color: #77717b; font-size: 14px; }
.hero-visual { min-height: 470px; position: relative; display: grid; place-items: center; }
.poster-card { position: absolute; width: min(330px, 76%); aspect-ratio: .73; border-radius: 22px; box-shadow: var(--shadow); }
.poster-back-one { background: var(--sage); transform: rotate(-9deg) translate(-16px, 3px); }
.poster-back-two { background: var(--blue); transform: rotate(9deg) translate(19px, 8px); }
.poster-main { padding: 24px 20px 18px; background: #fffaf1; transform: rotate(-1.5deg); border: 2px solid rgba(81,65,111,.16); display: flex; flex-direction: column; align-items: center; justify-content: space-between; overflow: hidden; }
.poster-main::before { content: ""; position: absolute; width: 210px; height: 210px; border-radius: 50%; background: var(--lavender); top: 85px; z-index: -1; }
.poster-main img { width: 76%; max-height: 265px; object-fit: contain; margin-top: 6px; }
.poster-small { align-self: flex-start; color: var(--purple); font-size: 12px; font-weight: 900; letter-spacing: .12em; }
.poster-title { color: var(--ink); text-align: center; font: 900 31px/1.35 "Kosugi Maru", "Microsoft JhengHei", sans-serif; }

.resource-area { padding: 82px clamp(28px, 6vw, 90px) 96px; background-image: linear-gradient(rgba(110,90,141,.03) 1px, transparent 1px), linear-gradient(90deg, rgba(110,90,141,.03) 1px, transparent 1px); background-size: 32px 32px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin-bottom: 38px; }
h2 { margin: 0; color: var(--ink); font: 900 clamp(36px, 4vw, 56px)/1.25 "Kosugi Maru", "Microsoft JhengHei", sans-serif; }
.search-box { width: min(390px, 100%); height: 58px; display: flex; align-items: center; gap: 10px; padding: 0 17px; border: 1px solid rgba(81,65,111,.2); border-radius: 16px; background: rgba(255,255,255,.7); box-shadow: 0 7px 25px rgba(59,48,72,.06); }
.search-box:focus-within { outline: 3px solid rgba(110,90,141,.2); border-color: var(--purple); }
.search-icon { color: var(--purple); font-size: 28px; line-height: 1; }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--body); font-size: 16px; }
.search-box input::placeholder { color: #8b858e; }
.resource-groups { display: grid; gap: 52px; position: relative; }
.resource-groups::before { content: ""; position: absolute; top: 12px; bottom: 12px; left: 23px; width: 2px; background: repeating-linear-gradient(to bottom, rgba(110,90,141,.18) 0 8px, transparent 8px 16px); }
.resource-group { scroll-margin-top: 30px; position: relative; padding-left: 66px; }
.group-heading { display: flex; align-items: center; gap: 14px; margin: 0 0 18px; }
.group-icon { position: absolute; left: 0; top: -3px; z-index: 1; width: 48px; height: 48px; display: grid; place-items: center; border: 3px solid var(--paper); border-radius: 16px; color: white; background: var(--accent, var(--purple)); box-shadow: 0 7px 18px color-mix(in srgb, var(--accent, var(--purple)) 26%, transparent); font: 900 23px/1 "Kosugi Maru", sans-serif; transform: rotate(-3deg); }
.group-heading h3 { margin: 0; color: var(--ink); font: 900 29px/1.3 "Kosugi Maru", "Microsoft JhengHei", sans-serif; }
.group-count { margin-left: auto; padding: 4px 11px; border-radius: 999px; background: rgba(110,90,141,.1); color: var(--purple-deep); font-size: 13px; font-weight: 700; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(315px, 100%), 1fr)); gap: 18px; }
.resource-card { min-height: 178px; padding: 25px; position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 24px; border: 1px solid var(--line); border-radius: 20px; background: rgba(255,255,255,.78); box-shadow: 0 8px 28px rgba(48,43,55,.07); overflow: hidden; transition: transform .2s ease, box-shadow .2s ease; }
.resource-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 7px; background: var(--accent, var(--purple)); }
.card-doodle { position: absolute; right: 18px; top: 13px; color: color-mix(in srgb, var(--accent, var(--purple)) 42%, white); font: 900 30px/1 "Kosugi Maru", sans-serif; transform: rotate(8deg); }
.resource-card:hover { transform: translateY(-4px); box-shadow: 0 14px 34px rgba(48,43,55,.13); }
.card-category { margin: 0 0 9px; color: var(--accent-dark, var(--purple)); font-size: 13px; font-weight: 900; letter-spacing: .08em; }
.resource-card h4 { margin: 0; color: #252a3b; font-size: 18px; line-height: 1.55; }
.card-link { align-self: flex-start; display: inline-flex; align-items: center; gap: 10px; color: var(--purple-deep); font-size: 16px; font-weight: 900; text-decoration: none; }
.card-link::after { content: "↗"; width: 31px; height: 31px; display: grid; place-items: center; border-radius: 50%; background: var(--lavender); transition: transform .2s ease; }
.card-link:hover::after { transform: translate(3px, -3px); }
.state-card { display: flex; align-items: center; gap: 18px; min-height: 120px; padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.72); }
.state-card strong { color: var(--ink); font-size: 20px; }
.state-card p { margin: 3px 0 0; font-size: 16px; color: #66616b; }
.loader { width: 42px; height: 42px; flex: 0 0 auto; border: 4px solid var(--lavender); border-top-color: var(--purple); border-radius: 50%; animation: spin .8s linear infinite; }
.state-symbol { width: 42px; height: 42px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; background: var(--lavender); color: var(--purple-deep); font-weight: 900; }
.error-state { border-color: rgba(165,82,82,.25); }
#retry-button { margin-top: 12px; padding: 7px 14px; border: 0; border-radius: 10px; color: white; background: var(--purple-deep); cursor: pointer; font-size: 15px; }
footer { min-height: 170px; padding: 34px clamp(28px, 6vw, 90px); display: flex; align-items: center; gap: 20px; background: var(--ink); color: white; }
.footer-avatar { width: 72px; height: 72px; object-fit: cover; object-position: top; border-radius: 50%; background: var(--lavender); }
footer p { margin: 0; font-size: 14px; line-height: 1.7; color: #e8e4ec; }
footer strong { font-size: 18px; }
footer a { margin-left: auto; color: white; font-size: 15px; text-decoration: none; }
.mobile-menu { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1020px) {
  :root { --sidebar-width: 250px; }
  .hero { grid-template-columns: 1fr; padding-top: 62px; }
  .hero-visual { min-height: 430px; }
  .section-heading { align-items: stretch; flex-direction: column; }
  .search-box { width: 100%; }
}
@media (max-width: 760px) {
  html { scroll-padding-top: 82px; }
  body { font-size: 18px; }
  .mobile-menu { position: fixed; z-index: 45; top: 12px; left: 12px; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 14px; border: 1px solid rgba(81,65,111,.2); border-radius: 14px; color: white; background: var(--purple-deep); box-shadow: var(--shadow); font-size: 15px; font-weight: 700; }
  .sidebar { width: min(310px, 87vw); transform: translateX(-105%); transition: transform .25s ease; box-shadow: 18px 0 35px rgba(40,35,47,.18); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop { position: fixed; z-index: 25; inset: 0; background: rgba(29,27,34,.4); }
  .main { margin-left: 0; }
  .hero { min-height: auto; padding: 110px 24px 56px; gap: 30px; }
  h1 { font-size: clamp(44px, 13vw, 62px); }
  .hero-description { font-size: 18px; }
  .hero-visual { min-height: 400px; }
  .poster-card { width: min(280px, 78%); }
  .resource-area { padding: 62px 20px 70px; }
  .section-heading { margin-bottom: 28px; }
  .group-heading h3 { font-size: 26px; }
  .resource-groups { gap: 42px; }
  .resource-groups::before { left: 18px; }
  .resource-group { padding-left: 48px; }
  .group-icon { width: 38px; height: 38px; border-radius: 13px; font-size: 18px; }
  .group-count { display: none; }
  footer { align-items: flex-start; flex-wrap: wrap; }
  footer a { width: 100%; margin-left: 92px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
