/* ===================================================
   大爪猫工具箱 - 样式
   主题：深色赛博工业风 · 霓虹网格
   =================================================== */

:root {
    --bg-void:       #05060d;
    --bg-base:       #0b0d17;
    --bg-card:       #111427;
    --bg-card-hover: #171b36;
    --border:        #1e2448;
    --border-bright: #2d3a7a;
    --accent:        #4f8ef7;
    --accent-glow:   rgba(79, 142, 247, 0.25);
    --accent-dim:    rgba(79, 142, 247, 0.12);
    --cyan:          #00d4ff;
    --cyan-glow:     rgba(0, 212, 255, 0.2);
    --purple:        #a855f7;
    --green:         #10b981;
    --orange:        #f97316;
    --text:          #c8d0f0;
    --text-muted:    #5a6380;
    --text-bright:   #eef1ff;
    --shadow-card:   0 4px 24px rgba(0,0,0,.55);
    --shadow-glow:   0 0 30px var(--accent-glow);
    --radius:        12px;
    --radius-sm:     8px;
    --transition:    .22s cubic-bezier(.4,0,.2,1);
}

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

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--border-bright) var(--bg-base);
}
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 3px; }

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
    background: var(--bg-void);
    color: var(--text);
    line-height: 1.65;
    overflow-x: hidden;
}

/* ── 背景网格 ─────────────────────────── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: .35;
    pointer-events: none;
    z-index: 0;
}
body::after {
    content: '';
    position: fixed;
    top: -30%;
    left: -20%;
    width: 70%;
    height: 60%;
    background: radial-gradient(ellipse, var(--accent-dim) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ── 顶部导航 ─────────────────────────── */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(11,13,23,.82);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    gap: 16px;
    overflow: hidden;
}
.header-left { display: flex; align-items: center; flex-shrink: 0; }
.header-stats {
    display: flex;
    align-items: center;
    gap: 20px;
    flex: 1;
    justify-content: center;
    overflow: hidden;
}
.header-stats .stat-item {
    display: flex;
    align-items: baseline;
    gap: 3px;
    flex-shrink: 0;
}
.header-stats .stat-num {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
}
.header-stats .stat-label {
    font-size: 11px;
    color: var(--text-muted);
}
.header-right { display: flex; align-items: center; flex-shrink: 0; gap: 8px; }
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}
.logo-icon {
    width: 34px; height: 34px;
    background: linear-gradient(135deg, var(--accent), var(--cyan));
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    box-shadow: 0 0 16px var(--accent-glow);
}
.logo-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-bright);
    letter-spacing: .5px;
}
.logo-text span { color: var(--accent); }

.nav-links { display: flex; gap: 4px; list-style: none; }
.nav-links a {
    display: block;
    padding: 6px 14px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    border: 1px solid transparent;
}
.nav-links a:hover,
.nav-links a.active {
    color: var(--accent);
    background: var(--accent-dim);
    border-color: var(--border);
}

.header-actions { display: flex; gap: 10px; align-items: center; }
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 7px 18px;
    border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 600;
    cursor: pointer; border: none;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}
.btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 0 16px var(--accent-glow);
}
.btn-primary:hover {
    background: #6ba3ff;
    box-shadow: 0 0 28px var(--accent-glow);
    transform: translateY(-1px);
}
.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.btn-ghost:hover {
    color: var(--text-bright);
    border-color: var(--border-bright);
    background: rgba(255,255,255,.04);
}

