/* ============================================================
   行恒简安 · 企业科技风主页（浅色主题）
   大厂风范：浅色基底、蓝色强调、毛玻璃卡片、流畅动效
   ============================================================ */

:root {
    --bg-0: #eaf1fb;
    --bg-1: #f5f9ff;
    --bg-2: #e6edf8;
    --bg-3: #dbe5f3;
    --panel: rgba(244, 249, 255, 0.62);
    --panel-strong: rgba(248, 251, 255, 0.9);
    --border: rgba(148, 163, 184, 0.22);
    --border-strong: rgba(66, 144, 245, 0.35);
    --text: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --primary: #4290f5;
    --primary-light: #5aa0ff;
    --primary-dark: #2563eb;
    --accent: #06b6d4;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --shadow: 0 4px 24px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 8px 40px rgba(15, 23, 42, 0.08);
    --shadow-glow: 0 0 40px rgba(66, 144, 245, 0.14);
    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --header-h: 76px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(ellipse at 6% -8%, rgba(66, 144, 245, 0.22) 0%, transparent 45%),
        radial-gradient(ellipse at 94% 2%, rgba(6, 182, 212, 0.16) 0%, transparent 42%),
        radial-gradient(ellipse at 50% 118%, rgba(66, 144, 245, 0.14) 0%, transparent 52%),
        linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 55%, var(--bg-2) 100%);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

#tech-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.5;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
}

/* ===== Header ===== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--header-h);
    background: linear-gradient(180deg, rgba(238, 244, 253, 0.85) 0%, rgba(231, 239, 251, 0.62) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.site-header::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), var(--accent), transparent);
    opacity: 0.65;
}

.header-inner {
    max-width: 1320px;
    height: 100%;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}

.brand-logo {
    width: 42px;
    height: 42px;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(66, 144, 245, 0.25));
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.brand-name {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--text);
}

.brand-slogan {
    font-size: 11px;
    color: var(--text-secondary);
    letter-spacing: 2px;
    text-transform: uppercase;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* ===== 顶部时钟 ===== */
.clock {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 16px;
    border-radius: 14px;
    background: var(--panel);
    border: 1px solid var(--border);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.clock:hover {
    border-color: rgba(66, 144, 245, 0.35);
    box-shadow: 0 4px 16px rgba(66, 144, 245, 0.13), inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.clock-main {
    display: flex;
    align-items: baseline;
    gap: 2px;
    font-family: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;
    font-variant-numeric: tabular-nums;
}

.clock-hm {
    font-size: 19px;
    font-weight: 600;
    letter-spacing: 0.5px;
    line-height: 1;
    color: var(--text);
}

.clock-sec {
    padding: 1px 4px;
    border-radius: 5px;
    background: rgba(66, 144, 245, 0.10);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--primary-dark);
    opacity: 0.9;
}

.clock-divider {
    width: 1px;
    height: 22px;
    background: linear-gradient(180deg, transparent, var(--border-strong), transparent);
}

.clock-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
    line-height: 1.15;
}

