/* CSS 变量 - 浅色主题 */
:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-card: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 深色主题 */
body.dark {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #64748b;
    --border-color: #334155;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.4), 0 4px 6px -4px rgb(0 0 0 / 0.4);
    --gradient-card: linear-gradient(135deg, #1e293b 0%, #334155 100%);
}

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

/* 安全横幅 */
.security-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 18px 24px;
    box-shadow: 0 4px 30px rgba(102, 126, 234, 0.5), 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    animation: slideDown 0.5s ease;
    border-bottom: 3px solid rgba(255, 255, 255, 0.2);
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.security-banner-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.banner-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.banner-logo {
    font-size: 32px;
    filter: drop-shadow(0 2px 8px rgba(255, 255, 255, 0.3));
}

.banner-title {
    font-size: 28px;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    letter-spacing: 2px;
}

.banner-security {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 30px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.banner-shield-icon {
    width: 24px;
    height: 24px;
    color: white;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.banner-text {
    font-size: 16px;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    letter-spacing: 1px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: background 0.3s ease, color 0.3s ease;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.03) 0%, rgba(118, 75, 162, 0.03) 100%);
    pointer-events: none;
    z-index: -1;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* 公告区域 */
.announcement-banner {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(168, 85, 247, 0.08) 100%);
    border: 2px solid rgba(99, 102, 241, 0.2);
    border-radius: 16px;
    padding: 24px 28px;
    margin-bottom: 24px;
    animation: slideIn 0.5s ease;
    position: relative;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.1);
}

.announcement-banner.hidden {
    display: none;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.announcement-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.announcement-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.announcement-title h2 {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.announcement-badge {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2) 0%, rgba(16, 185, 129, 0.2) 100%);
    color: #22c55e;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.announcement-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    line-height: 1;
    transition: all 0.2s ease;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.announcement-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
    transform: rotate(90deg);
}

body.dark .announcement-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.announcement-content {
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.8;
}

.announcement-content ul {
    margin: 12px 0;
    padding-left: 24px;
    list-style: none;
}

.announcement-content li {
    margin-bottom: 10px;
    color: var(--text-secondary);
    position: relative;
    padding-left: 20px;
}

.announcement-content li::before {
    content: '✨';
    position: absolute;
    left: 0;
    top: 0;
}

