/* ==========================================================================
   TaskFlow — 站点样式（自建设计系统，完全本地，无 CDN 依赖）
   浅色 / 深色通过 <html class="dark"> 切换
   ========================================================================== */

/* ---------- 1. Design tokens ---------- */
:root {
    --c-bg:            #f9fafb;
    --c-bg-alt:        #f3f4f6;
    --c-surface:       #ffffff;
    --c-surface-soft:  rgba(255, 255, 255, 0.8);
    --c-text:          #1f2937;
    --c-text-strong:   #111827;
    --c-muted:         #6b7280;
    --c-faint:         #9ca3af;
    --c-border:        #e5e7eb;
    --c-border-soft:   rgba(0, 0, 0, 0.08);
    --c-brand:         #3b82f6;
    --c-brand-strong:  #2563eb;
    --c-brand-soft:    rgba(59, 130, 246, 0.10);
    --c-brand-line:    rgba(59, 130, 246, 0.30);
    --c-emerald:       #059669;
    --c-purple:        #8b5cf6;
    --c-indigo:        #6366f1;
    --c-amber:         #d97706;
    --grad-brand:      linear-gradient(135deg, #3B82F6 0%, #8B5CF6 100%);
    --shadow-sm:       0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md:       0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg:       0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
    --shadow-xl:       0 20px 25px -5px rgba(0, 0, 0, 0.10), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    --shadow-brand:    0 10px 25px -5px rgba(59, 130, 246, 0.35);
    --radius:          1rem;
    --radius-lg:       1.5rem;
}

.dark {
    --c-bg:            #0B0F19;
    --c-bg-alt:        #111827;
    --c-surface:       #111827;
    --c-surface-soft:  rgba(17, 24, 39, 0.70);
    --c-text:          #e5e7eb;
    --c-text-strong:   #ffffff;
    --c-muted:         #9ca3af;
    --c-faint:         #6b7280;
    --c-border:        #1f2937;
    --c-border-soft:   rgba(255, 255, 255, 0.08);
    --c-brand:         #60a5fa;
    --c-brand-strong:  #3b82f6;
    --c-brand-soft:    rgba(96, 165, 250, 0.12);
    --c-brand-line:    rgba(96, 165, 250, 0.35);
    --c-emerald:       #34d399;
    --c-purple:        #a855f7;
    --c-indigo:        #818cf8;
    --c-amber:         #fbbf24;
    --grad-brand:      linear-gradient(135deg, #60A5FA 0%, #A855F7 100%);
    --shadow-brand:    0 10px 25px -5px rgba(37, 99, 235, 0.45);
}

/* ---------- 2. Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--c-bg);
    color: var(--c-text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
                 Roboto, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB",
                 "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
    transition: background-color .3s ease, color .3s ease;
}

img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; color: var(--c-text-strong); }
p { margin: 0; }
::selection { background: var(--c-brand); color: #fff; }

/* ---------- 3. Layout ---------- */
.wrap   { width: 100%; max-width: 72rem;  margin-inline: auto; padding-inline: 1.5rem; }
.wrap-n { width: 100%; max-width: 60rem;  margin-inline: auto; padding-inline: 1.5rem; }
.wrap-s { width: 100%; max-width: 48rem;  margin-inline: auto; padding-inline: 1.5rem; }

.section       { padding-block: 5rem; }
.section-alt   { background: var(--c-bg-alt); }
.section-t     { border-top: 1px solid var(--c-border); }
.section-t-alt { border-top: 1px solid var(--c-border); background: var(--c-bg-alt); }

/* ---------- 4. Header ---------- */
.site-header {
    position: fixed; inset: 0 0 auto 0; z-index: 50;
    background: var(--c-surface-soft);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--c-border);
    transition: background-color .3s ease, border-color .3s ease;
}
.site-header__inner {
    display: flex; align-items: center; justify-content: space-between;
    height: 4rem;
}
.brand { display: flex; align-items: center; gap: .75rem; }
.brand__logo {
    width: 2.25rem; height: 2.25rem; border-radius: 10px; flex-shrink: 0;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, .2);
}
.brand__name { font-weight: 700; font-size: 1.25rem; letter-spacing: -.02em; color: var(--c-text-strong); }
.brand__tag {
    font-size: .75rem; padding: .1rem .5rem; border-radius: 999px;
    background: var(--c-brand-soft); color: var(--c-brand);
    border: 1px solid var(--c-brand-line); font-weight: 500;
}

