/* 资讯门户首页 · 新版视觉（仅作用于 tools/home.html） */
.ph-home {
    --ph-accent: #c62828;
    --ph-accent-deep: #9e1b1b;
    --ph-accent-soft: #ffebee;
    --ph-ink: #0f172a;
    --ph-text: #334155;
    --ph-muted: #64748b;
    --ph-line: #e2e8f0;
    --ph-paper: #ffffff;
    --ph-radius: 16px;
    --ph-shadow: 0 10px 30px rgba(15, 23, 42, .07);
    padding-bottom: 34px;
    background:
        radial-gradient(1100px 420px at 12% -8%, rgba(37, 99, 235, .10), transparent 70%),
        radial-gradient(900px 360px at 92% 4%, rgba(14, 165, 233, .08), transparent 70%),
        #f5f7fb;
}
.ph-home .pt-inner {
    width: min(100% - 32px, 1280px);
}

/* 通用动效 */
@keyframes ph-rise {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: translateY(0); }
}
.ph-rise { animation: ph-rise .55s ease both; }
.ph-rise-2 { animation-delay: .08s; }
.ph-rise-3 { animation-delay: .16s; }

/* ---------- 头条区 ---------- */
.ph-hero { padding: 22px 0 8px; }
.ph-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.28fr) minmax(0, .82fr) 290px;
    gap: 16px;
    align-items: stretch;
}
.ph-lead {
    position: relative;
    display: block;
    min-height: 372px;
    overflow: hidden;
    border-radius: var(--ph-radius);
    background: linear-gradient(145deg, #12224a 0%, #1d4ed8 68%, #2563eb 100%);
    box-shadow: var(--ph-shadow);
    color: #fff;
    text-decoration: none;
    isolation: isolate;
    transition: transform .3s ease, box-shadow .3s ease;
}
.ph-lead:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 40px rgba(15, 23, 42, .22);
}
.ph-lead > img,
.ph-lead-fill {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -2;
    transition: transform .6s ease;
}
.ph-lead-fill {
    display: block;
    background:
        radial-gradient(circle at 82% 8%, rgba(147,197,253,.30), transparent 42%),
        radial-gradient(circle at 18% 18%, rgba(255,255,255,.16), transparent 36%),
        repeating-linear-gradient(135deg, rgba(255,255,255,.045) 0 12px, transparent 12px 24px);
}
.ph-lead-fill b {
    position: absolute;
    top: 18px;
    right: 20px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .18em;
    opacity: .38;
}
.ph-lead::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, rgba(8, 15, 35, .05) 30%, rgba(8, 15, 35, .88) 100%);
}
.ph-lead:hover > img,
.ph-lead:hover .ph-lead-fill { transform: scale(1.04); }
.ph-lead-body {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    padding: 26px 28px 28px;
}
.ph-lead-body::before {
    content: "";
    position: absolute;
    top: -6px;
    left: 28px;
    width: 34px;
    height: 3px;
    border-radius: 3px;
    background: #60a5fa;
}
.ph-kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    margin-bottom: 14px;
    border: 1px solid rgba(255,255,255,.42);
    border-radius: 999px;
    background: rgba(255,255,255,.14);
    backdrop-filter: blur(6px);
    font-size: 12px;
    letter-spacing: .12em;
}
.ph-lead h2 {
    margin: 0;
    font-size: 30px;
    line-height: 1.35;
    font-weight: 700;
    text-shadow: 0 2px 14px rgba(0, 0, 0, .28);
    text-wrap: balance;
}
.ph-lead p {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 12px 0 0;
    color: rgba(255,255,255,.82);
    font-size: 14px;
    line-height: 1.7;
}
.ph-lead time {
    display: inline-block;
    margin-top: 16px;
    color: rgba(255,255,255,.66);
    font-size: 12px;
    letter-spacing: .06em;
}

