/* 导航网站 CSS - 完全按照 xydh.fun 的样式 */

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

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

:root {
    --bg-primary: #f1f0f5;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-card-hover: rgba(255, 255, 255, 0.95);
    --text-primary: #222;
    --text-secondary: #666;
    --text-muted: #939393;
    --border-color: rgba(0, 0, 0, 0.08);
    --accent-color: #1890ff;
    --accent-hover: #40a9ff;
    --success-color: #52c41a;
    --warning-color: #faad14;
    --danger-color: #ff4d4f;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
    --transition: all 0.3s ease;
    --border-radius: 6px;
    --border-radius-lg: 10px;
}

html {
    font-size: 14px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg-primary);
    color: #fff;
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

.page-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    pointer-events: none;
}

.page-background::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
}

.stars-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stars-bg::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at bottom, #1B2735 0%, #090A0F 100%);
    z-index: -4;
}

.star {
    position: absolute;
    background: #fff;
    border-radius: 50%;
    opacity: 0.5;
    animation: twinkle var(--duration, 3s) infinite ease-in-out;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

.container {
    width: 100%;
    margin: 0 auto;
    padding: 0 10px;
}

.top-toolbar {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 100;
    display: flex;
    gap: 10px;
}

.toolbar-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    padding: 0;
}

.toolbar-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.toolbar-btn svg {
    width: 18px;
    height: 18px;
}

.site-header {
    text-align: center;
    padding: 40px 0 20px;
    margin-bottom: 20px;
}

.site-title {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 10px;
    color: #fff;
}

.site-description {
    font-size: 0.9rem;
    color: #fff;
}

