:root {
    --bg: #f8fafc;
    --ink: #0f172a;
    --muted: #64748b;
    --brand: #2563eb;
    --glass: rgba(255, 255, 255, 0.7);
    --border: rgba(226, 232, 240, 0.8);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

* { box-sizing: border-box; transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1); }

body {
    margin: 0; min-height: 100vh;
    font-family: 'Inter', system-ui, sans-serif;
    color: var(--ink); background-color: var(--bg);
    line-height: 1.5;
}

/* 极简极光背景 */
body::before {
    content: ""; position: fixed; inset: 0; z-index: -1;
    background: radial-gradient(circle at 50% -10%, rgba(37, 99, 235, 0.05), transparent 70%);
}

.directory-shell {
    width: min(1200px, calc(100% - 40px));
    margin: 32px auto;
}

/* Header：极致精简 */
.hero { text-align: center; margin-bottom: 32px; }
.hero h1 {
    font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 8px;
    background: linear-gradient(135deg, var(--ink), var(--brand));
    -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-subtitle { font-size: 14px; color: var(--muted); margin: 0; }

/* 搜索栏：秩序美感 */
.toolbar.panel {
    position: sticky; top: 16px; z-index: 100;
    margin-bottom: 40px; padding: 6px; border-radius: 14px;
    background: var(--glass); backdrop-filter: blur(20px);
    border: 1px solid var(--border); box-shadow: var(--shadow);
}
.toolbar-row { display: flex; gap: 8px; align-items: stretch; }
.search-box { flex: 2; }
.filter-box { flex: 1; min-width: 140px; }

input, select {
    width: 100%; border: 1px solid transparent; border-radius: 10px;
    padding: 10px 16px; font-size: 14px; background: rgba(255, 255, 255, 0.5);
    color: var(--ink); outline: none; height: 44px;
}
input:focus, select:focus { border-color: var(--brand); background: white; box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1); }

/* 卡片网格：严谨矩阵 */
.site-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.site-card {
    display: flex; flex-direction: column; justify-content: space-between;
    height: 100%;
    padding: 20px 24px; border-radius: 20px; background: var(--glass);
    border: 1px solid var(--border); box-shadow: var(--shadow);
    position: relative;
}
.site-card:hover { transform: translateY(-4px); box-shadow: 0 12px 20px -8px rgba(0, 0, 0, 0.08); background: white; }

/* 置顶站点：用边框强调而非改变布局 */
.site-card-pinned { border: 1.5px solid rgba(37, 99, 235, 0.3); background: white; }
.site-card-pinned::after {
    content: "Pinned"; position: absolute; top: 12px; right: 12px;
    font-size: 10px; font-weight: 800; color: var(--brand);
    text-transform: uppercase; letter-spacing: 0.1em;
}

.site-icon {
    width: 48px; height: 48px; border-radius: 12px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: #fff; border: 1px solid var(--border); font-size: 20px;
}
.site-icon img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; }

/* 站点内容：横向布局并强制两行截断 */
.site-body { display: flex; gap: 16px; align-items: flex-start; }
.site-copy { margin-top: 2px; flex: 1; min-width: 0; }
.site-copy h3 { font-size: 18px; font-weight: 700; margin: 0 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-copy p {
    font-size: 13.5px; color: var(--muted);
    display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; text-overflow: ellipsis; margin: 0;
}

/* 卡片页脚：对齐底部 */
.site-card-foot {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 16px; padding-top: 16px; border-top: 1px solid rgba(0, 0, 0, 0.03);
}
.site-category { font-size: 11px; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: 0.05em; background: rgba(37, 99, 235, 0.08); padding: 4px 8px; border-radius: 6px; }
.site-link {
    background: rgba(37, 99, 235, 0.1); color: var(--brand); padding: 8px 16px;
    border-radius: 10px; font-size: 13px; font-weight: 600; text-decoration: none; border: none; cursor: pointer;
    transition: all 0.3s ease; display: inline-block;
}
.site-link:not(.disabled-link):hover { 
    background: var(--brand); color: white; 
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.disabled-link { background: rgba(148, 163, 184, 0.1); color: var(--muted); cursor: not-allowed; }

/* 响应式适配：确保移动端也整齐 */
@media (max-width: 640px) {
    .site-grid { grid-template-columns: 1fr; }
    .toolbar-row { flex-direction: row; }
    .filter-box { min-width: 100px; }
}