.clock-ymd {
    font-size: 11px;
    letter-spacing: 0.3px;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.clock-lunar {
    font-size: 11px;
    white-space: nowrap;
    color: var(--primary-dark);
    opacity: 0.85;
}

/* ===== Buttons ===== */
.btn-primary,
.btn-secondary,
.btn-ghost,
.btn-ghost-sm,
.btn-mini {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-weight: 600;
    border-radius: 10px;
    transition: all 0.25s ease;
}

.btn-primary {
    padding: 12px 28px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    box-shadow: 0 4px 18px rgba(66, 144, 245, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 26px rgba(66, 144, 245, 0.45);
}

.btn-secondary {
    padding: 12px 28px;
    background: var(--bg-1);
    color: var(--text);
    border: 1px solid var(--border-strong);
}

.btn-secondary:hover {
    background: rgba(66, 144, 245, 0.06);
    border-color: var(--primary);
}

.btn-ghost {
    padding: 10px 22px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    color: var(--text);
    border-color: var(--border-strong);
    background: rgba(15, 23, 42, 0.03);
}

.btn-ghost-sm {
    padding: 7px 16px;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
    font-size: 13px;
}

.btn-ghost-sm:hover {
    color: var(--primary-dark);
    border-color: var(--border-strong);
}

.btn-mini {
    padding: 6px 12px;
    font-size: 12px;
    background: rgba(66, 144, 245, 0.10);
    color: var(--primary-dark);
    border: 1px solid var(--border);
    border-radius: 8px;
}

.btn-mini:hover {
    background: rgba(66, 144, 245, 0.18);
}

/* ===== Main / Sections ===== */
main {
    position: relative;
    z-index: 1;
    padding-top: var(--header-h);
}

section {
    max-width: 1320px;
    margin: 0 auto;
    padding: 64px 24px;
}

.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-tag {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 8px;
    background: rgba(66, 144, 245, 0.08);
    border: 1px solid var(--border);
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 14px;
}

.section-header h2 {
    position: relative;
    display: inline-block;
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 16px;
    background: linear-gradient(135deg, var(--text) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.section-header h2::after {
    content: '';
    display: block;
    width: 56px;
    height: 4px;
    margin: 14px auto 0;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.section-header p {
    color: var(--text-secondary);
    font-size: 16px;
    max-width: 560px;
    margin: 0 auto;
}

/* ===== Hero ===== */
.hero {
    position: relative;
    min-height: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 60px;
    padding-top: 30px;
    padding-bottom: 22px;
}

.hero::before {
    content: '';
    position: absolute;
    top: 50%;
    right: 4%;
    transform: translateY(-50%);
    width: 540px;
    height: 540px;
    background: radial-gradient(circle, rgba(66, 144, 245, 0.20) 0%, rgba(6, 182, 212, 0.12) 42%, transparent 70%);
    filter: blur(50px);
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
}

.hero > * {
    position: relative;
    z-index: 1;
}

.hero::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0%;
    transform: translateY(-50%);
    width: 440px;
    height: 440px;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.16) 0%, transparent 70%);
    filter: blur(50px);
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
}

.hero-content {
    flex: 1;
    max-width: 660px;
}

.hero-products {
    width: 100%;
}

.hero-products-head {
    text-align: left;
    margin-bottom: 20px;
}

.hero-products-head .section-tag {
    margin-bottom: 12px;
}

.hero-products-title {
    font-size: 25px;
    font-weight: 800;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--text) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-products-sub {
    color: var(--text-secondary);
    font-size: 13.5px;
    line-height: 1.65;
    max-width: 460px;
}

.hero-visual {
    flex: 0 0 420px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.orbit {
    position: relative;
    width: 360px;
    height: 360px;
}

.orbit-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 1px solid var(--border);
}

.ring-1 { width: 100%; height: 100%; animation: spin 20s linear infinite; }
.ring-2 { width: 75%; height: 75%; border-color: var(--border-strong); animation: spin-reverse 15s linear infinite; }
.ring-3 { width: 50%; height: 50%; border-style: dashed; animation: spin 10s linear infinite; }

.orbit-ring::before {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 12px var(--primary);
}

.ring-1::before { top: -4px; left: 50%; transform: translateX(-50%); }
.ring-2::before { bottom: -4px; left: 50%; transform: translateX(-50%); background: var(--accent); box-shadow: 0 0 12px var(--accent); }
.ring-3::before { top: 50%; right: -4px; transform: translateY(-50%); background: var(--primary-light); }

.orbit-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background:
        linear-gradient(var(--panel-strong), var(--panel-strong)) padding-box,
        linear-gradient(135deg, var(--primary), var(--accent)) border-box;
    border: 1px solid transparent;
    box-shadow: var(--shadow-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.orbit-core img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 10px rgba(66, 144, 245, 0.25));
}

@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes spin-reverse { to { transform: translate(-50%, -50%) rotate(-360deg); } }

/* ===== Products ===== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

/* ===== 产品服务矩阵（紧凑横向卡）=====
   结构：图标（色相按序轮转）/ 标题 + 一行描述 / 标题尾巴上的进入箭头。
   描述恒定一行 ⇒ 卡片高度严格一致。 */
.product-grid--compact {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    align-items: stretch;
}

.product-grid--compact .product-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    min-height: 68px;
    border-radius: 14px;
    /* 左上角一抹卡片专属色晕：七张卡七种色温，不再是一排同色白板 */
    background:
        radial-gradient(125% 130% at 0% 0%,
            hsl(var(--pc-h, 212), 94%, 94%) 0%,
            hsla(var(--pc-h, 212), 94%, 96%, 0) 62%),
        var(--panel);
    border: 1px solid var(--border);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

/* 小卡上那条 3px 渐变线 + 斜向蒙版只会显厚重，去掉 */
.product-grid--compact .product-card::before,
.product-grid--compact .product-card::after { display: none; }

.product-grid--compact .product-card:hover {
    transform: translateY(-2px);
    border-color: hsl(var(--pc-h, 212), 85%, 78%);
    box-shadow: 0 10px 22px -14px hsl(var(--pc-h, 212), 90%, 42%);
    background:
        radial-gradient(125% 130% at 0% 0%,
            hsl(var(--pc-h, 212), 92%, 90%) 0%,
            hsla(var(--pc-h, 212), 92%, 95%, 0) 66%),
        var(--panel);
}

/* 卡底统一品牌淡蓝：拟物图标本身色彩浓，卡片再七色轮转就会互相抢。
   所以全部收敛到 --pc-h 默认值（212 蓝），靠图标提供辨识度。 */

/* 图标：淡品牌色渐变底，给卡片一个视觉锚点（emoji 回退时用） */
.product-grid--compact .product-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    font-size: 24px;
    margin-bottom: 0;
    flex: 0 0 auto;
    background: linear-gradient(150deg,
        hsl(var(--pc-h, 212), 96%, 96%),
        hsl(var(--pc-h2, 232), 90%, 89%));
    border: 1px solid hsl(var(--pc-h, 212), 88%, 87%);
    box-shadow:
        0 3px 8px -4px hsl(var(--pc-h, 212), 82%, 55%, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* 拟物图标（图片）：自身已带浅色底与立体感，去掉渐变底/描边，只保留圆角与浮起投影 */
.product-grid--compact .product-icon--img {
    background: none;
    border: none;
    box-shadow: none;
}

.product-grid--compact .product-icon--img img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border-radius: 26%;
    filter: drop-shadow(0 3px 6px rgba(30, 80, 180, 0.20));
}

.product-grid--compact .product-card:hover .product-icon {
    transform: scale(1.05);
}

.product-grid--compact .product-body {
    flex: 1 1 auto;
    min-width: 0;
}

/* 标题行：箭头跟在标题尾巴上，不再单独占一列（文字因此宽出约 37px） */
.product-grid--compact .product-line {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 3px;
}

.product-grid--compact .product-card h3 {
    flex: 0 1 auto;
    min-width: 0;
    font-size: 14.5px;
    font-weight: 700;
    letter-spacing: 0.2px;
    margin-bottom: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-grid--compact .product-go {
    flex: 0 0 auto;
    font-size: 12px;
    line-height: 1;
    color: var(--primary);
    opacity: 0.5;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.product-grid--compact .product-card:hover .product-go {
    opacity: 1;
    transform: translate(2px, -2px);
}

.product-grid--compact .product-card p {
    font-size: 11.5px;
    line-height: 1.45;
    margin-bottom: 0;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 卡内嵌的行情 / 书单列表：保持紧凑但不挤 */
.product-grid--compact .product-list {
    margin: 8px 0 0;
    padding: 8px 0 0;
}

.product-grid--compact .pl-row {
    padding: 3px 0;
    font-size: 12px;
}

/* 编辑模式：卡里没有了「立即访问」占位，3 个操作按钮若并排会吃掉整个标题，
   改成让它们换行到卡片末行靠右 */
body.edit-mode .product-grid--compact .product-card {
    flex-wrap: wrap;
}

body.edit-mode .product-grid--compact .product-card .admin-actions {
    position: static;
    top: auto;
    right: auto;
    flex: 1 0 100%;
    margin-left: 0;
    justify-content: flex-end;
    opacity: 1;
}

.product-card {
    position: relative;
    padding: 32px;
    border-radius: var(--radius-md);
    background: var(--panel);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.product-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(66, 144, 245, 0.08) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-strong);
    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.07);
}

.product-card:hover::before {
    opacity: 1;
}

.product-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    background: linear-gradient(90deg, var(--primary), var(--accent));
}

.product-icon {
    width: 54px;
    height: 54px;
    border-radius: var(--radius-sm);
    background: rgba(66, 144, 245, 0.10);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}

.product-card h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.product-card p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 22px;
    position: relative;
    z-index: 1;
}

