/* PPS / 基础：变量、重置、页头、Hero、Dashboard、频道、看板 */

/*
 * PPS — a personal publishing dashboard
 * Typecho 1.2 theme
 */

:root {
    --bg: #12120f;
    --panel: #191915;
    --panel-2: #1f1f1a;
    --ink: #f0ece2;
    --muted: #aaa397;
    --line: rgba(240, 236, 226, 0.14);
    --line-strong: rgba(240, 236, 226, 0.32);
    --yellow: #fff000;
    --yellow-deep: #b88900;
    --on-accent: #12120f;
    --fs-micro: 12px;
    --fs-meta: 12px;
    --fs-body: 18px;
    --fs-article: 18px;
    --fs-card: 18px;
    --fs-heading: 24px;
    --fs-kpi: 60px;
    --fs-hero: 68px;
    --blue: #13AE67;
    --blue-ink: #13AE67;
    --radius: 4px;
    --grid-line: rgba(240, 236, 226, 0.035);
    --panel-bg: rgba(25, 25, 21, 0.8);
    --inset-bg: rgba(240, 236, 226, 0.015);
    --placeholder-bg: rgba(240, 236, 226, 0.045);
    --body-text: #e3ddd1;
    --dek: #c6bfb2;
    --list-dek: #c3bcaf;
    --code-bg: rgba(240, 236, 226, 0.08);
    --green: #9bdf8f;
    --serif: "Iowan Old Style", "Palatino Linotype", "Songti SC", "STSong", "Noto Serif CJK SC", Georgia, serif;
    --sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    --gutter: clamp(20px, 3.5vw, 80px);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    max-width: 100%;
    overflow-x: hidden;
    overflow-x: clip;
    scroll-padding-top: 90px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    position: relative;
    isolation: isolate;
    max-width: 100%;
    min-height: 100vh;
    margin: 0;
    overflow-x: hidden;
    overflow-x: clip;
    background-color: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: auto;
}

