* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --dock-bg: #0b0b0f;
    --dock-surface: #13131a;
    --dock-surface2: #1a1a24;
    --dock-border: #2a2a38;
    --dock-accent: #6c5ce7;
    --dock-accent2: #a29bfe;
    --dock-text: #eae6ff;
    --dock-muted: #706b8a;
    --dock-dim: #4a4660;
    --dock-pink: #ff6b81;
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f7f8f9;
    min-height: 100vh;
    color: #16191f;
}

.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== HEADER / TOOLBAR（自启动台迁入） ===== */
.header {
    padding: 28px 48px 22px;
    border-bottom: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.logo-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.header h1 {
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 26px;
    letter-spacing: 0.04em;
    line-height: 1.15;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(to bottom right, #ffffff 0%, #f3f4f6 40%, #e5e7eb 70%, #cfd4da 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-sub {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
    margin-top: 4px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
    flex: 1;
    min-width: 0;
}

.stat-pill {
    background: #fff;
    border: 1px solid #e5e7eb;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.stat-pill .num {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    color: #6c5ce7;
    font-size: 13px;
}

.toolbar {
    padding: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    border-bottom: none;
    background: transparent;
    min-width: 0;
}

.search-box {
    flex: 1;
    min-width: 160px;
    max-width: 240px;
    position: relative;
}

.search-box input {
    width: 100%;
    background: #fff;
    border: 1px solid rgba(255, 255, 255, 0.9);
    color: #16191f;
    padding: 10px 14px 10px 38px;
    border-radius: 8px;
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.12);
}

.search-box input:focus {
    border-color: #fff;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.45), 0 2px 10px rgba(15, 23, 42, 0.12);
}

.search-box input::placeholder {
    color: #94a3b8;
}

.search-box svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    stroke: #94a3b8;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    pointer-events: none;
}

.filter-btns {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.filter-btn {
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.06);
    color: #475569;
    padding: 8px 16px;
    border-radius: 8px;
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1);
}

.filter-btn:hover {
    background: #f8fafc;
    border-color: rgba(15, 23, 42, 0.1);
    color: #0f172a;
}

.filter-btn.active {
    background: #0f172a;
    border-color: #0f172a;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 3px 12px rgba(15, 23, 42, 0.35);
}

.container {
    width: 100%;
    text-align: center;
    padding: 40px 30px 60px;
    flex: 1;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
}

.tools-grid .tool-card {
    width: 280px;
    margin: 0 auto;
}

.tool-card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 18px 12px;
    min-height: 120px;
    width: 280px;
    background: #fff;
    border: 1px solid #e8eaed;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.23, 1, 0.32, 1);
    text-decoration: none;
    color: inherit;
    box-sizing: border-box;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    border-radius: 0 0 4px 4px;
    background: #64748b;
    transition: background 0.35s ease;
}

.tool-logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.tool-logo img {
    width: 100%;
    height: 100%;
    border-radius: 10px;
    object-fit: cover;
}

.tool-text-wrap {
    display: inline-flex;
    flex-direction: column;
    align-items: stretch;
    gap: 5px;
    position: relative;
    z-index: 1;
    min-width: 0;
    max-width: calc(100% - 46px);
}

.tool-name {
    font-size: 15px;
    font-weight: 600;
    color: #16191f;
    line-height: 1.4;
    text-align: center;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-decoration: none;
}

a.tool-card,
a.tool-card:link,
a.tool-card:visited,
a.tool-card:hover,
a.tool-card:active,
a.tool-card .tool-name,
a.tool-card:hover .tool-name {
    text-decoration: none !important;
    color: inherit;
}

.tool-line {
    width: 100%;
    height: 2px;
    background: #f97316;
    border-radius: 1px;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.tool-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.tool-card:hover::before {
    background: #f97316;
}

.tool-card:hover .tool-line {
    transform: scaleX(1);
}

.tool-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.tool-card.disabled:hover {
    transform: none;
    box-shadow: none;
}

.tool-card.disabled:hover::before {
    background: #64748b;
}

.tool-card.disabled:hover .tool-line {
    transform: scaleX(0);
}

.tool-card.no-icon .tool-text-wrap {
    max-width: 100%;
}

.seo-page-title,
.seo-page-desc {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.home-page-btn {
    background: #fff;
    color: #334155;
    border: 1px solid #d1d5db;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
    flex-shrink: 0;
}

.home-page-btn:hover {
    border-color: #6c5ce7;
    background: #f5f3ff;
    color: #4c1d95;
    transform: translateX(-2px);
}

.home-page-btn svg {
    transition: transform 0.25s ease;
}

.home-page-btn:hover svg {
    transform: translateX(-2px);
}

.tools-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: #64748b;
    padding: 40px;
}

@media (max-width: 900px) {
    .header {
        padding: 20px 16px 16px;
    }
    .header h1 {
        font-size: 26px;
    }
    .toolbar {
        padding: 14px 16px;
    }
    .container {
        padding: 28px 16px 48px;
    }
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    .tools-grid .tool-card,
    .tool-card {
        width: 100%;
        max-width: 280px;
    }
}

.tool-download-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.tool-download-modal[hidden] {
    display: none !important;
}

.tool-download-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}

.tool-download-dialog {
    position: relative;
    width: min(520px, 100%);
    max-height: 80vh;
    overflow: auto;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.2);
    padding: 24px 24px 20px;
}

.tool-download-close {
    position: absolute;
    top: 12px;
    right: 14px;
    border: none;
    background: transparent;
    font-size: 28px;
    line-height: 1;
    color: #94a3b8;
    cursor: pointer;
}

.tool-download-close:hover {
    color: #475569;
}

.tool-download-dialog h3 {
    margin: 0 0 16px;
    font-size: 20px;
    color: #16191f;
    padding-right: 28px;
}

.tool-download-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tool-download-version {
    border: 1px solid #e8eaed;
    border-radius: 10px;
    overflow: hidden;
}

.tool-download-version-title {
    padding: 10px 14px;
    background: #f8fafc;
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    border-bottom: 1px solid #e8eaed;
}

.tool-download-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px 14px;
}

.tool-download-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #e8eaed;
    border-radius: 8px;
    background: #fff;
    color: #16191f;
    text-decoration: none;
    transition: all 0.2s ease;
}

.tool-download-link:hover {
    border-color: #f97316;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.12);
    transform: translateY(-1px);
}

.tool-download-link-name {
    font-size: 14px;
    font-weight: 500;
}

.tool-download-link-action {
    font-size: 12px;
    color: #f97316;
    white-space: nowrap;
}

.tool-download-empty {
    color: #64748b;
    font-size: 14px;
    text-align: center;
    padding: 12px 0;
}
