/* desk-calendar · 台历 —— 双圈线装订、靛蓝撕页日期块贯穿全站 */
:root {
    --dc-desk: #e4e8f0;
    --dc-leaf: #ffffff;
    --dc-wire: #5b6372;
    --dc-ink: #1d2333;
    --dc-soft: #4d566a;
    --dc-date: #3730a3;
    --dc-sun: #c2185b;
    --dc-rule: #cfd8ea;
    --dc-display: Sora, system-ui, -apple-system, "Segoe UI", sans-serif;
    --dc-body: Lato, system-ui, -apple-system, "Segoe UI", sans-serif;
    --pagination-accent: #3730a3;
}

body.theme-deskcal { margin: 0; background: var(--dc-desk); color: var(--dc-ink); font-family: var(--dc-body); font-size: 16px; }
:where(.theme-deskcal) a { color: inherit; text-decoration: none; }
.theme-deskcal :focus-visible { outline: 3px solid var(--dc-sun); outline-offset: 3px; }
.dc-skip { position: absolute; left: -9999px; }
.dc-skip:focus { left: 12px; top: 12px; z-index: 50; padding: 10px 14px; background: var(--dc-leaf); font-weight: 700; }
.dc-desk:focus { outline: none; }

/* ---------- 母题：线圈、日期块 ---------- */
.dc-wire { display: block; height: 16px; margin: -8px 14px 0; background:
    radial-gradient(ellipse 3px 8px at 50% 50%, var(--dc-wire) 92%, transparent 100%) 0 0 / 16px 16px repeat-x,
    radial-gradient(circle 3px at 50% 85%, var(--dc-desk) 90%, transparent 100%) 0 0 / 16px 16px repeat-x; }
