@charset "utf-8";
/* ============================================================
   tp-riven 自定义页面统一样式
   适用：归档 / 关于 / 友链
   命名前缀：custom-
   最小字号：14px
   ============================================================ */

/* ---------- 变量 ---------- */
:root {
    --custom-bg: rgba(237, 246, 255, .72);
    --custom-panel: rgba(237, 246, 255, .80);
    --custom-panel-soft: rgba(237, 246, 255, .62);
    --custom-border: rgba(67, 127, 199, .14);
    --custom-border-strong: rgba(67, 127, 199, .22);
    --custom-text: #2f435a;
    --custom-sub: #6b7a8d;
    --custom-soft: #8fa2b8;
    --custom-accent: #437fc7;
    --custom-accent-dark: #3568a8;
    --custom-shadow: 0 16px 38px rgba(67, 127, 199, .05);
    --custom-shadow-hover: 0 20px 44px rgba(67, 127, 199, .10);
}

:root[data-theme="dark"] {
    --custom-bg: rgba(30, 42, 56, .78);
    --custom-panel: rgba(30, 42, 56, .88);
    --custom-panel-soft: rgba(36, 50, 68, .74);
    --custom-border: rgba(47, 64, 84, .72);
    --custom-border-strong: rgba(74, 98, 128, .78);
    --custom-text: var(--text-body);
    --custom-sub: var(--text-secondary);
    --custom-soft: var(--text-muted);
    --custom-accent: var(--accent-brown);
    --custom-accent-dark: var(--accent-brown);
    --custom-shadow: 0 16px 38px rgba(0, 0, 0, .32);
    --custom-shadow-hover: 0 20px 44px rgba(0, 0, 0, .42);
}

/* ---------- 页面容器 ---------- */
.custom-page {
    width: 100%;
    color: var(--custom-text);
    font-family: var(--font-main);
}

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

.custom-wrap {
    width: 100%;
    max-width: var(--page-width, 800px);
    margin: 0 auto;
    padding: 10px 0 30px;
}

/* ---------- 顶部标题卡片 ---------- */
.custom-hero {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 62px;
    margin: 8px 0 18px;
    padding: 0 18px;
    border: 1px solid var(--custom-border);
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(237, 246, 255, .88), rgba(237, 246, 255, .72));
    box-shadow: 0 12px 30px rgba(67, 127, 199, .045);
    overflow: hidden;
}

.custom-hero::before {
    content: "";
    position: absolute;
    inset: 1px;
    border-radius: 13px;
    border: 1px solid rgba(255, 255, 255, .50);
    pointer-events: none;
}

:root[data-theme="dark"] .custom-hero {
    border-color: var(--custom-border);
    background: linear-gradient(135deg, rgba(30, 42, 56, .9), rgba(26, 36, 48, .76));
    box-shadow: var(--custom-shadow);
}

:root[data-theme="dark"] .custom-hero::before {
    border-color: rgba(255, 255, 255, .08);
}

.custom-hero-main {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    width: 100%;
}

.custom-hero-icon {
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
    color: rgba(67, 127, 199, .68);
}

:root[data-theme="dark"] .custom-hero-icon {
    color: var(--accent-brown);
}

.custom-hero-text {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.custom-hero h1 {
    margin: 0;
    font-size: 22px;
    line-height: 1.2;
    letter-spacing: .03em;
    white-space: nowrap;
    color: #1f2c3d;
    font-weight: 500;
}

:root[data-theme="dark"] .custom-hero h1 {
    color: var(--text-body);
}

.custom-hero p {
    position: relative;
    margin: 0;
    padding-left: 14px;
    color: var(--custom-soft);
    font-size: 16px;
    line-height: 1.6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.custom-hero p::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    width: 1px;
    height: 16px;
    transform: translateY(-50%);
    background: rgba(67, 127, 199, .18);
}

:root[data-theme="dark"] .custom-hero p::before {
    background: var(--custom-border);
}

/* 归档页专用：图标 + 标题 + 竖线 + 描述 */
.custom-hero-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 31px auto 1px minmax(0, 1fr);
    grid-template-areas: "icon title line desc";
    align-items: center;
    gap: 0 13px;
    min-width: 0;
    width: 100%;
}

