/* ============================================================================
   V165 / F1：对外门户（Portal）样式
   只依赖 base/variables.css 的语义 token；不加载 SPA 样式与 Alpine 通知栈。
   ========================================================================== */

.pt-body {
    margin: 0;
    padding: 0 !important;
    background: var(--paper-1);
    color: var(--ink-0);
    font-family: var(--font-sans);
    line-height: 1.75;
    -webkit-user-select: text;
    user-select: text;
}
.pt-body button, .pt-body summary { user-select: none; }

.pt-body a { color: inherit; text-decoration: none; }
.pt-body a:hover { color: var(--river); }

.pt-header {
    background: var(--paper-0);
    border-bottom: 1px solid var(--rule);
}
.pt-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    gap: 28px;
}
.pt-brand {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
}
.pt-brand-sub {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--ink-2);
    margin-left: 6px;
    letter-spacing: 0.08em;
}
.pt-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 0.875rem;
    color: var(--ink-1);
}
.pt-nav a:hover { color: var(--river); }
.pt-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}
.pt-icon-btn {
    width: 34px; height: 34px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--rule);
    border-radius: var(--radius-sm);
    background: var(--paper-0);
    color: var(--ink-1);
    cursor: pointer;
}
.pt-icon-btn:hover { color: var(--river); border-color: var(--river); }
.pt-icon-btn .icon-moon { display: none; }
[data-theme="dark"] .pt-icon-btn .icon-sun { display: none; }
[data-theme="dark"] .pt-icon-btn .icon-moon { display: inline; }
.pt-auth-links { display: flex; align-items: center; gap: 12px; font-size: 0.875rem; }
.pt-link { color: var(--ink-1); }
.pt-btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 8px 16px;
    border: 1px solid var(--river);
    border-radius: var(--radius-sm);
    background: var(--river);
    color: var(--text-on-accent);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}
.pt-btn:hover { background: var(--river-hover); border-color: var(--river-hover); color: var(--text-on-accent); }
/* .pt-body a 的 color:inherit 特异性高于 .pt-btn，必须显式压回按钮前景色 */
.pt-body a.pt-btn,
.pt-body a.pt-btn:hover { color: var(--text-on-accent); }
.pt-btn-block { display: flex; width: 100%; margin-top: 10px; }

.pt-user { position: relative; }
.pt-user summary {
    list-style: none;
    display: flex; align-items: center; gap: 8px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: var(--radius-sm);
}
.pt-user summary::-webkit-details-marker { display: none; }
.pt-avatar {
    width: 26px; height: 26px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%;
    background: var(--river-soft);
    color: var(--river);
    font-weight: 700;
    font-size: 0.8rem;
}
.pt-username { font-size: 0.84rem; color: var(--ink-1); }
.pt-menu {
    position: absolute; right: 0; top: calc(100% + 8px);
    width: 190px;
    background: var(--paper-0);
    border: 1px solid var(--rule);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 6px;
    z-index: 30;
}
.pt-menu a, .pt-menu button {
    display: block; width: 100%;
    padding: 8px 10px;
    border: 0; border-radius: var(--radius-sm);
    background: transparent; color: var(--ink-1);
    font-size: 0.84rem; text-align: left; cursor: pointer;
}
.pt-menu a:hover, .pt-menu button:hover { background: var(--river-soft); color: var(--river); }
.pt-menu-primary { color: var(--river) !important; font-weight: 600; }
.pt-menu form { margin: 0; }

.pt-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px 56px;
}

.pt-announce {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 10px 14px;
    margin: 18px 0 8px;
    border: 1px solid var(--rule);
    border-left: 3px solid var(--signal);
    background: var(--paper-0);
    font-size: 0.82rem;
}
.pt-announce-label {
    font-family: var(--font-mono); font-size: 0.7rem;
    color: var(--signal); letter-spacing: 0.08em;
}
.pt-announce a { color: var(--ink-1); }
.pt-announce a:hover { color: var(--river); }

