/* 
 * Links Page Styles - 友情链接页面样式
 * Version: 5.0 - 完全重构版
 * 
 * 目录结构：
 * 1. CSS变量与基础重置
 * 2. 页面容器与布局
 * 3. Hero区域样式
 * 4. 站点信息卡片
 * 5. 操作按钮区域
 * 6. 状态显示区域
 * 7. 友链卡片样式
 * 8. RSS图标样式
 * 9. 申请友链弹窗
 * 10. 友链检测说明
 * 11. 响应式设计
 * 12. 深色模式适配
 */

/* ============================================
   1. CSS变量与基础重置
   ============================================ */
:root {
    /* 主色调 */
    --color-primary: #002FA7;
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --color-info: #3b82f6;
    --color-purple: #8b5cf6;
    --color-orange: #f97316;
    --color-rss: #ff6b35;
    --color-rss-dark: #ff8c42;
    
    /* 文字颜色 */
    --color-text-primary: #111827;
    --color-text-secondary: #6b7280;
    --color-text-muted: #9ca3af;
    
    /* 背景颜色 */
    --color-bg-primary: #ffffff;
    --color-bg-secondary: #f9fafb;
    --color-bg-tertiary: #f3f4f6;
    
    /* 边框颜色 */
    --color-border: #e5e7eb;
    --color-border-light: #f3f4f6;
    
    /* 圆角 */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 50px;
    
    /* 阴影 */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 25px 50px rgba(0, 0, 0, 0.15);
    --shadow-rss: 0 2px 8px rgba(255, 107, 53, 0.3);
    --shadow-rss-hover: 0 4px 12px rgba(255, 107, 53, 0.4);
    
    /* 过渡动画 */
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.3s ease;
    --transition-bounce: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 基础重置 */
*,
*::before,
*::after { 
    box-sizing: border-box; 
}

/* ============================================
   2. 页面容器与布局
   ============================================ */
.links-page {
    max-width: 1280px;
    margin: 24px auto;
    background: var(--color-bg-primary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.links-section {
    padding: 26px;
}

.links-container {
    max-width: 1280px;
    margin: 0 auto;
}

/* ============================================
   3. Hero区域样式
   ============================================ */
.links-hero {
    position: relative;
    padding: 48px 0;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-bottom: 1px solid var(--color-border);
    overflow: hidden;
}

/* 装饰性背景元素 */
.links-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 60%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 47, 167, 0.03) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.links-hero::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -5%;
    width: 40%;
    height: 150%;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.03) 0%, transparent 60%);
    border-radius: 50%;
    pointer-events: none;
}

.links-hero .hero-container {
    position: relative;
    z-index: 1;
    padding: 0 20px;
    max-width: 1280px;
    margin: 0 auto;
}

.links-hero .hero-inner {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 32px;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 20px;
}

/* 左侧内容区 */
.hero-left { 
    position: relative; 
    min-height: 140px; 
}

/* 友链头像墙装饰背景 */
.friends-wall {
    position: absolute;
    inset: -20px;
    display: grid;
    grid-template-columns: repeat(14, 48px);
    grid-template-rows: repeat(4, 48px);
    gap: 8px;
    opacity: 0.1;
    pointer-events: none;
    justify-content: center;
    align-content: center;
    overflow: hidden;
    z-index: 0;
}

.wall-item {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--color-bg-secondary);
}

.wall-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wall-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-weight: 600;
    color: var(--color-text-secondary);
    background: var(--color-bg-secondary);
}

/* Hero内容 */
.hero-content {
    position: relative;
    z-index: 5;
    display: flex;
    flex-direction: column;
}

.links-hero .page-title {
    margin: 0 0 16px;
    font-size: 2.25rem;
    font-weight: 500;
    color: var(--color-primary);
    font-family: "KuaiKanShiJieTi", sans-serif;
}

.hero-text {
    margin-top: 16px;
    color: #4b5563;
    font-family: "Source Han Serif CN", var(--font-chinese);
    font-size: 0.95rem;
    line-height: 1.25;
}