.product-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-dark);
    position: relative;
    z-index: 1;
}

.product-link::after {
    content: '→';
    transition: transform 0.2s ease;
}

.product-card:hover .product-link::after {
    transform: translateX(4px);
}

/* 卡片内嵌模块列表（股票 / 读书等） */
.product-list {
    list-style: none;
    margin: 0 0 10px;
    padding: 10px 0 0;
    border-top: 1px solid var(--border);
}

.pl-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding: 5px 0;
    font-size: 12.5px;
}

.pl-name {
    display: flex;
    align-items: baseline;
    gap: 6px;
    color: var(--text);
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pl-code {
    font-style: normal;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.pl-meta {
    flex-shrink: 0;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
    font-size: 12px;
}

.pl-meta.up { color: #e23b3b; font-weight: 600; }
.pl-meta.down { color: #16a34a; font-weight: 600; }

/* ===== Search ===== */
.search-section {
    padding-top: 24px;
    padding-bottom: 24px;
}

.search-box {
    display: flex;
    align-items: center;
    max-width: 800px;
    margin: 0 auto;
    padding: 8px;
    border-radius: 14px;
    background: var(--panel);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    transition: all 0.25s ease;
}

.search-box:focus-within {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-glow);
}

.search-engine-select select {
    appearance: none;
    padding: 12px 34px 12px 18px;
    border: none;
    border-radius: 10px;
    background: var(--bg-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    outline: none;
}

.search-box input {
    flex: 1;
    padding: 12px 18px;
    border: none;
    background: transparent;
    color: var(--text);
    font-size: 16px;
    outline: none;
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.search-box button {
    border-radius: 10px;
}

/* ===== Navigation Center ===== */
.nav-center {
    padding-top: 32px;
}

.nav-layout {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.nav-sidebar {
    position: sticky;
    top: calc(var(--header-h) + 24px);
    flex: 0 0 172px;
    padding: 12px;
    border-radius: var(--radius-md);
    background: var(--panel);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.nav-sidebar h3 {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 9px;
    padding-left: 10px;
}

.side-menu-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 11px;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    background: transparent;
    text-align: left;
}

.side-menu-item:hover {
    background: rgba(66, 144, 245, 0.08);
    color: var(--text);
}

.side-menu-item.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    box-shadow: 0 4px 16px rgba(66, 144, 245, 0.30);
}

.nav-content {
    flex: 1;
    min-width: 0;
}

.group-block {
    scroll-margin-top: calc(var(--header-h) + 24px);
}

.group-title {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text);
}

.group-title .title-accent {
    width: 4px;
    height: 18px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--primary) 0%, var(--accent) 100%);
}

.grp-count {
    margin-left: auto;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-2);
    padding: 2px 10px;
    border-radius: 999px;
}

.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(178px, 1fr));
    gap: 11px;
}

