/* 首頁（index.html）專用樣式；共用的在 common.css */
body { padding-bottom: calc(72px + var(--safe-bottom)); }
body.no-scroll { overflow: hidden; }
.page { max-width: 1000px; margin: auto; padding: 0 16px; }

.app-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: calc(10px + env(safe-area-inset-top, 0px)) 8px 4px 16px; max-width: 1000px; margin: auto;
}
.app-header h1 { font-family: var(--f-mark); font-weight: 400; font-size: 1.65rem; letter-spacing: -0.01em; margin: 0; display: flex; align-items: baseline; }
.header-actions { display: flex; align-items: center; color: var(--text-sub); }
.app-header .count { font-family: var(--f-body); font-size: 0.8rem; color: var(--text-muted); font-weight: normal; margin-left: 8px; letter-spacing: 0; }
.app-header .server-pill { font-family: var(--f-body); letter-spacing: 0; align-self: center; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* 作品列表：固定在上方的搜尋與狀態列 */
.list-toolbar {
    position: sticky; top: 0; z-index: 20;
    background: var(--toolbar-bg); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    margin: 0 -16px; padding: 8px 16px 0;
    border-bottom: 1px solid var(--border);
}
.search-row { display: flex; gap: 8px; }
/* 點人名跳過來的提示條 */
.search-wrap { position: relative; flex: 1; }
.search-wrap .input { padding-left: 36px; padding-right: 40px; border-radius: 22px; background: var(--card-bg); }
.search-wrap .search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; display: flex; }
.search-wrap .clear-btn { position: absolute; right: 0; top: 0; width: 44px; height: 44px; border: none; background: none; color: var(--text-muted); font-size: 1.1rem; cursor: pointer; }
.filter-btn { position: relative; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--input-border); background: var(--card-bg); color: var(--text-sub); font-size: 1.1rem; cursor: pointer; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; }
.filter-btn .dot { position: absolute; top: 6px; right: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--primary); display: none; }
.filter-btn.active .dot { display: block; }

.status-scroller { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0; scrollbar-width: none; }
.status-scroller::-webkit-scrollbar { display: none; }
.status-scroller .chip { flex-shrink: 0; min-height: 36px; border-width: 1px; font-size: 0.85rem; }
.status-scroller .chip.selected { background: var(--text); border-color: var(--text); color: var(--bg); box-shadow: none; }
.chip .hot-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--backlog-text); margin-right: 6px; vertical-align: 0.08em; }

/* 我的書櫃／找新作品 切換 */
.mode-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 3px; margin-bottom: 8px; border-radius: 12px; background: var(--raised); }
.mode-seg button { min-height: 36px; border: none; border-radius: 9px; background: transparent; color: var(--text-sub); font-weight: bold; font-size: 0.88rem; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.mode-seg button.active { background: var(--card-bg); color: var(--text-strong); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25); }
.mode-seg.list-modes { grid-template-columns: repeat(3, 1fr); }
/* 創作者分頁：兩部以上的人一人一塊，作品封面排成一列（多的可以左右滑） */
#peopleSort .chip.selected { background: var(--text); border-color: var(--text); color: var(--bg); box-shadow: none; }
#peopleList { display: flex; flex-direction: column; gap: 10px; padding-bottom: 16px; }
.crew { background: var(--card-bg); border: 1px solid var(--border); border-radius: 14px; padding: 10px 12px 12px; display: grid; gap: 10px; }
.crew-head { display: grid; gap: 4px; }
.crew-name { justify-self: start; border: none; background: none; padding: 0; font: inherit; font-size: 1rem; font-weight: 900; color: var(--text-strong); cursor: pointer;
    text-decoration: underline dotted var(--border-strong); text-underline-offset: 4px; }
