:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --text-main: #111827;
    --text-secondary: #6b7280;
    --bg-color: #ffffff;
    --bg-secondary: #f9fafb;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-main);
    background-color: var(--bg-color);
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

nav ul {
    display: flex;
    gap: 2rem;
    align-items: center;
}

nav a {
    color: var(--text-secondary);
    font-weight: 500;
    transition: color 0.2s;
}

nav a:hover, nav a.active {
    color: var(--text-main);
}

.nav-btn-highlight {
    background-color: #fef3c7;
    color: #d97706 !important;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
}

.nav-btn-highlight:hover {
    background-color: #fde68a;
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.btn-primary {
    background-color: #000;
    color: #fff;
}

.btn-primary:hover {
    background-color: #333;
}

.btn-secondary {
    background-color: #f3f4f6;
    color: var(--text-main);
}

.btn-secondary:hover {
    background-color: #e5e7eb;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 6rem 1rem 4rem;
    max-width: 1200px;
    margin: 0 auto;
}

.hero-badge {
    display: inline-block;
    background-color: #f3f4f6;
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.hero h1 {
    font-size: 3.5rem;
    line-height: 1.2;
    font-weight: 800;
    margin-bottom: 1.5rem;
    letter-spacing: -0.025em;
}

.hero h1 span {
    color: var(--primary-color);
    background: linear-gradient(to right, #6366f1, #a855f7);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto 2.5rem;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* Tools Section */
.tools-section {
    padding: 4rem 2rem;
    background-color: var(--bg-secondary);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.section-header p {
    color: var(--text-secondary);
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.tool-card {
    background: #fff;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.tool-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.tool-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    display: inline-block;
    padding: 0.5rem;
    background: #f3f4f6;
    border-radius: 0.75rem;
    width: fit-content;
}

.tool-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.tool-desc {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tool-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.tool-category {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: #f3f4f6;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

.tool-link {
    color: var(--primary-color);
    font-weight: 500;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.tool-link:hover {
    text-decoration: underline;
}

/* Footer */
footer {
    padding: 2rem 1rem;
    background: #fff;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.footer-simple {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* Admin Styles Refined */
.admin-body {
    background-color: #f8fafc; /* 更加清爽的背景色 */
    min-height: 100vh;
}

.badge-admin {
    background: #1e293b;
    color: #fff;
    font-size: 0.75rem;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    margin-left: 0.5rem;
    vertical-align: middle;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.admin-wrapper {
    max-width: 1400px; /* 加宽整体容器 */
    margin: 3rem auto;
    padding: 0 2rem;
}

.admin-layout {
    display: grid;
    grid-template-columns: 400px 1fr; /* 左侧加宽 */
    gap: 2.5rem;
    align-items: start;
}

.admin-panel {
    background: #fff;
    border-radius: 1rem;
    padding: 2.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03); /* 更柔和的阴影 */
    border: 1px solid #e2e8f0;
}

.admin-sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    position: sticky;
    top: 2rem;
}

.category-list {
    margin-top: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.category-item {
    background: #f1f5f9;
    padding: 0.4rem 0.75rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #475569;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.category-item:hover {
    background: #fff;
    border-color: #cbd5e1;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.btn-icon-xs {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    color: #94a3b8;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
}

.btn-icon-xs:hover {
    color: #ef4444;
}

/* Category Sections in Tools Page */
.category-section {
    margin-bottom: 4rem;
}

.category-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.category-title::before {
    content: '';
    display: block;
    width: 6px;
    height: 1.5rem;
    background: var(--primary-color);
    border-radius: 3px;
}

.panel-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #f1f5f9;
}

.panel-header h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #0f172a;
    font-weight: 700;
}

.panel-header p {
    color: #64748b;
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #334155;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.75rem;
    font-family: inherit;
    font-size: 0.95rem;
    background-color: #fff;
    transition: all 0.2s ease;
    color: #1e293b;
}

.form-control:hover {
    border-color: #94a3b8;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-control::placeholder {
    color: #94a3b8;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    display: flex;
    gap: 1.5rem;
}

.form-group.half {
    flex: 1;
}

.form-actions {
    margin-top: 2.5rem;
    display: flex;
    gap: 1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.875rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 0.95rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background-color: #f1f5f9;
    color: #475569;
}

.btn-secondary:hover {
    background-color: #e2e8f0;
    color: #1e293b;
}

.full-width {
    width: 100%;
}

.hidden {
    display: none !important;
}

/* Admin Tool List */
.admin-tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.admin-tool-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.admin-tool-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    border-color: #cbd5e1;
    transform: translateY(-2px);
}

.tool-info {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.tool-icon-small {
    font-size: 1.75rem;
    background: #f8fafc;
    width: 3.5rem;
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.75rem;
    border: 1px solid #f1f5f9;
}

.tool-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.tool-details strong {
    color: #0f172a;
    font-size: 1rem;
}

.tool-meta {
    font-size: 0.75rem;
    color: #64748b;
    background: #f1f5f9;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    display: inline-block;
    align-self: flex-start;
    font-weight: 500;
}

.tool-actions {
    display: flex;
    gap: 0.75rem;
}

.btn-icon {
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
    color: #64748b;
}

.btn-edit:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: #eef2ff;
}

.btn-delete:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: #fef2f2;
}

@media (max-width: 1024px) {
    .admin-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .admin-panel {
        position: static;
    }
    
    .admin-wrapper {
        margin: 2rem auto;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }
    
    header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    nav ul {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
    }
}