.link-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 13px;
    border-radius: 10px;
    background: var(--panel);
    border: 1px solid var(--border);
    color: var(--text);
    transition: all 0.25s ease;
    position: relative;
}

.link-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

.link-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: rgba(66, 144, 245, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    flex-shrink: 0;
}

.link-info {
    min-width: 0;
}

.link-name {
    font-size: 13.5px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.link-url {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-actions {
    display: flex;
    gap: 6px;
    margin-left: auto;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.link-card:hover .admin-actions {
    opacity: 1;
}

.admin-actions button {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-actions button:hover {
    background: rgba(66, 144, 245, 0.12);
    color: var(--primary-dark);
}

/* 编辑模式下操作区常显（这两个元素只在编辑模式渲染） */
.link-card .admin-actions {
    opacity: 1;
}

/* 拖拽手柄：鼠标可拖整卡，触屏按住手柄拖（手柄 touch-action 关掉，避免误滚动） */
.drag-handle {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.drag-handle:hover {
    background: rgba(66, 144, 245, 0.12);
    color: var(--primary-dark);
}

.drag-handle:active {
    cursor: grabbing;
}

/* 非编辑态：卡片是 <a href>，关掉 WebKit 自带的「链接拖影」，避免误拖。
   编辑态（body.edit-mode）则放开，交给原生 HTML5 拖放做排序。 */
body:not(.edit-mode) .product-card,
body:not(.edit-mode) .link-card {
    -webkit-user-drag: none;
}

/* ===== 拖拽排序（仅编辑模式出现） ===== */
.drag-ghost {
    position: fixed;
    z-index: 999;
    margin: 0;
    border-radius: var(--radius-sm);
    pointer-events: none;
    opacity: 0.94;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.22);
    transform: rotate(1.5deg) scale(1.02);
}

.drag-source {
    opacity: 0.35;
}

/* 落点指示：用主色描边 + 浅底高亮，比虚线框更利落、更像门户后台 */
.drag-over {
    outline: none;
    border-color: var(--primary);
    background: rgba(66, 144, 245, 0.07);
    box-shadow: 0 0 0 2px var(--primary), var(--shadow-md);
}

body.dragging {
    cursor: grabbing;
    user-select: none;
    -webkit-user-select: none;
}

/* 编辑态：分组标题与产品卡的按钮始终可见（不依赖 hover） */
.group-title .admin-actions {
    opacity: 1;
}

.product-card .admin-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 3;
    opacity: 1;
}

.new-product-wrap {
    grid-column: 1 / -1;
    margin-top: 4px;
}

.product-grid .new-group-wrap {
    grid-column: 1 / -1;
    margin-top: 4px;
}

.new-group-wrap {
    margin-top: 28px;
}

.new-group-btn {
    width: 100%;
    padding: 14px;
    border-radius: var(--radius-sm);
    border: 1px dashed var(--border-strong);
    background: rgba(66, 144, 245, 0.04);
    color: var(--primary-dark);
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.new-group-btn:hover {
    background: rgba(66, 144, 245, 0.10);
    border-style: solid;
}

/* ===== Contact ===== */
.contact-section {
    padding-top: 40px;
    padding-bottom: 60px;
}

.contact-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 36px 42px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(66, 144, 245, 0.08) 0%, rgba(6, 182, 212, 0.04) 100%);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.contact-text h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 6px;
}

.contact-text p {
    color: var(--text-secondary);
}

/* ===== Footer ===== */
.site-footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--border-strong);
    background: linear-gradient(135deg, rgba(66, 144, 245, 0.10) 0%, rgba(6, 182, 212, 0.06) 100%);
    backdrop-filter: blur(12px);
}