/* ---------------- Hero ---------------- */
.pt-hero {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 20px;
    margin: 28px 0 32px;
}
.pt-hero-lead {
    background: var(--paper-0);
    border: 1px solid var(--rule);
    border-radius: var(--radius-md);
    padding: 32px;
    min-height: 320px;
    display: flex; flex-direction: column; justify-content: space-between;
}
.pt-hero-main { margin: 12px 0; }
.pt-hero-empty { padding: 32px; border: 1px dashed var(--rule); border-radius: var(--radius-md); }
.pt-kicker {
    display: flex; align-items: center; gap: 10px;
    font-family: var(--font-mono); font-size: 0.7rem;
    color: var(--ink-2); letter-spacing: 0.06em;
}
.pt-kicker span + span::before { content: "·"; margin-right: 10px; }
.pt-hero h1, .pt-hero-empty h1 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 2.9rem);
    line-height: 1.2;
    margin: 12px 0;
    font-weight: 700;
}
.pt-hero h1 a:hover { color: var(--river); }
.pt-hero-summary {
    color: var(--ink-1);
    font-size: 0.98rem;
    margin: 0 0 14px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.pt-meta {
    display: flex; flex-wrap: wrap; gap: 14px;
    color: var(--ink-2);
    font-size: 0.76rem;
}
.pt-hero-side { display: flex; flex-direction: column; gap: 12px; }
.pt-hero-card {
    background: var(--paper-0);
    border: 1px solid var(--rule);
    border-radius: var(--radius-md);
    padding: 18px 20px;
}
.pt-hero-card h2 {
    font-family: var(--font-display);
    font-size: 1.12rem; line-height: 1.35; margin: 8px 0;
}
.pt-hero-card h2 a:hover { color: var(--river); }
.pt-hero-cta { border-left: 3px solid var(--river); }
.pt-hero-cta p { color: var(--ink-1); font-size: 0.84rem; margin: 0 0 12px; }

/* ---------------- Feed + rail ---------------- */
.pt-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 28px;
    align-items: start;
}
.pt-feed-head {
    display: flex; align-items: baseline; justify-content: space-between;
    border-bottom: 1px solid var(--rule);
    padding-bottom: 8px;
}
.pt-tabs { display: flex; gap: 18px; }
.pt-tabs a {
    font-size: 0.88rem; color: var(--ink-2);
    padding-bottom: 8px; border-bottom: 2px solid transparent;
}
.pt-tabs a:hover { color: var(--river); }
.pt-tabs a.active { color: var(--river); border-bottom-color: var(--river); font-weight: 600; }
.pt-feed-count { font-family: var(--font-mono); font-size: 0.72rem; color: var(--ink-2); }
.pt-list { display: flex; flex-direction: column; }
.pt-row {
    display: grid;
    grid-template-columns: 56px 78px minmax(0, 1fr);
    gap: 12px;
    padding: 16px 4px;
    border-bottom: 1px solid var(--rule-light);
}
.pt-row-date { font-family: var(--font-mono); font-size: 0.76rem; color: var(--ink-2); padding-top: 3px; }
.pt-row-type {
    justify-self: start;
    font-family: var(--font-mono); font-size: 0.66rem;
    color: var(--river);
    border: 1px solid var(--rule);
    border-radius: var(--radius-sm);
    padding: 1px 6px;
    height: fit-content;
    max-width: 78px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pt-row-body h3 { margin: 0 0 4px; font-size: 0.98rem; line-height: 1.5; }
.pt-row-body h3 a:hover { color: var(--river); }
.pt-row-summary {
    margin: 0 0 6px;
    color: var(--ink-1);
    font-size: 0.84rem;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pt-empty { padding: 40px 0; color: var(--ink-2); text-align: center; }
.pt-more {
    display: inline-block; margin-top: 16px;
    font-size: 0.84rem; color: var(--river);
}

.pt-rail { display: flex; flex-direction: column; }
.pt-panel {
    background: var(--paper-0);
    border: 1px solid var(--rule);
    border-radius: var(--radius-md);
    padding: 18px;
    margin-bottom: 16px;
}
.pt-panel-title {
    font-size: 0.82rem; font-weight: 600;
    margin: 0 0 10px; padding-bottom: 8px;
    border-bottom: 1px solid var(--rule-light);
}
.pt-checkin-count { margin: 0 0 12px; font-size: 0.8rem; color: var(--ink-2); }
.pt-checkin-count strong { font-family: var(--font-mono); font-size: 1.7rem; color: var(--river); margin-right: 4px; }
.pt-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-bottom: 10px; }
.pt-week span {
    height: 26px; display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--rule); border-radius: var(--radius-sm);
    font-family: var(--font-mono); font-size: 0.62rem; color: var(--ink-2);
}
.pt-week span.on { background: var(--river); border-color: var(--river); color: var(--text-on-accent); }
.pt-week span.today { outline: 2px solid var(--signal); outline-offset: 1px; }
.pt-checkin-streak { margin: 0 0 4px; font-size: 0.76rem; color: var(--ink-2); }
.pt-checkin-msg { margin: 6px 0 0; font-size: 0.76rem; color: var(--river); min-height: 1.2em; }
.pt-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin: 0; }
.pt-stats dt { font-size: 0.72rem; color: var(--ink-2); }
.pt-stats dd { margin: 0; font-family: var(--font-mono); font-size: 1.05rem; color: var(--ink-0); }

