/* 六百工具箱 - 极致紧凑版 (水平布局) */
:root {
    --primary: #2563eb;
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --sidebar-w: 120px; 
    --card-w: 240px;    
    --card-h: 75px;     
}

html.dark {
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #334155;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    overflow-x: hidden;
    line-height: 1.4;
}

.container {
    width: 1300px !important;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.main-header {
    height: 70px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.main-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.logo a {
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
}

.nav-links ul { display: flex; list-style: none; gap: 20px; }
.nav-links a { font-size: 14px; color: var(--text-muted); text-decoration: none; font-weight: 500; transition: 0.2s; }
.nav-links a:hover, .nav-links a.active { color: var(--primary); }

.header-right { display: flex; align-items: center; gap: 20px; }

/* Main Layout */
.main-layout {
    display: flex;
    margin-top: 30px;
    gap: 30px;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
}

.sidebar-nav ul { list-style: none; }
.sidebar-nav li a {
    display: block;
    padding: 10px 15px;
    font-size: 14px;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 2px;
    transition: 0.2s;
}

.sidebar-nav li a:hover { background: rgba(37, 99, 235, 0.05); color: var(--primary); }
.sidebar-nav li a.active { background: var(--primary); color: #fff; }

/* Content */
.main-content {
    flex: 1;
    min-width: 0;
}

.sub-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.sub-nav a {
    padding: 4px 12px;
    font-size: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 15px;
    color: var(--text-muted);
    text-decoration: none;
}

.sub-nav a.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Grid - 4 Columns */
.sites-grid {
    display: grid;
    grid-template-columns: repeat(4, var(--card-w));
    gap: 15px;
}

/* Card - Horizontal Layout */
.site-card {
    width: var(--card-w);
    height: var(--card-h);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0 15px; 
    display: flex;
    flex-direction: row; 
    align-items: center; 
    justify-content: flex-start;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
}

.site-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.site-card-inner {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 12px;
}

.site-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), #6366f1);
    color: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    flex-shrink: 0;
}

.site-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.site-name {
    font-size: 13.5px;
    font-weight: 600;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.site-desc {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Theme Toggle - Full Restore */
.theme-switch {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    outline: none;
    display: block;
}

.capsule {
    width: 48px;
    height: 24px;
    background: #e2e8f0;
    border-radius: 12px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5px;
    transition: background 0.3s ease;
}

html.dark .capsule { background: #334155; }

.capsule .icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    z-index: 1;
    transition: color 0.3s ease;
}

.switch-ball {
    position: absolute;
    left: 2px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

html.dark .switch-ball { transform: translateX(24px); background: #3b82f6; }
html.dark .icon.moon { color: #fff; }
html:not(.dark) .icon.sun { color: #f59e0b; }

.btn { padding: 8px 18px; border-radius: 8px; font-size: 13px; font-weight: 600; text-decoration: none; cursor: pointer; transition: 0.2s; }
.btn-login { color: var(--text-main); }
.btn-register { background: var(--text-main); color: var(--bg-body); }