.nav { display: none; gap: 1.25rem; font-size: .875rem; font-weight: 500; color: var(--c-muted); }
.nav a { transition: color .2s ease; white-space: nowrap; }
.nav a:hover { color: var(--c-brand); }
/* 导航在 <1024px 隐藏：7 项 + 品牌 + 操作区在此宽度以下装不进一行，会被挤成竖排 */
@media (min-width: 1024px) { .nav { display: flex; } }
@media (min-width: 1280px) { .nav { gap: 2rem; } }

.header-actions { display: flex; align-items: center; gap: .75rem; }

.icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 2.25rem; height: 2.25rem; border: 0; cursor: pointer;
    border-radius: .5rem; background: var(--c-bg-alt); color: var(--c-text);
    transition: background-color .2s ease;
}
.icon-btn:hover { background: var(--c-border); }
.icon-btn svg { width: 1rem; height: 1rem; }

.lang-btn {
    padding: .3rem .55rem; font-size: .75rem; font-weight: 600; cursor: pointer;
    border-radius: .5rem; background: var(--c-bg-alt); color: var(--c-text);
    border: 1px solid var(--c-border); transition: background-color .2s ease;
}
.lang-btn:hover { background: var(--c-border); }

/* 主题图标：浅色显示月亮，深色显示太阳 */
.icon-sun  { display: none; }
.icon-moon { display: block; }
.dark .icon-sun  { display: block; }
.dark .icon-moon { display: none; }

/* ---------- 5. Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .875rem 2rem; border-radius: .75rem; font-weight: 600; font-size: .95rem;
    transition: transform .15s ease, box-shadow .2s ease, background-color .2s ease;
    border: 1px solid transparent; cursor: pointer;
}
.btn--primary {
    background: var(--c-brand-strong); color: #fff; box-shadow: var(--shadow-brand);
}
.btn--primary:hover { background: var(--c-brand); transform: translateY(-1px); }
.btn--ghost {
    background: var(--c-surface-soft); color: var(--c-text);
    backdrop-filter: blur(12px); border-color: var(--c-border);
}
.btn--ghost:hover { color: var(--c-text-strong); border-color: var(--c-brand-line); }
.btn--sm { padding: .5rem 1rem; font-size: .8rem; border-radius: .5rem; box-shadow: none; }
.btn-row { display: flex; flex-direction: column; gap: 1rem; align-items: center; justify-content: center; }
@media (min-width: 640px) { .btn-row { flex-direction: row; } .btn-row .btn { width: auto; } }

/* ---------- 6. Hero ---------- */
.hero { position: relative; overflow: hidden; padding-top: 8rem; padding-bottom: 2.5rem; }
.hero__glow {
    position: absolute; left: 50%; top: 25%; width: 600px; height: 600px;
    transform: translate(-50%, -50%); border-radius: 9999px; filter: blur(120px);
    background: rgba(59, 130, 246, .10); pointer-events: none;
}
.dark .hero__glow { background: rgba(59, 130, 246, .15); }
.hero__inner { position: relative; z-index: 1; text-align: center; }

.badge-pill {
    display: inline-flex; align-items: center; gap: .5rem;
    padding: .3rem .9rem; border-radius: 999px; font-size: .875rem; font-weight: 500;
    background: var(--c-brand-soft); border: 1px solid var(--c-brand-line); color: var(--c-brand);
    margin-bottom: 1.5rem;
}

.hero__title {
    font-size: 2.25rem; font-weight: 800; letter-spacing: -.03em;
    line-height: 1.15; margin-bottom: 1.5rem;
}
@media (min-width: 768px) { .hero__title { font-size: 3.75rem; } }

.text-gradient {
    background: var(--grad-brand);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
}

.hero__lead {
    font-size: 1.125rem; color: var(--c-muted); max-width: 42rem;
    margin: 0 auto 2rem; line-height: 1.75;
}
@media (min-width: 768px) { .hero__lead { font-size: 1.25rem; } }

.narrative {
    margin-top: 4rem; padding: 1rem; border-radius: var(--radius);
    background: var(--c-surface-soft); backdrop-filter: blur(12px);
    border: 1px solid var(--c-border);
    font-size: .875rem; color: var(--c-muted);
    display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .35rem;
}
.narrative strong { color: var(--c-text-strong); }
.narrative .hl { color: var(--c-brand); font-weight: 700; }