.crew-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: 0.78rem; color: var(--text-muted); }
.crew-role { font-family: var(--f-kr); padding: 1px 8px; border-radius: 999px; background: var(--link-soft-bg); color: var(--link-soft-text); }
.crew-role b, .crew-avg b { font-family: var(--f-num); font-weight: 800; margin-left: 4px; }
.crew-avg b { color: var(--star); font-size: 0.95rem; margin: 0 2px; }
.crew-works { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -12px; padding: 0 12px; }
.crew-works::-webkit-scrollbar { display: none; }
.crew-work { flex: 0 0 64px; display: grid; gap: 4px; border: none; background: none; padding: 0; color: var(--text-sub); font: inherit; cursor: pointer; text-align: left; }
.crew-work .cover-sm { width: 64px; height: 86px; border-radius: 8px; }
.crew-work .cover-sm.cover-placeholder { font-size: 44px; }
.crew-work span { font-size: 0.72rem; font-weight: bold; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crew-singles { background: var(--card-bg); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.crew-singles-toggle { display: flex; align-items: center; gap: 4px; width: 100%; min-height: 46px; padding: 0 12px; border: none; background: none; color: var(--text); font: inherit; font-size: 0.9rem; cursor: pointer; }
.crew-singles-toggle b { font-family: var(--f-num); font-weight: 800; font-size: 1.05rem; margin: 0 2px; }
.crew-singles-toggle .ico, .crew-singles-toggle span { margin-left: auto; color: var(--text-muted); font-size: 0.8rem; }
.crew-single { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 42px; padding: 0 12px; border: none; border-top: 1px solid var(--border); background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.crew-single span { font-size: 0.9rem; flex-shrink: 0; }
.crew-single small { font-size: 0.75rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crew-singles > .crew-single:first-child { border-top: none; }
.find-row { padding-bottom: 10px; }
.find-go { min-height: 44px; border-radius: 22px; padding: 0 18px; }
.find-status { font-size: 0.8rem; color: var(--text-muted); padding: 12px 2px 8px; line-height: 1.6; }
.find-status:empty { display: none; }
.find-status.bad { color: var(--danger); }
.find-list { display: flex; flex-direction: column; gap: 10px; padding-bottom: 16px; }
.find-cover { width: 68px; height: 92px; flex-shrink: 0; border-radius: 8px; background: var(--raised); overflow: hidden; }
.find-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.find-cover.kakao img { object-fit: contain; object-position: bottom; }

/* 搜尋中：每個平台一顆膠囊，查完打勾、查不到打叉；下面放骨架卡片 */
#findProbe { display: grid; gap: 10px; padding-top: 10px; }
.probe { display: grid; gap: 8px; padding: 12px; border-radius: 14px; background: var(--card-bg); border: 1px solid var(--border); }
.probe-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 0.85rem; font-weight: bold; }
.probe-head span { color: var(--text-muted); font-weight: normal; font-size: 0.78rem; white-space: nowrap; }
.probe-list { display: flex; flex-wrap: wrap; gap: 6px; }
.probe-note { font-size: 0.75rem; color: var(--text-muted); }
.pp { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 999px; font-size: 0.75rem; font-weight: bold; background: var(--raised); color: var(--text); }
.pp::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--pc); }
.pp.tw { border: 1px dashed var(--border-strong); }
.pp.ok::after { content: '✓'; color: var(--status-ongoing); }
.pp.fail { color: var(--danger); } .pp.fail::after { content: '×'; }
.find-skel { display: grid; grid-template-columns: 68px 1fr; gap: 12px; padding: 10px; border-radius: 14px; background: var(--card-bg); border: 1px solid var(--border); }
.find-skel > div { display: grid; gap: 8px; align-content: start; padding-top: 4px; }
.find-skel i { display: block; height: 11px; border-radius: 6px; background: var(--raised); }
.find-skel i.c { height: 92px; border-radius: 8px; }
@media (prefers-reduced-motion: no-preference) {
    .pp.run::before { animation: pill-blink 1s ease-in-out infinite; }
    .find-skel i { background: linear-gradient(90deg, var(--raised) 25%, var(--border) 50%, var(--raised) 75%); background-size: 200% 100%; animation: skel-shimmer 1.4s linear infinite; }
    @keyframes skel-shimmer { to { background-position: -200% 0; } }
}

/* 搜尋結果卡片：跟書櫃卡片同一家族；右邊不放星星、話數，底部一排寫原因和動作 */
.fcard { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; padding: 10px; border-radius: 14px; background: var(--card-bg); border: 1px solid var(--border); cursor: pointer; }
.fcard:active { background: var(--raised); }
.fcard.owned { background: color-mix(in srgb, var(--card-bg) 70%, transparent); }
.fcard.owned .find-cover, .fcard.owned .cover { filter: saturate(0.6); }
.fc-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fc-title, .fd-title { font-weight: 900; color: var(--text-strong); line-height: 1.3; overflow-wrap: anywhere; }
.fc-title[lang="ko"], .fd-title[lang="ko"] { font-family: var(--f-kr); font-weight: 700; }
.fc-kr, .fd-kr { font-family: var(--f-kr); font-size: 0.78rem; color: var(--text-kr); line-height: 1.3; }
.fcard mark, .detail-hero mark { background: none; color: var(--link); box-shadow: inset 0 -0.35em 0 var(--link-soft-bg); }
.fc-author { font-size: 0.75rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.fc-found { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 4px; }
.fc-found span { display: inline-flex; align-items: center; gap: 4px; font-size: 0.7rem; font-weight: bold; color: var(--text-muted); }
.fc-found span::before { content: ''; width: 6px; height: 6px; border-radius: 2px; background: var(--pc); }
.fc-found span.tw { border: 1px dashed var(--border-strong); border-radius: 4px; padding: 0 4px; }
.same-badge { align-self: flex-start; font-size: 0.7rem; font-weight: bold; color: var(--text-sub); background: var(--raised); border-radius: 5px; padding: 0 6px; margin-top: 2px; }
.fc-foot { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; border-top: 1px dashed var(--border); padding-top: 8px; }
.fc-note { flex: 1; min-width: 0; font-size: 0.75rem; color: var(--text-muted); }
.fc-note b { color: var(--text); font-family: var(--f-num); font-weight: 800; font-size: 0.95rem; }
.fc-note-link { border: none; background: none; padding: 0; font: inherit; color: var(--link); cursor: pointer; text-align: left; }
.fc-add { flex-shrink: 0; display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 12px; border-radius: 10px; border: none; background: var(--primary); color: var(--on-primary); font: inherit; font-size: 0.82rem; font-weight: bold; cursor: pointer; }
.fc-add.ghost { background: none; border: 1px solid var(--primary); color: var(--link); }
.fc-add.done { background: color-mix(in srgb, var(--status-ongoing) 18%, transparent); color: var(--status-ongoing); }
.owned-badge { position: absolute; top: 6px; left: 6px; z-index: 2; display: inline-flex; align-items: center; gap: 3px; padding: 1px 6px 1px 4px; border-radius: 6px; background: var(--status-ongoing); color: #fff; font-size: 0.66rem; font-weight: bold; }
.owned-badge .ico { width: 12px; height: 12px; }
.find-more { width: 100%; min-height: 42px; border: 1px dashed var(--border-strong); border-radius: 12px; background: none; color: var(--text-sub); font: inherit; font-size: 0.85rem; font-weight: bold; cursor: pointer; }

/* 找新作品的詳細頁：沿用作品詳細頁；三格是狀態、最新話數、年齡 */
.find-cover-lg { width: 104px; height: 140px; border-radius: 10px; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3); }
.fd-title { font-size: 1.35rem; }
.fd-title[lang="ko"] { font-size: 1.3rem; }
.fd-kr { font-size: 0.85rem; margin-top: 3px; }
.detail-head-text .fc-found { margin-top: 8px; }
.find-stats b .status-badge { font-family: var(--f-body); vertical-align: 0.3em; }
.find-stats .find-day { font-family: var(--f-kr); font-size: 0.75rem; font-weight: bold; color: var(--text-sub); background: var(--raised); border-radius: 5px; padding: 1px 5px; margin-left: 4px; vertical-align: 0.3em; }
.find-stats .find-age { font-family: var(--f-kr); font-size: 1.05rem; font-weight: 700; }
.find-stats.loading b { color: var(--text-faint); }
.find-add-row { display: flex; margin: -4px 0 6px; }
.find-add-big { flex: 1; min-height: 46px; border-radius: 12px; }
.find-add-big.owned { background: color-mix(in srgb, var(--status-ongoing) 18%, transparent); color: var(--status-ongoing); }
.find-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 3px; }
.find-hint.center { text-align: center; margin-bottom: 4px; }
.find-hint .fc-note-link { font-size: inherit; }
.collapsible.collapsed .comment-text.find-synopsis .clamp-body { -webkit-line-clamp: 4; line-clamp: 4; }
.find-synopsis { font-family: var(--f-kr); font-size: 0.9rem; }
.find-genres { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.find-genre { font-family: var(--f-kr); font-size: 0.76rem; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-sub); }
.team-role.tw { font-family: var(--f-body); font-weight: bold; }
.find-links { background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.find-link { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 10px; align-items: center; min-height: 50px; padding: 6px 12px; color: var(--text); text-decoration: none; }
.find-link + .find-link { border-top: 1px solid var(--border); }
.find-link:active { background: var(--raised); }
.find-link i { width: 8px; height: 8px; border-radius: 2px; background: var(--pc); }
.find-link.tw i { outline: 1px dashed var(--text-muted); outline-offset: 1px; }
.find-link b { display: block; font-size: 0.9rem; }
.find-link small { display: block; font-size: 0.75rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.find-link .ico { color: var(--text-muted); }
.find-notice { display: grid; grid-template-columns: auto 1fr; gap: 8px; margin-top: 14px; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--star) 12%, transparent); font-size: 0.82rem; color: var(--text-sub); line-height: 1.55; }
.find-notice .ico { color: var(--star); margin-top: 2px; }
.find-sticky { align-items: center; }
.find-sticky-name { flex: 1; min-width: 0; display: grid; line-height: 1.25; }
.find-sticky-name b { font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.find-sticky-name small { font-size: 0.72rem; color: var(--text-muted); }
.find-sticky .find-add-big { flex: 0 0 auto; min-height: 44px; padding: 0 18px; }
.empty-find { margin-top: 10px; }
.result-bar { display: flex; justify-content: space-between; align-items: center; font-size: 0.8rem; color: var(--text-muted); padding: 10px 0; min-height: 44px; }
.link-btn { background: none; border: none; color: var(--primary); font-size: 0.8rem; font-weight: bold; cursor: pointer; padding: 8px 0 8px 12px; }

/* 作品卡片 */
.gallery-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
@media (min-width: 700px) { .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; } }

/* 封面牆 */
.gallery-grid.cover-wall { grid-template-columns: repeat(3, 1fr); gap: 14px 10px; }
@media (min-width: 700px) { .gallery-grid.cover-wall { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); } }
.wall-tile { cursor: pointer; min-width: 0; }
.wall-tile:active { opacity: 0.8; }
.wall-cover { position: relative; container-type: inline-size; }
.wall-cover .cover-placeholder { font-size: 70cqw; }
.wall-cover .cover-placeholder::after { display: none; } /* 左上角已經有狀態標籤 */
.cover-fill { width: 100%; height: auto; aspect-ratio: 3 / 4; border-radius: 10px; }
.wall-status { position: absolute; left: 4px; top: 4px; font-size: 0.66rem; padding: 1px 6px; border-radius: 5px; background: var(--sc) !important; color: #fff !important; }
/* 右上角話數：實心底色（分區顏色加深），白字 */
.wall-ep {
    position: absolute; right: 4px; top: 4px; font-family: var(--f-num); font-size: 0.82rem; font-weight: 800; padding: 0 6px; border-radius: 5px; line-height: 1.5;
    background: color-mix(in srgb, var(--ep-band, var(--primary)) 88%, black); color: #fff; font-variant-numeric: tabular-nums;
}
.wall-title {
    margin-top: 6px; font-size: 0.82rem; font-weight: bold; line-height: 1.35;
    display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.wall-sub { display: flex; gap: 6px; align-items: center; font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; min-height: 1.2em; }
.wall-sub .stars-display { font-size: 0.7rem; letter-spacing: -1px; }
.wall-backlog { margin-left: auto; color: var(--backlog-text); font-weight: bold; white-space: nowrap; }
/* 依評分排序時的分區標題（清單、封面牆都跨整排） */
.rating-section { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; margin: 10px 0 -2px; font-size: 0.85rem; color: var(--text-sub); }
.rating-section:first-child { margin-top: 0; }
.rating-section .count { color: var(--text-muted); font-size: 0.78rem; font-weight: normal; }
.rating-section::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.view-btn { font-size: 1rem; }
.review-card {
    background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px;
    padding: 12px 14px; cursor: pointer; text-align: left; color: inherit; font: inherit; width: 100%;
}
.review-card:active { background: var(--raised); }
@media (hover: hover) { .review-card:hover { border-color: var(--primary); } }
/* 書櫃卡片：封面｜內容｜右邊一欄（星星在上、話數和未讀在下） */
.review-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: stretch; padding: 10px 12px 10px 10px; border-radius: 14px; }
.card-body { min-width: 0; }
.card-side { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; gap: 8px; }
.card-ep { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.card-ep .ep-badge { margin-left: 0; }
.card-ep .ep-badge.ep-band { font-size: 1.12rem; padding: 1px 8px; }
.chip-n { font-weight: 500; opacity: 0.65; font-variant-numeric: tabular-nums; }
.detail-head { display: flex; gap: 14px; align-items: flex-end; }
/* 詳細頁上方：作品顏色（或模糊封面）＋網點的背景，往下淡到底色 */
.detail-hero { position: relative; isolation: isolate; overflow: hidden; margin: -16px -16px 12px; padding: 20px 16px 14px; }
.detail-hero-bg { position: absolute; inset: 0; z-index: -1; background: linear-gradient(160deg, var(--c1), var(--c2)); background-size: cover; background-position: center; opacity: var(--hero-opacity, 0.55); }
.detail-hero-bg.has-img { filter: blur(26px) saturate(1.2); transform: scale(1.25); }
.detail-hero::before { content: ''; position: absolute; inset: 0; z-index: -1;
    background-image: radial-gradient(rgba(255, 255, 255, 0.16) 1.2px, transparent 1.6px); background-size: 7px 7px;
    -webkit-mask-image: linear-gradient(180deg, #000, transparent 70%); mask-image: linear-gradient(180deg, #000, transparent 70%); }
.detail-hero::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, transparent 15%, var(--bg) 92%); }
:root[data-theme="light"] .detail-hero { --hero-opacity: 0.3; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .detail-hero { --hero-opacity: 0.3; } }
.detail-hero .cover { box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3); }
.trail-back + .detail-hero { margin-top: 0; }
.detail-head-text { flex: 1; min-width: 0; }
.card-top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.comic-title { font-size: 1.02rem; font-weight: 900; color: var(--text-strong); margin: 0; line-height: 1.35; overflow-wrap: anywhere; }
.comic-kr-title { font-family: var(--f-kr); font-size: 0.78rem; color: var(--text-kr); margin: 1px 0 0; }
.card-stars { color: var(--star); font-size: 0.85rem; white-space: nowrap; letter-spacing: -1px; }
.card-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 7px 0 0; }
.card-creators {
    font-size: 0.8rem; color: var(--text-sub); margin: 6px 0 0; line-height: 1.55;
    display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-relations { font-size: 0.8rem; color: var(--link); margin: 4px 0 0; line-height: 1.55; }
.card-relations .ico, .item-note .ico { margin-right: 4px; }
.card-relations b { font-weight: bold; margin-right: 4px; }
.card-dates { font-size: 0.72rem; color: var(--text-muted); margin: 6px 0 0; font-variant-numeric: tabular-nums; }
.empty-msg { text-align: center; color: var(--text-faint); padding: 50px 0; }

/* 可收合的區塊（本週頁、統計頁） */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin: 12px 0; }
.panel-title { font-size: 0.95rem; font-weight: bold; color: var(--text-strong); margin: 0 0 10px; display: flex; align-items: center; gap: 7px; }
.panel-title > .ico { color: var(--primary); }

