@import url('tokens.css');

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-hover); }

.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 480px; }
.main { min-height: calc(100vh - var(--header-h) - 120px); }

/* ── Header ── */
.header {
    position: sticky; top: 0; z-index: 200;
    background: var(--bg-glass);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    display: flex; align-items: center; gap: 20px;
    height: var(--header-h);
}
.logo {
    display: flex; align-items: center; gap: 10px;
    font-size: 17px; font-weight: 700; color: var(--text); flex-shrink: 0;
}
.logo-icon {
    width: 32px; height: 32px; border-radius: 8px;
    background: var(--primary); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.nav { display: flex; gap: 4px; flex: 1; }
.nav a {
    padding: 6px 12px; border-radius: var(--radius-sm);
    color: var(--text-muted); font-size: 14px; font-weight: 500;
}
.nav a:hover, .nav a.active { color: var(--text); background: var(--border); }
.header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.header-search { position: relative; }
.header-search input {
    width: 200px; padding: 7px 12px 7px 34px;
    background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius); color: var(--text); font-size: 13px;
    transition: border-color var(--transition), width var(--transition);
}
.header-search input:focus { outline: none; border-color: var(--primary); width: 240px; }
.header-search .search-icon {
    position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); font-size: 14px; pointer-events: none;
}
.mobile-menu-btn {
    display: none; background: none; border: 1px solid var(--border);
    color: var(--text); width: 36px; height: 36px; border-radius: var(--radius-sm);
    cursor: pointer; font-size: 18px; align-items: center; justify-content: center;
}
.mobile-nav {
    display: none; position: fixed; inset: var(--header-h) 0 0 0;
    background: var(--bg-elevated); z-index: 190; padding: 16px 20px;
    border-top: 1px solid var(--border); overflow-y: auto;
}
.mobile-nav.open { display: block; }
.mobile-nav a {
    display: block; padding: 12px 0; color: var(--text);
    border-bottom: 1px solid var(--border); font-size: 15px;
}

/* ── Buttons ── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 8px 16px; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500;
    border: 1px solid transparent; cursor: pointer; transition: all var(--transition);
    background: var(--bg-hover); color: var(--text); white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); color: #fff; border-color: var(--primary-hover); }
.btn-outline { background: transparent; border-color: var(--border-strong); color: var(--text-secondary); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-muted); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--border); color: var(--text); }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-lg { padding: 11px 24px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-icon { padding: 6px; width: 32px; height: 32px; }

/* ── Hero V3 ── */
.hero-v3 {
    padding: 36px 0 28px;
    border-bottom: 1px solid var(--border);
    background:
        radial-gradient(ellipse 80% 60% at 50% -20%, rgba(99, 102, 241, 0.12), transparent),
        var(--bg);
}
.hero-v3-inner { display: grid; grid-template-columns: 1fr auto; gap: 32px; align-items: center; }
.hero-v3-text h1 {
    font-size: clamp(26px, 4vw, 36px); font-weight: 700; letter-spacing: -0.02em;
    margin-bottom: 8px; color: var(--text);
}
.hero-v3-text .hero-slogan { font-size: 15px; color: var(--text-muted); margin-bottom: 20px; }
.hero-v3-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.hero-search {
    flex: 1; min-width: 220px; max-width: 420px; position: relative;
}
.hero-search input {
    width: 100%; padding: 11px 16px 11px 40px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); color: var(--text); font-size: 14px;
}
.hero-search input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-muted); }
.hero-search .search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }

/* Stats cards */
.stats-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
}
.stat-card-v3 {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 14px 16px;
    transition: border-color var(--transition), transform var(--transition);
}
.stat-card-v3:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.stat-card-v3 .stat-value {
    display: block; font-size: 22px; font-weight: 700; letter-spacing: -0.02em;
    color: var(--text); line-height: 1.2;
}
.stat-card-v3 .stat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.stat-card-v3 .stat-trend {
    font-size: 11px; color: var(--success); margin-top: 4px;
}
.stat-card-v3.stat-highlight { border-color: rgba(99, 102, 241, 0.3); background: var(--primary-muted); }
.stat-card-v3.stat-highlight .stat-value { color: var(--primary-hover); }