.footer-inner {
    max-width: 1320px;
    margin: 0 auto;
    padding: 48px 24px 28px;
}

.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 28px;
}

.footer-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    opacity: 0.9;
}

.footer-name {
    font-size: 18px;
    font-weight: 700;
}

.footer-slogan {
    font-size: 12px;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px 24px;
    margin-bottom: 28px;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 14px;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--primary-dark);
}

.footer-copy {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

.footer-beian {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}

.footer-beian a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-beian a svg {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
    opacity: 0.85;
}

.footer-beian a:hover svg {
    opacity: 1;
}

.footer-beian a:hover {
    color: var(--primary-dark);
}

.beian-sep {
    margin: 0 8px;
    opacity: 0.4;
}

/* ===== Floating Buttons ===== */
#dark-toggle,
#scroll-top {
    position: fixed;
    right: 28px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--panel);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 20px;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    transition: all 0.25s ease;
}

#dark-toggle {
    bottom: 90px;
}

#scroll-top {
    bottom: 28px;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

#scroll-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

#dark-toggle:hover,
#scroll-top:hover {
    background: rgba(66, 144, 245, 0.10);
    color: var(--primary-dark);
    transform: scale(1.08);
}

#edit-badge {
    position: fixed;
    top: calc(var(--header-h) + 12px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 998;
    padding: 8px 18px;
    border-radius: 10px;
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.35);
    color: #15803d;
    font-size: 13px;
    font-weight: 600;
    backdrop-filter: blur(8px);
}