/* ---------- 7. Section headers ---------- */
.eyebrow {
    font-size: .75rem; text-transform: uppercase; letter-spacing: .18em;
    font-weight: 600; color: var(--c-brand); margin-bottom: .5rem;
}
.h2 { font-size: 1.875rem; font-weight: 700; margin-bottom: 2rem; }
@media (min-width: 768px) { .h2 { font-size: 2.25rem; } }
.lead { font-size: 1.0625rem; color: var(--c-muted); line-height: 1.75; }

/* ---------- 8. Cards ---------- */
.card {
    background: var(--c-surface); border: 1px solid var(--c-border);
    border-radius: var(--radius-lg); padding: 1.5rem; box-shadow: var(--shadow-sm);
}
.glass-card {
    background: var(--c-surface-soft); backdrop-filter: blur(12px);
    border: 1px solid var(--c-border-soft); border-radius: var(--radius-lg);
    padding: 1.5rem; transition: border-color .2s ease;
}
.glass-card:hover { border-color: var(--c-brand-line); }
.card-brand { border-color: var(--c-brand-line); }

.grid-2 { display: grid; gap: 2rem; }
.grid-3 { display: grid; gap: 1.5rem; }
@media (min-width: 768px) {
    .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Feature / benefit card */
.feat { display: flex; gap: 1rem; }
.feat__num {
    width: 3rem; height: 3rem; border-radius: .75rem; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: .95rem;
}
.feat--blue   .feat__num { background: rgba(59,130,246,.10); color: var(--c-brand);    border: 1px solid rgba(59,130,246,.20); }
.feat--purple .feat__num { background: rgba(139,92,246,.10); color: var(--c-purple);   border: 1px solid rgba(139,92,246,.20); }
.feat--indigo .feat__num { background: rgba(99,102,241,.10); color: var(--c-indigo);   border: 1px solid rgba(99,102,241,.20); }
.feat--green  .feat__num { background: rgba(16,185,129,.10); color: var(--c-emerald);  border: 1px solid rgba(16,185,129,.20); }
.feat__title { font-size: 1.0625rem; font-weight: 700; margin-bottom: .5rem; }
.feat__desc  { font-size: .875rem; color: var(--c-muted); line-height: 1.7; }

/* Context card (GTD / Time / Tag) */
.ctx-card {
    background: var(--c-surface-soft); backdrop-filter: blur(12px);
    border: 1px solid var(--c-border-soft); border-radius: var(--radius-lg);
    overflow: hidden; transition: border-color .2s ease, transform .2s ease;
    display: flex; flex-direction: column;
}
.ctx-card:hover { border-color: var(--c-brand-line); transform: translateY(-2px); }
.ctx-card__body { padding: 1.5rem; }
.ctx-card__kicker {
    font-size: .75rem; font-weight: 700; letter-spacing: .1em;
    text-transform: uppercase; margin-bottom: .5rem;
}
.ctx-card--gtd  .ctx-card__kicker { color: var(--c-brand); }
.ctx-card--time .ctx-card__kicker { color: var(--c-purple); }
.ctx-card--tag  .ctx-card__kicker { color: var(--c-indigo); }
.ctx-card__title { font-size: 1.125rem; font-weight: 700; margin-bottom: .75rem; }
.ctx-card__desc  { font-size: .875rem; color: var(--c-muted); line-height: 1.7; }
.ctx-card__shot {
    width: 100%; height: auto; display: block;
    border-top: 1px solid var(--c-border); background: var(--c-bg);
    margin-top: auto;              /* 多列时把截图压到卡片底部，三卡底边对齐 */
}
/* 三张截图原始高度不同（389/343/412），统一显示高度避免底边参差；
   用 contain 而非 cover，保证 UI 截图不被裁切 */
@media (min-width: 768px) {
    .ctx-card__shot { height: 200px; object-fit: contain; padding: 10px 0; }
}

/* ---------- 9. Callout / quote ---------- */
.callout {
    padding: 1.5rem; border-radius: var(--radius-lg);
    background: var(--c-surface); border: 1px solid var(--c-border);
    box-shadow: var(--shadow-sm);
}
.callout__label { font-weight: 500; margin-bottom: .5rem; }
.callout__q { color: var(--c-brand); font-weight: 600; font-size: 1.25rem; }

.quote-strip {
    display: flex; align-items: center; justify-content: center; gap: .5rem;
    padding: 1.5rem; border-radius: var(--radius-lg); text-align: center;
    background: var(--c-brand-soft); border: 1px solid var(--c-brand-line);
    font-size: 1.0625rem; color: var(--c-muted); flex-wrap: wrap;
}
.quote-strip strong { color: var(--c-text-strong); }
.quote-strip .accent { color: var(--c-brand); font-weight: 700; font-size: 1.25rem; }

.pull {
    font-weight: 600; font-size: 1.25rem; color: var(--c-text-strong);
    border-left: 4px solid var(--c-brand); padding: .25rem 0 .25rem 1rem;
}

/* ---------- 10. Tables ---------- */
.table-scroll {
    overflow-x: auto; border-radius: var(--radius-lg);
    border: 1px solid var(--c-border);
    background: var(--c-surface-soft); backdrop-filter: blur(12px);
}
table.cmp { width: 100%; border-collapse: collapse; text-align: left; font-size: .875rem; }
table.cmp th, table.cmp td { padding: 1rem; vertical-align: top; }
@media (min-width: 768px) {
    table.cmp { font-size: 1rem; }
    table.cmp th, table.cmp td { padding: 1.25rem 1.5rem; }
}
table.cmp thead th {
    font-weight: 600; color: var(--c-muted);
    background: var(--c-bg-alt); border-bottom: 1px solid var(--c-border);
    white-space: nowrap;
}
table.cmp thead th.is-own { color: var(--c-brand); }
table.cmp tbody tr { border-top: 1px solid var(--c-border); }
table.cmp tbody td:first-child { font-weight: 500; color: var(--c-text-strong); }
table.cmp td.dim  { color: var(--c-muted); }
table.cmp td.own  { color: var(--c-text); }
table.cmp td.own b,
table.cmp td .own-key { color: var(--c-brand); font-weight: 600; }
table.cmp td.good { color: var(--c-emerald); font-weight: 600; }

/* ---------- 11. Media ---------- */
.figure { margin: 3.5rem auto; }
.figure__frame {
    border-radius: var(--radius-lg); overflow: hidden;
    border: 1px solid var(--c-border); background: var(--c-surface);
    box-shadow: var(--shadow-xl);
}
.figure__frame img { width: 100%; height: auto; }
.figure__cap {
    margin-top: 1rem; text-align: center; font-size: .875rem; color: var(--c-faint);
}
.figure--wide { max-width: 60rem; }
.figure--mid  { max-width: 48rem; }
.figure--sm   { max-width: 32rem; }

.video-block {
    margin: 3.5rem auto; max-width: 60rem;
    border-radius: var(--radius-lg); overflow: hidden;
    border: 1px solid var(--c-border); background: #000;
    box-shadow: var(--shadow-xl);
}
/* 锁定视频比例（1236×916），避免 poster 比例不同导致加载后跳版 */
.video-block video {
    width: 100%; height: auto; display: block;
    aspect-ratio: 1236 / 916;
    object-fit: cover; background: #000;
}
.video-cap {
    max-width: 60rem; margin: -2rem auto 3.5rem; text-align: center;
    font-size: .875rem; color: var(--c-faint);
}

/* ---------- 12. Steps (install) ---------- */
.steps { counter-reset: step; }
/* 横向排布的步骤（用于「社区插件中心安装」这类整宽卡片）：<1024px 仍纵向堆叠 */
.steps--row { display: grid; gap: 1.25rem; }
@media (min-width: 1024px) {
    .steps--row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .steps--row .step { margin-bottom: 0; }
}
.step { display: flex; gap: 1rem; margin-bottom: 1.25rem; }
.step:last-child { margin-bottom: 0; }
.step__dot {
    flex-shrink: 0; width: 1.75rem; height: 1.75rem; border-radius: 999px;
    background: var(--c-brand-soft); color: var(--c-brand);
    border: 1px solid var(--c-brand-line);
    display: flex; align-items: center; justify-content: center;
    font-size: .8rem; font-weight: 700;
}
.step__body { font-size: .9375rem; color: var(--c-muted); line-height: 1.7; }
.step__body strong { display: block; color: var(--c-text-strong); margin-bottom: .25rem; }
.step__body code {
    background: var(--c-bg-alt); border: 1px solid var(--c-border);
    padding: .1rem .4rem; border-radius: .375rem; font-size: .85em;
    word-break: break-all;
}

.tree {
    background: var(--c-bg-alt); border: 1px solid var(--c-border);
    border-radius: .75rem; padding: 1rem; margin-top: .75rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .8125rem; color: var(--c-muted); line-height: 1.8;
    overflow-wrap: anywhere;      /* 长 URL 在窄屏自动换行，避免撑破卡片 */
}
.tree a {
    color: var(--c-brand); text-decoration: none;
    border-bottom: 1px dashed var(--c-brand-line);
    transition: border-bottom-color .2s ease, color .2s ease;
}
.tree a:hover { border-bottom-style: solid; color: var(--c-text-strong); }

.note {
    margin-top: 1rem; font-size: .875rem; color: var(--c-muted);
    padding: .875rem 1rem; border-radius: .75rem;
    background: var(--c-brand-soft); border: 1px solid var(--c-brand-line);
}

.method-tag {
    display: inline-block; font-size: .75rem; font-weight: 600;
    padding: .2rem .6rem; border-radius: 999px; margin-bottom: 1rem;
    background: var(--c-bg-alt); color: var(--c-muted); border: 1px solid var(--c-border);
}
.method-tag--hot { background: var(--c-brand-soft); color: var(--c-brand); border-color: var(--c-brand-line); }

/* ---------- 13. Pipeline strip ---------- */
.pipeline {
    margin-top: 3rem; padding: 2rem; border-radius: var(--radius-lg);
    background: var(--c-surface-soft); backdrop-filter: blur(12px);
    border: 1px solid var(--c-brand-line); text-align: center;
}
.pipeline__label {
    font-size: .75rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: .12em; color: var(--c-brand); margin-bottom: .5rem;
}
.pipeline__flow {
    font-size: 1.25rem; font-weight: 700; color: var(--c-text-strong); letter-spacing: .02em;
}
@media (min-width: 768px) { .pipeline__flow { font-size: 1.5rem; } }
.pipeline__sub { font-size: .875rem; color: var(--c-muted); margin-top: .5rem; }

/* ---------- 14. Author ---------- */
.author-card {
    display: flex; flex-direction: column; align-items: center; gap: 2rem;
    padding: 2rem; border-radius: var(--radius-lg);
    background: var(--c-surface-soft); backdrop-filter: blur(12px);
    border: 1px solid var(--c-brand-line);
}
@media (min-width: 768px) {
    .author-card { flex-direction: row; padding: 2.5rem; }
}
.author__avatar {
    width: 6rem; height: 6rem; border-radius: var(--radius);
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    display: flex; align-items: center; justify-content: center;
    /* 文字为 "Lifein"（6 字符），字号需收小以适配 6rem 见方的头像块 */
    font-size: 1.125rem; font-weight: 800; color: #fff; flex-shrink: 0;
    white-space: nowrap; letter-spacing: .01em;
    box-shadow: var(--shadow-brand);
}
.author__name { font-size: 1.5rem; font-weight: 700; margin-bottom: .75rem; }
.author__bio { font-size: .875rem; color: var(--c-muted); line-height: 1.9; }
.author__link {
    display: inline-flex; align-items: center; gap: .25rem;
    margin-top: .75rem; font-size: .875rem; font-weight: 500; color: var(--c-brand);
}
.author__link:hover { text-decoration: underline; }

/* ---------- 15. Footer ---------- */
.site-footer {
    padding-block: 3rem; border-top: 1px solid var(--c-border);
    font-size: .875rem; color: var(--c-faint);
}
.site-footer__inner {
    display: flex; flex-direction: column; align-items: center; gap: 1rem;
    justify-content: space-between; text-align: center;
}
@media (min-width: 768px) {
    .site-footer__inner { flex-direction: row; text-align: left; }
}
.site-footer a:hover { color: var(--c-text); }
.site-footer strong { color: var(--c-text); }

/* ---------- 16. Helpers ---------- */
.mb-2 { margin-bottom: .5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.text-center { text-align: center; }
.muted { color: var(--c-muted); }
.stack-6 > * + * { margin-top: 1.5rem; }
.list-dash { padding-left: 0; margin: 0; list-style: none; }
.list-dash li { position: relative; padding-left: 1.1rem; margin-bottom: .5rem; color: var(--c-muted); }
.list-dash li::before { content: "—"; position: absolute; left: 0; color: var(--c-brand); }