/* ── 英雄区 ─────────────────────────────── */
.hero {
    padding: 80px 0 60px;
    text-align: center;
}
.hero-eyebrow {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 14px;
    background: var(--accent-dim);
    border: 1px solid var(--border-bright);
    border-radius: 50px;
    font-size: 12px;
    color: var(--accent);
    margin-bottom: 24px;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.hero-title {
    font-size: clamp(36px, 6vw, 60px);
    font-weight: 800;
    color: var(--text-bright);
    line-height: 1.15;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}
.hero-title .highlight {
    background: linear-gradient(90deg, var(--accent), var(--cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero-sub {
    font-size: 16px;
    color: var(--text-muted);
    max-width: 560px;
    margin: 0 auto 36px;
}
.search-bar {
    display: flex;
    max-width: 540px;
    margin: 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border-bright);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
}
.search-bar:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}
.search-bar input {
    flex: 1;
    background: transparent;
    border: none; outline: none;
    padding: 14px 18px;
    font-size: 15px;
    color: var(--text-bright);
}
.search-bar input::placeholder { color: var(--text-muted); }
.search-bar button {
    padding: 12px 22px;
    background: var(--accent);
    border: none;
    cursor: pointer;
    font-size: 15px;
    color: #fff;
    transition: var(--transition);
}
.search-bar button:hover { background: #6ba3ff; }

/* ── 统计区 ─────────────────────────────── */
.stat-item { text-align: center; }
.stat-num {
    font-size: 28px;
    font-weight: 800;
    color: var(--accent);
    font-variant-numeric: tabular-nums;
}
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ── 分类导航 ─────────────────────────────── */
.categories {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 36px;
    justify-content: center;
}
.cat-btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 13px; color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    font-family: inherit;
}
.cat-btn:hover { color: var(--accent); border-color: var(--border-bright); background: var(--accent-dim); }
.cat-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 0 18px var(--accent-glow);
}
.cat-btn .cat-icon { font-size: 15px; }

/* ── 工具卡片网格 ─────────────────────────── */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 64px;
}
.tool-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.tool-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--cyan));
    opacity: 0;
    transition: var(--transition);
}
.tool-card:hover {
    border-color: var(--border-bright);
    background: var(--bg-card-hover);
    transform: translateY(-3px);
    box-shadow: var(--shadow-card), var(--shadow-glow);
}
.tool-card:hover::before { opacity: 1; }

/* ── 置顶卡片 ── */
.tool-card-pinned {
    border-color: rgba(251, 191, 36, 0.45) !important;
    background: rgba(251, 191, 36, 0.06) !important;
}
.tool-card-pinned::before {
    opacity: 1 !important;
    background: linear-gradient(90deg, #fbbf24, #f59e0b) !important;
}
.tool-card-pinned:hover {
    background: rgba(251, 191, 36, 0.10) !important;
}

/* ── 置顶按钮 ── */
.pin-btn {
    font-size: 11px;
    padding: 3px 8px;
    border: 1px solid rgba(251, 191, 36, 0.35);
    border-radius: 20px;
    background: rgba(251, 191, 36, 0.08);
    color: #fbbf24;
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap;
}
.pin-btn:hover {
    background: rgba(251, 191, 36, 0.18);
}
.pin-btn-active {
    background: rgba(251, 191, 36, 0.22);
    color: #f59e0b;
}
.pin-btn-active:hover {
    background: rgba(251, 191, 36, 0.10);
}
.pin-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.tool-card-top {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    margin-bottom: 14px;
}
.tool-icon-wrap {
    width: 48px; height: 48px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
    background: var(--accent-dim);
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
    border: 1px solid var(--border);
}
.tool-icon-wrap img {
    width: 100%; height: 100%;
    object-fit: cover;
}
.tool-meta { flex: 1; min-width: 0; }
.tool-name {
    font-size: 16px; font-weight: 700;
    color: var(--text-bright);
    margin-bottom: 4px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tool-cat-badge {
    display: inline-block;
    padding: 2px 10px;
    background: var(--accent-dim);
    border: 1px solid var(--border-bright);
    border-radius: 50px;
    font-size: 11px;
    color: var(--accent);
}
.tool-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 14px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.tool-tags {
    display: flex; flex-wrap: wrap; gap: 5px;
    margin-bottom: 14px;
}
.tool-tag {
    padding: 2px 9px;
    background: rgba(255,255,255,.04);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 11px;
    color: var(--text-muted);
}
.tool-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}
.tool-stats { font-size: 12px; color: var(--text-muted); }
.tool-dl-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 6px 16px;
    background: var(--accent);
    color: #fff;
    border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    border: none; cursor: pointer;
}
.tool-dl-btn:hover {
    background: #6ba3ff;
    box-shadow: 0 0 14px var(--accent-glow);
    transform: translateY(-1px);
}
.tool-dl-btn:active { transform: translateY(0); }

/* ── 空状态 ─────────────────────────────── */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}
.empty-state-icon { font-size: 48px; margin-bottom: 16px; opacity: .4; }
.empty-state p { font-size: 15px; }