/* ===== Modals ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    width: 100%;
    max-width: 440px;
    max-height: 90vh;
    overflow: auto;
    padding: 28px;
    border-radius: var(--radius-md);
    background: var(--panel-strong);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-glow);
}

.modal h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
}

.modal label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.modal input,
.modal select {
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-1);
    color: var(--text);
    font-size: 14px;
    outline: none;
}

.modal input:focus,
.modal select:focus {
    border-color: var(--primary);
}

.modal .row {
    display: flex;
    gap: 12px;
    margin-top: 18px;
}

.modal .row button {
    flex: 1;
}

.modal .err {
    color: var(--danger);
    font-size: 13px;
    min-height: 20px;
}

/* 登录弹窗「记住登录状态」：复选框不能继承 .modal input 的整行样式 */
.modal label.remember-line {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin: 2px 0 14px;
    cursor: pointer;
}

.modal label.remember-line input[type="checkbox"] {
    width: auto;
    flex: none;
    margin: 0;
    padding: 0;
    accent-color: var(--primary);
    cursor: pointer;
}

.modal .hint {
    margin-top: 14px;
    padding: 12px;
    border-radius: var(--radius-sm);
    background: rgba(66, 144, 245, 0.06);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.6;
}

/* ===== Toast ===== */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    z-index: 3000;
    padding: 12px 24px;
    border-radius: 12px;
    background: var(--panel-strong);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.err {
    border-color: rgba(239, 68, 68, 0.35);
    color: var(--danger);
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .hero {
        flex-direction: column;
        text-align: center;
        gap: 50px;
    }

    .hero-content {
        max-width: 100%;
    }

    .hero-actions {
        justify-content: center;
    }

    .hero-visual {
        flex: 0 0 auto;
    }

    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* 竖向堆叠后卡片会被拉得很宽，改成自适应列数，维持长方形比例 */
    .product-grid--compact {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    }

    .nav-layout {
        flex-direction: column;
    }

    .nav-sidebar {
        position: relative;
        top: auto;
        flex: 1 1 auto;
        /* min-width:0 + max-width:100%：这一行是横向滚动的，不压住最小宽度
           会把整页 scrollWidth 顶出去（窄屏下页面能左右晃） */
        min-width: 0;
        max-width: 100%;
        display: flex;
        gap: 10px;
        overflow-x: auto;
        padding: 12px;
    }

    .nav-sidebar h3 {
        display: none;
    }

    .side-menu-item {
        white-space: nowrap;
        width: auto;
    }

    /* 中等屏：时钟只保留时:分:秒，避免顶栏拥挤 */
    .clock {
        gap: 0;
        padding: 6px 12px;
    }

    .clock-divider,
    .clock-meta {
        display: none;
    }
}