.custom-hero-grid .custom-hero-icon {
    grid-area: icon;
    width: 31px;
    height: 31px;
}

.custom-hero-grid h1 {
    grid-area: title;
}

.custom-hero-grid i {
    grid-area: line;
    display: block;
    width: 1px;
    height: 16px;
    background: rgba(67, 127, 199, .18);
    font-style: normal;
}

:root[data-theme="dark"] .custom-hero-grid i {
    background: var(--custom-border);
}

.custom-hero-grid span {
    grid-area: desc;
    color: #5f7288;
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

:root[data-theme="dark"] .custom-hero-grid span {
    color: var(--text-body);
}

/* ---------- 简介文字 ---------- */
.custom-intro {
    margin: 0 0 18px;
    color: #3d4a5c;
    font-size: 16px;
    line-height: 2;
    letter-spacing: .02em;
}

.custom-intro p {
    margin: 0;
}

:root[data-theme="dark"] .custom-intro {
    color: var(--text-body);
}

/* ---------- 面板 ---------- */
.custom-panel {
    border: 1px solid var(--custom-border);
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(237, 246, 255, .84), rgba(237, 246, 255, .62)), rgba(237, 246, 255, .72);
    box-shadow: var(--custom-shadow);
    backdrop-filter: blur(9px);
    padding: 16px;
}

:root[data-theme="dark"] .custom-panel {
    background: var(--custom-panel);
}

/* ---------- 通用胶囊标签 ---------- */
.custom-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 0;
    height: 38px;
    padding: 0 10px 0 16px;
    border-radius: 10px;
    color: var(--custom-text);
    text-decoration: none;
    border: 1px solid var(--custom-border);
    background: rgba(237, 246, 255, .72);
    font-size: 15px;
    font-weight: 500;
    transition: border-color .18s ease, background .18s ease, color .18s ease;
}

.custom-chip:hover {
    border-color: var(--custom-border-strong);
    background: rgba(237, 246, 255, .9);
    color: var(--custom-accent);
    text-decoration: none;
}

:root[data-theme="dark"] .custom-chip {
    color: var(--text-body);
    border-color: var(--custom-border);
    background: rgba(36, 50, 68, .74);
}

:root[data-theme="dark"] .custom-chip:hover {
    color: var(--accent-brown);
    border-color: var(--custom-border-strong);
    background: rgba(36, 50, 68, .92);
}

.custom-chip-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.custom-chip-count {
    flex: 0 0 auto;
    color: var(--custom-sub);
    min-width: 46px;
    height: 24px;
    padding: 0 9px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(237, 246, 255, .78);
    border: 1px solid var(--custom-border);
    font-size: 14px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

:root[data-theme="dark"] .custom-chip-count {
    color: var(--text-body);
    border-color: var(--custom-border);
    background: rgba(30, 42, 56, .86);
}

/* ---------- 标签统计区块（归档页复用） ---------- */
.custom-tags {
    margin: 0 0 16px;
    padding: 18px;
    border: 1px solid var(--custom-border);
    border-radius: 12px;
    background: rgba(237, 246, 255, .62);
}

:root[data-theme="dark"] .custom-tags {
    border-color: var(--custom-border);
    background: var(--custom-panel-soft);
    box-shadow: var(--custom-shadow);
}

.custom-tags-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--custom-border);
}

.custom-tags-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #2f435a;
    font-size: 20px;
    font-weight: 500;
}

:root[data-theme="dark"] .custom-tags-title {
    color: var(--text-body);
}

.custom-tags-title svg {
    width: 22px;
    height: 22px;
    color: #437fc7;
}

:root[data-theme="dark"] .custom-tags-title svg {
    color: var(--accent-brown);
}

.custom-tags-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px 18px;
    margin-top: 18px;
}

/* ---------- 工具栏（归档页切换按钮） ---------- */
.custom-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 14px;
}

.custom-switch {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 18px;
    border-radius: 9px;
    border: 1px solid var(--custom-border);
    background: rgba(237, 246, 255, .82);
    color: #3d4a5c;
    font-size: 14px;
    text-decoration: none;
    transition: all .18s ease;
}

:root[data-theme="dark"] .custom-switch {
    color: var(--text-body);
    border-color: var(--custom-border);
    background: rgba(30, 42, 56, .86);
}

