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

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #333;
    transition: background 0.3s, color 0.3s;
    min-height: 100vh;
}

body.dark-mode {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #e0e0e0;
}

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

/* 导航 */
nav {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.dark-mode nav {
    background: rgba(26, 26, 46, 0.95);
    box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-links {
    display: flex;
    gap: 25px;
}

.nav-links a {
    text-decoration: none;
    color: #555;
    font-weight: 500;
    transition: color 0.3s;
}

.dark-mode .nav-links a {
    color: #ccc;
}

.nav-links a:hover {
    color: #667eea;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.theme-btn {
    background: none;
    border: 2px solid #667eea;
    color: #667eea;
    padding: 8px 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
}

.theme-btn:hover {
    background: #667eea;
    color: white;
}

.hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #667eea;
    cursor: pointer;
}

/* Hero */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 80px 20px;
    text-align: center;
}

.hero-content h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 15px;
}

.hero-content p {
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto 30px;
    opacity: 0.9;
}

.search-box {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
    background: white;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.search-box input {
    flex: 1;
    padding: 15px 20px;
    border: none;
    outline: none;
    font-size: 1rem;
}

.search-box button {
    background: #667eea;
    color: white;
    border: none;
    padding: 15px 25px;
    cursor: pointer;
    transition: background 0.3s;
}

.search-box button:hover {
    background: #764ba2;
}

.stats-bar {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 30px;
    font-size: 0.9rem;
}

/* 筛选 */
.filter-section {
    padding: 30px 0;
}

.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.filter-btn {
    padding: 8px 20px;
    border: 2px solid #667eea;
    background: transparent;
    color: #667eea;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.filter-btn.active, .filter-btn:hover {
    background: #667eea;
    color: white;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.tag {
    padding: 5px 15px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.tag:hover {
    background: #667eea;
    color: white;
}

/* 工具网格 */
.tools-grid-section {
    padding: 40px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
}

.section-title h3 {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
}

.dark-mode .section-title h3 {
    color: #e0e0e0;
}

.section-title p {
    color: #777;
    margin-top: 10px;
}

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

.tool-card {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.dark-mode .tool-card {
    background: #2a2a4a;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

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

.card-header h4 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
}

.dark-mode .card-header h4 {
    color: #e0e0e0;
}

.category-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 500;
}

.card-desc {
    color: #666;
    margin-bottom: 15px;
    line-height: 1.5;
}

.dark-mode .card-desc {
    color: #b0b0b0;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 15px;
}

.tag-sm {
    background: rgba(102, 126, 234, 0.1);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    color: #667eea;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.visit-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s;
}

.visit-btn:hover {
    transform: scale(1.05);
}

.card-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.star {
    color: #ddd;
    cursor: pointer;
    transition: color 0.2s;
}

.star.active {
    color: #ffc107;
}

.favorite-btn {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 1.1rem;
    transition: transform 0.3s;
}

.favorite-btn.active {
    color: #e74c3c;
}

.favorite-btn:hover {
    transform: scale(1.2);
}

.visit-count {
    font-size: 0.85rem;
    color: #999;
}

.heatmap-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.5s;
}

/* 页脚 */
footer {
    background: #1a1a2e;
    color: #ccc;
    padding: 40px 0 20px;
    margin-top: 60px;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 30px;
    margin-bottom: 30px;
}

.footer-section h4 {
    color: white;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section ul li a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-section ul li a:hover {
    color: #667eea;
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid #333;
    padding-top: 20px;
    font-size: 0.9rem;
}

/* 管理后台 */
.admin-page .login-form {
    max-width: 400px;
    margin: 80px auto;
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.dark-mode .admin-page .login-form {
    background: #2a2a4a;
}

.login-form h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.dark-mode .login-form h2 {
    color: #e0e0e0;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

.dark-mode .form-group label {
    color: #ccc;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus, .form-group textarea:focus {
    border-color: #667eea;
    outline: none;
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.error {
    color: #e74c3c;
    text-align: center;
    margin-bottom: 20px;
}

.admin-dashboard {
    padding: 40px 0;
}

.admin-dashboard h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 2rem;
}

.add-tool-form {
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    margin-bottom: 40px;
}

.dark-mode .add-tool-form {
    background: #2a2a4a;
}

.add-tool-form h3 {
    margin-bottom: 20px;
    color: #333;
}

.dark-mode .add-tool-form h3 {
    color: #e0e0e0;
}

.tool-list h3 {
    margin-bottom: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.dark-mode table {
    background: #2a2a4a;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.dark-mode th, .dark-mode td {
    border-bottom: 1px solid #444;
}

th {
    background: #667eea;
    color: white;
    font-weight: 600;
}

.btn-delete {
    color: #e74c3c;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.btn-delete:hover {
    color: #c0392b;
}

/* 响应式 */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background: white;
        padding: 20px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    }

    .dark-mode .nav-links {
        background: #1a1a2e;
    }

    .nav-links.active {
        display: flex;
    }

    .hamburger {
        display: block;
    }

    .hero-content h2 {
        font-size: 1.8rem;
    }

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

    .stats-bar {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .tools-grid {
        grid-template-columns: 1fr;
    }
}

/* 提交页面样式 */
.submit-page {
    padding: 60px 0;
}

.submit-page h2 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2rem;
}

.submit-form {
    max-width: 600px;
    margin: 0 auto;
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.dark-mode .submit-form {
    background: #2a2a4a;
}

/* 关于页面 */
.about-page {
    padding: 60px 0;
}

.about-page h2 {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2rem;
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    line-height: 1.8;
}

.dark-mode .about-content {
    background: #2a2a4a;
}