/* k01 前台（lovek01）樣式：手寫、不依賴外部字型與框架。版型延續 2017 舊站：上方分類、左內文、右側欄 */
:root {
  --brand: #e11d48;
  --brand-dark: #be123c;
  --ink: #1f2328;
  --muted: #667085;
  --line: #e8eaee;
  --bg: #f5f6f8;
  --card: #fff;
  --radius: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.7 system-ui, -apple-system, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--brand); }
img { max-width: 100%; height: auto; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }

/* 頁首與分類 */
.site-header { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.header-inner { display: flex; align-items: baseline; gap: 14px; padding-top: 12px; padding-bottom: 6px; }
.logo { font-size: 26px; font-weight: 800; letter-spacing: .5px; color: var(--brand); }
.logo:hover { color: var(--brand-dark); }
.tagline { color: var(--muted); font-size: 14px; }
.site-nav > ul { list-style: none; margin: 0 auto; padding: 0 16px; display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.site-nav > ul::-webkit-scrollbar { display: none; }
.site-nav .sub { list-style: none; margin: 0; }
.site-nav > ul > li:first-child > a { padding-left: 0; }
.site-nav li { position: relative; flex: none; }
.site-nav a { display: block; padding: 10px 14px; font-size: 15px; font-weight: 600; white-space: nowrap; border-bottom: 3px solid transparent; }
.site-nav a.active { color: var(--brand); border-bottom-color: var(--brand); }
.site-nav .sub { display: none; position: absolute; left: 0; top: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius); padding: 6px 0; min-width: 150px; flex-direction: column; box-shadow: 0 8px 24px rgba(0,0,0,.08); }
.site-nav .sub a { font-weight: 500; border: 0; padding: 8px 16px; }
@media (hover: hover) { .site-nav .has-sub:hover > .sub { display: flex; } }

/* 兩欄 */
.cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; padding-top: 20px; padding-bottom: 32px; }
@media (min-width: 992px) { .cols { grid-template-columns: minmax(0, 1fr) 320px; } }
.main { min-width: 0; }
.sidebar { min-width: 0; }
@media (min-width: 992px) { .sidebar .box { position: sticky; top: 112px; } }