.custom-switch:hover {
    border-color: var(--custom-border-strong);
    background: rgba(237, 246, 255, .95);
    text-decoration: none;
}

:root[data-theme="dark"] .custom-switch:hover {
    color: var(--accent-brown);
    border-color: var(--custom-border-strong);
    background: rgba(36, 50, 68, .92);
}

.custom-switch.active {
    color: #fff8ed;
    border-color: #437fc7;
    background: linear-gradient(180deg, #6DAFFE, #437fc7);
    box-shadow: 0 9px 18px rgba(67, 127, 199, .16);
}

:root[data-theme="dark"] .custom-switch.active {
    color: #141c26;
    border-color: var(--accent-brown);
    background: var(--accent-brown);
}

/* ---------- 统计卡片（归档页） ---------- */
.custom-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 0 0 14px;
}

.custom-stat {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    min-width: 0;
    min-height: 84px;
    border: 1px solid var(--custom-border);
    border-radius: 10px;
    background: radial-gradient(circle at 50% 0, rgba(67, 127, 199, .055), transparent 54%), rgba(237, 246, 255, .58);
    box-shadow: 0 10px 24px rgba(67, 127, 199, .045);
    backdrop-filter: blur(8px);
}

:root[data-theme="dark"] .custom-stat {
    border-color: var(--custom-border);
    background: var(--custom-panel-soft);
    box-shadow: var(--custom-shadow);
}

.custom-stat-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #437fc7;
    background: rgba(67, 127, 199, .075);
    border: 1px solid rgba(67, 127, 199, .09);
}

:root[data-theme="dark"] .custom-stat-icon {
    color: var(--accent-brown);
    border-color: var(--custom-border);
    background: rgba(109, 175, 254, .12);
}

.custom-stat-icon svg {
    display: block;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
}

.custom-stat-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.custom-stat-text span {
    color: #5f7288;
    font-size: 16px;
}

:root[data-theme="dark"] .custom-stat-text span {
    color: var(--text-body);
}

.custom-stat-text strong {
    color: #1f2c3d;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(26px, 3.15vw, 32px);
    line-height: 1;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

:root[data-theme="dark"] .custom-stat-text strong {
    color: var(--text-body);
}

/* ---------- 归档分组列表 ---------- */
.custom-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.custom-group {
    border: 1px solid var(--custom-border);
    border-radius: 10px;
    background: rgba(237, 246, 255, .62);
    overflow: hidden;
    transition: box-shadow .18s ease, border-color .18s ease, background .18s ease;
}

:root[data-theme="dark"] .custom-group {
    border-color: var(--custom-border);
    background: var(--custom-panel-soft);
    box-shadow: var(--custom-shadow);
}

.custom-group:hover {
    border-color: var(--custom-border-strong);
    box-shadow: 0 12px 26px rgba(67, 127, 199, .05);
    background: rgba(237, 246, 255, .72);
}

:root[data-theme="dark"] .custom-group:hover,
:root[data-theme="dark"] .custom-group.is-open {
    border-color: var(--custom-border-strong);
    background: rgba(36, 50, 68, .82);
    box-shadow: var(--custom-shadow-hover);
}

.custom-group.is-open {
    border-color: var(--custom-border-strong);
}

.custom-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
    padding: 18px 18px;
    border: 0;
    background: transparent;
    cursor: pointer;
    text-align: left;
    color: inherit;
}

.custom-group-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.custom-chevron {
    position: relative;
    width: 16px;
    height: 16px;
    color: var(--custom-soft);
    flex: 0 0 auto;
    transition: transform .18s ease, color .18s ease;
}

:root[data-theme="dark"] .custom-chevron {
    color: var(--accent-brown);
}

.custom-chevron::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 4px;
    width: 7px;
    height: 7px;
    border-top: 1.6px solid currentColor;
    border-right: 1.6px solid currentColor;
    transform: rotate(135deg);
}

.custom-group.is-open .custom-chevron {
    transform: rotate(-90deg);
    color: var(--custom-accent-dark);
}

.custom-group-title {
    color: #1f2c3d;
    font-size: 18px;
    font-weight: 650;
    letter-spacing: .02em;
    white-space: nowrap;
}

:root[data-theme="dark"] .custom-group-title {
    color: var(--text-body);
}