/* ── 登录页 ─────────────────────────────── */
.page-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}
.login-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px 36px;
    box-shadow: var(--shadow-card);
}
.login-logo {
    text-align: center;
    margin-bottom: 32px;
}
.login-logo-icon {
    width: 52px; height: 52px;
    background: linear-gradient(135deg, var(--accent), var(--cyan));
    border-radius: var(--radius);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 26px;
    margin-bottom: 12px;
    box-shadow: 0 0 24px var(--accent-glow);
}
.login-title {
    font-size: 22px; font-weight: 700;
    color: var(--text-bright);
    text-align: center;
}
.login-sub { font-size: 13px; color: var(--text-muted); text-align: center; margin-top: 4px; }
.form-group { margin-bottom: 18px; }
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 7px;
}
.form-input {
    width: 100%;
    padding: 11px 14px;
    background: var(--bg-base);
    border: 1px solid var(--border-bright);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-bright);
    font-family: inherit;
    transition: var(--transition);
    outline: none;
}
.form-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}
.form-input::placeholder { color: var(--text-muted); }
.form-error {
    font-size: 12px;
    color: #f87171;
    margin-top: 5px;
}
.btn-block { width: 100%; justify-content: center; padding: 12px; font-size: 15px; }
.login-link {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 20px;
}
.login-link a { color: var(--accent); text-decoration: none; }
.login-link a:hover { text-decoration: underline; }

/* ── 管理后台 ─────────────────────────────── */
.admin-layout {
    min-height: 100vh;
    display: flex;
}
.admin-sidebar {
    width: 220px;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    padding: 24px 0;
    flex-shrink: 0;
}
.admin-logo {
    padding: 0 20px 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
    display: flex; align-items: center; gap: 10px;
    font-size: 17px; font-weight: 700; color: var(--text-bright);
}
.admin-nav { list-style: none; }
.admin-nav a {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 20px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    border-left: 3px solid transparent;
    transition: var(--transition);
}
.admin-nav a:hover { color: var(--text-bright); background: rgba(255,255,255,.03); }
.admin-nav a.active {
    color: var(--accent);
    background: var(--accent-dim);
    border-left-color: var(--accent);
}
.admin-main { flex: 1; overflow: auto; }
.admin-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 0 28px;
    height: 60px;
    display: flex; align-items: center; justify-content: space-between;
}
.admin-page-title { font-size: 17px; font-weight: 700; color: var(--text-bright); }
.admin-content { padding: 28px; }

.panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 24px;
}
.panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; justify-content: space-between;
}
.panel-title { font-size: 15px; font-weight: 700; color: var(--text-bright); }

.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td {
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.data-table th {
    color: var(--text-muted);
    font-weight: 600;
    background: rgba(255,255,255,.02);
}
.data-table tr:hover td { background: rgba(255,255,255,.02); }
.data-table td:last-child { text-align: right; }

.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 600;
}
.badge-site    { background: rgba(79,142,247,.15); color: #4f8ef7; }
.badge-client  { background: rgba(0,212,255,.15);  color: #00d4ff; }
.badge-game    { background: rgba(168,85,247,.15); color: #a855f7; }
.badge-pc      { background: rgba(16,185,129,.15); color: #10b981; }
.badge-remote  { background: rgba(249,115,22,.15); color: #f97316; }
.badge-solution{ background: rgba(236,72,153,.15); color: #ec4899; }
.badge-other   { background: rgba(100,116,139,.15); color: #94a3b8; }

.btn-sm {
    padding: 4px 12px;
    font-size: 12px;
    border-radius: var(--radius-sm);
    cursor: pointer; border: 1px solid var(--border);
    background: transparent; color: var(--text-muted);
    font-family: inherit;
    transition: var(--transition);
    text-decoration: none;
}
.btn-sm:hover { color: var(--text-bright); border-color: var(--border-bright); }
.btn-sm-danger { border-color: #7f1d1d; color: #f87171; }
.btn-sm-danger:hover { background: rgba(239,68,68,.1); border-color: #dc2626; color: #f87171; }

/* ── 添加工具表单 ─────────────────────────── */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.form-group-full { grid-column: 1 / -1; }
textarea.form-input { resize: vertical; min-height: 100px; }
select.form-input { cursor: pointer; }

/* ── Toast 通知 ─────────────────────────── */
.toast {
    position: fixed;
    top: 20px; right: 20px;
    z-index: 9999;
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 32px rgba(0,0,0,.4);
    transform: translateX(120%);
    transition: .35s cubic-bezier(.4,0,.2,1);
    max-width: 320px;
}
.toast.show { transform: translateX(0); }
.toast-success { background: #064e3b; color: #6ee7b7; border: 1px solid #065f46; }
.toast-error   { background: #450a0a; color: #fca5a5; border: 1px solid #7f1d1d; }

/* ── 响应式 ─────────────────────────────── */
@media (max-width: 768px) {
    .tools-grid { grid-template-columns: 1fr; }
    .admin-layout { flex-direction: column; }
    .admin-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
    .form-grid { grid-template-columns: 1fr; }
    .header-stats { gap: 12px; }
    .header-stats .stat-num { font-size: 14px; }
    .header-stats .stat-label { font-size: 10px; }
}