.hero-text p {
    margin: 0 0 16px;
}

.hero-text ul {
    list-style: none;
    padding-left: 0;
    margin: 24px 0;
}

.hero-text li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 14px;
}

.hero-text li::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 4px;
    width: 8px;
    height: 8px;
    background-color: var(--color-success);
    border-radius: 50%;
}

.hero-text li strong {
    color: var(--color-text-primary);
    font-weight: 700;
}

/* ============================================
   4. 站点信息卡片
   ============================================ */
.site-card {
    background: var(--color-bg-primary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-lg);
    height: fit-content;
    min-height: 280px;
    display: flex;
    flex-direction: column;
}

.site-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}

.site-avatar {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: var(--radius-md);
    object-fit: cover;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
}

.site-meta .site-name {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--color-text-primary);
}

.site-meta .site-slogan {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin-top: 4px;
}

.site-info-codeblock { 
    display: flex; 
    flex-direction: column; 
    gap: 6px; 
}

.site-info-codeblock .ic-row {
    display: grid;
    grid-template-columns: 50px 1fr auto;
    align-items: center;
    padding: 3px 6px;
    background: var(--color-bg-secondary);
    border: 1px dashed var(--color-border);
    border-radius: var(--radius-sm);
    transition: border-color var(--transition-fast);
}

.site-info-codeblock .ic-row:hover { 
    border-color: var(--color-success); 
}

.k {
    color: var(--color-text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.v {
    color: var(--color-text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.code-inline {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    background: var(--color-bg-primary);
    border: 1px solid var(--color-border);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 0.85rem;
}

.copy-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    height: 32px;
    min-width: 32px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg-primary);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.copy-btn:hover {
    background: var(--color-success);
    color: var(--color-bg-primary);
    border-color: var(--color-success);
    transform: translateY(-1px);
}

.copy-btn.copying { 
    opacity: 0.6; 
    cursor: wait; 
}

.copy-btn.copy-success {
    background: rgba(16, 185, 129, 0.1) !important;
    border-color: var(--color-success) !important;
}

.copy-btn.copy-error {
    background: rgba(239, 68, 68, 0.1) !important;
    border-color: var(--color-danger) !important;
}

/* ============================================
   5. 操作按钮区域 - 重写版
   ============================================ */
.links-actions {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    border: none !important;
}

/* 圆形按钮组 */
.capsule-buttons {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 0;
    background: none;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
}

.capsule-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid var(--color-border);
    background: var(--color-bg-primary);
    color: var(--color-text-secondary);
    font-size: 20px;
    cursor: pointer;
    transition: all var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.capsule-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-info);
    color: var(--color-info);
}

.capsule-btn:active {
    transform: translateY(0);
    box-shadow: var(--shadow-sm);
}

/* 按钮特定悬浮颜色 */
.capsule-btn:nth-child(1):hover {
    border-color: var(--color-success);
    color: var(--color-success);
    background: rgba(16, 185, 129, 0.05);
}

.capsule-btn:nth-child(2):hover {
    border-color: var(--color-warning);
    color: var(--color-warning);
    background: rgba(245, 158, 11, 0.05);
}

.capsule-btn:nth-child(3):hover {
    border-color: var(--color-purple);
    color: var(--color-purple);
    background: rgba(139, 92, 246, 0.05);
}

/* 隐藏多余元素 */
.capsule-btn .loading-spinner,
.capsule-btn .btn-text,
.capsule-btn .loading-text {
    display: none;
}

/* 图标样式 */
.capsule-btn > i {
    transition: all var(--transition-smooth);
    z-index: 1;
}

/* 加载状态样式 */
.capsule-btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.capsule-btn.loading > i {
    display: none;
}

.capsule-btn.loading .loading-dots {
    display: flex;
    position: absolute;
    align-items: center;
    justify-content: center;
    gap: 3px;
}

.loading-dots {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.loading-dots .dot {
    width: 4px;
    height: 4px;
    background: currentColor;
    border-radius: 50%;
    animation: loading-bounce 1.4s ease-in-out infinite both;
}

.loading-dots .dot:nth-child(1) { animation-delay: -0.32s; }
.loading-dots .dot:nth-child(2) { animation-delay: -0.16s; }
.loading-dots .dot:nth-child(3) { animation-delay: 0s; }

@keyframes loading-bounce {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.4;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* 禁用状态 */
.capsule-btn:disabled {
    pointer-events: none;
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   6. 状态显示区域
   ============================================ */
.link-status {
    padding: 12px 16px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #bae6fd;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    color: #0c4a6e;
    box-shadow: var(--shadow-sm);
    transition: all 0.5s ease-out;
    opacity: 0;
    display: none;
    transform: translateY(-10px);
}

.link-status.show {
    opacity: 1;
    display: block;
    transform: translateY(0);
}

.category-stats {
    padding: 12px 16px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #fefce8 0%, #fef3c7 100%);
    border: 1px solid #fcd34d;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    color: #92400e;
    box-shadow: var(--shadow-sm);
    transition: all 0.5s ease-out;
    opacity: 0;
    display: none;
    transform: translateY(-10px);
}

.category-stats.show {
    opacity: 1;
    display: block;
    transform: translateY(0);
}

.stats-header {
    font-weight: 600;
    margin-bottom: 8px;
}

/* ============================================
   7. 友链卡片样式
   ============================================ */
.links-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

/* 分组标题 */
.group-title {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text-primary);
    font-size: 1.125rem;
    font-weight: 600;
}

.group-title .count {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    font-weight: 400;
}

/* 友链卡片 */
.link-card {
    background: var(--color-bg-primary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
    overflow: hidden;
    position: relative;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1;
}

.link-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    z-index: 10;
}

/* 卡片内容相对定位 */
.link-card > * {
    position: relative;
    z-index: 1;
}

/* 卡片头部 */
.link-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
}

/* 友链头像 */
.link-avatar,
.avatar-fallback {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    object-fit: cover;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border);
    flex-shrink: 0;
    transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
    cursor: pointer;
}

.link-avatar:hover,
.avatar-fallback:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10;
}

.avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-secondary);
    font-weight: 600;
}

/* 友链信息 */
.link-info {
    flex: 1;
    min-width: 0;
}

/* 站点名称行 */
.link-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-text-primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.link-name a {
    color: inherit;
    text-decoration: none;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.link-name a:hover {
    color: var(--color-info);
}

/* 评星组件 */
.link-rating {
    display: flex;
    align-items: center;
    gap: 1px;
    flex-shrink: 0;
}

.link-rating .star {
    width: 12px;
    height: 12px;
    color: #fbbf24;
    font-size: 12px;
}

.link-rating .star.empty {
    color: var(--color-border);
}

.link-desc {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 友链状态 */
.link-card.is-unavailable {
    background: #fef2f2;
    border-color: #fca5a5;
    box-shadow: 0 1px 4px rgba(239, 68, 68, 0.1);
}

.link-card.is-unavailable:hover {
    transform: none;
    box-shadow: 0 1px 4px rgba(239, 68, 68, 0.15);
}

.link-card.is-unavailable .link-name {
    color: #dc2626;
}

.link-card.is-unavailable .link-desc {
    color: #991b1b;
}

/* 检测中状态 */
.link-card.checking {
    opacity: 0.7;
}

.link-card.checking::after {
    content: '\f110';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 16px;
    color: var(--color-text-secondary);
    animation: spin 1s linear infinite;
    z-index: 2;
}

@keyframes spin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* 无友链提示 */
.no-links {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: var(--color-text-secondary);
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg-secondary);
}

.no-links i {
    font-size: 2rem;
    margin-bottom: 16px;
    color: #d1d5db;
}

/* ============================================
   8. RSS图标样式 - 左下角定位
   ============================================ */
.link-rss-icon {
    position: absolute;
    left: 0px;
    bottom: 0px;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: all var(--transition-smooth);
}

.link-rss-icon i {
    font-size: 16px;
    color: var(--color-rss);
    font-weight: 900;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* RSS图标悬浮效果 - 无提示，只有视觉反馈 */
.link-card:hover .link-rss-icon {
    transform: scale(1.15);
}

.link-card:hover .link-rss-icon i {
    color: #ff5722;
    text-shadow: 0 2px 4px rgba(255, 107, 53, 0.3);
}

/* ============================================
   9. 申请友链弹窗
   ============================================ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-smooth);
    pointer-events: none;
}

.modal.show {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    background: var(--color-bg-primary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    transition: transform var(--transition-smooth);
}

.modal.show .modal-content {
    transform: translate(-50%, -50%) scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg-secondary);
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--color-text-primary);
}

.modal-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-bg-primary);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--color-bg-tertiary);
    color: #374151;
}

.modal-body {
    padding: 24px;
    max-height: 60vh;
    overflow-y: auto;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #374151;
    font-size: 0.9rem;
}

.form-label .required {
    color: var(--color-danger);
    margin-left: 2px;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: var(--radius-sm);
    background: var(--color-bg-primary);
    color: var(--color-text-primary);
    font-size: 0.9rem;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--color-info);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.form-helper {
    margin-top: 4px;
    font-size: 0.8rem;
    color: var(--color-text-secondary);
}

.form-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 12px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: var(--radius-sm);
}

.form-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    flex-shrink: 0;
    cursor: pointer;
}

.form-checkbox label {
    margin: 0;
    font-size: 0.9rem;
    color: #0c4a6e;
    line-height: 1.4;
    cursor: pointer;
}

.form-checkbox .required {
    color: #dc2626;
    font-weight: 600;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--color-border);
    background: var(--color-bg-secondary);
}

.modal-cancel {
    padding: 8px 16px;
    border: 1px solid #d1d5db;
    border-radius: var(--radius-sm);
    background: var(--color-bg-primary);
    color: var(--color-text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.modal-cancel:hover {
    background: var(--color-bg-tertiary);
    color: #374151;
}

.modal-submit {
    padding: 8px 20px;
    border: 1px solid var(--color-info);
    border-radius: var(--radius-sm);
    background: var(--color-info);
    color: var(--color-bg-primary);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.modal-submit:hover:not(:disabled) {
    background: #2563eb;
    border-color: #2563eb;
}

.modal-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: var(--color-text-muted);
    border-color: var(--color-text-muted);
}

/* ============================================
   10. 友链检测说明
   ============================================ */
.link-checker-notice {
    margin-top: 40px;
    padding: 20px 0;
    border-top: 1px solid var(--color-border);
}

.notice-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    text-align: center;
    line-height: 1.5;
}

.notice-content i {
    color: var(--color-info);
    font-size: 1rem;
    flex-shrink: 0;
}

.notice-content span {
    max-width: 800px;
}

/* ============================================
   11. 响应式设计
   ============================================ */
@media (max-width: 1024px) {
    .links-hero .hero-inner {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .links-cards {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}

@media (max-width: 768px) {
    .capsule-buttons {
        padding: 6px;
        gap: 3px;
    }
    
    .capsule-btn {
        width: 44px;
        height: 44px;
        font-size: 16px;
    }
    
    .links-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .link-name {
        font-size: 0.9rem;
    }
    
    .link-desc {
        font-size: 0.8rem;
    }
    
    .link-rating .star {
        width: 10px;
        height: 10px;
        font-size: 10px;
    }
    
    /* RSS图标响应式调整 */
    .link-rss-icon {
        width: 18px;
        height: 18px;
        left: 6px;
        bottom: 6px;
    }
    
    .link-rss-icon i {
        font-size: 9px;
    }
    
    .link-checker-notice {
        margin-top: 30px;
        padding: 16px 0;
    }
    
    .notice-content {
        flex-direction: column;
        gap: 6px;
        font-size: 0.8rem;
        padding: 0 16px;
    }
}

@media (max-width: 480px) {
    .capsule-buttons {
        padding: 4px;
        gap: 2px;
    }
    
    .capsule-btn {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
    
    .links-cards {
        grid-template-columns: 1fr;
    }
    
    .link-card {
        padding: 12px;
    }
    
    .link-avatar,
    .avatar-fallback {
        width: 40px;
        height: 40px;
    }
    
    .links-hero .page-title {
        font-size: 1.875rem;
    }
    
    .hero-text {
        font-size: 0.9rem;
    }
    
    /* RSS图标小屏调整 */
    .link-rss-icon {
        width: 16px;
        height: 16px;
        left: 6px;
        bottom: 6px;
    }
    
    .link-rss-icon i {
        font-size: 8px;
    }
}

/* ============================================
   12. 深色模式适配
   ============================================ */
@media (prefers-color-scheme: dark) {
    :root {
        --color-text-primary: #f9fafb;
        --color-text-secondary: #d1d5db;
        --color-text-muted: #9ca3af;
        
        --color-bg-primary: #1f2937;
        --color-bg-secondary: #374151;
        --color-bg-tertiary: #4b5563;
        
        --color-border: #374151;
        --color-border-light: #4b5563;
        
        /* RSS图标深色模式颜色 */
        --color-rss: #ff8c42;
        --color-rss-dark: #ffa726;
        --shadow-rss: 0 2px 8px rgba(255, 140, 66, 0.3);
        --shadow-rss-hover: 0 4px 12px rgba(255, 140, 66, 0.4);
    }
    
    .capsule-buttons {
        background: rgba(17, 24, 39, 0.8);
        border-color: rgba(75, 85, 99, 0.3);
    }
    
    .capsule-btn {
        color: var(--color-text-muted);
    }
    
    .capsule-btn:hover {
        color: var(--color-text-primary);
    }
    
    .link-status {
        background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
        border-color: #475569;
        color: #cbd5e1;
    }
    
    .category-stats {
        background: linear-gradient(135deg, #451a03 0%, #78350f 100%);
        border-color: #a16207;
        color: #fcd34d;
    }
    
    .link-card.is-unavailable {
        background: #451a1a;
        border-color: #991b1b;
    }
    
    .link-card.is-unavailable .link-name {
        color: #f87171;
    }
    
    .link-card.is-unavailable .link-desc {
        color: #fca5a5;
    }
    
    .link-rating .star.empty {
        color: var(--color-bg-tertiary);
    }
    
    .no-links {
        border-color: var(--color-border);
        color: var(--color-text-secondary);
        background: var(--color-bg-secondary);
    }
    
    .notice-content {
        color: var(--color-text-muted);
    }
    
    .notice-content i {
        color: #60a5fa;
    }
    
    /* RSS图标深色模式样式 */
    .link-rss-icon {
        background: linear-gradient(135deg, var(--color-rss-dark), #ffa726);
        box-shadow: var(--shadow-rss);
    }
    
    .link-card:hover .link-rss-icon {
        box-shadow: var(--shadow-rss-hover);
    }
}

/* 毛玻璃效果增强 */
@supports (backdrop-filter: blur(10px)) {
    .capsule-buttons {
        background: rgba(255, 255, 255, 0.7);
        backdrop-filter: blur(10px);
    }
    
    @media (prefers-color-scheme: dark) {
        .capsule-buttons {
            background: rgba(17, 24, 39, 0.7);
        }
    }
}

/* 可访问性：确保在高对比度模式下仍然可见 */
@media (prefers-contrast: high) {
    .link-rss-icon {
        border: 1px solid rgba(255, 255, 255, 0.2);
    }
}

/* 移除可能的多余样式冲突 */
.links-actions,
.links-buttons {
    border-bottom: none !important;
    margin-bottom: 0;
}

.links-section::before,
.links-container::before,
.links-actions::before,
.links-actions::after {
    display: none !important;
}

/* ============================================
   4. 状态信息区域 - 重写版
   ============================================ */
.links-status-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-bottom: 30px;
}

/* 友链状态信息卡片 */
#linkStatus {
    display: none;
    background: linear-gradient(135deg, var(--color-bg-primary) 0%, var(--color-bg-secondary) 100%);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 16px 24px;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
    min-width: 300px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

#linkStatus::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--color-info), transparent);
    animation: status-scan 2s ease-in-out;
}

#linkStatus i {
    color: var(--color-info);
    margin-right: 8px;
    font-size: 16px;
}

#linkStatus strong {
    color: var(--color-text-primary);
    font-weight: 600;
}

/* 扫描动画 */
@keyframes status-scan {
    0% {
        left: -100%;
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
    100% {
        left: 100%;
        opacity: 0;
    }
}

/* 淡入淡出动画 */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.fade-out {
    animation: fadeOut 0.5s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* ============================================
   响应式调整 - 状态信息区域
   ============================================ */
@media (max-width: 768px) {
    .links-status-area {
        gap: 12px;
        margin-bottom: 24px;
    }
    
    #linkStatus {
        min-width: 260px;
        max-width: 90vw;
        padding: 14px 18px;
    }
}

@media (max-width: 480px) {
    #linkStatus {
        min-width: 240px;
        padding: 12px 16px;
        border-radius: 12px;
    }
}

/* ============================================
   深色模式适配 - 状态信息区域
   ============================================ */
@media (prefers-color-scheme: dark) {
    #linkStatus {
        background: linear-gradient(135deg, var(--color-bg-primary) 0%, rgba(0, 0, 0, 0.3) 100%);
        border-color: var(--color-border);
        backdrop-filter: blur(15px);
    }
}

/* Hero区域按钮样式 - 移动到左下角 */
.hero-left {
    position: relative;
    min-height: 140px;
}

.hero-actions {
    position: absolute;
    bottom: -30px;
    left: -10px;
    z-index: 10;
    display: flex;
    justify-content: flex-start;
    padding: 0;
    margin: 0;
    border: none;
}

.hero-actions .capsule-buttons {
    display: flex;
    gap: 12px;
    align-items: center;
    background: none; /* 移除背景 */
    backdrop-filter: none; /* 移除毛玻璃效果 */
    padding: 0; /* 移除内边距 */
    border-radius: 0; /* 移除圆角 */
    border: none; /* 移除边框 */
    box-shadow: none; /* 移除阴影 */
}

/* 在hero区域中的按钮稍微小一点 */
.hero-actions .capsule-btn {
    width: 44px;
    height: 44px;
    font-size: 16px;
    border: 1px solid var(--color-border);
    background: var(--color-bg-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.hero-actions .capsule-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* 深色模式适配 */
@media (prefers-color-scheme: dark) {
    .hero-actions .capsule-buttons {
        background: none; /* 确保深色模式下也没有背景 */
        border: none; /* 确保深色模式下也没有边框 */
    }
}

/* 响应式调整 */
@media (max-width: 768px) {
    .hero-actions {
        position: static;
        justify-content: center;
        margin-top: 16px;
        padding-top: 12px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .hero-actions .capsule-buttons {
        gap: 8px;
        padding: 0; /* 移除内边距 */
        border-radius: 0; /* 移除圆角 */
    }
    
    .hero-actions .capsule-btn {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .hero-actions .capsule-buttons {
        gap: 6px;
        padding: 0; /* 移除内边距 */
        border-radius: 0; /* 移除圆角 */
    }
    
    .hero-actions .capsule-btn {
        width: 36px;
        height: 36px;
        font-size: 12px;
    }
}

/* 确保按钮容器不影响友链头像墙 */
.friends-wall {
    position: absolute;
    inset: -20px;
    display: grid;
    grid-template-columns: repeat(14, 48px);
    grid-template-rows: repeat(4, 48px);
    gap: 8px;
    opacity: 0.1;
    pointer-events: none;
    justify-content: center;
    align-content: center;
    overflow: hidden;
    z-index: 0;
}

/* 确保内容层级正确 */
.hero-content {
    position: relative;
    z-index: 5;
    display: flex;
    flex-direction: column;
}

/* 移除站点卡片中的按钮容器样式冲突 */
.site-card .hero-actions {
    display: none !important;
}