.custom-group-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 84px;
    height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(67, 127, 199, .065);
    color: var(--custom-sub);
    font-size: 14px;
    white-space: nowrap;
}

:root[data-theme="dark"] .custom-group-count {
    color: var(--text-body);
}

.custom-group-body {
    border-top: 1px solid var(--custom-border);
    padding: 0 18px;
}

.custom-group-body-inner {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 42px;
    row-gap: 8px;
    padding: 18px 0 16px;
}

.custom-item {
    display: flex;
    align-items: baseline;
    gap: 14px;
    min-width: 0;
    padding: 4px 0;
}

.custom-date {
    color: #437fc7;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 14px;
    line-height: 1.4;
    white-space: nowrap;
    flex: 0 0 auto;
}

:root[data-theme="dark"] .custom-date {
    color: var(--accent-brown);
}

.custom-link {
    min-width: 0;
    color: var(--custom-text);
    font-size: 15px;
    line-height: 1.7;
    text-decoration: none;
    transition: color .18s ease, transform .18s ease;
}

:root[data-theme="dark"] .custom-link {
    color: var(--text-body);
}

.custom-link:hover {
    color: var(--custom-accent-dark);
    transform: translateX(1px);
    text-decoration: none;
}

:root[data-theme="dark"] .custom-link:hover {
    color: var(--accent-brown);
}

.custom-group-body.is-collapsed {
    display: none;
}

.custom-empty {
    padding: 46px 18px;
    text-align: center;
    border: 1px solid var(--custom-border);
    border-radius: 10px;
    color: var(--custom-sub);
    background: rgba(237, 246, 255, .55);
}

/* ---------- 关于页文章卡片 ---------- */
.custom-article {
    padding: 26px 28px;
    border: 1px solid var(--custom-border);
    border-radius: 14px;
    background: var(--bg-card, #FBFAF7);
    box-shadow: var(--custom-shadow);
    line-height: 1.85;
    font-size: 16px;
}

:root[data-theme="dark"] .custom-article {
    background: rgba(30, 42, 56, .82);
    border-color: var(--custom-border);
}

.custom-article h3 {
    margin: 28px 0 12px;
    font-size: 20px;
    font-weight: 600;
    color: #1f2c3d;
    letter-spacing: .02em;
}

:root[data-theme="dark"] .custom-article h3 {
    color: var(--text-body);
}

.custom-article h3:first-child {
    margin-top: 0;
}

.custom-article h4 {
    margin: 22px 0 10px;
    font-size: 17px;
    font-weight: 600;
    color: #1f2c3d;
}

:root[data-theme="dark"] .custom-article h4 {
    color: var(--text-body);
}

.custom-article p {
    margin: 0 0 14px;
}

.custom-article p:last-child {
    margin-bottom: 0;
}

.custom-article ul {
    margin: 0 0 16px;
    padding-left: 22px;
}

.custom-article li {
    margin-bottom: 6px;
    line-height: 1.8;
}

.custom-article blockquote {
    margin: 16px 0;
    padding: 14px 18px;
    border-left: 3px solid rgba(67, 127, 199, .35);
    border-radius: 0 8px 8px 0;
    background: rgba(67, 127, 199, .05);
    color: #3d4a5c;
    line-height: 1.9;
}

:root[data-theme="dark"] .custom-article blockquote {
    border-left-color: var(--accent-brown);
    background: rgba(109, 175, 254, .08);
    color: var(--text-body);
}

.custom-article a {
    color: var(--custom-accent);
    text-decoration: none;
    border-bottom: 1px solid rgba(67, 127, 199, .25);
    transition: color .18s ease, border-color .18s ease;
}

.custom-article a:hover {
    color: var(--custom-accent);
    border-bottom-color: var(--custom-accent);
}

/* ---------- 友链页申请区块 ---------- */
.custom-apply {
    margin: 0 0 24px;
}

.custom-apply-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}

.custom-apply-title {
    margin: 0;
    color: #1f2c3d;
    font-size: 18px;
    line-height: 1.35;
    font-weight: 500;
    letter-spacing: .04em;
}

:root[data-theme="dark"] .custom-apply-title {
    color: var(--text-body);
}

.custom-apply-note {
    margin: 0;
    color: var(--custom-soft);
    font-size: 14px;
    line-height: 1.6;
    white-space: nowrap;
}