/* Background textures */
.background-textures {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.site-main,
.site-foot {
    position: relative;
    z-index: 1;
}

.bg-layer {
    position: absolute;
    inset: 0;
    display: block;
    opacity: 0;
    background-repeat: repeat;
    pointer-events: none;
}

.bg-layer-topo {
    background-image: url("../terrain.svg");
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    opacity: var(--bg-topo-opacity, .07);
}

.bg-layer-paper {
    background-image: url("../paper.svg");
    background-size: 240px 240px;
    opacity: var(--bg-paper-opacity, .03);
}

.bg-layer-grid {
    background-image:
        linear-gradient(rgba(240, 236, 226, .055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(240, 236, 226, .055) 1px, transparent 1px),
        linear-gradient(rgba(240, 236, 226, .022) 1px, transparent 1px),
        linear-gradient(90deg, rgba(240, 236, 226, .022) 1px, transparent 1px);
    background-size: 80px 80px, 80px 80px, 16px 16px, 16px 16px;
    opacity: var(--bg-grid-opacity, 0);
}

.bg-layer-dot {
    background-image: radial-gradient(circle, rgba(240, 236, 226, .18) 1px, transparent 1.5px);
    background-size: 9px 9px;
    opacity: var(--bg-dot-opacity, 0);
}

.bg-layer-aurora {
    inset: -10%;
    background:
        radial-gradient(ellipse at 18% 22%, rgba(255, 240, 0, .22), transparent 44%),
        radial-gradient(ellipse at 84% 28%, rgba(19, 174, 103, .2), transparent 46%),
        radial-gradient(ellipse at 50% 88%, rgba(19, 174, 103, .14), transparent 50%);
    filter: blur(18px);
    opacity: var(--bg-aurora-opacity, 0);
}

.bg-layer-scan {
    background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(240, 236, 226, .055) 3px 4px);
    opacity: var(--bg-scan-opacity, 0);
}

@media (max-width: 760px) {
    .bg-layer-aurora {
        filter: blur(10px);
    }
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: inherit;
}

::selection {
    background: var(--yellow);
    color: var(--on-accent);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible {
    outline: 2px solid var(--blue-ink);
    outline-offset: 3px;
}

.wrap {
    width: calc(100% - (2 * var(--gutter)));
    max-width: none;
    margin-inline: auto;
}

.skip {
    position: fixed;
    top: -100px;
    left: 20px;
    z-index: 100;
    padding: 8px 12px;
    background: var(--yellow);
    color: var(--on-accent);
    font-family: var(--mono);
    font-size: 10px;
    text-decoration: none;
}

.skip:focus {
    top: 12px;
}

.eyebrow {
    margin: 0;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 8px;
    letter-spacing: 0.12em;
    line-height: 1.5;
    text-transform: uppercase;
}

.text-link {
    display: inline-block;
    padding-bottom: 3px;
    border-bottom: 1px dotted var(--yellow);
    color: var(--yellow);
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.1em;
    text-decoration: none;
    text-transform: uppercase;
}

.text-link:hover {
    color: var(--ink);
    border-color: var(--ink);
}

/* Header */

.topbar-sticky {
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px dotted var(--line);
    background: rgba(18, 18, 15, 0.72);
    -webkit-backdrop-filter: blur(18px) saturate(135%);
    backdrop-filter: blur(18px) saturate(135%);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .topbar-sticky {
        background: var(--bg);
    }
}

.topbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 28px;
    width: calc(100% - (2 * var(--gutter)));
    margin-inline: auto;
    padding: 20px 0 18px;
    border-bottom: 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    color: var(--ink);
    text-decoration: none;
}

.brand-text {
    font-family: var(--sans);
    font-size: 23px;
    font-weight: 800;
    letter-spacing: -0.055em;
    line-height: 1;
    text-transform: lowercase;
}

.brand-logo {
    display: block;
    width: auto;
    max-width: min(230px, 32vw);
    max-height: 40px;
    object-fit: contain;
    filter: drop-shadow(0 0 1px rgba(240, 236, 226, 0.6)) drop-shadow(0 0 10px rgba(240, 236, 226, 0.18));
}

.brand.has-logo-bg .brand-logo {
    padding: 4px 7px;
    border-radius: 2px;
    background: #f0ece2;
    filter: none;
}

.brand-fallback {
    align-items: center;
    color: var(--ink);
    font-family: var(--sans);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.055em;
    line-height: 1;
    text-transform: lowercase;
}

.brand-fallback sup {
    margin-left: 3px;
    color: var(--yellow);
    font-family: var(--mono);
    font-size: 8px;
}

.pulse,
.live-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 3px rgba(155, 223, 143, 0.12);
}

.desk-nav {
    display: flex;
    align-items: center;
    justify-self: end;
    gap: clamp(12px, 1.6vw, 24px);
}

.desk-nav a {
    color: var(--muted);
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.1em;
    text-decoration: none;
    text-transform: uppercase;
}

.desk-nav a:hover,
.desk-nav a[aria-current="page"] {
    color: var(--yellow);
}

.mobile-nav {
    display: none;
}

.status-strip {
    display: flex;
    align-items: center;
    gap: 14px;
    width: calc(100% - (2 * var(--gutter)));
    margin-inline: auto;
    padding: 7px 0;
    overflow: hidden;
    border-bottom: 1px dotted var(--line);
    color: var(--muted);
    font-family: var(--mono);
    font-size: 7px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    white-space: nowrap;
}

.status-line {
    flex: 1 1 auto;
    height: 1px;
    background: var(--line);
}

.status-strip span:first-child {
    color: var(--yellow-deep);
}

/* Hero */

.site-main {
    padding: 0;
}

.console-hero {
    border-bottom: 1px dotted var(--line);
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(320px, 30vw, 480px);
    gap: 54px;
    align-items: center;
    padding: 56px 0 48px;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    align-items: center;
    margin-bottom: 26px;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 8px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.live {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--green);
}