.announcement-content li strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* 头部 */
.header {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(10px);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.brand-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.brand-tagline {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tagline-item {
    display: inline-flex;
    align-items: center;
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    }
    50% {
        box-shadow: 0 4px 25px rgba(102, 126, 234, 0.4);
    }
}

.internal-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.security-badge {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 28px;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-icon {
    font-size: 32px;
    filter: drop-shadow(0 2px 4px rgba(99, 102, 241, 0.3));
}

/* 搜索框 */
.search-box {
    position: relative;
    flex: 1;
    max-width: 500px;
}

.search-input {
    width: 100%;
    padding: 12px 48px 12px 20px;
    font-size: 15px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-secondary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.search-input::placeholder {
    color: var(--text-tertiary);
}

.search-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-tertiary);
    pointer-events: none;
}

/* 控制按钮 */
.header-controls {
    display: flex;
    gap: 8px;
}

.control-btn {
    padding: 10px 16px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
}

.control-btn:hover {
    border-color: var(--primary-color);
    background: var(--bg-secondary);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.control-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.control-btn svg {
    width: 18px;
    height: 18px;
}

.moon-icon, .sun-icon {
    transition: opacity 0.3s ease;
}

body:not(.dark) .moon-icon {
    opacity: 0;
    position: absolute;
}

body.dark .sun-icon {
    opacity: 0;
    position: absolute;
}

/* GitHub按钮 */
.github-btn {
    background: linear-gradient(135deg, #181818 0%, #2d2d2d 100%);
    border: 2px solid #404040;
    color: white;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.github-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #2d2d2d 0%, #404040 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.github-btn:hover::before {
    opacity: 1;
}

.github-btn:hover {
    background: linear-gradient(135deg, #2d2d2d 0%, #404040 100%);
    border-color: #58a6ff;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(88, 166, 255, 0.3);
}

.github-btn svg {
    width: 20px;
    height: 20px;
    fill: white;
    position: relative;
    z-index: 1;
}

/* 分类导航 */
.category-nav {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
}

.category-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.category-btn {
    padding: 10px 20px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.category-btn:hover {
    border-color: var(--primary-color);
    background: var(--bg-secondary);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.category-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.category-icon {
    font-size: 16px;
}

/* 统计栏 */
.stats-bar {
    display: flex;
    gap: 24px;
    margin-bottom: 20px;
    padding: 12px 20px;
    background: var(--bg-secondary);
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    align-items: center;
}

.security-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    padding: 10px 20px;
    background: linear-gradient(135deg, rgba(17, 153, 142, 0.15) 0%, rgba(56, 239, 125, 0.15) 100%);
    border: 2px solid rgba(17, 153, 142, 0.3);
    border-radius: 12px;
    font-size: 14px;
    color: #11998e;
    font-weight: 700;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(17, 153, 142, 0.2);
    animation: borderGlow 3s ease-in-out infinite;
}

@keyframes borderGlow {
    0%, 100% {
        border-color: rgba(17, 153, 142, 0.3);
    }
    50% {
        border-color: rgba(17, 153, 142, 0.6);
    }
}

.security-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    animation: shieldPulse 2s ease-in-out infinite;
}

@keyframes shieldPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
}

.stats-text {
    font-size: 14px;
    color: var(--text-secondary);
}

.stats-text strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* 工具网格 */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 工具卡片 */
.tool-card {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 2px solid var(--border-color);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.tool-card:hover::before {
    opacity: 1;
}

.tool-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.tool-icon {
    font-size: 40px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.tool-favorite {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: var(--transition);
    color: var(--text-tertiary);
}

.tool-favorite:hover {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.tool-favorite.active {
    color: #ef4444;
}

.tool-favorite svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.tool-favorite.active svg {
    fill: currentColor;
}

.tool-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.3;
}

.tool-desc {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tool-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tool-category {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
}

.tool-url {
    display: none;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    animation: fadeIn 0.3s ease;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.clear-btn {
    padding: 12px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.clear-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .security-banner {
        padding: 12px 16px;
    }

    .security-banner-content {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .banner-brand {
        justify-content: center;
    }

    .banner-logo {
        font-size: 28px;
    }

    .banner-title {
        font-size: 24px;
    }

    .banner-security {
        padding: 8px 16px;
    }

    .banner-text {
        font-size: 14px;
    }
    .header-content {
        flex-direction: column;
        align-items: stretch;
    }

    .brand-section {
        align-items: center;
        text-align: center;
    }

    .logo {
        justify-content: center;
    }

    .search-box {
        max-width: 100%;
    }

    .header-controls {
        justify-content: center;
    }

    .tools-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 16px;
    }

    .stats-bar {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .security-notice {
        margin-left: 0;
        justify-content: center;
    }

    .category-nav {
        padding: 12px;
    }

    .category-btn {
        padding: 8px 16px;
        font-size: 13px;
    }

    .brand-tagline {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 12px;
    }

    .header {
        padding: 16px;
    }

    .logo {
        font-size: 24px;
    }

    .tools-grid {
        grid-template-columns: 1fr;
    }
}

/* 滚动条样式 */
.category-nav::-webkit-scrollbar {
    height: 6px;
}

.category-nav::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 3px;
}

.category-nav::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.category-nav::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
}

/* 动画效果 */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* 工具状态标签 */
.tool-status {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-available {
    background: #dcfce7;
    color: #166534;
}

.status-developing {
    background: #fef3c7;
    color: #92400e;
}

body.dark .status-available {
    background: #166534;
    color: #dcfce7;
}

body.dark .status-developing {
    background: #92400e;
    color: #fef3c7;
}

/* 页脚 */
.footer {
    margin-top: 40px;
    padding: 30px 20px;
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
}

.footer-brand {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 2px solid var(--border-color);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    border-radius: 12px;
    padding: 28px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.1);
    border: 2px solid rgba(102, 126, 234, 0.15);
}

.footer-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
}

.footer-logo-icon {
    font-size: 36px;
    filter: drop-shadow(0 2px 8px rgba(102, 126, 234, 0.3));
}

.footer-logo-text {
    font-size: 24px;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 2px;
}

.footer-slogan {
    font-size: 15px;
    color: var(--text-secondary);
    letter-spacing: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

.footer-info {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.footer-item {
    font-size: 13px;
    color: var(--text-secondary);
    padding: 6px 14px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-item a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
    display: inline-block;
    height: 20px;
    line-height: 20px;
}

.footer-item a:hover {
    color: var(--primary-color);
}

.beian-logo {
    width: 16px;
    height: 16px;
    display: inline-block;
}

.footer-copyright {
    font-size: 13px;
    color: var(--text-tertiary);
    margin-top: 8px;
}

@media (max-width: 768px) {
    .footer {
        margin-top: 30px;
        padding: 24px 16px;
    }

    .footer-brand {
        margin-bottom: 16px;
        padding-bottom: 16px;
    }

    .footer-logo {
        flex-direction: column;
        gap: 6px;
    }

    .footer-logo-text {
        font-size: 18px;
    }

    .footer-slogan {
        font-size: 12px;
    }

    .footer-info {
        flex-direction: column;
        gap: 10px;
    }

    .footer-item {
        font-size: 12px;
        padding: 5px 12px;
    }

    .footer-copyright {
        font-size: 12px;
    }
}