:root[data-theme="dark"] .custom-apply-note {
    color: var(--text-body);
}

.custom-apply-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(260px, .92fr);
    gap: 12px;
}

.custom-rule-card,
.custom-site-card {
    position: relative;
    border: 1px solid var(--custom-border);
    border-radius: 10px;
    background:
        radial-gradient(circle at 86% 12%, rgba(67, 127, 199, .08), transparent 34%),
        linear-gradient(135deg, rgba(237, 246, 255, .82), rgba(237, 246, 255, .58));
    box-shadow: 0 14px 30px rgba(67, 127, 199, .045);
    backdrop-filter: blur(10px);
    overflow: hidden;
}

:root[data-theme="dark"] .custom-rule-card,
:root[data-theme="dark"] .custom-site-card {
    border-color: var(--custom-border);
    background: var(--custom-panel-soft);
    box-shadow: var(--custom-shadow);
}

.custom-rule-card {
    padding: 18px 18px 16px;
}

.custom-site-card {
    padding: 18px;
}

.custom-card-kicker {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 12px;
    margin-bottom: 13px;
    border: 1px solid rgba(67, 127, 199, .22);
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(67, 127, 199, .96), rgba(109, 175, 254, .9));
    color: #fff9ef;
    font-size: 14px;
    line-height: 1;
    font-weight: 500;
    letter-spacing: .04em;
    box-shadow: 0 8px 18px rgba(67, 127, 199, .16);
}

.custom-rule-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.custom-rule-item {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 10px;
    align-items: flex-start;
}

.custom-rule-no {
    width: 22px;
    height: 22px;
    border-radius: 7px;
    background: rgba(67, 127, 199, .1);
    color: #437fc7;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
    font-weight: 500;
    font-family: Arial, Helvetica, sans-serif;
    font-variant-numeric: tabular-nums;
    flex: 0 0 22px;
}

:root[data-theme="dark"] .custom-rule-no {
    color: var(--text-body);
    background: rgba(36, 50, 68, .78);
}

.custom-rule-text strong {
    display: block;
    color: #1f2c3d;
    font-size: 16px;
    line-height: 1.45;
    font-weight: 500;
}

:root[data-theme="dark"] .custom-rule-text strong {
    color: var(--text-body);
}

.custom-rule-text span {
    display: block;
    margin-top: 3px;
    color: #5f7288;
    font-size: 14px;
    line-height: 1.7;
}

:root[data-theme="dark"] .custom-rule-text span {
    color: var(--text-body);
}

/* ---------- 本站信息表 ---------- */
.custom-site-info {
    display: grid;
    gap: 8px;
    margin: 0;
}

.custom-site-row {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 8px 10px;
    border: 1px solid var(--custom-border);
    border-radius: 8px;
    background: rgba(237, 246, 255, .48);
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

:root[data-theme="dark"] .custom-site-row {
    border-color: var(--custom-border);
    background: rgba(36, 50, 68, .68);
}

.custom-site-row:hover,
.custom-site-row:focus-within {
    border-color: var(--custom-border-strong);
    background: rgba(237, 246, 255, .74);
    box-shadow: 0 8px 18px rgba(67, 127, 199, .055);
}

.custom-site-row dt {
    color: var(--custom-soft);
    font-size: 16px;
    line-height: 1.45;
}

:root[data-theme="dark"] .custom-site-row dt {
    color: var(--text-body);
}

.custom-site-row dd {
    min-width: 0;
    margin: 0;
    color: #3d4a5c;
    font-size: 16px;
    line-height: 1.45;
    word-break: break-all;
    display: flex;
    align-items: center;
    gap: 8px;
}

:root[data-theme="dark"] .custom-site-row dd {
    color: var(--text-body);
}

.custom-site-row a {
    color: #437fc7;
    text-decoration: none;
}

:root[data-theme="dark"] .custom-site-row a {
    color: var(--text-body);
}

.custom-copy-text {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
}

.custom-copy {
    flex: 0 0 auto;
    height: 24px;
    padding: 0 8px;
    border: 1px solid var(--custom-border);
    border-radius: 999px;
    background: rgba(237, 246, 255, .78);
    color: #437fc7;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    opacity: 0;
    transform: translateX(4px);
    transition: opacity .18s ease, transform .18s ease, background .18s ease, color .18s ease, border-color .18s ease;
}

:root[data-theme="dark"] .custom-copy {
    color: var(--text-body);
    border-color: var(--custom-border);
    background: rgba(36, 50, 68, .78);
}

.custom-site-row:hover .custom-copy,
.custom-site-row:focus-within .custom-copy {
    opacity: 1;
    transform: translateX(0);
}

.custom-copy:hover {
    border-color: rgba(67, 127, 199, .42);
    background: #437fc7;
    color: #fff8ed;
}

.custom-copy.is-copied {
    border-color: rgba(67, 127, 199, .3);
    background: rgba(109, 175, 254, .13);
    color: #3568a8;
}

.custom-empty-config {
    margin: 15px 0 0;
    padding: 12px 13px;
    border-radius: 8px;
    background: rgba(67, 127, 199, .07);
    color: #3d4a5c;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.75;
}

:root[data-theme="dark"] .custom-empty-config {
    color: var(--text-body);
    background: rgba(36, 50, 68, .74);
}

/* ---------- 友链分类导航 ---------- */
.custom-sort-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 0 18px;
    padding: 10px;
    border: 1px solid var(--custom-border);
    border-radius: 12px;
    background: rgba(237, 246, 255, .54);
    box-shadow: 0 10px 24px rgba(67, 127, 199, .038);
    backdrop-filter: blur(8px);
}