.ph-hero-side {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}
.ph-sublead {
    display: grid;
    grid-template-columns: 116px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    min-height: 152px;
    padding: 14px;
    border: 1px solid var(--ph-line);
    border-radius: var(--ph-radius);
    background: var(--ph-paper);
    box-shadow: var(--ph-shadow);
    color: inherit;
    text-decoration: none;
    transition: transform .25s ease, box-shadow .25s ease;
}
.ph-sublead:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 34px rgba(15, 23, 42, .12);
}
.ph-sublead-thumb {
    display: block;
    width: 116px;
    height: 116px;
    overflow: hidden;
    border-radius: 11px;
    background: linear-gradient(135deg, var(--ph-accent-soft), #eff6ff);
}
.ph-sublead-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-sublead-thumb span {
    display: grid;
    place-items: center;
    height: 100%;
    padding: 8px;
    color: var(--ph-accent);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    text-align: center;
}
.ph-sublead-copy { min-width: 0; }
.ph-sublead-copy .ph-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 7px;
    color: var(--ph-accent);
    font-size: 12px;
    font-weight: 600;
}
.ph-sublead-copy .ph-tag::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--ph-accent);
}
.ph-sublead-copy strong {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 18px;
    line-height: 1.45;
}
.ph-sublead-copy em {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 8px;
    color: var(--ph-muted);
    font-size: 12px;
    font-style: normal;
    line-height: 1.6;
}
.ph-headlines {
    flex: 1;
    margin: 0;
    padding: 14px 18px 12px;
    list-style: none;
    border: 1px solid var(--ph-line);
    border-radius: var(--ph-radius);
    background: var(--ph-paper);
    box-shadow: var(--ph-shadow);
}
.ph-headlines li {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    gap: 9px;
    align-items: baseline;
    margin: 0 -8px;
    padding: 9px 8px;
    border-bottom: 1px dashed var(--ph-line);
    border-radius: 8px;
    transition: background .2s ease;
}
.ph-headlines li:hover { background: rgba(37, 99, 235, .05); }
.ph-headlines li:last-child { border-bottom: 0; }
.ph-headlines li::before {
    content: counter(ph-hl, decimal-leading-zero);
    counter-increment: ph-hl;
    color: var(--ph-accent);
    font-size: 12px;
    font-weight: 700;
}
.ph-headlines { counter-reset: ph-hl; }
.ph-headlines a {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--ph-ink);
    font-size: 14px;
    text-decoration: none;
}
.ph-headlines a:hover { color: var(--ph-accent); }
.ph-headlines time {
    padding: 1px 7px;
    border-radius: 999px;
    background: #f1f5f9;
    color: var(--ph-muted);
    font-size: 11px;
}