@media (max-width: 768px) {
    :root {
        --header-h: 64px;
    }

    .brand-name {
        font-size: 16px;
    }

    .gradient-text {
        font-size: 42px;
    }

    .hero-subtitle {
        font-size: 18px;
    }

    .orbit {
        width: 280px;
        height: 280px;
    }

    .orbit-core {
        width: 90px;
        height: 90px;
        padding: 16px;
    }

    .product-grid,
    .link-grid {
        grid-template-columns: 1fr;
    }

    /* 平板竖屏仍能排两列，只有真手机才落成单列 */
    .product-grid--compact {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    }

    /* 单列时卡片很宽，高度略收，图标小一档 */
    .product-grid--compact .product-card {
        min-height: 68px;
        padding: 11px 13px;
        gap: 11px;
    }

    .product-grid--compact .product-icon {
        width: 46px;
        height: 46px;
        border-radius: 14px;
        font-size: 21px;
    }

    .section-header h2 {
        font-size: 28px;
    }

    .search-box {
        flex-direction: column;
        border-radius: var(--radius-md);
    }

    .search-engine-select,
    .search-box input,
    .search-box button {
        width: 100%;
    }

    .search-engine-select select {
        border-radius: var(--radius-sm);
    }

    .contact-card {
        flex-direction: column;
        text-align: center;
    }
}

/* ============================================================
   首页「全网热点」四平台实时榜
   数据：hot.xhja.cn（GitHub Actions 每小时生成 data/hot-boards.json）
   结构：标题行 + 四列并排榜单卡；每卡固定 10 条、单行省略，四列高度完全对齐
   ============================================================ */
.hot-boards {
    padding: 12px 24px 26px;
}

.hot-boards[hidden] {
    display: none;
}

.hot-boards-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;        /* 窄屏放不下就换行，绝不横向撑破页面 */
    gap: 6px 16px;
    margin-bottom: 14px;
}

.hot-boards-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 19px;
    font-weight: 800;
    letter-spacing: 0.3px;
    color: var(--text);
}

.hot-spark {
    font-size: 17px;
    line-height: 1;
}

.hot-boards-more {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--primary-dark);
    text-decoration: none;
    transition: gap 0.2s ease;
}

.hot-boards-more:hover {
    gap: 8px;
}

.hot-board-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    align-items: start;
}

/* --- 单个平台卡 --- */
.hb-card {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-md);
    background: var(--panel);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    overflow: hidden;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.hb-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-md);
}

.hb-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 12px 10px;
    border-bottom: 1px solid var(--border);
}

.hb-icon {
    width: 26px;
    height: 26px;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 14px;
    background: linear-gradient(140deg, rgba(66, 144, 245, 0.16), rgba(6, 182, 212, 0.10));
    border: 1px solid rgba(66, 144, 245, 0.20);
}

/* 换成平台官方 logo 图片时的徽标：去掉 emoji 版的底色与描边 */
.hb-icon--img {
    padding: 0;
    background: #fff;
    border: none;
    overflow: hidden;
    /* 白底 logo（如澎湃）在浅色卡片上需要一点轮廓 */
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.07), 0 1px 3px rgba(0, 0, 0, 0.08);
}

.hb-icon--img img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.hb-name {
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: 0.2px;
    white-space: nowrap;
}

.hb-badge {
    margin-left: auto;
    padding: 1px 7px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 600;
    color: var(--primary-dark);
    background: rgba(66, 144, 245, 0.10);
    border: 1px solid rgba(66, 144, 245, 0.18);
    white-space: nowrap;
}