:root[data-theme="dark"] .custom-sort-nav {
    border-color: var(--custom-border);
    background: var(--custom-panel-soft);
    box-shadow: var(--custom-shadow);
}

.custom-sort-label {
    height: 30px;
    padding: 0 9px;
    display: inline-flex;
    align-items: center;
    border-right: 1px solid var(--custom-border);
    color: var(--custom-sub);
    font-size: 16px;
    white-space: nowrap;
}

.custom-sort-nav a {
    max-width: 100%;
    height: 30px;
    padding: 0 11px;
    border: 1px solid var(--custom-border);
    border-radius: 999px;
    background: rgba(237, 246, 255, .58);
    color: #437fc7;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    transition: transform .18s ease, background .18s ease, border-color .18s ease, color .18s ease;
}

.custom-sort-nav a:hover {
    transform: translateY(-1px);
    border-color: var(--custom-border-strong);
    background: rgba(237, 246, 255, .88);
    text-decoration: none;
}

:root[data-theme="dark"] .custom-sort-nav a {
    color: var(--text-body);
    border-color: var(--custom-border);
    background: rgba(36, 50, 68, .78);
}

:root[data-theme="dark"] .custom-sort-nav a:hover {
    color: var(--accent-brown);
    border-color: var(--custom-border-strong);
    background: rgba(36, 50, 68, .92);
}

.custom-sort-nav em {
    font-style: normal;
    color: var(--custom-soft);
    font-size: 14px;
}

/* ---------- 友链分组 ---------- */
.custom-links-list {
    display: grid;
    gap: 22px;
}

.custom-sort-section {
    min-width: 0;
    scroll-margin-top: 80px;
}

.custom-sort-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 12px;
    padding: 0 2px;
}

.custom-sort-title-wrap {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 9px;
}

.custom-sort-mark {
    width: 8px;
    height: 22px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(67, 127, 199, .88), rgba(109, 175, 254, .42));
    box-shadow: 0 6px 14px rgba(67, 127, 199, .12);
    flex: 0 0 auto;
}