.section-title { font-size: 20px; margin: 0 0 14px; padding-left: 10px; border-left: 4px solid var(--brand); line-height: 1.4; }
.breadcrumb { font-size: 14px; color: var(--muted); margin-bottom: 10px; }
.breadcrumb a:hover { color: var(--brand); }
.category-intro { color: var(--muted); margin: -4px 0 14px; }
.tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.tabs a { padding: 4px 16px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 14px; }
.tabs a.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* 列表卡片 */
.card { display: flex; gap: 14px; background: var(--card); border-radius: var(--radius); padding: 12px; margin-bottom: 12px; border: 1px solid var(--line); }
.card-thumb { flex: none; }
.card-body { min-width: 0; }
.card-title { margin: 0 0 4px; font-size: 18px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-excerpt { margin: 0 0 6px; color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta { margin: 0; color: var(--muted); font-size: 13px; }
.meta a:hover { color: var(--brand); }

.thumb { display: block; object-fit: cover; border-radius: 8px; background: #fde4ea; }
.thumb-md { width: 168px; height: 104px; }
.thumb-sm { width: 76px; height: 52px; }
.thumb-empty { display: flex; align-items: center; justify-content: center; color: var(--brand); font-weight: 700; font-size: 15px; background: linear-gradient(135deg, #fde4ea, #fff1f3); }
@media (max-width: 600px) {
  .thumb-md { width: 112px; height: 76px; }
  .card { padding: 10px; gap: 10px; }
  .card-title { font-size: 16px; }
  .card-excerpt { display: none; }
}

/* 側欄 */
.box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.box-title { font-size: 17px; margin: 0 0 10px; }
.hot-list { list-style: none; margin: 0; padding: 0; }
.hot-list li + li { border-top: 1px dashed var(--line); }
.hot-list a { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.rank { flex: none; width: 22px; height: 22px; border-radius: 6px; background: #f1f2f4; color: var(--muted); font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.hot-list li:nth-child(-n+3) .rank { background: var(--brand); color: #fff; }
.hot-title { font-size: 14px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* 文章 */
.post { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; }
@media (max-width: 600px) { .post { padding: 16px; border-radius: 0; margin: 0 -16px; border-left: 0; border-right: 0; } }
.post-title { font-size: 28px; line-height: 1.4; margin: 0 0 8px; }
@media (max-width: 600px) { .post-title { font-size: 23px; } }
.post .meta { margin-bottom: 16px; }
.post-cover { margin: 0 0 18px; }
.post-cover img { width: 100%; border-radius: 8px; aspect-ratio: 1200 / 630; object-fit: cover; }
.post-lead { font-size: 17px; color: #475467; background: #fff7f8; border-left: 4px solid var(--brand); padding: 10px 14px; border-radius: 0 8px 8px 0; margin: 0 0 18px; }
.prose { font-size: 18px; line-height: 1.9; word-break: break-word; }
.prose p { margin: 0 0 1.1em; }
.prose h2 { font-size: 22px; line-height: 1.45; margin: 1.6em 0 .6em; padding-left: 10px; border-left: 4px solid var(--brand); }
.prose h3 { font-size: 19px; margin: 1.4em 0 .5em; }
.prose h4 { font-size: 17px; margin: 1.2em 0 .4em; }
.prose a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.prose img { display: block; margin: 1em auto; border-radius: 8px; }
.prose ul, .prose ol { padding-left: 1.4em; margin: 0 0 1.1em; }
.prose li { margin: .25em 0; }
.prose blockquote { margin: 1.2em 0; padding: 10px 16px; background: #f8f9fb; border-left: 4px solid #cbd2dc; color: #475467; border-radius: 0 8px 8px 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: 16px; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.prose th { background: #f8f9fb; }
.prose th p, .prose td p { margin: 0; }
.prose code { background: #f3f4f6; padding: 1px 6px; border-radius: 4px; font-size: .9em; }
.prose pre { background: #f3f4f6; padding: 12px; border-radius: 8px; overflow-x: auto; }

.share { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 15px; color: var(--muted); }
.share a { color: #fff; padding: 6px 18px; border-radius: 999px; font-weight: 700; font-size: 14px; }
.share a:hover { color: #fff; opacity: .9; }
.share-line { background: #06c755; }
.share-fb { background: #1877f2; }

.related { margin-top: 24px; }
.related-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 700px) { .related-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.related-item { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; font-size: 14px; line-height: 1.5; }
.related-item .thumb { width: 100%; height: auto; aspect-ratio: 16 / 10; border-radius: 0; }
.related-item span:last-child { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin: 8px 10px 10px; }

.pager { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 20px 0; }
.pager a, .pager span { min-width: 38px; padding: 6px 12px; text-align: center; border-radius: 8px; background: var(--card); border: 1px solid var(--line); font-size: 14px; }
.pager .current { background: var(--brand); border-color: var(--brand); color: #fff; }

/* 頁尾 */
.site-footer { background: #1f2328; color: #c9ced6; padding: 24px 0 30px; font-size: 14px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 10px; }
.footer-links a { color: #fff; }
.footer-links a:hover { color: #fda4af; }
.disclaimer, .copyright { margin: 4px 0; color: #98a2b3; }

/* 錯誤頁、預覽列 */
.error-page { text-align: center; padding: 80px 16px; }
.error-page h1 { font-size: 26px; }
.btn { display: inline-block; background: var(--brand); color: #fff; padding: 8px 22px; border-radius: 999px; font-weight: 700; }
.btn:hover { color: #fff; background: var(--brand-dark); }
.preview-bar { background: #fef3c7; color: #92400e; text-align: center; font-size: 14px; padding: 6px 12px; }