/* ── Sections ── */
.section { padding: 32px 0; }
.section-compact { padding: 24px 0; }
.section-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 18px; gap: 12px;
}
.section-header h2 {
    font-size: 18px; font-weight: 600; letter-spacing: -0.01em;
    display: flex; align-items: center; gap: 8px;
}
.section-header h2 .section-icon { font-size: 16px; opacity: 0.8; }
.section-tabs { display: flex; gap: 6px; }
.section-tab {
    padding: 5px 12px; border-radius: 20px; font-size: 12px; font-weight: 500;
    color: var(--text-muted); background: transparent; border: 1px solid var(--border);
    cursor: pointer; transition: all var(--transition);
}
.section-tab.active, .section-tab:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.more-link { font-size: 13px; color: var(--text-muted); white-space: nowrap; }
.more-link:hover { color: var(--primary); }

/* ── Site Grid & Cards V3 ── */
.site-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
}
.site-grid-dense { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }

.site-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
    display: flex; flex-direction: column; gap: 0;
}
.site-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--border-strong);
}

.card-header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.site-logo { width: 44px; height: 44px; border-radius: var(--radius); object-fit: cover; flex-shrink: 0; border: 1px solid var(--border); }
.site-logo-placeholder, .rank-logo-placeholder, .detail-logo-placeholder {
    width: 44px; height: 44px; border-radius: var(--radius);
    background: linear-gradient(135deg, var(--primary), #818cf8);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 18px; flex-shrink: 0;
}
.card-title-wrap { flex: 1; min-width: 0; }
.site-title {
    font-size: 15px; font-weight: 600; color: var(--text);
    display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.site-url { font-size: 12px; color: var(--text-muted); display: block; margin-top: 1px; }
.card-badges { display: flex; gap: 4px; flex-wrap: wrap; flex-shrink: 0; }
.site-desc {
    font-size: 13px; color: var(--text-muted); line-height: 1.55;
    margin-bottom: 12px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.card-meta {
    display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
    margin-bottom: 12px; font-size: 11px;
}
.seo-score { color: var(--warning); font-weight: 600; }
.star-rating { color: var(--warning); letter-spacing: -1px; font-size: 11px; }
.card-stats {
    display: flex; flex-wrap: wrap; gap: 10px; font-size: 11px; color: var(--text-muted);
    padding: 10px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
}
.card-stats span { display: flex; align-items: center; gap: 3px; }
.card-actions { display: flex; gap: 8px; margin-top: auto; }
.card-actions .btn { flex: 1; justify-content: center; }
.card-actions .btn-primary { flex: 1.5; }
.card-footer { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--text-muted); flex-wrap: wrap; }
.card-footer .btn { margin-left: auto; }
.growth-badge { font-size: 11px; }

/* Badges & Tags */
.badge { font-size: 10px; padding: 2px 7px; border-radius: 4px; font-weight: 600; letter-spacing: 0.02em; }
.badge-hot { background: var(--danger-muted); color: #f87171; }
.badge-fast { background: var(--success-muted); color: #4ade80; }
.badge-auth { background: rgba(168, 85, 247, 0.15); color: #c084fc; }
.badge-verified { background: var(--success-muted); color: #4ade80; }
.badge-auth-expired { background: rgba(100, 116, 139, 0.15); color: #94a3b8; }
.badge-pending { background: var(--warning-muted); color: #fbbf24; }
.badge-green { background: var(--success-muted); color: #4ade80; }
.badge-gray { background: rgba(100, 116, 139, 0.15); color: #94a3b8; }
.badge-orange { background: var(--warning-muted); color: #fbbf24; }
.tag { font-size: 10px; padding: 2px 7px; border-radius: 4px; background: var(--bg-hover); color: var(--text-muted); }
.tag-green { background: var(--success-muted); color: #4ade80; }
.tag-blue { background: var(--primary-muted); color: #818cf8; }
.tag-red { background: var(--danger-muted); color: #f87171; }

/* Category */
.category-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.category-sections { display: flex; flex-direction: column; gap: 28px; }
.category-block-header {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.category-block-header h3 {
    display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; margin: 0;
}
.category-item {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    padding: 18px 12px; background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); transition: all var(--transition); color: var(--text); text-align: center;
}
.category-item:hover { border-color: var(--primary); background: var(--primary-muted); transform: translateY(-2px); }
.cat-icon { font-size: 26px; line-height: 1; }
.cat-name { font-size: 13px; font-weight: 500; }
.cat-count { font-size: 11px; color: var(--text-muted); }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-link {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 7px 14px; background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 20px; font-size: 13px; color: var(--text-secondary); transition: all var(--transition);
}
.tag-link:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-muted); }

/* Two-column layout */
.home-columns { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
.home-main-col { min-width: 0; }
.home-side-col { position: sticky; top: calc(var(--header-h) + 16px); }

/* Rank */
.rank-panel {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); overflow: hidden;
}
.rank-panel-header {
    padding: 14px 16px; border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
}
.rank-panel-header h3 { font-size: 15px; font-weight: 600; }
.rank-tabs { display: flex; gap: 4px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.rank-tab {
    flex: 1; text-align: center; padding: 5px 8px; border-radius: var(--radius-sm);
    font-size: 12px; color: var(--text-muted); background: transparent;
}
.rank-tab.active, .rank-tab:hover { background: var(--primary-muted); color: var(--primary); }
.rank-list { display: flex; flex-direction: column; }
.rank-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; color: var(--text); transition: background var(--transition);
    border-bottom: 1px solid var(--border);
}
.rank-item:last-child { border-bottom: none; }
.rank-item:hover { background: var(--bg-hover); }
.rank-num { width: 22px; font-weight: 700; font-size: 13px; color: var(--text-muted); text-align: center; flex-shrink: 0; }
.rank-num-1 { color: #fbbf24; }
.rank-num-2 { color: #94a3b8; }
.rank-num-3 { color: #d97706; }
.rank-logo { width: 28px; height: 28px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.rank-title { flex: 1; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-views, .rank-score { font-size: 12px; color: var(--text-muted); flex-shrink: 0; }

/* Notice */
.notice-bar {
    background: var(--primary-muted); border: 1px solid rgba(99, 102, 241, 0.2);
    padding: 10px 16px; border-radius: var(--radius); font-size: 13px;
    display: flex; gap: 24px; flex-wrap: wrap; overflow-x: auto;
}
.notice-bar span { white-space: nowrap; color: var(--text-secondary); }

/* Empty state */
.empty-state {
    text-align: center; padding: 48px 24px;
    background: var(--bg-card); border: 1px dashed var(--border);
    border-radius: var(--radius-lg); color: var(--text-muted);
}
.empty-state-icon { font-size: 32px; margin-bottom: 12px; opacity: 0.5; }
.empty-tip { text-align: center; padding: 40px; color: var(--text-muted); }

/* Skeleton */
.skeleton {
    background: linear-gradient(90deg, var(--bg-hover) 25%, var(--bg-card) 50%, var(--bg-hover) 75%);
    background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius-sm);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* Detail (keep compat) */
.detail-header { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
.detail-logo { width: 80px; height: 80px; border-radius: var(--radius-lg); }
.detail-logo-placeholder { width: 80px; height: 80px; border-radius: var(--radius-lg); font-size: 32px; }
.detail-info { flex: 1; }
.detail-info h1 { font-size: 28px; margin-bottom: 8px; letter-spacing: -0.02em; }
.detail-url { color: var(--text-muted); margin-bottom: 12px; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.detail-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.views-count { font-size: 13px; color: var(--text-muted); }
.detail-score-box { text-align: center; }
.score-circle {
    width: 80px; height: 80px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), #818cf8);
    display: flex; align-items: center; justify-content: center;
    font-size: 28px; font-weight: 800; color: #fff; margin: 0 auto 8px;
}
.detail-grid { display: grid; grid-template-columns: 1fr 300px; gap: 24px; }
.site-screenshot { width: 100%; border-radius: var(--radius); border: 1px solid var(--border); }
.info-block, .sidebar-block {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-lg); padding: 20px; margin-bottom: 16px;
}
.info-block h3, .sidebar-block h3 { margin-bottom: 12px; font-size: 15px; font-weight: 600; }
.info-list { list-style: none; }
.info-list li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.info-list li span:first-child { color: var(--text-muted); }
.seo-bars { display: flex; flex-direction: column; gap: 8px; }
.seo-bar-item { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.seo-label { width: 80px; color: var(--text-muted); }
.seo-bar { flex: 1; height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; }
.seo-bar-fill { height: 100%; background: var(--primary); border-radius: 3px; }
.seo-val { width: 30px; text-align: right; }
.similar-item { display: block; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text); }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 14px; color: var(--text-muted); }
.form-input, .form-input-lg, .auth-form input, textarea {
    width: 100%; padding: 10px 14px; background: var(--bg-card);
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    color: var(--text); font-size: 14px; transition: border-color var(--transition);
}
.form-input:focus, .form-input-lg:focus, .auth-form input:focus, textarea:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-muted);
}
.form-input-lg { padding: 14px 18px; font-size: 16px; }
.auth-form { margin-top: 24px; }
.auth-link { text-align: center; margin-top: 16px; font-size: 14px; color: var(--text-muted); }
.submit-hero { text-align: center; margin-bottom: 40px; }
.submit-form-wrap { max-width: 600px; margin: 0 auto; }
.submit-tips {
    margin-top: 32px; background: var(--bg-card); padding: 24px;
    border-radius: var(--radius-lg); border: 1px solid var(--border);
}
.submit-tips ul { padding-left: 20px; margin-top: 12px; }
.submit-tips li { margin-bottom: 8px; font-size: 14px; color: var(--text-muted); }

/* Alert */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); margin: 12px 0; font-size: 14px; }
.alert-success { background: var(--success-muted); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.3); }
.alert-error { background: var(--danger-muted); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }

/* Tables */
.data-table { width: 100%; border-collapse: collapse; margin-top: 16px; }
.data-table th, .data-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; }
.data-table th { color: var(--text-muted); font-weight: 500; }

/* API doc, comments, modal */
.api-doc .api-item { background: var(--bg-card); padding: 20px; border-radius: var(--radius-lg); margin-bottom: 16px; border: 1px solid var(--border); }
.api-doc pre { background: var(--bg); padding: 12px; border-radius: var(--radius-sm); margin-top: 8px; font-size: 13px; overflow-x: auto; }
.api-doc code { background: var(--bg); padding: 2px 6px; border-radius: 4px; font-size: 13px; }
.comment-item { padding: 10px 0; border-bottom: 1px solid var(--border); }
.comment-content { display: block; font-size: 14px; margin-bottom: 4px; }
.comment-time { font-size: 12px; color: var(--text-muted); }
.comment-form textarea { width: 100%; margin-bottom: 8px; padding: 10px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); }
.modal-wide { max-width: 560px; }
.modal-desc { color: var(--text-muted); font-size: 14px; margin-bottom: 16px; }
.provider-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.provider-card { display: block; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; position: relative; }
.provider-card:has(input:checked) { border-color: var(--primary); background: var(--primary-muted); }
.provider-card input { margin-right: 8px; }
.provider-label { display: block; font-weight: 600; margin-bottom: 4px; }
.provider-meta { display: block; font-size: 12px; color: var(--text-muted); }
.provider-rec { position: absolute; top: 8px; right: 8px; font-size: 11px; background: var(--primary); color: #fff; padding: 2px 8px; border-radius: 10px; }
.verify-instructions { background: var(--bg); padding: 12px; border-radius: var(--radius); white-space: pre-wrap; word-break: break-all; font-size: 13px; margin: 12px 0; }
.text-muted { color: var(--text-muted); font-size: 13px; }

/* 认证证书 */
.cert-intro { font-size: 13px; margin-bottom: 20px; line-height: 1.6; }
.cert-workflow {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    padding: 16px; background: var(--bg); border-radius: var(--radius); margin-bottom: 24px;
}
.cert-step { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); }
.cert-step-num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; border-radius: 50%; background: var(--primary-muted);
    color: var(--primary-hover); font-size: 11px; font-weight: 700;
}
.cert-step-arrow { color: var(--text-muted); opacity: 0.5; }
.cert-panel { display: flex; flex-direction: column; gap: 24px; }
.cert-panel-section { display: flex; flex-direction: column; gap: 10px; }
.cert-label { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.cert-select { max-width: 420px; }
.cert-style-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.cert-style-card {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 14px 10px; border: 1px solid var(--border); border-radius: var(--radius);
    cursor: pointer; position: relative; text-align: center; transition: border-color var(--transition);
}
.cert-style-card:has(input:checked) { border-color: var(--primary); background: var(--primary-muted); }
.cert-style-card input { position: absolute; opacity: 0; pointer-events: none; }
.cert-style-preview {
    display: flex; align-items: center; justify-content: center;
    min-height: 48px; padding: 8px; background: var(--bg); border-radius: var(--radius-sm); width: 100%;
}
.cert-style-name { font-size: 13px; font-weight: 600; }
.cert-style-desc { font-size: 11px; color: var(--text-muted); }
.cert-style-rec {
    position: absolute; top: 6px; right: 6px; font-size: 10px;
    background: var(--primary); color: #fff; padding: 1px 6px; border-radius: 8px;
}
.cert-preview-box {
    display: flex; align-items: center; justify-content: center;
    padding: 24px; background: var(--bg); border: 1px dashed var(--border-strong);
    border-radius: var(--radius); min-height: 80px;
}
.cert-code-tip { font-size: 12px; margin: 0; }
.cert-code-area {
    width: 100%; font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
    font-size: 12px; line-height: 1.5; padding: 12px; background: var(--bg);
    border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text);
    resize: vertical; min-height: 90px;
}
@media (max-width: 768px) {
    .cert-style-grid { grid-template-columns: 1fr; }
    .cert-workflow { justify-content: center; }
}

/* Footer */
.footer {
    border-top: 1px solid var(--border);
    padding: 32px 0 28px;
    margin-top: 24px;
    background: var(--bg);
}
.footer-compact { margin-top: 32px; }
.footer-shell {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-elevated);
    padding: 28px 28px 20px;
}
.footer-main {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr) minmax(0, 1fr);
    gap: 32px 40px;
}
.footer-logo { margin-bottom: 12px; display: inline-flex; }
.footer-brand p {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0 0 8px;
    line-height: 1.75;
    max-width: 460px;
}
.footer-slogan { color: var(--text-secondary) !important; }
.footer-tags {
    font-size: 12px !important;
    color: var(--text-muted);
    opacity: .85;
    margin-bottom: 0 !important;
}
.footer-col h4 {
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 14px;
    color: var(--text);
    letter-spacing: .02em;
}
.footer-col a {
    display: block;
    font-size: 13px;
    color: var(--text-muted);
    padding: 5px 0;
    transition: color .15s ease;
}
.footer-col a:hover { color: var(--primary); }
.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}
.footer-links a {
    font-size: 12px;
    color: var(--text-muted);
    padding: 5px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 20px;
    transition: border-color .15s ease, color .15s ease;
}
.footer-links a:hover { color: var(--primary); border-color: var(--primary); }
.footer-stats-panel {
    margin-top: 24px;
    padding-top: 22px;
    border-top: 1px solid var(--border);
}
.footer-compact .footer-stats-panel {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}
.footer-stats-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.footer-stats-title {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    letter-spacing: .02em;
    line-height: 1.2;
}
.footer-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #16a34a;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(34, 197, 94, .1);
    border: 1px solid rgba(34, 197, 94, .22);
    flex-shrink: 0;
}
.live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, .5);
    animation: live-pulse 2s ease-in-out infinite;
}
@keyframes live-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .45); }
    50% { box-shadow: 0 0 0 4px rgba(34, 197, 94, 0); }
}
.footer-stats-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.footer-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 10px;
    text-align: center;
    background: var(--bg-card);
    min-height: 88px;
    transition: background .2s ease;
    border: none;
}
.footer-stat:hover { background: rgba(99, 102, 241, .06); }
.footer-stat--online { background: rgba(99, 102, 241, .08); }
.footer-stat--online:hover { background: rgba(99, 102, 241, .12); }
.footer-stat-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--text-muted);
}
.footer-stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.footer-stat--online .footer-stat-meta { color: var(--primary); }
.footer-stat-label {
    font-size: 12px;
    line-height: 1.2;
    white-space: nowrap;
}
.footer-stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
    font-variant-numeric: tabular-nums;
    transition: color .25s ease, transform .25s ease;
}
.footer-stat--online .footer-stat-value { color: var(--primary); }
.footer-stat-value.is-updated {
    color: var(--primary);
    transform: scale(1.06);
}
.footer-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px solid var(--border);
}
.footer-meta-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    min-height: 72px;
}
.footer-meta-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: .04em;
    text-transform: uppercase;
}
.footer-meta-value {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-secondary);
    word-break: break-all;
}
.footer-meta-value:hover { color: var(--primary); }
.footer-meta-text { color: var(--text); word-break: break-word; }
.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-muted);
    flex-wrap: wrap;
}