.search-container {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.search-box {
    width: 100%;
    max-width: 600px;
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 25px;
    padding: 0 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: var(--transition);
    height: 40px;
    box-shadow: var(--shadow);
    filter: invert(0.15);
}

.search-box:hover,
.search-box:focus-within {
    box-shadow: var(--shadow-hover);
    border-color: var(--accent-color);
}

.search-engine-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.search-engine-btn img {
    width: 18px;
    height: 18px;
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 0.9rem;
    padding: 10px 15px;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.search-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.search-btn:hover {
    color: var(--accent-color);
}

.search-engines-dropdown {
    display: none;
    position: fixed;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 10px;
    z-index: 1000;
    min-width: 200px;
    box-shadow: var(--shadow-hover);
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.search-engines-dropdown.show {
    display: block;
}

.search-engine-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    cursor: pointer;
    transition: var(--transition);
    color: #fff;
}

.search-engine-item:hover {
    background: rgba(24, 144, 255, 0.2);
}

.search-engine-item img {
    width: 16px;
    height: 16px;
}

.footprints-panel {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.footprints-toggle {
    color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
}

.footprints-toggle:hover {
    color: var(--accent-color);
}

.footprints-list {
    display: none;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 10px;
}

.footprints-list.show {
    display: flex;
}

.footprint-item {
    display: inline-block;
    padding: 6px 12px;
    background: var(--bg-card);
    border-radius: 15px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.footprint-item:hover {
    background: var(--bg-card-hover);
    color: var(--accent-color);
}

/* ========== 首页导航网格 - xydh.fun 风格 ========== */
.nav-grid {
    padding: 10px 130px 30px; /* 两侧固定留白 130px */
    display: grid;
    grid-gap: 20px;
    /* 使用 auto-fill 配合 minmax，确保卡片自动填满宽度 */
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); /* 增加最小宽度以容纳长标题 */
    width: 100%;
    max-width: none; /* 取消最大宽度限制 */
    margin: 0 auto;
    box-sizing: border-box;
}

@media (max-width: 1200px) {
    .nav-grid {
        padding: 10px 60px 30px; /* 中等屏幕减少留白 */
    }
}

@media (max-width: 768px) {
    .nav-grid {
        padding: 10px 20px 30px; /* 小屏幕进一步减少留白 */
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

/* 移除固定列数的媒体查询，让 auto-fill 自动处理，确保填满右侧 */
@media (max-width: 600px) {
    .nav-grid {
        padding: 10px 15px 30px;
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
}

@media (max-width: 480px) {
    .nav-grid {
        grid-template-columns: 1fr;
    }
}

/* 分类卡片 - xydh.fun 深色毛玻璃风格 */
/* 分类卡片 - 固定5行高度（增加高度确保显示全） */
.category-card {
    height: 240px;
    max-height: 240px;
    border-radius: 20px;
    overflow: hidden;
    -webkit-backdrop-filter: blur(1.5px);
    backdrop-filter: blur(1.5px);
    border-bottom: 1px solid hsla(0, 0%, 100%, 0.4);
    border-right: 1px solid hsla(0, 0%, 100%, 0.4);
    -webkit-box-shadow: rgba(0, 0, 0, 0.3) -1px -1px 5px;
    box-shadow: -1px -1px 5px rgba(0, 0, 0, 0.3);
    padding: 13px 0;
    font-size: 13px;
    -webkit-transition: all 0.3s;
    transition: all 0.3s;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.category-card:hover {
    color: #fff;
    background: rgba(0, 0, 0, 0.3);
}

.category-card.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 分类头部 */
.category-header {
    position: relative;
    min-height: 50px;
    padding: 8px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.category-title {
    font-size: 16px;
    letter-spacing: 0;
    font-weight: bolder;
    margin: 0;
    cursor: default;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
    text-align: center;
}

.category-title-text {
    word-break: break-word;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    line-height: 1.4;
}

.category-icon {
    font-size: 1rem;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.category-toggle {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
    font-size: 0.75rem;
}

.category-toggle:hover {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
}

/* 链接列表 - 固定5行高度，超出滚动但隐藏滚动条 */
.links-list {
    padding: 0 6px;
    display: grid;
    justify-content: flex-start;
    grid-gap: 0;
    grid-template-columns: repeat(3, 1fr);
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.links-list::-webkit-scrollbar {
    display: none;
}

.link-item {
    min-height: 33px;
    max-height: 33px;
    cursor: pointer;
    text-align: left;
    padding: 0 10px; /* 减少内边距以腾出更多空间给文字 */
    display: flex;
    align-items: center;
    gap: 6px; /* 缩小图标和文字间距 */
    color: #fff;
    text-decoration: none;
    transition: var(--transition);
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
}

.link-item .linkContent {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.link-item .icon {
    width: 16px;
    display: inline-block;
    text-align: center;
    flex-shrink: 0;
}

.link-item:hover .linkName::before {
    -webkit-transform: scaleY(0.5);
    transform: scaleY(0.5);
}

.link-item .linkName {
    position: relative;
    margin-left: 1px;
}

.link-item .linkName::before {
    content: '';
    position: absolute;
    color: inherit;
    bottom: -2px;
    width: 100%;
    height: 1px;
    opacity: 1;
    border-style: solid;
    border-bottom: 1px;
    -webkit-transform: scale3d(0, 0.5, 1);
    transform: scale3d(0, 0.5, 1);
    -webkit-transform-origin: 0 50%;
    transform-origin: 0 50%;
    -webkit-transition: -webkit-transform 1s;
    transition: -webkit-transform 1s;
    transition: transform 1s;
    transition: transform 1s, -webkit-transform 1s;
    -webkit-transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
    transition-timing-function: cubic-bezier(0.2, 1, 0.3, 1);
}

.link-item:hover {
    color: #87cefa;
}

/* 悬停描述框已移除，改用分类标题上方的透明描述框 */

.link-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    border-radius: 4px;
    object-fit: contain;
    display: inline-block;
    text-align: center;
}

.link-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 模态链接项 */
.modal-link-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--border-radius);
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.9rem;
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid transparent;
    cursor: pointer;
    min-height: 36px;
}

.modal-link-item:hover {
    background: rgba(24, 144, 255, 0.08);
    border-color: rgba(24, 144, 255, 0.2);
    color: var(--accent-color);
}

.modal-link-item img {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border-radius: 4px;
}

/* ========== 登录/注册页面样式 ========== */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-box {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--border-radius-lg);
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-hover);
    border: 1px solid var(--border-color);
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 30px;
    color: var(--text-primary);
}

.auth-links {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.auth-links a {
    color: var(--accent-color);
    text-decoration: none;
    transition: var(--transition);
}

.auth-links a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* ========== 排行榜页面样式 ========== */
.ranking-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px 20px;
}

.ranking-title {
    font-size: 2rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 30px;
    color: var(--text-primary);
}

.ranking-tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 25px;
    min-height: 40px;
}

.ranking-tab {
    padding: 8px 24px;
    border-radius: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.ranking-tab:hover {
    background: var(--bg-card-hover);
    color: var(--accent-color);
}

.ranking-tab.active {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
}

.ranking-search {
    max-width: 400px;
    margin: 0 auto 25px;
}

.ranking-search input {
    width: 100%;
    padding: 10px 16px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
}

.ranking-search input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.1);
}

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

.ranking-table {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    min-height: 400px;
}

.ranking-row {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.ranking-row:last-child {
    border-bottom: none;
}

.ranking-row:hover {
    background: rgba(24, 144, 255, 0.04);
}

.rank-number {
    width: 50px;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--accent-color);
    text-align: center;
    flex-shrink: 0;
}

.rank-info {
    flex: 1;
    min-width: 0;
}

.rank-name {
    display: block;
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    margin-bottom: 4px;
}

.rank-name:hover {
    text-decoration: underline;
}

.rank-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-views {
    width: 120px;
    text-align: right;
    font-size: 0.85rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.1);
}

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

/* 按钮 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: var(--accent-color);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
}

.btn-danger {
    background: var(--danger-color);
    color: #fff;
}

.btn-danger:hover {
    opacity: 0.8;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

/* 标签和徽章 */
.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.tag-primary {
    background: rgba(24, 144, 255, 0.1);
    color: var(--accent-color);
}

.tag-success {
    background: rgba(82, 196, 26, 0.1);
    color: var(--success-color);
}

.tag-warning {
    background: rgba(250, 173, 20, 0.1);
    color: var(--warning-color);
}

.tag-danger {
    background: rgba(255, 77, 79, 0.1);
    color: var(--danger-color);
}

/* 提示消息 */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 20px;
    background: var(--bg-card);
    color: var(--text-primary);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    z-index: 3000;
    opacity: 0;
    transform: translateY(20px);
    transition: var(--transition);
    box-shadow: var(--shadow-hover);
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    border-color: var(--success-color);
    color: var(--success-color);
}

.toast.error {
    border-color: var(--danger-color);
    color: var(--danger-color);
}

/* ========== 后台管理布局 ========== */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 220px;
    background: #f5f5f5;
    border-right: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
    padding: 20px 0;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
    box-shadow: var(--shadow);
}

.admin-logo {
    padding: 0 20px 20px;
    font-size: 1.2rem;
    font-weight: 600;
    color: #222;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 15px;
}

.admin-logo a {
    color: inherit;
    text-decoration: none;
}

.admin-nav {
    list-style: none;
    padding: 0 10px;
    margin: 0;
}

.admin-nav-item {
    margin-bottom: 4px;
}

.admin-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    color: #666;
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: var(--transition);
    font-size: 0.9rem;
}