.custom-sort-title {
    min-width: 0;
    margin: 0;
    color: #1f2c3d;
    font-size: 18px;
    line-height: 1.35;
    font-weight: 500;
    letter-spacing: .04em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

:root[data-theme="dark"] .custom-sort-title {
    color: var(--text-body);
}

.custom-sort-count {
    flex: 0 0 auto;
    height: 28px;
    padding: 0 10px;
    border: 1px solid var(--custom-border);
    border-radius: 999px;
    background: rgba(237, 246, 255, .58);
    color: var(--custom-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    white-space: nowrap;
}

:root[data-theme="dark"] .custom-sort-count {
    color: var(--text-body);
    border-color: var(--custom-border);
    background: rgba(36, 50, 68, .78);
}

/* ---------- 友链网格 ---------- */
.custom-links-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.custom-link-card {
    position: relative;
    min-height: 68px;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    padding: 10px 10px;
    border: 1px solid var(--custom-border);
    border-radius: 10px;
    background:
        radial-gradient(circle at 86% 16%, rgba(67, 127, 199, .065), transparent 34%),
        linear-gradient(135deg, rgba(237, 246, 255, .66), rgba(237, 246, 255, .46));
    box-shadow: 0 10px 22px rgba(67, 127, 199, .045);
    backdrop-filter: blur(8px);
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    transition: transform .2s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

:root[data-theme="dark"] .custom-link-card {
    border-color: var(--custom-border);
    background: var(--custom-panel-soft);
    box-shadow: var(--custom-shadow);
}

.custom-link-card:hover {
    border-color: var(--custom-border-strong);
    background:
        radial-gradient(circle at 86% 16%, rgba(67, 127, 199, .1), transparent 36%),
        linear-gradient(135deg, rgba(237, 246, 255, .84), rgba(237, 246, 255, .66));
    box-shadow: 0 16px 34px rgba(67, 127, 199, .085);
    text-decoration: none;
}

:root[data-theme="dark"] .custom-link-card:hover {
    border-color: var(--custom-border-strong);
    background: var(--custom-panel-soft);
    box-shadow: var(--custom-shadow-hover);
}

.custom-link-cover {
    width: 42px;
    height: 42px;
    border-radius: 9px;
    overflow: hidden;
    border: 1px solid var(--custom-border);
    background: linear-gradient(135deg, rgba(237, 246, 255, .9), rgba(214, 232, 250, .62));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 14px rgba(67, 127, 199, .06);
}

:root[data-theme="dark"] .custom-link-cover {
    border-color: var(--custom-border);
    background: rgba(36, 50, 68, .82);
    box-shadow: none;
}

.custom-link-cover img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform .32s ease, opacity .32s ease;
}

.custom-link-card:hover .custom-link-cover img {
    transform: scale(1.05);
    opacity: .94;
}

.custom-link-placeholder {
    color: #437fc7;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: .03em;
}

:root[data-theme="dark"] .custom-link-placeholder {
    color: var(--accent-brown);
}

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

.custom-link-name {
    display: block;
    color: #1f2c3d;
    font-size: 16px;
    line-height: 1.25;
    font-weight: 500;
    letter-spacing: .03em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

:root[data-theme="dark"] .custom-link-name {
    color: var(--text-body);
}

.custom-link-card:hover .custom-link-name {
    color: var(--custom-accent);
}

:root[data-theme="dark"] .custom-link-card:hover .custom-link-name {
    color: var(--accent-brown);
}

.custom-link-url {
    display: block;
    margin-top: 4px;
    color: var(--custom-soft);
    font-size: 14px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: Georgia, "Times New Roman", serif;
}

:root[data-theme="dark"] .custom-link-url {
    color: var(--text-body);
}

/* ---------- 空状态 ---------- */
.custom-empty-box {
    padding: 42px 18px;
    border: 1px solid var(--custom-border);
    border-radius: 10px;
    background: rgba(237, 246, 255, .62);
    color: var(--custom-sub);
    text-align: center;
    line-height: 1.9;
}

:root[data-theme="dark"] .custom-empty-box {
    border-color: var(--custom-border);
    background: var(--custom-panel-soft);
    color: var(--text-body);
}

.custom-empty-box strong {
    color: var(--custom-accent);
}

:root[data-theme="dark"] .custom-empty-box strong {
    color: var(--accent-brown);
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 820px) {
    .custom-links-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .custom-apply-grid {
        grid-template-columns: 1fr;
    }
    .custom-apply-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }
    .custom-apply-note {
        white-space: normal;
    }
}

@media (max-width: 800px) {
    .custom-hero {
        min-height: 56px;
        padding: 0 14px;
        margin-bottom: 16px;
    }
    .custom-hero-grid {
        gap: 0 10px;
    }
    .custom-hero-grid .custom-hero-icon {
        width: 27px;
        height: 27px;
    }
    .custom-hero h1 {
        font-size: 20px;
    }
    .custom-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
    .custom-stat {
        min-height: auto;
        padding: 12px 8px;
        gap: 8px;
        flex-direction: column;
        justify-content: center;
        text-align: center;
    }
    .custom-stat-icon {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
    }
    .custom-stat-icon svg {
        width: 21px;
        height: 21px;
        flex-basis: 21px;
    }
    .custom-stat-text strong {
        font-size: clamp(22px, 8vw, 28px);
    }
    .custom-tags {
        padding: 16px;
    }
    .custom-tags-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
    .custom-group-body-inner {
        grid-template-columns: 1fr;
        column-gap: 0;
        row-gap: 6px;
    }
}

@media (max-width: 680px) {
    .custom-hero {
        min-height: 68px;
        margin: 6px 0 16px;
        padding: 12px 15px;
        border-radius: 13px;
    }
    .custom-hero::before {
        border-radius: 12px;
    }
    .custom-hero-main {
        align-items: flex-start;
    }
    .custom-hero-text {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    .custom-hero h1 {
        font-size: 20px;
    }
    .custom-hero p {
        padding-left: 0;
        font-size: 14px;
        line-height: 1.5;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }
    .custom-hero p::before {
        display: none;
    }
    .custom-hero-grid {
        grid-template-columns: 28px minmax(0, 1fr);
        grid-template-areas:
            "icon title"
            "icon desc";
        column-gap: 12px;
        row-gap: 4px;
    }
    .custom-hero-grid .custom-hero-icon {
        width: 28px;
        height: 28px;
    }
    .custom-hero-grid i {
        display: none;
    }
    .custom-article {
        padding: 18px 16px;
        font-size: 15px;
        line-height: 1.8;
    }
    .custom-article h3 {
        font-size: 18px;
        margin-top: 22px;
    }
    .custom-article h4 {
        font-size: 16px;
    }
    .custom-article blockquote {
        padding: 12px 14px;
        font-size: 14px;
    }
}

@media (max-width: 560px) {
    .custom-intro {
        font-size: 14px;
        line-height: 1.9;
    }
    .custom-panel {
        padding: 12px;
    }
    .custom-tags {
        padding: 14px;
    }
    .custom-tags-head {
        padding-bottom: 12px;
    }
    .custom-tags-title {
        font-size: 18px;
    }
    .custom-toolbar {
        justify-content: stretch;
    }
    .custom-switch {
        flex: 1 1 0;
        justify-content: center;
        padding: 0 12px;
    }
    .custom-group-header {
        padding: 15px 14px;
    }
    .custom-group-body {
        padding: 0 14px;
    }
    .custom-group-title {
        font-size: 17px;
    }
    .custom-group-count {
        min-width: 74px;
        height: 28px;
        padding: 0 10px;
        font-size: 14px;
    }
    .custom-item {
        gap: 12px;
    }
    .custom-link {
        font-size: 14px;
        line-height: 1.65;
    }
    .custom-sort-nav {
        gap: 7px;
        padding: 9px;
        border-radius: 10px;
    }
    .custom-sort-label {
        width: 100%;
        height: auto;
        padding: 0 2px 2px;
        border-right: 0;
    }
    .custom-sort-nav a {
        height: 28px;
        max-width: calc(50% - 4px);
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .custom-sort-head {
        gap: 8px;
        margin-bottom: 10px;
    }
    .custom-sort-title {
        font-size: 16px;
    }
    .custom-sort-count {
        height: 26px;
        padding: 0 8px;
        font-size: 14px;
    }
    .custom-rule-card,
    .custom-site-card {
        padding: 14px;
    }
    .custom-site-row {
        grid-template-columns: 42px minmax(0, 1fr);
        gap: 8px;
        padding: 7px 9px;
    }
    .custom-links-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }
    .custom-link-card {
        grid-template-columns: 36px minmax(0, 1fr);
        gap: 8px;
        min-height: 58px;
        padding: 9px 9px;
    }
    .custom-link-cover {
        width: 36px;
        height: 36px;
        border-radius: 8px;
    }
    .custom-link-url {
        font-size: 14px;
    }
    .custom-copy {
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 380px) {
    .custom-link-card {
        grid-template-columns: 32px minmax(0, 1fr);
        gap: 7px;
        padding: 8px;
    }
    .custom-link-cover {
        width: 32px;
        height: 32px;
    }
    .custom-link-url {
        font-size: 14px;
    }
}