.dc-date { display: inline-grid; justify-items: center; align-content: center; min-width: 52px; padding: 4px 8px 6px; border-radius: 6px; background: var(--dc-date); color: #fff; font-family: var(--dc-display); font-weight: 800; font-size: 1.5rem; line-height: 1; }
.dc-date small { display: block; margin-bottom: 3px; font-size: .62rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.dc-date-big { min-width: 76px; padding: 8px 12px 10px; font-size: 2.4rem; }
.dc-leaf-topic { display: grid; gap: 2px; min-width: 0; font-family: var(--dc-display); font-weight: 600; font-size: .86rem; color: var(--dc-date); }
.dc-leaf-topic small { font-family: var(--dc-body); font-weight: 400; font-size: .8rem; color: var(--dc-soft); }

/* ---------- 顶栏 ---------- */
.dc-top { background: var(--dc-leaf); border-bottom: 1px solid var(--dc-rule); }
.dc-top-inner { display: flex; align-items: center; gap: 20px; max-width: 1360px; margin: 0 auto; padding: 10px 24px; }
.dc-brand { display: inline-flex; align-items: center; gap: 12px; margin-right: auto; min-width: 0; }
.dc-brand-pad { flex: none; display: grid; width: 34px; height: 36px; border-radius: 5px; background: var(--dc-date); padding-top: 9px; box-sizing: border-box; }
.dc-brand-pad i { display: block; margin: 0 4px; border-radius: 2px; background: #fff; }
.dc-brand-name { font-family: var(--dc-display); font-weight: 800; font-size: 1.4rem; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dc-months { display: flex; gap: 2px; }
.dc-months a { padding: 8px 14px; border-radius: 999px; font-weight: 700; font-size: .95rem; }
.dc-months a:hover { background: var(--dc-desk); }
.dc-months a.is-on { background: var(--dc-date); color: #fff; }
.dc-menu-toggle { display: none; color: inherit; }

/* ---------- 版心 ---------- */
.dc-desk-wrap { max-width: 1360px; margin: 0 auto; padding: 24px 24px 0; }
.dc-desk { display: block; min-height: 60vh; padding-bottom: 40px; }
.dc-crumb { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 0 8px; font-size: .9rem; color: var(--dc-soft); }
.dc-crumb a { color: var(--dc-date); font-weight: 700; }
.dc-empty { margin: 32px 0; padding: 24px; border-radius: 8px; background: var(--dc-leaf); text-align: center; }
.dc-pager { margin-top: 32px; }

.dc-run { margin-top: 32px; }
.dc-run-head { margin: 0 0 18px; font-family: var(--dc-display); font-weight: 800; font-size: 1.25rem; }
.dc-run-head::after { content: ""; display: block; width: 48px; height: 4px; margin-top: 6px; border-radius: 2px; background: var(--dc-sun); }

/* ---------- 日历页卡片 ---------- */
.dc-leaves { display: grid; gap: 28px 20px; }
.dc-leaves-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dc-leaves-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dc-leaf { min-width: 0; padding-top: 8px; }
.dc-leaf-link { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto 1fr; gap: 12px; height: 100%; padding: 0 12px 16px; border-radius: 8px; background: var(--dc-leaf); box-shadow: 0 2px 0 var(--dc-rule), 0 4px 0 #f6f7fb, 0 5px 0 var(--dc-rule); }
.dc-leaf-link .dc-wire { margin: -8px 2px 0; }
.dc-leaf-head { display: flex; align-items: center; gap: 12px; }
.dc-leaf-link img { display: block; width: 100%; height: auto; aspect-ratio: 5 / 3; object-fit: cover; border-radius: 4px; background: var(--dc-desk); }
.dc-leaf-title { overflow-wrap: anywhere; font-family: var(--dc-display); font-weight: 600; font-size: 1.06rem; line-height: 1.32; }
.dc-leaf-link:hover .dc-leaf-title { color: var(--dc-date); text-decoration: underline; }

/* ---------- 首页头条：月历封面 ---------- */
.dc-cover { padding-top: 8px; }
.dc-cover-link { display: block; padding: 0 0 0; border-radius: 10px; background: var(--dc-leaf); box-shadow: 0 2px 0 var(--dc-rule), 0 5px 0 #f6f7fb, 0 7px 0 var(--dc-rule); }
.dc-cover-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 0; }
.dc-cover-text { display: grid; gap: 16px; align-content: center; padding: 24px 28px 28px; }
.dc-cover-date { display: flex; align-items: center; gap: 16px; }
.dc-cover-title { font-family: var(--dc-display); font-weight: 800; font-size: clamp(1.6rem, 2.6vw, 2.3rem); line-height: 1.14; letter-spacing: -.01em; }
.dc-cover-link:hover .dc-cover-title { color: var(--dc-date); }
.dc-cover-excerpt { color: var(--dc-soft); line-height: 1.6; }
.dc-cover-grid img { display: block; width: 100%; height: 100%; aspect-ratio: 2 / 1; object-fit: cover; border-radius: 0 0 10px 0; background: var(--dc-desk); }

/* ---------- 分类页：日程行 ---------- */
.dc-cat-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; max-width: 1040px; }
.dc-day { min-width: 0; }
.dc-day-link { display: grid; grid-template-columns: 84px 240px minmax(0, 1fr); align-items: stretch; border-radius: 8px; background: var(--dc-leaf); overflow: hidden; box-shadow: 0 2px 0 var(--dc-rule); }
.dc-stub { display: grid; align-content: center; justify-items: center; gap: 2px; padding: 10px 6px; background: var(--dc-date); color: #fff; border-right: 3px dashed var(--dc-leaf); }
.dc-stub strong { font-family: var(--dc-display); font-weight: 800; font-size: 2rem; line-height: 1; }
.dc-stub small { font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.dc-day-link img { display: block; width: 100%; height: 100%; min-height: 150px; object-fit: cover; background: var(--dc-desk); }
.dc-day-text { display: grid; gap: 8px; align-content: center; padding: 16px 22px; background: repeating-linear-gradient(var(--dc-leaf) 0 31px, var(--dc-rule) 31px 32px); }
.dc-day-topic { font-family: var(--dc-display); font-weight: 600; font-size: .84rem; color: var(--dc-date); }
.dc-day-title { overflow-wrap: anywhere; font-family: var(--dc-display); font-weight: 700; font-size: 1.2rem; line-height: 1.3; }
.dc-day-link:hover .dc-day-title { color: var(--dc-date); text-decoration: underline; }
.dc-day-excerpt { color: var(--dc-soft); line-height: 1.55; }
.dc-cat-list > .dc-ad { margin: 4px 0; }
.dc-cat-list > .dc-ad:not(:has(.ad)) { display: none; }

/* ---------- 分类索引：挂墙日历标签 ---------- */
.dc-wall-title { margin: 8px 0 24px; font-family: var(--dc-display); font-weight: 800; font-size: clamp(1.8rem, 3.6vw, 2.6rem); letter-spacing: -.02em; }
.dc-wallplanner { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 28px 20px; }
.dc-tab { display: grid; grid-template-rows: auto auto 1fr auto; gap: 10px; padding: 0 16px 16px; border-radius: 8px; background: var(--dc-leaf); border-top: 28px solid var(--dc-date); box-shadow: 0 2px 0 var(--dc-rule); }
.dc-tab .dc-wire { margin: -22px 0 0; }
.dc-tab-name { font-family: var(--dc-display); font-weight: 800; font-size: 1.15rem; }
.dc-tab-desc { color: var(--dc-soft); font-size: .93rem; line-height: 1.5; }
.dc-tab-open { font-weight: 700; font-size: .88rem; color: var(--dc-sun); }
.dc-tab:hover .dc-tab-name { color: var(--dc-date); text-decoration: underline; }

/* ---------- 广告壳：无广告时塌陷 ---------- */
.dc-ad:has(.ad) { margin: 24px 0; }
.dc-ad:has(.ad) .ad { min-height: 250px; margin: 0 !important; }

/* ---------- 页脚：撕页条 ---------- */
.dc-pad { max-width: 1360px; margin: 0 auto; padding: 8px 24px 96px; }
.dc-pad-sheet { border-radius: 8px; background: var(--dc-leaf); box-shadow: 0 2px 0 var(--dc-rule); overflow: hidden; }
.dc-pad-note { margin: 0; padding: 16px 20px; font-size: .95rem; color: var(--dc-soft); }
.dc-pad-note strong { font-family: var(--dc-display); color: var(--dc-ink); }
.dc-tearoffs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 2px dashed var(--dc-rule); }
.dc-tear { display: grid; place-items: center; min-height: 56px; padding: 8px; font-weight: 700; text-align: center; color: var(--dc-date); }
.dc-tear + .dc-tear { border-left: 2px dashed var(--dc-rule); }
.dc-tear:hover { background: var(--dc-desk); }

/* ---------- 共享页面调色 ---------- */
.theme-deskcal .site-menu, .theme-deskcal .site-search, .theme-deskcal .static-page, .theme-deskcal .theme-error { --menu-accent: var(--dc-date); background: var(--dc-leaf); border-radius: 10px; }

/* ---------- 断点 ---------- */
@media (min-width: 1200px) {
    .dc-cat-list { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: none; }
    .dc-cat-list > .dc-day:first-child { grid-column: 1 / -1; }
    .dc-cat-list > .dc-day:not(:first-child) .dc-day-link { grid-template-columns: 76px 200px minmax(0, 1fr); }
}

@media (min-width: 1600px) {
    .dc-desk-wrap, .dc-top-inner, .dc-pad { max-width: 1560px; }
    .dc-leaves-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (max-width: 1023px) {
    .dc-cover-grid { grid-template-columns: minmax(0, 1fr); }
    .dc-cover-grid img { grid-row: 1; aspect-ratio: 16 / 7; border-radius: 0; }
    .dc-leaves-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .dc-day-link { grid-template-columns: 76px 180px minmax(0, 1fr); }
    .dc-day-excerpt { display: none; }
    .dc-tearoffs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .dc-tear:nth-child(4) { border-left: 0; }
    .dc-tear:nth-child(n+4) { border-top: 2px dashed var(--dc-rule); }
}

@media (max-width: 767px) {
    .dc-top-inner { min-height: 56px; padding: 4px 12px; gap: 10px; }
    .dc-brand-pad { width: 28px; height: 30px; padding-top: 8px; }
    .dc-brand-name { font-size: 1.2rem; }
    .dc-menu-toggle { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 999px; background: var(--dc-desk); }
    .dc-desk-wrap { padding: 12px 10px 0; }
    .dc-cover-grid img { aspect-ratio: 16 / 9; }
    .dc-cover-text { padding: 14px; gap: 10px; }
    .dc-date-big { min-width: 60px; font-size: 1.8rem; }
    .dc-cover-title { font-size: 1.4rem; }
    .dc-cover-excerpt { display: none; }
    .dc-run { margin-top: 22px; }
    .dc-leaves { gap: 14px; }
    .dc-leaves-three, .dc-leaves-grid { grid-template-columns: minmax(0, 1fr); }
    .dc-leaf-link { grid-template-columns: 96px minmax(0, 1fr); grid-template-rows: auto auto 1fr; gap: 6px 12px; padding: 0 10px 10px; }
    .dc-leaf-link .dc-wire { grid-column: 1 / -1; }
    .dc-leaf-head { grid-column: 2; grid-row: 2; gap: 8px; }
    .dc-leaf-head .dc-date { min-width: 40px; padding: 3px 6px 4px; font-size: 1.1rem; }
    .dc-leaf-link img { grid-column: 1; grid-row: 2 / span 2; height: 100%; min-height: 80px; aspect-ratio: auto; }
    .dc-leaf-title { grid-column: 2; grid-row: 3; font-size: 1rem; }
    .dc-day-link { grid-template-columns: 52px 88px minmax(0, 1fr); }
    .dc-stub { padding: 8px 2px; border-right-width: 2px; }
    .dc-stub strong { font-size: 1.4rem; }
    .dc-stub small { font-size: .6rem; letter-spacing: .06em; }
    .dc-day-link img { min-height: 96px; }
    .dc-day-text { padding: 10px 12px; gap: 6px; }
    .dc-day-title { font-size: 1rem; }
    .dc-wallplanner { grid-template-columns: minmax(0, 1fr); gap: 20px; }
    .dc-pad { padding: 8px 10px 96px; }
    .dc-tearoffs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dc-tear:nth-child(n) { border-left: 0; border-top: 0; }
    .dc-tear:nth-child(even) { border-left: 2px dashed var(--dc-rule); }
    .dc-tear:nth-child(n+3) { border-top: 2px dashed var(--dc-rule); }
}

/* 移动端：分类导航只在 /menu 出现，隐藏规则放在全局规则之后 */
@media (max-width: 767px) {
    .dc-months { display: none; }
}