/* 本週：星期列 + 當天清單 */
.day-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 14px; }
.day-btn {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-height: 56px; border: none; border-radius: 12px; background: transparent; cursor: pointer;
    color: var(--text-sub); font: inherit; position: relative;
}
.day-btn .day-name { font-family: var(--f-mark); font-size: 1.3rem; font-weight: 400; line-height: 1.1; }
.day-btn .day-count { font-family: var(--f-num); font-weight: 800; font-size: 0.95rem; line-height: 1; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.day-btn.empty .day-name { color: var(--text-faint); }
.day-btn.today { box-shadow: inset 0 0 0 1.5px var(--primary); }
.day-btn.selected { background: var(--text); color: var(--bg); }
.day-btn.selected .day-count { color: var(--bg); opacity: 0.8; }
.day-heading { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.day-heading-title { font-weight: bold; font-size: 1rem; }
.day-heading-sub { font-size: 0.8rem; color: var(--text-muted); }
/* 本週：最上面一行總結；當天清單放在一塊裡 */
.week-sum { display: flex; justify-content: space-between; gap: 8px; margin: 6px 2px 8px; font-size: 0.8rem; color: var(--text-sub); }
.week-sum:empty { display: none; }
.week-sum b { color: var(--text-strong); font-family: var(--f-num); font-weight: 800; font-size: 1.15rem; }
.week-sum-backlog { color: var(--backlog-text); font-weight: bold; }
.day-strip { margin-bottom: 8px; }
.day-panel { padding-top: 10px; padding-bottom: 4px; }
.panel-title small { font-weight: normal; color: var(--text-muted); font-size: 0.75rem; margin-left: 8px; }
.memo-head { display: flex; align-items: center; }
.memo-toggle { margin-left: auto; border: none; background: none; color: var(--link); font: inherit; font-size: 0.82rem; font-weight: bold; cursor: pointer; padding: 4px 2px; }
.memo-preview { display: flex; gap: 8px; align-items: baseline; font-size: 0.88rem; color: var(--text-sub); cursor: pointer; min-width: 0; }
.memo-preview span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.memo-preview small { flex-shrink: 0; color: var(--text-muted); font-size: 0.75rem; }
.memo-preview.empty { color: var(--text-muted); font-size: 0.84rem; }
.day-list { touch-action: pan-y; min-height: 120px; }
.day-item {
    display: flex; align-items: center; gap: 10px; padding: 10px 2px; min-height: 56px;
    border-bottom: 1px solid var(--border); cursor: pointer;
}
.day-item:last-child { border-bottom: none; }
.day-item:active { background: var(--raised); }
.day-item-main { flex: 1; min-width: 0; }
.day-item-title { font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day-item-kr { font-family: var(--f-kr); font-size: 0.78rem; color: var(--text-kr); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day-item-links { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }
/* 本週：一部作品兩行（標題＋話數、平台），+1 話和已讀放右邊 */
.day-item-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.read-pill {
    width: 32px; height: 32px; padding: 0; border-radius: 50%; border: 1px solid var(--border-strong);
    background: transparent; color: var(--text-muted); font-size: 0.9rem; font-weight: bold; cursor: pointer; position: relative;
}
.read-pill::after { content: ''; position: absolute; inset: -7px -4px; } /* 放大點擊範圍 */
.read-pill.on { background: var(--status-ongoing); border-color: var(--status-ongoing); color: #fff; }
.day-item.read .day-item-title, .day-item.read .day-item-kr, .day-item.read .ep-badge { opacity: 0.45; }
.ep-plus, .read-pill { white-space: nowrap; flex-shrink: 0; }
.ep-plus {
    min-height: 32px; padding: 0 10px; border-radius: 15px; border: 1px solid var(--primary);
    background: transparent; color: var(--primary); font-size: 0.78rem; font-weight: bold; cursor: pointer; position: relative;
}
.ep-plus::after { content: ''; position: absolute; inset: -7px -4px; } /* 放大點擊範圍 */
.ep-plus:active { background: var(--ep-bg); }
/* 話數標籤：貼在標題右邊 */
.ep-badge {
    display: inline-block; flex-shrink: 0; margin-left: 6px; padding: 1px 7px; border-radius: 6px;
    background: var(--ep-bg); color: var(--ep-text); font-family: var(--f-num); font-size: 0.92rem; font-weight: 800; letter-spacing: 0.02em;
    line-height: 1.35; vertical-align: 0.1em; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.detail-title .ep-badge { font-size: 0.95rem; vertical-align: 0.2em; }
/* 話數分區的顏色（淺色模式文字加深一點才看得清楚） */
.ep-b1 { --ep-band: var(--ep-b1); }
.ep-b2 { --ep-band: var(--ep-b2); }
.ep-b3 { --ep-band: var(--ep-b3); }
.ep-b4 { --ep-band: var(--ep-b4); }
.ep-badge.ep-band { color: var(--ep-band); background: color-mix(in srgb, var(--ep-band) 18%, transparent); }
:root[data-theme="light"] .ep-badge.ep-band { color: color-mix(in srgb, var(--ep-band) 72%, black); }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .ep-badge.ep-band { color: color-mix(in srgb, var(--ep-band) 72%, black); } }
.backlog-badge { background: var(--backlog-bg); color: var(--backlog-text); }
/* 本週清單標題可換行，話數標籤接在標題後面 */
.title-line { font-weight: bold; line-height: 1.4; word-break: break-word; }
.title-line .day-item-title { display: inline; white-space: normal; }

.toast {
    position: fixed; left: 16px; right: 16px; bottom: calc(140px + var(--safe-bottom)); z-index: 200;
    max-width: 480px; margin: auto; display: flex; align-items: center; gap: 12px;
    padding: 10px 10px 10px 16px; border-radius: 12px; background: #2b303a; color: #ecf0f1; /* 提示列在兩種模式都用深色 */
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5); font-size: 0.9rem; animation: slideUp 0.2s ease-out;
}
.toast span { flex: 1; }
.toast button + button { padding-left: 4px; }
.toast button { min-height: 40px; padding: 0 12px; border: none; background: none; color: #8fb0ff; font-weight: bold; font-size: 0.9rem; cursor: pointer; }
.return-banner {
    display: flex; align-items: center; gap: 8px; max-width: 1000px; margin: 4px auto 0; padding: 0 16px;
}
.return-banner-inner {
    flex: 1; display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border-radius: 12px;
    background: rgba(138, 112, 200, 0.18); border: 1px solid var(--status-paused); font-size: 0.88rem;
}
.return-banner-inner span { flex: 1; }
.return-banner-inner .banner-ico { width: 20px; height: 20px; color: var(--primary); }
.fab .ico { width: 26px; height: 26px; }
.return-banner-inner .btn { min-height: 36px; padding: 0 12px; font-size: 0.82rem; }
.backup-banner .return-banner-inner { background: var(--ep-bg); border-color: var(--primary); }
.return-item { display: flex; align-items: center; gap: 10px; padding: 8px 2px; min-height: 44px; border-bottom: 1px solid var(--border); cursor: pointer; font-size: 0.9rem; }
.return-item .day-item-title { flex: 1; min-width: 0; }
.return-item:last-child { border-bottom: none; }
.return-item:active { background: var(--raised); }
.return-main { flex: 1; min-width: 0; }
.return-when { font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; max-width: 45%; overflow: hidden; text-overflow: ellipsis; }
.return-count { flex-shrink: 0; text-align: right; font-variant-numeric: tabular-nums; }
.return-count b { font-family: var(--f-num); font-weight: 800; font-size: 1.15rem; }
.return-count small { color: var(--text-muted); font-size: 0.75rem; margin-left: 2px; }
.return-when.due { color: var(--due-text); font-weight: bold; }
.return-item.unknown .day-item-title { color: var(--text-sub); }
.return-pill { flex-shrink: 0; font-size: 0.72rem; font-weight: bold; color: #fff; background: var(--status-paused); border-radius: 12px; padding: 2px 9px; }
.return-note { font-size: 0.8rem; color: var(--text-muted); padding-top: 8px; }
.day-empty { color: var(--text-muted); text-align: center; padding: 36px 0; font-size: 0.9rem; }
.memo-panel .panel-title { color: var(--text-sub); }
.memo-textarea { width: 100%; min-height: 120px; background: transparent; border: none; color: var(--text); font-family: inherit; font-size: 16px; line-height: 1.6; resize: none; padding: 0; }
.memo-textarea:focus { outline: none; }

/* 顯示設定 */
.display-note { font-size: 0.78rem; color: var(--text-muted); margin: -2px 0 4px; }

/* 設定：每段一塊底色（set-group），裡面一行一項，細線分隔 */
.set-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 16px 4px 6px; }
.set-head span { font-size: 0.75rem; font-weight: bold; color: var(--text-muted); letter-spacing: 0.04em; }
.sheet h3 + .set-head, .sheet-head + .set-head { margin-top: 4px; }
.set-group { background: var(--raised); border-radius: 12px; overflow: hidden; }
.set-item {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 48px; padding: 0 14px;
    border: none; background: none; color: var(--text); font: inherit; font-size: 0.95rem; text-align: left; cursor: pointer;
}
.set-item + .set-item { border-top: 1px solid var(--border); }
.set-item:active { background: var(--border); }
.set-item.link::after { content: "›"; color: var(--text-muted); font-size: 1.2rem; margin-left: -4px; }
.set-item.danger { color: var(--danger); }
.set-val { margin-left: auto; color: var(--text-muted); font-size: 0.85rem; text-align: right; }
.set-hint { font-size: 0.75rem; color: var(--text-muted); margin: 6px 4px 0; }
.set-done { width: 100%; margin-top: 18px; }
.mode-seg.seg-3 { grid-template-columns: 1fr 1fr 1fr; margin-bottom: 0; }
.mode-seg.set-seg { display: inline-grid; margin: 0; padding: 2px; }
.mode-seg.set-seg button { min-height: 28px; padding: 0 12px; font-size: 0.8rem; }
#latestFromSeg { margin-bottom: 0; }

/* 開關（checkbox 畫成開關） */
.switch {
    appearance: none; -webkit-appearance: none; position: relative; flex-shrink: 0; width: 44px; height: 26px; margin: 0;
    border-radius: 13px; background: var(--border-strong); cursor: pointer; transition: background 0.15s;
}
.switch::after {
    content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); transition: transform 0.15s;
}
.switch:checked { background: var(--primary); }
.switch:checked::after { transform: translateX(18px); }
.switch:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .switch, .switch::after { transition: none; } }

/* 我看的平台：一區一排小膠囊（台版虛線框，跟平台標籤一樣） */
.set-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 14px; }
.set-chips + .set-chips { border-top: 1px solid var(--border); }
.set-chips-title { width: 100%; font-size: 0.72rem; font-weight: bold; color: var(--text-muted); }
.pchip {
    display: inline-flex; align-items: center; min-height: 32px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 999px;
    background: var(--card-bg); color: var(--text-sub); font-size: 0.85rem; cursor: pointer; user-select: none;
}
.pchip-tw { border-style: dashed; }
.pchip input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.pchip:has(input:checked) { border-color: var(--primary); color: var(--text-strong); background: var(--ep-bg); }
.pchip:has(input:checked)::before { content: "✓"; margin-right: 5px; font-size: 0.8rem; color: var(--primary); }
.sheet.covered { visibility: hidden; }
.pchip:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.welcome-options { display: grid; gap: 8px; margin: 12px 0 4px; }
.welcome-options .btn { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 14px; text-align: left; }
.welcome-options .btn span { font-size: 0.78rem; font-weight: normal; color: var(--text-muted); }

/* 統計圖表 */
.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
/* 統計頁最上面：四個數字併成一條 */
/* 統計頁最上面：四個數字不用框，直接排成一列大字，當作整頁的標題 */
.kpi-strip { display: grid; grid-template-columns: repeat(4, 1fr); margin: 8px 0 12px; padding: 4px 2px; text-align: left; }
.kpi-strip .kpi { background: none; border: none; border-radius: 0; padding: 0 4px; min-width: 0; display: flex; flex-direction: column; }
.kpi-strip .kpi-value { font-size: 2.3rem; margin: 0; line-height: 1; }
.kpi-strip .kpi-label { font-size: 0.7rem; }
.year-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.year-two > div { min-width: 0; }
.year-two:has(> div:only-child) { grid-template-columns: 1fr; }
.year-two .bar-row { grid-template-columns: 44px 1fr; min-height: 30px; }
.year-two .bar-label { font-size: 0.74rem; }
.year-two .rank-item { font-size: 0.85rem; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.kpi-label { font-size: 0.8rem; color: var(--text-muted); }
.kpi-value { font-family: var(--f-num); font-size: 2rem; font-weight: 800; line-height: 1.1; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi-value small { font-family: var(--f-body); }
.kpi-value small { font-size: 0.8rem; color: var(--text-muted); font-weight: normal; margin-left: 2px; }
.panel-sub { font-size: 0.78rem; color: var(--text-muted); margin: -6px 0 12px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 0.8rem; color: var(--text-sub); margin-bottom: 12px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }
.bar-row { display: grid; grid-template-columns: 52px 1fr; align-items: center; gap: 8px; min-height: 40px; }
.bar-row + .bar-row { margin-top: 4px; }
.bar-row.overall { padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid var(--border); }
.bar-label { font-size: 0.82rem; color: var(--text-sub); white-space: nowrap; }
/* 右側預留空間給長條尾端的總數 */
.bar-track { display: flex; align-items: center; gap: 6px; min-width: 0; padding-right: 34px; }
.bar-stack { display: flex; gap: 2px; height: 16px; flex-shrink: 0; border-radius: 4px; overflow: hidden; }
.bar-seg {
    height: 100%; border: none; padding: 0; cursor: pointer; flex: 0 1 auto; min-width: 4px;
    color: #fff; font-family: var(--f-num); font-size: 0.78rem; font-weight: 800; line-height: 16px; overflow: visible;
    position: relative;
}
.bar-seg:last-child { border-radius: 0 4px 4px 0; }
.bar-seg.dim { opacity: 0.35; }
.bar-seg::after { content: ''; position: absolute; inset: -9px 0; } /* 放大點擊範圍 */
.bar-total { font-family: var(--f-num); font-weight: 800; font-size: 0.95rem; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.chart-info { min-height: 40px; margin-top: 10px; padding: 8px 12px; border-radius: 8px; background: var(--raised); font-size: 0.85rem; color: var(--text-sub); display: flex; align-items: center; }
.chart-empty { color: var(--text-faint); text-align: center; padding: 20px 0; }
.stars-label { color: var(--star); letter-spacing: -1px; font-size: 0.78rem; }
.chart-chips { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 12px; scrollbar-width: none; }
.chart-chips::-webkit-scrollbar { display: none; }
.chart-chips .chip { min-height: 34px; font-size: 0.8rem; border-width: 1px; flex-shrink: 0; }
.chart-chips .chip.selected { background: var(--text); border-color: var(--text); color: var(--bg); box-shadow: none; }
.kpi-grid.three { grid-template-columns: repeat(3, 1fr); margin: 0 0 14px; }
.kpi-grid.three .kpi { background: var(--raised); border: none; padding: 10px 12px; }
.kpi-grid.three .kpi-value { font-size: 1.7rem; }
/* 閱讀日曆 */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-nav { display: flex; align-items: center; gap: 4px; font-size: 0.9rem; font-weight: bold; }
.cal-nav .icon-btn { width: 36px; height: 36px; font-size: 1.4rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-week { font-size: 0.72rem; color: var(--text-muted); text-align: center; padding-bottom: 2px; }
.cal-cell { aspect-ratio: 5 / 4; border: none; border-radius: 6px; background: var(--raised); color: var(--text-sub); font: inherit; font-size: 0.66rem;
    display: flex; align-items: flex-start; justify-content: flex-start; padding: 2px 4px; cursor: pointer; }
.cal-cell.empty { visibility: hidden; }
.cal-cell.future { opacity: 0.35; cursor: default; }
.cal-cell.today { box-shadow: inset 0 0 0 2px var(--text); }
.cal-cell.selected { box-shadow: inset 0 0 0 2px var(--text); }
.cal-cell.lv1, .cal-legend .lv1 { background: color-mix(in srgb, var(--primary) 22%, var(--raised)); }
.cal-cell.lv2, .cal-legend .lv2 { background: color-mix(in srgb, var(--primary) 45%, var(--raised)); }
.cal-cell.lv3, .cal-legend .lv3 { background: color-mix(in srgb, var(--primary) 70%, var(--raised)); color: var(--on-primary); }
.cal-cell.lv4, .cal-legend .lv4 { background: var(--primary); color: var(--on-primary); }
.cal-legend { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 8px; font-size: 0.72rem; color: var(--text-muted); }
.cal-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.cal-summary { margin-top: 10px; font-size: 0.85rem; color: var(--text-sub); line-height: 1.7; }
.cal-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; text-align: center; }
.cal-stats > div { display: flex; flex-direction: column; background: var(--raised); border-radius: 8px; padding: 6px 0; }
.cal-stats b { font-family: var(--f-num); font-weight: 800; font-size: 1.3rem; color: var(--text-strong); font-variant-numeric: tabular-nums; line-height: 1.2; }
.cal-stats span { font-size: 0.68rem; color: var(--text-muted); }
.cal-summary-line { margin-top: 6px; font-size: 0.8rem; }
.cal-summary b { color: var(--text); }
.cal-day { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.cal-day-title { font-size: 0.85rem; font-weight: bold; margin-bottom: 6px; }
.cal-day-row { display: flex; gap: 8px; align-items: baseline; font-size: 0.85rem; padding: 3px 0; }
.cal-day-row .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-day-row .d { color: var(--text-sub); white-space: nowrap; }
.year-section-title { font-size: 0.85rem; color: var(--text-muted); font-weight: bold; margin: 18px 0 8px; }
.month-chart { display: grid; grid-template-columns: repeat(12, 1fr); gap: 2px; height: 130px; align-items: end; }
.month-col {
    height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
    border: none; background: none; padding: 0; cursor: pointer; font: inherit;
}
.month-value { font-size: 0.7rem; color: var(--text-sub); min-height: 16px; font-variant-numeric: tabular-nums; }
.month-bar { width: 100%; max-width: 20px; border-radius: 4px 4px 0 0; background: var(--status-completed); min-height: 0; }
.month-col.dim .month-bar { opacity: 0.35; }
.month-axis { display: grid; grid-template-columns: repeat(12, 1fr); gap: 2px; border-top: 1px solid var(--border); margin-top: 0; }
.month-axis span { text-align: center; font-size: 0.68rem; color: var(--text-muted); padding-top: 4px; }
.rank-list { display: flex; flex-direction: column; }
.rank-item {
    display: flex; align-items: center; gap: 10px; min-height: 44px; border: none; background: none; width: 100%;
    color: var(--text); font: inherit; text-align: left; cursor: pointer; padding: 0 2px; border-bottom: 1px solid var(--border);
}
.rank-item:last-child { border-bottom: none; }
.rank-item:active { background: var(--raised); }
.rank-no { width: 18px; color: var(--text-muted); font-size: 0.8rem; text-align: center; font-variant-numeric: tabular-nums; }
.rank-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-count { color: var(--text-sub); font-family: var(--f-num); font-weight: 800; font-size: 1rem; font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; }

/* 底部分頁列在 common.css（平台留言頁共用） */
.fab {
    position: fixed; right: 16px; bottom: calc(72px + var(--safe-bottom)); z-index: 30;
    width: 56px; height: 56px; border-radius: 18px; background: var(--primary); color: var(--on-primary);
    display: flex; align-items: center; justify-content: center; text-decoration: none;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}

/* 彈出視窗：底部選單 (sheet) 與全螢幕詳細頁 (fullsheet) */
.backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); z-index: 90; display: none; }
.backdrop.open { display: block; }
.sheet {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 100; display: none;
    max-height: 85vh; overflow-y: auto; background: var(--card-bg); border-radius: 16px 16px 0 0;
    padding: 8px 16px calc(16px + var(--safe-bottom)); max-width: 640px; margin: auto;
}
.sheet.open { display: block; animation: slideUp 0.2s ease-out; }
.sheet-handle { width: 40px; height: 4px; border-radius: 2px; background: var(--border-strong); margin: 4px auto 12px; }
.sheet h3 { margin: 0 0 12px; font-size: 1rem; }
/* 有標題列的面板（設定和它的第二層）：標題列捲動時固定在上方 */
.sheet-head { position: sticky; top: -8px; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 8px;
    margin: 0 -16px 4px; padding: 2px 6px 2px 16px; background: var(--card-bg); }
.sheet-head h3 { margin: 0; }
.sheet-close { width: 40px; height: 40px; color: var(--text-sub); }
.sheet-close .ico { width: 20px; height: 20px; }
/* 設定的第二層（作品清單顯示、我看的平台…）：左上角 ‹ 回到設定，標題接在後面 */
.sheet-head-sub { justify-content: flex-start; gap: 2px; padding-left: 4px; }
.sheet-back { width: 40px; height: 40px; color: var(--text-sub); }
.sheet-back .ico { width: 22px; height: 22px; }
.sheet .form-section:last-child { margin-bottom: 0; }

.fullsheet {
    position: fixed; inset: 0; z-index: 100; display: none; flex-direction: column;
    background: var(--bg);
}
.fullsheet.open { display: flex; animation: slideUp 0.22s ease-out; }
@media (min-width: 700px) {
    .fullsheet { inset: 4vh 0; max-width: 680px; margin: 0 auto; border-radius: 16px; border: 1px solid var(--border); overflow: hidden; }
}
.fullsheet-header {
    display: flex; align-items: center; gap: 4px; padding: 6px 8px; padding-top: calc(6px + env(safe-area-inset-top, 0px));
    border-bottom: 1px solid var(--border); background: var(--surface); flex-shrink: 0;
}
.fullsheet-header .sheet-title { flex: 1; font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fullsheet-body { flex: 1; overflow-y: auto; padding: 16px; -webkit-overflow-scrolling: touch; }
.fullsheet-footer {
    display: flex; gap: 10px; padding: 10px 16px calc(10px + var(--safe-bottom));
    border-top: 1px solid var(--border); background: var(--surface); flex-shrink: 0;
}
.fullsheet-footer .btn { min-height: 48px; }
@keyframes slideUp { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }

/* 詳細頁內容 */
.detail-title { font-size: 1.4rem; margin: 0; line-height: 1.3; }
.detail-kr { font-family: var(--f-kr); color: var(--text-kr); margin-top: 4px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }
.open-links { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.open-link {
    display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px;
    border-radius: 10px; background: var(--raised); border: 1px solid var(--border);
    color: var(--text); text-decoration: none; font-size: 0.9rem; font-weight: bold;
}
.open-link:active { background: var(--border); }
.open-link.open-link-tw { border-style: dashed; border-color: var(--border-strong); }
.open-link .swatch { width: 10px; height: 10px; border-radius: 3px; }
.open-link-icon { color: var(--text-muted); font-size: 0.85rem; }
.detail-progress { display: flex; margin: -4px 0 14px; }
.detail-progress .ep-plus { flex: 1; min-height: 42px; border-radius: 12px; font-size: 0.92rem; background: var(--primary); color: var(--on-primary); border: none; }
/* 詳細頁：最新話數不會自己更新的提示 */
.detail-hint { margin: -6px 0 12px; font-size: 0.78rem; color: var(--text-muted); line-height: 1.5; }
/* 詳細頁上方三格：看到第幾話、我的評分、未讀 */
.detail-stats {
    display: grid; grid-template-columns: repeat(3, 1fr); margin: 4px 0 14px; padding: 12px 4px;
    background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; text-align: center;
}
.detail-stats > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; border-right: 1px solid var(--border); }
.detail-stats > div:last-child { border-right: none; }
.detail-stats b { font-family: var(--f-num); font-weight: 800; font-size: 1.75rem; line-height: 1.15; color: var(--text-strong); font-variant-numeric: tabular-nums; white-space: nowrap; }
.detail-stats b small { font-family: var(--f-body); }
.detail-stats b small { font-size: 0.75rem; color: var(--text-muted); font-weight: normal; }
.detail-stats b.star { color: var(--star); }
.detail-stats b.backlog { color: var(--backlog-text); }
.detail-stats b.muted { font-family: var(--f-body); color: var(--text-muted); font-size: 0.95rem; font-weight: normal; line-height: 1.9; }
.detail-stats span { font-size: 0.72rem; color: var(--text-muted); }
.detail-dates { display: flex; gap: 16px; font-size: 0.85rem; margin-bottom: 12px; }
.item-note { font-size: 0.78rem; color: var(--note-text); margin-top: 2px; }
.card-note { margin: 2px 0 0; }
.notes-head { display: flex; justify-content: space-between; align-items: center; margin: 20px 0 8px; }
.notes-head .detail-section-title { margin: 0; }
.notes-add { min-height: 36px; padding: 0 12px; font-size: 0.85rem; }
.note-list { border-left: 2px dashed var(--border-strong); margin-left: 6px; }
.note-item {
    position: relative; padding: 4px 4px 12px 16px; cursor: pointer; border-radius: 0 8px 8px 0;
}
.note-item:active { background: var(--raised); }
.note-item::before { content: ''; position: absolute; left: -7px; top: 8px; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 2px solid var(--primary); box-sizing: border-box; }
.note-meta { display: flex; gap: 6px; align-items: center; font-size: 0.78rem; color: var(--text-muted); margin-bottom: 2px; }
.note-meta .ep-badge { margin-left: 0; font-size: 0.72rem; }
/* 被 @ 的反向連結、從標籤跳過來時的「回到」 */
.trail-back { border: none; background: var(--link-soft-bg); color: var(--link-soft-text); border-radius: 16px; padding: 6px 12px; margin-bottom: 12px; font-size: 0.85rem; font-weight: bold; cursor: pointer; }
.backlinks { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; }
.backlink { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 10px; background: var(--raised); cursor: pointer; }
.backlink:active { opacity: 0.8; }
.backlink-main { flex: 1; min-width: 0; }
.backlink-title { font-weight: bold; font-size: 0.9rem; }
.backlink-title span { font-weight: normal; font-size: 0.75rem; color: var(--text-muted); margin-left: 6px; }
.backlink-snippet { font-size: 0.8rem; color: var(--text-sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-text { font-size: 0.95rem; line-height: 1.65; white-space: pre-wrap; word-break: break-word; color: var(--text-sub); }
.note-empty { color: var(--text-faint); font-size: 0.88rem; padding: 4px 0 4px 16px; }
.cleanup-item { background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.cleanup-item label.cleanup-title { display: flex; gap: 10px; align-items: flex-start; font-weight: bold; cursor: pointer; }
.cleanup-item input[type="checkbox"] { width: 20px; height: 20px; margin: 2px 0 0; flex-shrink: 0; accent-color: var(--primary); }
/* 更新平台資料：要你選的候選作品 */
.sync-cand {
    display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 6px; padding: 8px; border-radius: 10px;
    border: 1px solid var(--border); background: var(--raised); color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.sync-cand:active { opacity: 0.8; }
.sync-cand-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sync-cand-main small { font-size: 0.75rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sync-cand-go { flex-shrink: 0; font-size: 0.78rem; font-weight: bold; color: var(--primary); }
.cleanup-rows { margin: 8px 0 0 30px; font-size: 0.85rem; color: var(--text-sub); display: grid; gap: 4px; }
.cleanup-rows .k { color: var(--text-muted); margin-right: 6px; }
.cleanup-rows .old { color: var(--text-muted); text-decoration: line-through; }
.cleanup-flag { color: var(--flag-text); }
.sync-diff { display: flex; gap: 10px; align-items: flex-start; margin-top: 4px; padding: 8px 10px; border-radius: 8px; background: color-mix(in srgb, var(--flag-text) 12%, transparent); cursor: pointer; }
.sync-diff input { width: 18px; height: 18px; margin: 2px 0 0; flex-shrink: 0; accent-color: var(--primary); }
.sync-diff-hint { color: var(--text-muted); font-size: 0.8rem; }
.help details { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; background: var(--surface); }
.help summary { list-style: none; cursor: pointer; padding: 12px 14px; font-weight: bold; min-height: 44px; display: flex; justify-content: space-between; align-items: center; }
.help summary::-webkit-details-marker { display: none; }
.help summary::after { content: '▾'; color: var(--text-muted); transition: transform 0.2s; }
.help details[open] summary::after { transform: rotate(180deg); }
.help .help-body { padding: 0 14px 12px; font-size: 0.88rem; line-height: 1.7; color: var(--text-sub); }
.help .help-body ul { margin: 4px 0; padding-left: 20px; }
.help .help-body li { margin: 3px 0; }
.help .help-body b { color: var(--text); }
.help table { width: 100%; border-collapse: collapse; font-size: 0.82rem; margin: 6px 0; }
.help th, .help td { border: 1px solid var(--border); padding: 6px 8px; text-align: left; vertical-align: top; }
.help td:first-child { white-space: nowrap; color: var(--text); }
/* 動態：更新平台資料縮成一行；同一天的紀錄放在同一塊，一筆一行 */
.sync-bar { display: flex; align-items: center; gap: 10px; margin: 0 2px 6px; }
.sync-bar-text { flex: 1; min-width: 0; font-size: 0.78rem; color: var(--text-muted); line-height: 1.5; }
.sync-bar-text.bad { color: var(--flag-text); }
.sync-bar .btn { flex-shrink: 0; min-height: 32px; padding: 0 12px; font-size: 0.8rem; border-radius: 16px; }
.activity-seg { display: flex; gap: 4px; padding: 3px; margin: 10px 0; border-radius: 10px; background: var(--raised); }
.activity-seg button { flex: 1; min-height: 34px; font-size: 0.88rem; border: none; border-radius: 9px; background: none; color: var(--text-sub); font: inherit; font-weight: bold; cursor: pointer; }
.activity-seg button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); }
.act-day { margin-bottom: 8px; }
.act-feed { border: 1px solid var(--border); border-radius: 12px; background: var(--surface); padding: 0 12px; }
.act-day-title { position: sticky; top: 0; z-index: 1; display: flex; align-items: baseline; gap: 6px; padding: 8px 2px 6px; font-size: 0.8rem; font-weight: bold; color: var(--text-sub); background: var(--bg); }
.act-date { font-family: var(--f-num); font-weight: 800; font-size: 1.25rem; color: var(--text-strong); line-height: 1; }
.act-old { opacity: 0.55; }
.act-new { font-family: var(--f-num); font-weight: 800; font-size: 1.05rem; color: var(--text-strong); }
.act-item { display: flex; gap: 8px; align-items: flex-start; width: 100%; padding: 9px 0; text-align: left; font-size: 0.86rem;
    border: none; border-bottom: 1px solid var(--border); background: none; color: var(--text); font: inherit; }
.act-feed .act-item:last-child { border-bottom: none; }
button.act-item { cursor: pointer; }
/* 每一種動態一個顏色（--act-c 由 js/activity.js 的 ACTIVITY_ICON 決定）：淡底＋同色圖示 */
.act-icon { flex-shrink: 0; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center;
    background: color-mix(in srgb, var(--act-c, var(--text-sub)) 26%, transparent); color: var(--act-c, var(--text-sub)); }
.act-icon .ico { width: 15px; height: 15px; }
.act-main { flex: 1; min-width: 0; }
.act-title { font-weight: bold; color: var(--text-strong); overflow-wrap: anywhere; margin-right: 6px; }
.act-text { font-size: 0.84rem; color: var(--text-sub); overflow-wrap: anywhere; }
.act-time { flex-shrink: 0; font-size: 0.72rem; color: var(--text-muted); padding-top: 2px; font-variant-numeric: tabular-nums; }
.act-empty { padding: 40px 16px; text-align: center; color: var(--text-muted); line-height: 1.7; }
.act-more { width: 100%; margin: 4px 0 16px; }
.sync-intro { color: var(--text-sub); font-size: 0.88rem; line-height: 1.7; margin: 0 0 12px; }
/* 長文字收合 */
/* 截斷套在沒有內距的內層，外層的內距才不會露出下一行 */
.collapsible.collapsed .clamp-body { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.collapsible.collapsed .comment-text .clamp-body { -webkit-line-clamp: 6; line-clamp: 6; }
.expand-btn { border: none; background: none; color: var(--primary); font-weight: bold; font-size: 0.85rem; padding: 8px 0; min-height: 40px; cursor: pointer; }
.comment-text { font-size: 1rem; color: var(--text-sub); line-height: 1.7; white-space: pre-wrap; word-break: break-word; background: var(--raised); padding: 12px 14px; border-radius: 10px; }
.detail-section-title { font-size: 0.85rem; color: var(--text-muted); font-weight: bold; margin: 20px 0 8px; }
/* 創作團隊：一個人一行，合作過的其他作品直接列在名字底下 */
.team { background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.team-row { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 8px; padding: 10px 12px; align-items: start; }
.team-row + .team-row { border-top: 1px solid var(--border); }
.team-role { font-family: var(--f-kr); font-size: 0.8rem; color: var(--text-muted); padding-top: 3px; }
.team-main { min-width: 0; }
.team-works { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.team-work { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 4px 10px 4px 4px; border: none; border-radius: 10px; background: var(--raised); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.team-work:active { opacity: 0.8; }
.team-work .cover-xs { width: 28px; height: 38px; }
.team-work .cover-xs.cover-placeholder { font-size: 18px; }
.team-work span { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.team-work b { font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-work small { font-size: 0.72rem; color: var(--text-muted); }
.creator-list { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 0.92rem; }
.creator-list dt { font-family: var(--f-kr); font-size: 0.85rem; color: var(--text-muted); white-space: nowrap; }
.creator-list dd { margin: 0; color: var(--text); }
.creator-name {
    border: none; background: none; padding: 2px 0; margin-right: 2px; font: inherit; color: var(--text); cursor: pointer;
    text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px;
}
.creator-name:active { color: var(--primary); }
.relation-group { margin-bottom: 10px; font-size: 0.9rem; }
.relation-group .label { color: var(--link); font-weight: bold; margin-right: 4px; }
.relation-link { border: none; background: var(--link-soft-bg); color: var(--link-soft-text); border-radius: 6px; padding: 4px 8px; margin: 3px 4px 3px 0; font-size: 0.85rem; cursor: pointer; }

/* 使用說明：分組小標題（每一頁都適用、其他頁）、「看其他頁的說明」按鈕 */
.help-group-title { font-size: 0.78rem; color: var(--text-muted); margin: 18px 2px 8px; }
.help-more { width: 100%; margin-top: 16px; }

/* 創作者頁：名字、職位膠囊、三格（參與作品／平均評分／已看完）、作品一列一部 */
.creator-title { font-family: var(--f-kr); font-size: 1.5rem; font-weight: 800; color: var(--text-strong); margin: 4px 0 10px; overflow-wrap: anywhere; }
.role-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.role-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 8px; background: var(--raised); color: var(--text-sub); font-family: var(--f-kr); font-size: 0.82rem; }
.role-chip b { font-family: var(--f-num); font-size: 1rem; color: var(--text-strong); }
.creator-kpis { margin-bottom: 8px; }
.creator-works { display: grid; }
.work-row { display: flex; gap: 12px; align-items: center; padding: 12px 2px; border-bottom: 1px solid var(--border); cursor: pointer; }
.work-row:last-child { border-bottom: none; }
.work-row:active { background: var(--raised); }
.work-row:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; border-radius: 8px; }
.work-main { flex: 1; min-width: 0; }
.work-title { font-weight: bold; color: var(--text-strong); overflow-wrap: anywhere; }
.work-kr { font-family: var(--f-kr); font-size: 0.82rem; color: var(--text-kr); overflow-wrap: anywhere; }
.work-roles { font-family: var(--f-kr); font-size: 0.8rem; color: var(--link); margin-top: 2px; }
.work-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }

/* 統計：各平台閱讀狀態（數字格，格子底色依數量深淺，由 js/stats.js 設定） */
.status-matrix { width: 100%; border-collapse: separate; border-spacing: 3px; font-variant-numeric: tabular-nums; }
.status-matrix th { font-size: 0.7rem; font-weight: normal; color: var(--text-muted); padding: 0 2px 2px; text-align: center; white-space: nowrap; }
.status-matrix th .swatch { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 3px; vertical-align: 0.1em; }
.status-matrix th.row { text-align: left; font-size: 0.8rem; color: var(--text-sub); padding-right: 4px; }
.status-matrix td { text-align: center; height: 36px; padding: 0 2px; border-radius: 7px; font-family: var(--f-num); font-weight: 800; font-size: 1.05rem; color: var(--text-strong); }
.status-matrix td.zero { color: var(--text-faint); font-weight: 600; }
.status-matrix td.total { color: var(--text-sub); font-size: 0.95rem; }
.status-matrix tr.all th.row { color: var(--text-strong); font-weight: bold; }
.status-matrix tr.all td { height: 40px; font-size: 1.2rem; }

/* 統計：評分分布（左邊平均大字、右邊 1～5 星直條、下面各平台平均） */
.rating-top { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; align-items: end; }
.rating-avg { display: grid; gap: 2px; justify-items: start; }
.rating-avg-num { font-family: var(--f-num); font-weight: 800; font-size: 3.2rem; line-height: 0.9; color: var(--text-strong); }
.rating-avg-stars { color: var(--star); letter-spacing: 1px; font-size: 0.9rem; }
.rating-avg-stars i { color: var(--star-empty); font-style: normal; }
.rating-avg small { font-size: 0.72rem; color: var(--text-muted); }
.rating-cols { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; align-items: end; height: 120px; }
.rating-col { display: grid; align-content: end; justify-items: center; gap: 3px; height: 100%; }
.rating-col-n { font-family: var(--f-num); font-weight: 800; font-size: 0.95rem; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.rating-col-bar { width: 100%; max-width: 30px; border-radius: 5px 5px 2px 2px; background: var(--star); }
.rating-axis { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--border); }
.rating-axis span { text-align: center; font-size: 0.7rem; color: var(--star); white-space: nowrap; }
.rating-sub { font-size: 0.78rem; color: var(--text-muted); margin: 14px 0 4px; }
.rating-platform { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; width: 100%; padding: 7px 8px; margin: 0 -8px; box-sizing: content-box;
    border: none; border-top: 1px solid var(--border); border-radius: 0; background: none; font: inherit; font-size: 0.86rem; color: inherit; text-align: left; cursor: pointer; }
.rating-platform:first-child { border-top-color: transparent; }
.rating-platform.selected { background: var(--raised); border-radius: 8px; border-top-color: transparent; }
.rating-platform.selected + .rating-platform { border-top-color: transparent; }
.rating-platform:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; border-radius: 8px; }
.rating-avg-label { display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; font-weight: bold; color: var(--text-sub); }
.rating-avg-label .swatch { width: 8px; height: 8px; border-radius: 50%; }
.rating-platform .name { display: flex; align-items: center; gap: 7px; color: var(--text-sub); }
.rating-platform .swatch { width: 8px; height: 8px; border-radius: 50%; }
.rating-platform .score { font-family: var(--f-num); font-weight: 800; font-size: 1.15rem; color: var(--text-strong); }
.rating-platform .score::after { content: '★'; font-family: var(--f-body); font-size: 0.75rem; color: var(--star); margin-left: 2px; }
.rating-platform .cnt { font-size: 0.74rem; color: var(--text-muted); min-width: 3.6em; text-align: right; }