.ph-today {
    display: flex;
    flex-direction: column;
    padding: 20px 18px 16px;
    border-radius: var(--ph-radius);
    background: linear-gradient(180deg, #111c33 0%, #0b1223 100%);
    box-shadow: var(--ph-shadow);
    color: rgba(255,255,255,.86);
}
.ph-today-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,.14);
}
.ph-today-head h3 { margin: 0; color: #fff; font-size: 17px; letter-spacing: .04em; }
.ph-today-head a { color: rgba(255,255,255,.58); font-size: 12px; text-decoration: none; }
.ph-today-head a:hover { color: #fff; }
.ph-today-list { list-style: none; margin: 6px 0 0; padding: 0; counter-reset: ph-td; }
.ph-today-list li {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: baseline;
    padding: 9px 0;
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.ph-today-list li::before {
    content: counter(ph-td);
    counter-increment: ph-td;
    color: #60a5fa;
    font-size: 12px;
    font-weight: 700;
}
.ph-today-list a {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: rgba(255,255,255,.9);
    font-size: 13px;
    text-decoration: none;
}
.ph-today-list a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.ph-today-list time { color: rgba(255,255,255,.42); font-size: 11px; }
.ph-today-ad { display: block; margin-top: 14px; border-radius: 10px; overflow: hidden; }
.ph-today-ad img { width: 100%; height: 88px; object-fit: cover; display: block; }

/* ---------- 广告条 ---------- */
.ph-ad { padding: 18px 0 0; }
.ph-ad-frame {
    overflow: hidden;
    border-radius: var(--ph-radius);
    box-shadow: var(--ph-shadow);
    background: #fff;
}
.ph-ad img { width: 100%; max-height: 112px; object-fit: cover; display: block; }

/* ---------- 栏目内容区 ---------- */
.ph-channels { padding: 24px 0 8px; }
.ph-channel-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}
.ph-channel-grid .pt-chan {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 0 0 14px;
    border: 1px solid var(--ph-line);
    border-radius: var(--ph-radius);
    background: var(--ph-paper);
    box-shadow: var(--ph-shadow);
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease;
}
.ph-channel-grid .pt-chan:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 38px rgba(15, 23, 42, .12);
}
.ph-channel-grid .pt-chan-hd {
    margin: 0;
    padding: 0 18px;
    border-bottom: 1px solid var(--ph-line);
}
.ph-channel-grid .pt-chan-hd a:first-child {
    position: relative;
    min-height: 46px;
    padding: 0;
    background: none;
    color: var(--ph-ink);
    font-size: 17px;
    font-weight: 700;
}
.ph-channel-grid .pt-chan-hd a:first-child::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 32px;
    height: 3px;
    border-radius: 3px;
    background: var(--ph-accent);
}
.ph-channel-grid .pt-chan-hd .more { color: var(--ph-accent); font-size: 12px; }
.ph-channel-grid .pt-chan-pic {
    display: block;
    height: 138px;
    margin: 14px 18px 0;
    border-radius: 11px;
    overflow: hidden;
}
.ph-channel-grid .pt-chan-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-channel-grid .pt-chan-lead { margin: 14px 18px 4px; }
.ph-channel-grid .pt-chan-lead strong { font-size: 16px; line-height: 1.5; }
.ph-channel-grid .pt-chan-list { margin: 4px 18px 0; padding: 0; list-style: none; }
.ph-channel-grid .pt-chan-list li {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px dashed var(--ph-line);
}
.ph-channel-grid .pt-chan-list li:last-child { border-bottom: 0; }
.ph-channel-grid .pt-chan-list a {
    flex: 1;
    min-width: 0;
    color: var(--ph-text);
    font-size: 13px;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ph-channel-grid .pt-chan-list a:hover { color: var(--ph-accent); }
.ph-channel-grid .pt-chan-list time { flex-shrink: 0; color: var(--ph-muted); font-size: 11px; }

/* ---------- 友情链接 ---------- */
.ph-friends { padding: 26px 0 0; }
.ph-friends-inner {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 18px;
    border: 1px solid var(--ph-line);
    border-radius: var(--ph-radius);
    background: rgba(255,255,255,.78);
}
.ph-friends-label {
    flex-shrink: 0;
    padding-top: 4px;
    color: var(--ph-accent);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .08em;
}
.ph-friends-links { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.ph-friends-links a { color: var(--ph-muted); font-size: 12px; text-decoration: none; }
.ph-friends-links a:hover { color: var(--ph-accent); }
.ph-friends-links img { height: 14px; width: auto; margin-right: 4px; vertical-align: -2px; }

/* ---------- 响应式 ---------- */
@media (max-width: 1180px) {
    .ph-hero-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, .9fr); }
    .ph-today { grid-column: 1 / -1; }
    .ph-today-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 22px; }
    .ph-today-ad img { height: 120px; }
}
@media (max-width: 900px) {
    .ph-channel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ph-lead { min-height: 330px; }
    .ph-lead h2 { font-size: 26px; }
}
@media (max-width: 680px) {
    .ph-home .pt-inner { width: min(100% - 20px, 1280px); }
    .ph-hero { padding-top: 12px; }
    .ph-hero-grid { grid-template-columns: 1fr; gap: 12px; }
    .ph-lead { min-height: 280px; }
    .ph-lead-body { padding: 20px; }
    .ph-lead h2 { font-size: 22px; }
    .ph-lead p { -webkit-line-clamp: 2; font-size: 13px; }
    .ph-sublead { grid-template-columns: 84px minmax(0, 1fr); min-height: 112px; padding: 10px; }
    .ph-sublead-thumb { width: 84px; height: 84px; }
    .ph-sublead-copy strong { font-size: 15px; }
    .ph-today-list { grid-template-columns: 1fr; }
    .ph-channel-grid { grid-template-columns: 1fr; gap: 12px; }
    .ph-channel-grid .pt-chan-pic { height: 180px; }
    .ph-friends-inner { flex-direction: column; gap: 8px; }
}

/* 暗色模式下的少量适配 */
[data-theme="dark"] .ph-home {
    --ph-line: #263449;
    --ph-paper: #111827;
    --ph-ink: #e2e8f0;
    --ph-text: #cbd5e1;
    --ph-muted: #94a3b8;
    background: #0b1220;
}
[data-theme="dark"] .ph-friends-inner { background: rgba(17, 24, 39, .8); }
[data-theme="dark"] .ph-lead { box-shadow: 0 10px 30px rgba(0,0,0,.35); }

