/* medici.work 封存站樣式：沿用原平台的配色與版面 */
:root {
  --brand: #007bff;
  --brand-dark: #0062cc;
  --title: #000000;
  --text: #1f2328;
  --sub: #565b66;
  --muted: #8a8f98;
  --line: #e6e8eb;
  --bg: #ffffff;
  --bg-soft: #f5f6f8;
  --notice-bg: #eef5ff;
  --radius: 6px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { color: var(--title); line-height: 1.35; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.wrap { width: 100%; max-width: 1104px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 728px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }

/* ---------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px; border-radius: var(--radius); border: 1px solid transparent;
  font-size: 15px; font-weight: 700; line-height: 1.3; white-space: nowrap; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-outline { background: #fff; color: var(--brand); border-color: var(--brand); }
.btn-outline:hover { background: var(--notice-bg); }
.btn-sm { padding: 7px 13px; font-size: 14px; }
.btn-block { display: flex; width: 100%; }
.btn-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- notice + header */
.notice { background: var(--notice-bg); color: var(--sub); font-size: 13.5px; text-align: center; padding: 8px 0; line-height: 1.5; }
.notice a { font-weight: 600; white-space: nowrap; }
.site-header { background: #fff; position: relative; z-index: 20; }
.header-inner { display: flex; align-items: center; gap: 20px; height: 64px; max-width: 1440px; }
.logo { display: flex; align-items: center; margin-right: auto; }
.logo img { height: 38px; width: auto; display: block; }
.main-nav { display: flex; gap: 22px; }
.main-nav a { color: var(--sub); font-size: 15px; padding: 21px 0 19px; border-bottom: 3px solid transparent; }
.main-nav a:hover { color: var(--title); text-decoration: none; }
.main-nav a[aria-current="page"] { color: var(--title); border-bottom-color: var(--brand); }
.mobile-nav { display: none; position: relative; }
.mobile-nav summary { list-style: none; cursor: pointer; color: var(--sub); display: flex; padding: 6px; }
.mobile-nav summary::-webkit-details-marker { display: none; }
.mobile-nav nav { position: absolute; right: 0; top: 44px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.1); min-width: 180px; padding: 6px 0; }
.mobile-nav nav a { display: block; padding: 10px 18px; color: var(--text); }

/* ---------- hero carousel */
.hero { position: relative; background: #0b1530; }
.slides { list-style: none; margin: 0; padding: 0; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.slides::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; scroll-snap-align: start; }
.slide a, .slide img { display: block; width: 100%; }
.slide img { aspect-ratio: 2.88 / 1; object-fit: cover; }
.hero-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(0, 0, 0, .45); color: #fff; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .2s;
}
.hero:hover .hero-arrow, .hero-arrow:focus-visible { opacity: 1; }
.hero-arrow.prev { left: 16px; }
.hero-arrow.next { right: 16px; }
.dots { position: absolute; left: 0; right: 0; bottom: 12px; display: flex; justify-content: center; gap: 8px; }
.dot { width: 9px; height: 9px; border-radius: 50%; border: 0; padding: 0; background: rgba(255, 255, 255, .5); cursor: pointer; }
.dot[aria-current="true"] { background: #fff; }

/* ---------- sections + grid */
.section { padding: 40px 0 56px; }
.section-tight { padding-top: 8px; }
.section-title { text-align: center; font-size: 20px; margin: 0 0 32px; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px 24px; max-width: 1104px; margin: 0 auto; }

.card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 4px; box-shadow: var(--shadow); overflow: hidden; }
.card-media { display: block; background: var(--bg-soft); }
.card-media img { display: block; width: 100%; aspect-ratio: 1.91 / 1; object-fit: cover; }
.card-body { display: flex; flex-direction: column; flex: 1; padding: 16px 16px 18px; }
.card-title { font-size: 15.5px; margin: 0 0 14px; line-height: 1.55; }
.card-title a { color: var(--title); }
.card-sub { color: var(--sub); font-size: 13.5px; margin: -6px 0 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; color: var(--sub); font-size: 13px; }
.card-meta time { color: var(--muted); }
.lecturer-inline { display: inline-flex; align-items: center; gap: 8px; }
.lecturer-inline img { border-radius: 50%; object-fit: cover; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 18px; }
.card-status { color: var(--muted); font-size: 14px; }
.card-price { color: var(--title); font-weight: 700; }
.post-card .card-body { padding-bottom: 16px; }

/* ---------- page heads */
.page-head { padding-top: 28px; }
.page-head h1 { font-size: 28px; margin: 6px 0 20px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--muted); }
.crumbs a { color: var(--sub); }

/* ---------- course page */
.course-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 330px; column-gap: 32px;
  grid-template-areas: "head side" "main side"; align-items: start; padding-top: 40px; padding-bottom: 64px;
}
.course-head { grid-area: head; }
.course-side { grid-area: side; }
.course-main { grid-area: main; min-width: 0; }
.side-sticky { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 16px; }
.badge { display: inline-block; font-size: 12.5px; font-weight: 700; padding: 3px 10px; border-radius: 3px; }
.badge-ended { background: #4b5563; color: #fff; }
.badge-sale { background: #127a4a; color: #fff; }
.course-head h1 { font-size: 30px; margin: 10px 0 10px; }
.lead { color: var(--sub); font-size: 15px; margin: 0 0 14px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.tag { font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--brand); border: 1px solid var(--brand); border-radius: 4px; padding: 2px 7px; }
.course-head .card-meta { font-size: 14px; margin-bottom: 20px; }

.tabs { display: flex; flex-wrap: wrap; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.tabs a { flex: 1; text-align: center; color: var(--sub); padding: 13px 8px; font-size: 14.5px; white-space: nowrap; }
.tabs a:hover { color: var(--title); text-decoration: none; }
.course-sec { padding-top: 28px; scroll-margin-top: 16px; }
.course-sec > h2 { font-size: 18px; margin: 0 0 18px; }

.side-card { border: 1px solid var(--line); border-radius: 4px; background: #fff; box-shadow: var(--shadow); overflow: hidden; }
.media-card .media img { display: block; width: 100%; }
.includes { padding: 14px 16px 16px; font-size: 13.5px; color: var(--text); }
.includes p { margin: 0 0 6px; font-weight: 600; }
.includes ul { list-style: none; margin: 0; padding: 0; color: var(--sub); }
.includes li { display: flex; align-items: center; gap: 8px; line-height: 1.9; }
.status-card { padding: 20px 18px; }
.status-card .status-label { display: inline-block; margin: 0 0 8px; font-size: 12px; font-weight: 700; color: #fff; background: #4b5563; padding: 2px 9px; border-radius: 3px; }
.status-card h2 { font-size: 17px; margin: 0 0 8px; }
.status-card p { color: var(--sub); font-size: 13.5px; margin: 0 0 16px; }

.objectives { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.objectives li { display: flex; gap: 10px; align-items: flex-start; }
.objectives svg { color: var(--brand); flex: none; margin-top: 3px; }

.cur-section { border: 1px solid var(--line); border-radius: 4px; margin-bottom: 12px; overflow: hidden; }
.cur-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; background: var(--bg-soft); padding: 12px 16px; }
.cur-head h3 { font-size: 15px; margin: 0; }
.sec-dur, .lec-dur { color: var(--muted); font-size: 13px; white-space: nowrap; }
.cur-section ul { list-style: none; margin: 0; padding: 0; }
.lec, .lec summary { display: flex; align-items: center; gap: 10px; padding: 10px 16px; font-size: 14px; }
.lec { border-top: 1px solid var(--line); }
.lec.has-preview { padding: 0; display: block; }
.lec summary { cursor: pointer; list-style: none; }
.lec summary::-webkit-details-marker { display: none; }
.lec details[open] summary { background: var(--notice-bg); }
.lec details .video-embed { margin: 0; border-radius: 0; }
.lec-icon { color: var(--muted); display: flex; flex: none; }
.lec-title { flex: 1; }
.badge-preview { font-size: 12px; font-weight: 700; color: var(--brand); border: 1px solid var(--brand); border-radius: 3px; padding: 0 7px; line-height: 1.6; }

.lecturer-box { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 24px; }
.lecturer-box > img { border-radius: 50%; object-fit: cover; flex: none; }
.lecturer-box h3 { font-size: 16px; margin: 4px 0 0; }
.lecturer-box .muted { margin: 2px 0 8px; font-size: 13.5px; }
.lecturer-box .rich { font-size: 14px; color: var(--sub); }

/* ---------- rich content (course descriptions + posts) */
.rich { overflow-wrap: anywhere; }
.rich > :first-child { margin-top: 0; }
.rich h2 { font-size: 21px; margin: 2em 0 .7em; }
.rich h3 { font-size: 18px; margin: 1.7em 0 .6em; }
.rich h4 { font-size: 16px; margin: 1.5em 0 .5em; }
.rich p { margin: 0 0 1em; }
.rich ul, .rich ol { padding-left: 1.5em; margin: 0 0 1.1em; }
.rich li { margin: .25em 0; }
.rich figure { margin: 1.4em 0; }
.rich figure.image img, .rich p img { display: block; margin: 0 auto; }
.rich img { border-radius: 2px; }
.rich hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.rich blockquote { margin: 1.4em 0; padding: 12px 18px; background: var(--bg-soft); border-left: 4px solid var(--line); color: var(--sub); }
.rich blockquote > :last-child { margin-bottom: 0; }
.rich code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; background: var(--bg-soft); padding: .1em .35em; border-radius: 3px; }
.rich pre { background: #1f2328; color: #f5f6f8; padding: 14px 16px; border-radius: 6px; overflow-x: auto; font-size: 13.5px; line-height: 1.6; }
.rich pre code { background: none; padding: 0; color: inherit; }
.rich table { border-collapse: collapse; width: 100%; font-size: 14px; margin: 1.2em 0; }
.rich figure.table { overflow-x: auto; }
.rich th, .rich td { border: 1px solid #d5d8dc; padding: 8px 10px; vertical-align: top; text-align: left; }
.rich th { background: var(--bg-soft); font-weight: 700; }
.rich video { max-width: 100%; height: auto; }
.rich .dot-divider { display: flex; align-items: center; justify-content: center; margin: 20px 0; }
.rich .dot-divider span { color: #000; font-size: 24px; margin: 0 5px; }
.rich .quote-box { display: flex; align-items: center; background: #f9f9f9; border-left: 5px solid #ff5733; padding: 10px 15px; margin: 20px 0; font-size: 16px; line-height: 1.5; border-radius: 5px; color: #333; }
.rich .quote-box strong { color: #212121; }

.video-embed { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 4px; overflow: hidden; margin: 1.2em 0; }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.side-card .video-embed { margin: 0; border-radius: 0; }

/* ---------- post page */
.post { padding-top: 28px; padding-bottom: 24px; }
.post h1 { font-size: 30px; margin: 12px 0 10px; }
.author-row { display: flex; gap: 12px; align-items: center; padding-bottom: 22px; margin-bottom: 30px; border-bottom: 1px solid var(--line); }
.author-row img { border-radius: 50%; object-fit: cover; }
.author-row p { margin: 0; font-size: 13.5px; line-height: 1.6; }
.author-name { color: var(--text); font-weight: 600; }
.author-row .muted span::before { content: "．"; }
.post-body { font-size: 16px; line-height: 1.85; }
.more-posts { background: var(--bg-soft); margin-top: 24px; }
.more-posts .btn-outline { margin-top: 28px; }

/* ---------- simple pages */
.prose-page { padding-top: 28px; padding-bottom: 72px; }
.prose-page h1 { font-size: 28px; margin: 12px 0 12px; }
.prose-page h2 { font-size: 19px; margin: 36px 0 12px; }
.prose-page ol, .prose-page ul { padding-left: 1.4em; }
.prose-page li { margin: .35em 0; }
.info-box { background: var(--notice-bg); border-radius: 8px; padding: 18px 22px; margin: 24px 0; }
.info-box h2 { margin-top: 0; font-size: 17px; }
.info-box p:last-child { margin-bottom: 0; }
.link-list { padding-left: 1.2em; }
.archive { border: 1px solid var(--line); border-radius: 6px; margin: 12px 0; }
.archive summary { cursor: pointer; padding: 12px 16px; font-weight: 600; }
.archive .rich { padding: 0 18px 8px; font-size: 14px; color: var(--sub); }
.center-page { text-align: center; padding-top: 80px; }

/* ---------- learn page */
.learn { max-width: 860px; padding-top: 32px; padding-bottom: 72px; }
.learn-label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--brand); background: var(--notice-bg); padding: 3px 12px; border-radius: 999px; margin: 0; }
.learn h1 { font-size: 28px; margin: 12px 0 8px; }
.warn { color: var(--sub); font-size: 14px; margin: 0 0 8px; }
.learn-sec { padding-top: 28px; }
.learn-sec > h2 { font-size: 19px; margin: 0 0 14px; }
.learn-sec .video-embed { margin-top: 0; }
.placeholder { border: 1px dashed #c9cdd2; border-radius: 6px; padding: 28px; text-align: center; color: var(--muted); background: var(--bg-soft); }

/* ---------- footer */
.site-footer { border-top: 1px solid transparent; padding: 36px 0 28px; font-size: 13px; color: var(--sub); }
.footer-mail { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0 0 14px; }
.footer-mail a { color: var(--sub); }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.footer-bottom p { margin: 0; }
.footer-bottom a { color: var(--sub); text-decoration: underline; }

/* ---------- responsive */
@media (max-width: 960px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .course-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "side" "main"; }
  .side-sticky { position: static; }
  .course-side { margin-bottom: 8px; }
}
@media (max-width: 720px) {
  body { font-size: 15px; }
  .wrap { padding: 0 16px; }
  .main-nav { display: none; }
  .mobile-nav { display: block; }
  .header-inner { gap: 10px; height: 60px; }
  .logo img { height: 30px; }
  .grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .section { padding: 28px 0 40px; }
  .section-title { margin-bottom: 22px; }
  .hero-arrow { display: none; }
  .dots { bottom: 6px; }
  .dot { width: 7px; height: 7px; }
  .course-layout { padding-top: 24px; }
  .course-head h1, .post h1, .prose-page h1, .learn h1 { font-size: 23px; }
  .tabs a { font-size: 13.5px; padding: 11px 4px; }
  .post-body { font-size: 15.5px; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
  .lecturer-box { gap: 12px; }
  .lecturer-box > img { width: 56px; height: 56px; }
}