.admin-nav-link:hover {
    background: rgba(24, 144, 255, 0.08);
    color: var(--accent-color);
}

.admin-nav-link.active {
    background: rgba(24, 144, 255, 0.12);
    color: var(--accent-color);
    font-weight: 500;
}

.admin-nav-link svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.admin-main {
    flex: 1;
    margin-left: 220px;
    background: #f1f0f5;
    padding: 30px;
    overflow-y: auto;
    color: #333;
}

.admin-main h1,
.admin-main h2,
.admin-main h3,
.admin-main h4,
.admin-main h5,
.admin-main h6 {
    color: #222;
}

.admin-main p,
.admin-main span,
.admin-main div {
    color: inherit;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.admin-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: #222;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: var(--border-radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
}

.stat-label {
    color: #999;
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #222;
}

.stat-value.accent {
    color: #1890ff;
}

.stat-value.success {
    color: #52c41a;
}

.stat-value.warning {
    color: #faad14;
}

.stat-value.accent {
    color: var(--accent-color);
}

.stat-value.success {
    color: var(--success-color);
}

.stat-value.warning {
    color: var(--warning-color);
}

/* 排行榜和后台管理独立样式 */
.ranking-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.ranking-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.ranking-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.admin-table thead {
    background: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
}

.admin-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #222;
    font-size: 0.9rem;
}

.admin-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e0e0e0;
    color: #666;
    font-size: 0.9rem;
}