.hero-meta .live {
    color: var(--blue);
}

.hero-meta .live .pulse {
    background: var(--blue);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 14%, transparent);
}

.hero-copy h1 {
    margin: 0;
    font-family: var(--sans);
    font-size: clamp(50px, 8vw, 150px);
    font-weight: 900;
    letter-spacing: -0.085em;
    line-height: 0.84;
    text-transform: uppercase;
}

.hero-copy h1 span {
    display: block;
}

.hero-copy h1 .is-yellow {
    color: var(--yellow);
}

.hero-intro {
    max-width: 48ch;
    margin: 26px 0 0;
    color: var(--muted);
    font-family: var(--serif);
    font-size: 16px;
    line-height: 1.8;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 24px;
}

.hero-fullscreen {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px dotted var(--line);
    border-radius: var(--radius);
    background: transparent;
    color: var(--muted);
    font-family: var(--mono);
    font-size: max(9px, var(--fs-micro));
    letter-spacing: 0.06em;
    line-height: 1.2;
    cursor: pointer;
    transition: background 180ms ease, border-color 180ms ease, color 180ms ease;
}

.hero-fullscreen-icon {
    font-size: 16px;
    line-height: 1;
    color: var(--blue-ink);
}

.hero-fullscreen:hover {
    border-color: var(--yellow);
    color: var(--yellow);
}

.hero-fullscreen[aria-pressed="true"] {
    border-color: var(--yellow);
    background: var(--yellow);
    color: var(--on-accent);
}

.hero-fullscreen[aria-pressed="true"] .hero-fullscreen-icon {
    color: var(--on-accent);
}

@media (max-width: 760px) {
    .hero-fullscreen {
        display: none;
    }
}

.hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 18px;
    padding: 10px 14px;
    border: 1px dotted var(--line-strong);
    border-radius: var(--radius);
    background: var(--panel);
    color: var(--ink);
    font-family: var(--mono);
    font-size: max(10px, var(--fs-meta));
    letter-spacing: 0.1em;
    line-height: 1.2;
    text-decoration: none;
    text-transform: uppercase;
    transition: background 180ms ease, border-color 180ms ease, color 180ms ease;
}

.hero-cta:hover {
    border-color: var(--yellow);
    background: var(--yellow);
    color: var(--on-accent);
}

/* Dashboard */

.dashboard {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 14px;
    align-items: start;
    padding-top: 14px;
    padding-bottom: 38px;
}

.panel {
    position: relative;
    min-width: 0;
    padding: 14px;
    border: 1px dotted var(--line);
    background: var(--panel-bg);
}

.panel::before {
    content: "";
    position: absolute;
    top: -1px;
    left: -1px;
    width: 7px;
    height: 7px;
    border-top: 1px dotted var(--yellow);
    border-left: 1px dotted var(--yellow);
}

.panel-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px dotted var(--line);
}

