/* ============================================================
   小涵互联 · 全站视觉升级 v3（UI redesign）
   统一卡片 / 图标 / 网格 / 章节标题 / 空态 / 徽标体系
   所有图标走内联 SVG（Icons::svg），不再使用 emoji
   ============================================================ */

:root {
    --v3-r-sm: 10px;
    --v3-r: 14px;
    --v3-r-lg: 20px;
    --v3-r-xl: 26px;
    --v3-gap: 14px;
    --v3-line: color-mix(in srgb, var(--xh-line, #ffffff1f) 100%, transparent);
    --v3-soft: color-mix(in srgb, var(--xh-text, #e8eefc) 5%, transparent);
    --v3-soft-2: color-mix(in srgb, var(--xh-text, #e8eefc) 9%, transparent);
    --v3-ring: color-mix(in srgb, var(--xh-primary, #4f8cff) 34%, transparent);
    --v3-shadow: 0 10px 30px -18px rgba(6, 10, 24, .85);
}

/* ---------------- 图标基础 ---------------- */
.ico { width: 20px; height: 20px; flex: 0 0 auto; display: inline-block; vertical-align: -.18em; }
.ico-xs { width: 14px; height: 14px; }
.ico-sm { width: 16px; height: 16px; }
.ico-md { width: 20px; height: 20px; }
.ico-lg { width: 24px; height: 24px; }
.ico-xl { width: 30px; height: 30px; }
.ico-wrap {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: var(--v3-r);
    background: linear-gradient(150deg, color-mix(in srgb, var(--xh-primary) 22%, transparent), color-mix(in srgb, var(--xh-primary-2, #7a5cff) 12%, transparent));
    border: 1px solid var(--v3-line);
    color: var(--xh-primary);
    flex: 0 0 auto;
}
.ico-wrap.sm { width: 34px; height: 34px; border-radius: 11px; }
.ico-wrap.lg { width: 56px; height: 56px; border-radius: 18px; }
.ico-wrap.plain { background: var(--v3-soft); color: var(--xh-text-2); }

/* ---------------- 通用 Hero ---------------- */
.v3-hero {
    position: relative;
    overflow: hidden;
    margin: 22px 0 18px;
    padding: 28px 26px;
    border-radius: var(--v3-r-xl);
    border: 1px solid var(--v3-line);
    background:
        radial-gradient(900px 320px at 12% -30%, color-mix(in srgb, var(--xh-primary) 26%, transparent), transparent 62%),
        radial-gradient(700px 300px at 92% 8%, color-mix(in srgb, var(--xh-primary-2, #7a5cff) 20%, transparent), transparent 60%),
        var(--xh-panel, #0d1424);
    box-shadow: var(--v3-shadow);
}
.v3-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image: linear-gradient(to right, var(--v3-line) 1px, transparent 1px),
        linear-gradient(to bottom, var(--v3-line) 1px, transparent 1px);
    background-size: 46px 46px;
    opacity: .16;
    mask-image: radial-gradient(120% 90% at 50% 0%, #000 20%, transparent 78%);
    pointer-events: none;
}
.v3-hero > * { position: relative; z-index: 1; }
.v3-hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: var(--xh-primary);
    padding: 5px 11px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--xh-primary) 34%, transparent);
    background: color-mix(in srgb, var(--xh-primary) 12%, transparent);
    margin-bottom: 14px;
}
.v3-hero h1 {
    margin: 0 0 10px;
    font-size: 34px;
    line-height: 1.2;
    letter-spacing: -.6px;
}
.v3-hero p { margin: 0; color: var(--xh-text-2); font-size: 14.5px; line-height: 1.7; max-width: 760px; }
.v3-hero-stats { display: flex; flex-wrap: wrap; gap: 26px; margin-top: 20px; }
.v3-hero-stat b { display: block; font-size: 22px; letter-spacing: -.4px; }
.v3-hero-stat span { font-size: 12px; color: var(--xh-text-2); letter-spacing: .3px; }
.v3-hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

/* ---------------- 按钮 ---------------- */
.v3-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 42px;
    padding: 0 18px;
    border-radius: 12px;
    border: 1px solid var(--v3-line);
    background: var(--v3-soft);
    color: var(--xh-text);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: transform .16s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.v3-btn:hover { background: var(--v3-soft-2); border-color: var(--v3-ring); }
.v3-btn:active { transform: translateY(1px); }
.v3-btn.primary {
    background: linear-gradient(135deg, var(--xh-primary), var(--xh-primary-2, #7a5cff));
    border-color: transparent;
    color: #fff;
    box-shadow: 0 8px 22px -12px var(--xh-primary);
}
.v3-btn.primary:hover { filter: brightness(1.07); }
.v3-btn.ghost { background: transparent; }
.v3-btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.v3-btn.icon-only { width: 42px; padding: 0; }
.v3-btn[disabled] { opacity: .5; pointer-events: none; }

/* ---------------- 章节标题 ---------------- */
.v3-sec { margin: 26px 0 14px; display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; }
.v3-sec-title { display: flex; align-items: center; gap: 10px; }
.v3-sec-title h2 { margin: 0; font-size: 19px; letter-spacing: -.2px; }
.v3-sec-title .count {
    font-size: 12px;
    color: var(--xh-text-2);
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--v3-soft);
    border: 1px solid var(--v3-line);
}
.v3-sec-desc { margin: 4px 0 0; font-size: 13px; color: var(--xh-text-2); }
.v3-sec-more { font-size: 13px; color: var(--xh-text-2); display: inline-flex; align-items: center; gap: 5px; text-decoration: none; }
.v3-sec-more:hover { color: var(--xh-primary); }

/* ---------------- 通用卡片 ---------------- */
.v3-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    border-radius: var(--v3-r);
    border: 1px solid var(--v3-line);
    background: var(--xh-panel, #0d1424);
    text-decoration: none;
    color: inherit;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
    overflow: hidden;
}
.v3-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 1px;
    background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--xh-primary) 55%, transparent), transparent);
    opacity: 0;
    transition: opacity .2s ease;
}
.v3-card:hover {
    transform: translateY(-2px);
    border-color: var(--v3-ring);
    box-shadow: 0 16px 34px -22px rgba(8, 14, 32, .95);
}
.v3-card:hover::before { opacity: 1; }
.v3-card-head { display: flex; align-items: center; gap: 11px; min-width: 0; }
.v3-card-bd { min-width: 0; flex: 1 1 auto; }
.v3-card-bd b {
    display: block;
    font-size: 14.5px;
    font-weight: 600;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.v3-card-bd span {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    color: var(--xh-text-2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.v3-card-desc {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: var(--xh-text-2);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.v3-card-foot {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--xh-text-2);
    margin-top: auto;
}
.v3-dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .5; }

/* 图标盒（列表卡） */
.v3-ibx {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 13px;
    flex: 0 0 auto;
    border: 1px solid var(--v3-line);
    background: var(--v3-soft);
    color: var(--xh-primary);
    overflow: hidden;
}
.v3-ibx img { width: 100%; height: 100%; object-fit: cover; }
.v3-ibx .txt { font-size: 15px; font-weight: 600; color: var(--xh-text-2); }

/* ---------------- 综合站点（分类） ---------------- */
.site-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--v3-gap);
}
.site-cat-block { margin-bottom: 26px; }
.site-cat-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}
.site-cat-bar h3 {
    margin: 0;
    font-size: 15.5px;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -.1px;
}
.site-cat-bar h3 .ico { color: var(--xh-primary); }
.site-cat-bar .n { font-size: 12px; color: var(--xh-text-2); }
.site-cat-bar .line { flex: 1 1 auto; height: 1px; background: var(--v3-line); }

.site-card { min-height: 96px; }
.site-card .v3-card-desc { -webkit-line-clamp: 1; }

/* 分类总览磁贴 */
.cat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.cat-tile {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 14px;
    border-radius: var(--v3-r);
    border: 1px solid var(--v3-line);
    background: linear-gradient(150deg, var(--v3-soft), transparent 70%), var(--xh-panel, #0d1424);
    text-decoration: none;
    color: inherit;
    transition: transform .16s ease, border-color .16s ease;
}
.cat-tile:hover { transform: translateY(-2px); border-color: var(--v3-ring); }
.cat-tile b { display: block; font-size: 14px; }
.cat-tile span { font-size: 12px; color: var(--xh-text-2); }

/* ---------------- 工具站 ---------------- */
.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
    gap: var(--v3-gap);
}
.tool-tile { min-height: 132px; }
.tool-tile .v3-card-bd b { white-space: normal; }
.tool-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid var(--v3-line);
    color: var(--xh-text-2);
    background: var(--v3-soft);
    flex: 0 0 auto;
}
.tool-badge.ext { color: var(--xh-primary); border-color: color-mix(in srgb, var(--xh-primary) 40%, transparent); background: color-mix(in srgb, var(--xh-primary) 12%, transparent); }

/* ---------------- 下载站 ---------------- */
.dl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--v3-gap);
}
.dl-card {
    display: flex;
    flex-direction: column;
    gap: 11px;
    padding: 16px;
    border-radius: var(--v3-r);
    border: 1px solid var(--v3-line);
    background: var(--xh-panel, #0d1424);
    transition: transform .18s ease, border-color .18s ease;
}
.dl-card:hover { transform: translateY(-2px); border-color: var(--v3-ring); }
.dl-card-head { display: flex; gap: 11px; align-items: center; min-width: 0; }
.dl-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 13px;
    flex: 0 0 auto;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .4px;
    color: var(--xh-primary);
    border: 1px solid color-mix(in srgb, var(--xh-primary) 30%, transparent);
    background: color-mix(in srgb, var(--xh-primary) 12%, transparent);
}
.dl-meta { min-width: 0; }
.dl-title { font-size: 14.5px; font-weight: 600; display: block; color: inherit; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-title:hover { color: var(--xh-primary); }
.dl-sub { display: block; margin-top: 3px; font-size: 12px; color: var(--xh-text-2); }
.dl-desc { margin: 0; font-size: 13px; line-height: 1.6; color: var(--xh-text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 42px; }
.dl-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.dl-tag {
    font-size: 11.5px;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--v3-soft);
    border: 1px solid var(--v3-line);
    color: var(--xh-text-2);
}
.dl-tag.vip { color: #f7b955; border-color: #f7b95555; background: #f7b95518; }
.dl-tag.pts { color: #58d1a8; border-color: #58d1a855; background: #58d1a818; }
.dl-tag.cloud { color: var(--xh-primary); border-color: color-mix(in srgb, var(--xh-primary) 40%, transparent); }
.dl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    height: 40px;
    border-radius: 11px;
    border: 1px solid var(--v3-line);
    background: var(--v3-soft);
    color: var(--xh-text);
    font-size: 13.5px;
    text-decoration: none;
    margin-top: auto;
    transition: background .18s ease, border-color .18s ease;
}
.dl-btn:hover { background: color-mix(in srgb, var(--xh-primary) 16%, transparent); border-color: var(--v3-ring); color: var(--xh-primary); }
.dl-btn.solid { background: linear-gradient(135deg, var(--xh-primary), var(--xh-primary-2, #7a5cff)); border-color: transparent; color: #fff; }
.dl-btn.lg { height: 48px; font-size: 15px; border-radius: 13px; }

/* ---------------- 客户端 ---------------- */
.plat-tabs { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 18px; }
.plat-tab {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 15px;
    border-radius: var(--v3-r);
    border: 1px solid var(--v3-line);
    background: var(--v3-soft);
    color: var(--xh-text-2);
    text-decoration: none;
    font-size: 13.5px;
    transition: border-color .18s ease, color .18s ease, background .18s ease;
}
.plat-tab:hover { color: var(--xh-text); border-color: var(--v3-ring); }
.plat-tab.on {
    color: var(--xh-primary);
    border-color: color-mix(in srgb, var(--xh-primary) 48%, transparent);
    background: color-mix(in srgb, var(--xh-primary) 13%, transparent);
}
.plat-tab b { font-weight: 600; font-size: 13.5px; }
.plat-tab em { font-style: normal; font-size: 11px; opacity: .8; }
.plat-ico { display: inline-grid; place-items: center; }

.plat-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    gap: 24px;
    align-items: center;
    padding: 24px;
    border-radius: var(--v3-r-lg);
    border: 1px solid var(--v3-line);
    background:
        radial-gradient(600px 240px at 0% -10%, color-mix(in srgb, var(--xh-primary) 20%, transparent), transparent 60%),
        var(--xh-panel, #0d1424);
}
.plat-panel h2 { margin: 0 0 8px; font-size: 22px; letter-spacing: -.3px; }
.plat-panel-shot img { width: 100%; max-width: 260px; border-radius: 16px; border: 1px solid var(--v3-line); display: block; margin-left: auto; }
.changelog {
    margin: 10px 0 16px;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--v3-soft);
    border: 1px solid var(--v3-line);
    font-size: 13px;
    line-height: 1.75;
    color: var(--xh-text-2);
    max-height: 168px;
    overflow: auto;
}
.dl-hint { font-size: 11.5px; color: var(--xh-text-2); margin-top: 10px; word-break: break-all; }
.dl-hint code { font-size: 11px; opacity: .8; }
.dl-warn {
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 13.5px;
    color: #f7b955;
    background: #f7b95514;
    border: 1px solid #f7b95544;
}
.hist { margin-top: 26px; }
.hist h3 { font-size: 16px; margin: 0 0 12px; }
.hist-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.hist-table th {
    text-align: left;
    font-weight: 500;
    font-size: 12px;
    color: var(--xh-text-2);
    padding: 9px 10px;
    border-bottom: 1px solid var(--v3-line);
}
.hist-table td { padding: 11px 10px; border-bottom: 1px solid var(--v3-line); }
.hist-table tr:hover td { background: var(--v3-soft); }
.hist-table a { color: var(--xh-primary); text-decoration: none; }
.ota-tip {
    margin-top: 22px;
    padding: 18px;
    border-radius: var(--v3-r);
    border: 1px dashed var(--v3-line);
    background: var(--v3-soft);
}
.ota-tip h3 { margin: 0 0 8px; font-size: 15px; }
.ota-tip p { margin: 0; font-size: 13px; line-height: 1.75; color: var(--xh-text-2); }
.ota-tip code { font-size: 12px; padding: 2px 6px; border-radius: 6px; background: var(--v3-soft-2); }

/* ---------------- 空态 / 徽标 ---------------- */
.v3-empty {
    display: grid;
    place-items: center;
    gap: 8px;
    padding: 44px 20px;
    border-radius: var(--v3-r-lg);
    border: 1px dashed var(--v3-line);
    background: var(--v3-soft);
    color: var(--xh-text-2);
    font-size: 13.5px;
    text-align: center;
}
.v3-empty .ico-wrap { margin-bottom: 4px; }
.v3-empty b { color: var(--xh-text); font-size: 14.5px; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid var(--v3-line);
    background: var(--v3-soft);
    color: var(--xh-text-2);
}
.badge.on { color: var(--xh-primary); border-color: color-mix(in srgb, var(--xh-primary) 42%, transparent); background: color-mix(in srgb, var(--xh-primary) 12%, transparent); }

/* ---------------- 搜索框统一 ---------------- */
.v3-search {
    display: flex;
    align-items: center;
    gap: 9px;
    height: 46px;
    padding: 0 8px 0 14px;
    border-radius: 14px;
    border: 1px solid var(--v3-line);
    background: var(--xh-panel, #0d1424);
    transition: border-color .18s ease, box-shadow .18s ease;
}
.v3-search:focus-within { border-color: var(--v3-ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--xh-primary) 14%, transparent); }
.v3-search .ico { color: var(--xh-text-2); }
.v3-search input {
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--xh-text);
    font-size: 14.5px;
}
.v3-search button {
    height: 34px;
    padding: 0 16px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--xh-primary), var(--xh-primary-2, #7a5cff));
    color: #fff;
    font-size: 13.5px;
    cursor: pointer;
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 1024px) {
    .plat-panel { grid-template-columns: 1fr; }
    .plat-panel-shot img { margin: 0; max-width: 100%; }
}
@media (max-width: 820px) {
    .v3-hero { padding: 20px 16px; border-radius: 20px; margin: 12px 0 14px; }
    .v3-hero h1 { font-size: 25px; }
    .v3-hero p { font-size: 13.5px; }
    .v3-hero-stats { gap: 18px; margin-top: 14px; }
    .v3-hero-stat b { font-size: 18px; }
    .v3-hero-actions .v3-btn { flex: 1 1 auto; }
    .site-grid, .tool-grid, .dl-grid, .cat-tiles { grid-template-columns: 1fr; }
    .v3-sec { margin: 20px 0 12px; }
    .v3-sec-title h2 { font-size: 17px; }
    .v3-search { height: 44px; border-radius: 13px; }
}

/* 打印/极简兜底 */
@media (prefers-reduced-motion: reduce) {
    .v3-card, .dl-card, .cat-tile, .xh-tabbar, .xh-tab-ico { transition: none !important; }
}