.admin-table tbody tr:hover {
    background: rgba(24, 144, 255, 0.04);
}

.admin-table tbody tr:last-child td {
    border-bottom: none;
}

/* 后台数据表格样式 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid #e0e0e0;
}

.data-table thead {
    background: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
}

.data-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #222;
    font-size: 0.9rem;
}

.data-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e0e0e0;
    color: #444;
    font-size: 0.9rem;
}

.data-table tbody tr:hover {
    background: rgba(24, 144, 255, 0.04);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 0.95rem;
}

/* 加载动画 */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.loading::after {
    content: '';
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 链接项（后台） */
.link-item-admin {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--border-radius);
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid transparent;
    transition: var(--transition);
}

.link-item-admin:hover {
    background: rgba(24, 144, 255, 0.08);
    border-color: rgba(24, 144, 255, 0.2);
}

.link-item-admin img {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    border-radius: 2px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .admin-sidebar {
        width: 200px;
    }

    .admin-main {
        margin-left: 200px;
        padding: 20px;
    }

    .ranking-row {
        flex-wrap: wrap;
    }

    .rank-info {
        flex: 1 100%;
    }

    .rank-views {
        width: 100%;
        text-align: left;
        margin-top: 8px;
    }

    .nav-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media (max-width: 480px) {
    .admin-sidebar {
        width: 180px;
    }

    .admin-main {
        margin-left: 180px;
        padding: 15px;
    }

    .admin-title {
        font-size: 1.5rem;
    }

    .site-title {
        font-size: 1.8rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .nav-grid {
        grid-template-columns: 1fr;
    }
}

/* 实用类 */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

.p-20 {
    padding: 20px;
}

.hidden {
    display: none;
}

.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.gap-10 {
    gap: 10px;
}

/* 全屏展开遮罩 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(50, 50, 50, 0.4);
    z-index: 999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}

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

.modal-box {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--border-radius-lg);
    width: 90%;
    max-width: 1000px;
    max-height: 80vh;
    overflow: hidden;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-hover);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: #fff;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--accent-color);
    transform: scale(1.1);
}

.modal-links-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 20px 30px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
}

.modal-links-grid::-webkit-scrollbar {
    width: 6px;
}

.modal-links-grid::-webkit-scrollbar-track {
    background: transparent;
}

.modal-links-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.modal-links-grid::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* 模态框链接项 - 横向布局：左侧图标 + 右侧标题和描述 */
.modal-link-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    border-radius: var(--border-radius);
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    text-align: left;
    min-height: 70px;
    position: relative;
    /* 允许发光层溢出到卡片边缘外 */
    overflow: visible;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
}

.modal-link-item:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.35);
    color: #fff;
    transform: translateY(-2px);
}

/* 模态框卡片边缘发光效果 - 使用 box-shadow 实现从边缘向外扩散 */
.modal-link-item {
    transition: all 0.3s ease, box-shadow 0.4s ease;
    z-index: 1;
    position: relative;
    /* 移除之前的 scale 逻辑，确保发光层不偏移 */
}

.modal-link-item:hover {
    border-color: rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-3px);
    /* 默认发光颜色，JS 会根据 logo 颜色动态覆盖此值 */
    box-shadow: 0 0 25px rgba(255, 255, 255, 0.25);
}

/* 隐藏旧的发光层元素 */
.modal-link-icon-glow {
    display: none !important;
}

/* 模态框图标容器 */
.modal-link-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    z-index: 1;
}

.modal-link-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: contain;
    position: relative;
    z-index: 1;
}

/* 模态框链接文字容器 */
.modal-link-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.modal-link-name {
    font-size: 0.95rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #fff;
}

.modal-link-desc {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.65);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.4;
}

@media (max-width: 1200px) {
    .modal-links-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .modal-links-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-header {
        padding: 15px 20px;
    }
    
    .modal-links-grid {
        padding: 15px 20px;
    }
}

/* ========== 分类描述透明框 ========== */
.category-desc-box {
    position: fixed;
    display: none;
    background: rgba(30, 30, 30, 0.5);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: rgba(255, 255, 255, 0.95);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.4;
    z-index: 1000;
    border: 1px solid rgba(255, 255, 255, 0.15);
    max-height: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    pointer-events: none;
}