/* Legacy hero compat */
.hero { text-align: center; padding: 48px 20px 36px; border-bottom: 1px solid var(--border); }
.hero h1 { font-size: 36px; font-weight: 700; margin-bottom: 12px; color: var(--text); letter-spacing: -0.02em; }
.hero-slogan { font-size: 16px; color: var(--text-muted); margin-bottom: 24px; }
.hero-stats { display: flex; justify-content: center; gap: 40px; margin-bottom: 24px; }
.stat-item { text-align: center; }
.stat-num { display: block; font-size: 24px; font-weight: 700; }
.stat-label { font-size: 12px; color: var(--text-muted); }
.search-form { display: flex; }
.search-form input {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius-sm) 0 0 var(--radius-sm); padding: 6px 12px; color: var(--text); width: 180px; font-size: 13px;
}
.search-form button {
    background: var(--primary); border: none; color: #fff;
    padding: 6px 12px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; cursor: pointer;
}
.site-card-v2 .card-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.site-card-v3 .card-actions { display: flex; gap: 8px; }

/* Responsive */
@media (max-width: 1024px) {
    .stats-row { grid-template-columns: repeat(3, 1fr); }
    .home-columns { grid-template-columns: 1fr; }
    .home-side-col { position: static; }
    .hero-v3-inner { grid-template-columns: 1fr; }
    .footer-main { grid-template-columns: 1fr 1fr; }
    .footer-brand { grid-column: 1 / -1; }
    .footer-stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .footer-meta { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .nav, .header-search { display: none; }
    .mobile-menu-btn { display: flex; }
    .container { padding: 0 12px; }
    .section { padding: 20px 0; }
    .section-compact { padding: 16px 0; }
    .section-header { margin-bottom: 12px; }
    .section-header h2 { font-size: 16px; }
    .category-sections { gap: 18px; }
    .category-block-header { margin-bottom: 10px; padding-bottom: 8px; }
    .category-block-header h3 { font-size: 14px; }
    .site-grid, .site-grid-dense { grid-template-columns: 1fr; gap: 10px; }
    .stats-row { grid-template-columns: repeat(2, 1fr); }
    .detail-grid { grid-template-columns: 1fr; }
    .hero h1 { font-size: 28px; }
    .header-inner { gap: 10px; }
    .hero-v3-actions { flex-direction: column; }
    .hero-search { max-width: none; }
    .footer-main { grid-template-columns: 1fr; }
    .footer-shell { padding: 20px 16px 16px; }
    .footer-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .footer-stat { min-height: 76px; padding: 14px 8px; }
    .footer-stat-value { font-size: 20px; }
    .footer-stat:last-child { grid-column: 1 / -1; }
    .footer-meta { gap: 12px; }

    /* 站点卡片紧凑布局 */
    .site-card { padding: 10px 12px; border-radius: var(--radius); }
    .card-header { gap: 8px; margin-bottom: 6px; align-items: center; }
    .site-logo,
    .site-logo-placeholder { width: 34px; height: 34px; font-size: 14px; border-radius: 6px; }
    .site-title { font-size: 14px; }
    .site-url { font-size: 11px; margin-top: 0; }
    .card-badges { gap: 3px; }
    .card-badges .badge { font-size: 9px; padding: 1px 5px; }
    .site-desc {
        font-size: 12px;
        line-height: 1.5;
        margin-bottom: 8px;
        -webkit-line-clamp: unset;
        display: block;
        overflow: visible;
        word-break: break-word;
    }
    .card-meta { gap: 4px; margin-bottom: 6px; font-size: 10px; }
    .card-meta .tag { font-size: 9px; padding: 1px 5px; }
    .card-meta .seo-score,
    .card-meta .star-rating { font-size: 10px; }
    .card-stats {
        gap: 4px 8px;
        padding: 6px 0;
        margin-bottom: 8px;
        font-size: 10px;
    }
    .card-stats span { gap: 2px; }
    .card-stats .icon { width: 12px; height: 12px; }

    /* 按钮横排，不再竖向堆叠占高 */
    .site-card-v3 .card-actions {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
        margin-top: 0;
    }
    .site-card-v3 .card-actions .btn {
        flex: 1 1 calc(50% - 3px);
        width: auto;
        min-width: 0;
        padding: 5px 8px;
        font-size: 11px;
        min-height: 32px;
    }
    .site-card-v3 .card-actions .btn-primary { flex: 1.15 1 calc(50% - 3px); }
    .site-card-v3 .card-actions .favorite-btn {
        flex: 1 1 100%;
        min-height: 28px;
        padding: 4px 8px;
    }
    .site-card-v3 .card-actions .btn .icon { width: 14px; height: 14px; }
}

@media (max-width: 480px) {
    .stats-row { grid-template-columns: 1fr 1fr; }
    .category-grid { grid-template-columns: repeat(3, 1fr); }
    .cat-icon { font-size: 22px; }
    .cat-name { font-size: 11px; }
    .site-card { padding: 9px 10px; }
    .site-card-v3 .card-actions .btn { font-size: 10px; padding: 4px 6px; min-height: 30px; }
}