.hb-list {
    list-style: none;
    margin: 0;
    padding: 5px 5px 6px;
}

/* 固定行高 —— 四列卡片高度完全对齐，不会因标题长短参差 */
.hb-row {
    display: flex;
    align-items: center;
    gap: 7px;
    height: 30px;
    padding: 0 7px;
    border-radius: 7px;
    color: inherit;
    text-decoration: none;
    transition: background 0.18s ease;
}

.hb-row:hover {
    background: rgba(66, 144, 245, 0.08);
}

.hb-rank {
    flex: 0 0 auto;
    width: 16px;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--text-muted);
}

.hb-rank.r1 { color: #e11d48; }
.hb-rank.r2 { color: #ea580c; }
.hb-rank.r3 { color: #d97706; }

.hb-title {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 12.5px;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hb-row:hover .hb-title {
    color: var(--primary-dark);
}

.hb-foot {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 12px 10px;
    border-top: 1px solid var(--border);
    font-size: 11.5px;
    color: var(--text-muted);
}

.hb-link {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-weight: 600;
    color: var(--primary-dark);
    text-decoration: none;
    white-space: nowrap;
}

.hb-link-arrow {
    transition: transform 0.2s ease;
}

.hb-link:hover .hb-link-arrow {
    transform: translate(1px, -1px);
}

.hb-error {
    padding: 22px 12px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}

@media (max-width: 1024px) {
    .hot-boards {
        padding: 10px 20px 22px;
    }

    .hot-board-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
}

@media (max-width: 640px) {
    .hot-boards {
        padding: 8px 16px 18px;
    }

    .hot-boards-head {
        margin-bottom: 10px;
    }

    .hot-boards-title {
        font-size: 17px;
    }

    .hot-boards-more {
        font-size: 12px;
    }

    .hot-board-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* xhj 统一页脚 / favicon（2026-09-22） */
.xhja-mail{margin-top:12px;display:flex;align-items:center;justify-content:center;gap:6px;
  font-size:13px;line-height:1.6;color:#6b7b8b;text-align:center}
.xhja-mail a{display:inline-flex;align-items:center;gap:6px;color:#4290f5;font-weight:600;text-decoration:none}
.xhja-mail a:hover{text-decoration:underline}
.xhja-icp{margin-top:10px;display:flex;flex-wrap:wrap;align-items:center;justify-content:center;
  gap:3px 10px;font-size:12.5px;line-height:1.9;color:#8a97a3}
.xhja-icp a{display:inline-flex;align-items:center;gap:6px;color:inherit;text-decoration:none;transition:color .2s}
.xhja-icp a:hover{color:#4290f5;text-decoration:underline}
.xhja-icp svg{width:14px;height:14px;flex:0 0 auto;opacity:.85}
.xhja-icp .sep{opacity:.4;user-select:none}
.beian-sep{opacity:.4;margin:0 4px}
#footerBeian{margin-top:10px}
@media (prefers-color-scheme:dark){
  .xhja-mail{color:#8b8ea3} .xhja-mail a{color:#7ec8f5}
  .xhja-icp{color:#8b8ea3} .xhja-icp a:hover{color:#7ec8f5}
}

/* ===== 站长入口链接（2026-09-28）=====
   只在已登录（body.edit-mode）时出现，退出编辑即隐藏。
   ⚠ 必须排在文件末尾：.btn-ghost-sm 自带 display:inline-flex，
     同特异性下后定义者胜 —— 靠后的 display:none 才压得住那一条。
   用 body.edit-mode 而不是 hidden 属性，是因为 hidden 会被
   .btn-ghost-sm 的 display 覆盖掉。 */
.admin-nav { display: none; }
body.edit-mode .admin-nav { display: inline-flex; align-items: center; }