/* ---------- 参考图一：三栏新闻头版 ---------- */
.ph-hero { padding-top: 18px; }
.ph-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr) 300px;
    gap: 14px;
    align-items: stretch;
}
.ph-carousel {
    position: relative;
    min-height: 430px;
    overflow: hidden;
    border-radius: 10px;
    background: #0b1220;
    box-shadow: var(--ph-shadow);
}
.ph-slide {
    position: absolute;
    inset: 0;
    display: block;
    opacity: 0;
    visibility: hidden;
    transition: opacity .4s ease;
    color: #fff;
    text-decoration: none;
}
.ph-slide.is-active { opacity: 1; visibility: visible; }
.ph-slide > img,
.ph-slide-fill {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.ph-slide-fill {
    display: grid;
    place-items: center;
    padding: 24px;
    background: linear-gradient(135deg, #1f2937, #0f172a);
    font-size: 24px;
    font-weight: 700;
    opacity: .7;
}
.ph-slide::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 48%, rgba(0, 0, 0, .82) 100%);
}
.ph-slide-cap {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
    padding: 32px 18px 16px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.45;
    text-shadow: 0 2px 8px rgba(0, 0, 0, .5);
}
.ph-dots {
    position: absolute;
    right: 14px;
    bottom: 14px;
    z-index: 2;
    display: flex;
    gap: 6px;
}
.ph-dots span { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.45); }
.ph-dots span.is-active { width: 18px; border-radius: 99px; background: #fff; }

.ph-feed {
    display: flex;
    flex-direction: column;
    padding: 10px 16px;
    border: 1px solid var(--ph-line);
    border-radius: 10px;
    background: var(--ph-paper);
    box-shadow: var(--ph-shadow);
}
.ph-feed-item { padding: 9px 0; border-bottom: 1px solid #f0f0f0; }
.ph-feed-item:last-child { border-bottom: 0; }
.ph-feed-item a { display: block; color: inherit; text-decoration: none; }
.ph-tag {
    display: inline-block;
    margin-right: 6px;
    padding: 1px 6px;
    border: 1px solid #f3c7c7;
    border-radius: 2px;
    background: #fff5f5;
    color: var(--ph-accent);
    font-size: 11px;
    line-height: 1.5;
    vertical-align: 1px;
}
.ph-tag-hot { border-color: var(--ph-accent); background: var(--ph-accent); color: #fff; }
.ph-feed-item strong { font-size: 13.5px; line-height: 1.55; font-weight: 600; }
.ph-feed-item a:hover strong { color: var(--ph-accent); }
.ph-feed-item p {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 4px 0 0;
    color: var(--ph-muted);
    font-size: 12px;
    line-height: 1.6;
}

.ph-updates {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--ph-line);
    border-radius: 10px;
    background: var(--ph-paper);
    box-shadow: var(--ph-shadow);
}
.ph-updates-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    background: var(--ph-accent);
    color: #fff;
}
.ph-updates-head h3 { margin: 0; font-size: 15px; font-weight: 700; }
.ph-updates-head time { font-size: 11px; opacity: .88; }
.ph-updates-list { flex: 1; margin: 0; padding: 6px 12px; list-style: none; }
.ph-updates-list li {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid #f2f2f2;
}
.ph-updates-list li:last-child { border-bottom: 0; }
.ph-updates-list time { flex: 0 0 38px; color: #9aa3af; font-size: 11px; }
.ph-updates-list a {
    flex: 1;
    min-width: 0;
    color: #333;
    font-size: 12.5px;
    line-height: 1.5;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ph-updates-list a:hover { color: var(--ph-accent); }
.ph-updates-ad { display: block; margin: 0 12px 12px; border-radius: 6px; overflow: hidden; }
.ph-updates-ad img { display: block; width: 100%; height: 86px; object-fit: cover; }

@media (max-width: 1180px) {
    .ph-hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .ph-updates { grid-column: 1 / -1; }
    .ph-updates-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 18px; }
}
@media (max-width: 900px) {
    .ph-carousel { min-height: 340px; }
}
@media (max-width: 680px) {
    .ph-hero-grid { grid-template-columns: 1fr; }
    .ph-carousel { min-height: 260px; }
    .ph-slide-cap { font-size: 13px; }
    .ph-updates-list { display: block; }
}
[data-theme="dark"] .ph-feed-item,
[data-theme="dark"] .ph-updates-list li { border-color: #263449; }

/* 宽屏（≥1400px）适当放大首屏比例 */
@media (min-width: 1400px) {
    .ph-carousel { min-height: 480px; }
    .ph-slide-cap { padding: 40px 24px 20px; font-size: 17px; }
    .ph-feed { padding: 12px 20px; }
    .ph-feed-item strong { font-size: 14.5px; }
    .ph-updates-list a { font-size: 13.5px; }
    .ph-updates-ad img { height: 100px; }
}