.panel-index {
    color: var(--yellow);
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.panel-note {
    color: var(--muted);
    font-family: var(--mono);
    font-size: 8px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.activity {
    display: flex;
    flex-direction: column;
    align-self: stretch;
    grid-column: span 7;
}

.channels {
    display: flex;
    flex-direction: column;
    align-self: stretch;
    grid-column: span 5;
}

.channels .channel-list {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
}

.channels .channel-list li {
    flex: 1 1 auto;
}

.board {
    grid-column: span 12;
}

.feed {
    grid-column: span 12;
}

/* Contribution heatmap */
.activity .heatmap {
    flex: 1 1 auto;
    min-height: 120px;
    padding: 4px 2px 0;
}

.heatmap-year {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.heatmap-year + .heatmap-year {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dotted var(--line);
}

.heatmap-year-label {
    flex: 0 0 42px;
    padding-top: 2px;
    color: var(--yellow);
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.08em;
}

.heatmap-year-grid {
    display: flex;
    flex: 1 1 auto;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 5px;
}

.heatmap-cell {
    display: block;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    background: var(--line);
}

.heatmap-cell.is-l1 {
    background: color-mix(in srgb, var(--blue) 30%, var(--line));
}

.heatmap-cell.is-l2 {
    background: color-mix(in srgb, var(--blue) 75%, var(--line));
}

.heatmap-cell.is-l3 {
    background: color-mix(in srgb, var(--yellow) 55%, var(--blue));
}

.heatmap-cell.is-l4 {
    background: var(--yellow);
}

.heatmap-legend {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 8px;
    letter-spacing: 0.06em;
}

.heatmap-legend i {
    display: inline-block;
    width: 15px;
    height: 15px;
    border-radius: 3px;
}

.heatmap-legend .is-l0 { background: var(--line); }
.heatmap-legend .is-l1 { background: color-mix(in srgb, var(--blue) 30%, var(--line)); }
.heatmap-legend .is-l2 { background: color-mix(in srgb, var(--blue) 75%, var(--line)); }
.heatmap-legend .is-l3 { background: color-mix(in srgb, var(--yellow) 55%, var(--blue)); }
.heatmap-legend .is-l4 { background: var(--yellow); }

/* Channels */

.channel-list {
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
}

.channel-list li {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr) 34px;
    gap: 12px;
    align-items: center;
    padding: 9px 0;
    border-bottom: 1px dotted var(--line);
}

.channel-name {
    overflow: hidden;
    color: var(--ink);
    font-family: var(--sans);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.channel-track {
    display: block;
    width: 100%;
    height: 8px;
    background: rgba(240, 236, 226, 0.06);
}

.channel-track i {
    display: block;
    width: var(--width);
    height: 100%;
    background: var(--yellow);
    animation: grow-bar 720ms cubic-bezier(0.2, 0.7, 0.2, 1) var(--delay, 0ms) both;
    transform-origin: left;
}

@keyframes grow-bar {
    from { width: 0; }
    to { width: var(--width); }
}

.channel-list li:nth-child(2n) .channel-track i {
    background: var(--blue);
}

.channel-count {
    color: var(--muted);
    font-family: var(--mono);
    font-size: 8px;
    text-align: right;
}

/* Board */

.board-columns {
    display: grid;
    grid-template-columns: repeat(var(--board-cols, 3), minmax(0, 1fr));
    gap: 12px;
}

.board-col {
    min-width: 0;
    padding: 0 10px 10px;
    border: 1px dotted var(--line);
    background: var(--inset-bg);
}

.board-col > header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin: 0 -10px;
    padding: 9px 10px;
    border-bottom: 1px dotted var(--line);
}

.board-col h2 {
    margin: 0;
    overflow: hidden;
    color: var(--yellow);
    font-family: var(--sans);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.5;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.board-col header span {
    color: var(--muted);
    font-family: var(--mono);
    font-size: 7px;
}

.board-col h2 a {
    display: inline-block;
    color: inherit;
    text-decoration: none;
    text-underline-offset: 3px;
    transition: color 160ms ease;
}

.board-col h2 a:hover,
.board-col h2 a:focus-visible {
    color: var(--blue-ink);
    text-decoration: underline;
    text-decoration-thickness: 1px;
}

.board-card {
    display: block;
    padding: 10px 0;
    border-bottom: 1px dotted var(--line);
    text-decoration: none;
}

.board-card:last-child {
    border-bottom: 0;
}

.board-card:hover strong {
    color: var(--yellow);
}

.board-meta {
    display: block;
    margin-bottom: 3px;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 8px;
}

.board-meta i {
    color: var(--line-strong);
    font-style: normal;
}

.board-card strong {
    display: block;
    font-family: var(--sans);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.55;
    transition: color 160ms ease;
}

.board-dek {
    display: -webkit-box;
    margin-top: 6px;
    overflow: hidden;
    color: var(--list-dek);
    font-family: var(--sans);
    font-size: 14px;
    line-height: 1.7;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.board-empty {
    margin: 14px 0;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 8px;
}