.pt-hot { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pt-hot li { display: flex; gap: 8px; font-size: 0.82rem; line-height: 1.5; }
.pt-hot-index { font-family: var(--font-mono); font-size: 0.7rem; color: var(--ink-2); width: 16px; flex-shrink: 0; }
.pt-hot a:hover { color: var(--river); }

.pt-ad {
    display: flex; align-items: center; justify-content: center;
    border: 1px dashed var(--rule);
    background: var(--paper-2);
    color: var(--ink-2);
    font-family: var(--font-mono); font-size: 0.7rem;
    letter-spacing: 0.06em;
    margin-bottom: 16px;
}
.pt-ad-300 { min-height: 250px; }
.pt-ad-728 { min-height: 90px; max-width: 728px; margin: 24px auto; }

/* ---------------- Strips ---------------- */
.pt-strips {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    margin-top: 8px;
}
.pt-strip { min-width: 0; }
.pt-strip-head {
    display: flex; align-items: baseline; justify-content: space-between;
    border-bottom: 1px solid var(--rule);
    padding-bottom: 8px; margin-bottom: 10px;
}
.pt-strip-head h2 { font-family: var(--font-display); font-size: 1.05rem; margin: 0; }
.pt-strip-head a { font-size: 0.76rem; color: var(--river); }
.pt-doc-row {
    display: grid; grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 10px; align-items: baseline;
    padding: 8px 0; border-bottom: 1px solid var(--rule-light);
    font-size: 0.82rem;
}
.pt-doc-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-doc-zone { font-family: var(--font-mono); font-size: 0.66rem; color: var(--ink-2); }
.pt-doc-row time { font-family: var(--font-mono); font-size: 0.68rem; color: var(--ink-2); }
.pt-gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pt-gallery-item { display: block; }
.pt-gallery-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border: 1px solid var(--rule); border-radius: var(--radius-sm); }
.pt-gallery-item span { display: block; font-size: 0.7rem; color: var(--ink-2); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pt-videos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pt-video-item img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border: 1px solid var(--rule); border-radius: var(--radius-sm); }
.pt-video-item span { display: block; font-size: 0.72rem; color: var(--ink-2); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------------- Footer ---------------- */
.pt-footer {
    border-top: 1px solid var(--rule);
    background: var(--paper-0);
    padding: 32px 24px 20px;
}
.pt-footer-inner {
    max-width: 1200px; margin: 0 auto;
    display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px;
}
.pt-footer p { margin: 6px 0 0; color: var(--ink-2); font-size: 0.8rem; }
.pt-footer-links { display: flex; flex-direction: column; gap: 6px; font-size: 0.8rem; color: var(--ink-1); }
.pt-brand-small { font-size: 1.1rem; }
.pt-copy {
    max-width: 1200px; margin: 24px auto 0;
    padding-top: 12px; border-top: 1px solid var(--rule-light);
    font-size: 0.72rem; color: var(--ink-2);
}

@media (max-width: 960px) {
    .pt-hero { grid-template-columns: 1fr; }
    .pt-workspace { grid-template-columns: 1fr; }
    .pt-rail { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
    .pt-rail .pt-ad { margin-bottom: 0; }
    .pt-strips { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .pt-header-inner { height: auto; padding: 10px 16px; flex-wrap: wrap; gap: 10px; }
    .pt-nav { order: 3; width: 100%; gap: 14px; overflow-x: auto; padding-bottom: 4px; }
    .pt-main { padding: 0 16px 40px; }
    .pt-hero-lead { padding: 22px; min-height: 0; }
    .pt-row { grid-template-columns: 46px minmax(0, 1fr); }
    .pt-row-type { display: none; }
    .pt-rail { grid-template-columns: 1fr; }
    .pt-footer-inner { grid-template-columns: 1fr; }
    .pt-ad-300 { min-height: 160px; }
    .pt-ad-728 { min-height: 70px; }
}
