:root {
    --bg-color: #000000;
    --card-bg: rgba(28, 28, 30, 0.6);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-primary: #f5f5f7;
    --text-secondary: #86868b;
    --accent-color: #0071e3;
    --accent-hover: #0077ed;
    --danger-color: #ff3b30;
    --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 22px;
}

/* Background Glow */
.background-glow {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 50% 30%, rgba(0, 113, 227, 0.15) 0%, transparent 40%);
    z-index: -1;
    pointer-events: none;
}

/* Header */
header {
    height: 44px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    position: sticky;
    top: 0;
    z-index: 9999;
    border-bottom: 1px solid var(--card-border);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 22px;
}

.logo {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0.9;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-links a {
    color: #d1d1d6;
    text-decoration: none;
    font-size: 12px;
    transition: color 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    color: #fff;
}

.nav-btn {
    background: transparent;
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    padding: 4px 12px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
}

.nav-btn:hover,
.nav-btn.active {
    background: var(--text-primary);
    color: var(--bg-color);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 120px 0 80px;
}

.hero h1 {
    font-size: 56px;
    line-height: 1.07143;
    font-weight: 700;
    letter-spacing: -0.005em;
    margin-bottom: 16px;
    background: linear-gradient(180deg, #fff 0%, #a1a1a6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 24px;
    line-height: 1.16667;
    font-weight: 400;
    letter-spacing: 0.009em;
    color: var(--text-secondary);
    margin-bottom: 50px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.search-bar {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-bar i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 14px;
}

.search-bar input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border-radius: 12px;
    border: none;
    background: #1d1d1f;
    color: var(--text-primary);
    font-size: 17px;
    outline: none;
    transition: background 0.2s;
}

.search-bar input:focus {
    background: #2c2c2e;
}

/* Tools Section */
.section-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-bottom: 40px;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
}

.filter-group {
    background: #1d1d1f;
    padding: 3px;
    border-radius: 980px;
    /* Pill shape */
    display: flex;
}

.filter-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 8px 16px;
    border-radius: 980px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.filter-btn:hover {
    color: var(--text-primary);
}

.filter-btn.active {
    background: #3a3a3c;
    color: #fff;
}

.add-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.add-btn:hover {
    background: var(--accent-hover);
}

.add-btn.hidden {
    display: none;
}

/* Tools Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    padding-bottom: 100px;
}

.tool-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 30px;
    transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1), box-shadow 0.3s;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.tool-card:hover {
    transform: scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    z-index: 10;
}

.delete-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--danger-color);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 20;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    from {
        transform: scale(0);
    }

    to {
        transform: scale(1);
    }
}

.tool-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 20px;
}

.tool-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.tool-tags {
    display: flex;
    gap: 6px;
}

.tag {
    font-size: 10px;
    padding: 4px 10px;
    border-radius: 980px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tag.cn {
    background: rgba(255, 59, 48, 0.15);
    color: #ff453a;
}

.tag.global {
    background: rgba(10, 132, 255, 0.15);
    color: #0a84ff;
}

.tool-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.tool-desc {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.4;
    margin-bottom: 24px;
    flex-grow: 1;
}

.visit-btn {
    display: inline-block;
    color: var(--accent-color);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: opacity 0.2s;
}

.visit-btn:hover {
    text-decoration: underline;
    opacity: 0.8;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.modal:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: #1c1c1e;
    width: 90%;
    max-width: 500px;
    padding: 40px;
    border-radius: 24px;
    border: 1px solid var(--card-border);
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.modal:not(.hidden) .modal-content {
    transform: scale(1);
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover {
    color: var(--text-primary);
}

.modal h2 {
    margin-bottom: 24px;
    font-size: 24px;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-row .form-group {
    flex: 1;
}

label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 13px;
}

input,
textarea,
select {
    width: 100%;
    background: #2c2c2e;
    border: 1px solid transparent;
    padding: 12px;
    border-radius: 12px;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--accent-color);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

.submit-btn {
    width: 100%;
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: background 0.2s;
}

.submit-btn:hover {
    background: var(--accent-hover);
}

/* Footer */
footer {
    border-top: 1px solid var(--card-border);
    padding: 60px 0;
}

.tool-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.tool-tags {
    display: flex;
    gap: 6px;
}

.tag {
    font-size: 10px;
    padding: 4px 10px;
    border-radius: 980px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tag.cn {
    background: rgba(255, 59, 48, 0.15);
    color: #ff453a;
}

.tag.global {
    background: rgba(10, 132, 255, 0.15);
    color: #0a84ff;
}

.tool-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.tool-desc {
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.4;
    margin-bottom: 24px;
    flex-grow: 1;
}

.visit-btn {
    display: inline-block;
    color: var(--accent-color);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: opacity 0.2s;
}

.visit-btn:hover {
    text-decoration: underline;
    opacity: 0.8;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.modal:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: #1c1c1e;
    width: 90%;
    max-width: 500px;
    padding: 40px;
    border-radius: 24px;
    border: 1px solid var(--card-border);
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.modal:not(.hidden) .modal-content {
    transform: scale(1);
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover {
    color: var(--text-primary);
}

.modal h2 {
    margin-bottom: 24px;
    font-size: 24px;
    text-align: center;
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-row .form-group {
    flex: 1;
}

label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 13px;
}

input,
textarea,
select {
    width: 100%;
    background: #2c2c2e;
    border: 1px solid transparent;
    padding: 12px;
    border-radius: 12px;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--accent-color);
}

textarea {
    resize: vertical;
    min-height: 80px;
}

.submit-btn {
    width: 100%;
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: background 0.2s;
}

.submit-btn:hover {
    background: var(--accent-hover);
}

/* Footer */
footer {
    border-top: 1px solid var(--card-border);
    padding: 60px 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.category-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #2c2c2e;
    padding: 10px 15px;
    border-radius: 12px;
}

.category-item span {
    font-weight: 500;
}

.delete-cat-btn {
    background: transparent;
    border: none;
    color: var(--danger-color);
    cursor: pointer;
    font-size: 14px;
    padding: 5px;
    transition: opacity 0.2s;
}

.delete-cat-btn:hover {
    opacity: 0.7;
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 40px;
    }

    .hero p {
        font-size: 19px;
    }

    .filters {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        overflow-x: auto;
    }
}