* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
}

body {
    background: #f5f5f5;
    color: #333;
    line-height: 1.5;
}

header {
    background: #4CAF50;
    color: #fff;
    padding: 15px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}

header h1 {
    display: inline-block;
    font-size: 24px;
}

nav {
    display: inline-block;
    margin-left: 30px;
}

.nav-item {
    display: inline-block;
    position: relative;
    margin-right: 20px;
    cursor: pointer;
}

.nav-item>span {
    font-weight: bold;
}

.nav-item:hover {
    text-decoration: underline;
}

.submenu {
    display: none;
    position: absolute;
    top: 30px;
    left: 0;
    background: #fff;
    color: #333;
    border: 1px solid #ddd;
    min-width: 240px;
    /* 或 240px */
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    z-index: 200;
}

.submenu span,
.submenu a {
    display: block;
    padding: 8px 12px;
    text-decoration: none;
    color: #333;
    cursor: pointer;
    position: relative;
    white-space: nowrap;
}

.submenu span:hover,
.submenu a:hover {
    background: #f0f0f0;
}

.submenu .submenu {
    top: 0;
    left: 100%;
}

.submenu .has-submenu {
    padding-right: 32px;
    /* 给小三角留空间 */
}


.has-submenu::after {
    content: '▶';
    position: absolute;
    right: 10px;
    font-size: 12px;
    color: #666;
}

main {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.category-bar {
    margin-bottom: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.category-btn {
    padding: 6px 12px;
    cursor: pointer;
    border: none;
    border-radius: 4px;
    background: #e0e0e0;
    transition: 0.2s;
}

.category-btn:hover {
    background: #d5d5d5;
}

.category-btn.active {
    background: #4CAF50;
    color: #fff;
}

.more-dropdown {
    position: relative;
    display: inline-block;
}

.more-menu {
    display: none;
    position: absolute;
    top: 30px;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    z-index: 200;
    min-width: 160px;
}

.more-menu button {
    display: block;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: #fff;
    text-align: left;
    cursor: pointer;
}

.more-menu button:hover {
    background: #f0f0f0;
}

.search-container {
    position: relative;
    margin-bottom: 20px;
}

#toolSearch {
    width: 100%;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #ccc;
    font-size: 14px;
}

.search-results {
    display: none;
    position: absolute;
    top: 36px;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    max-height: 250px;
    overflow-y: auto;
    z-index: 300;
}

.search-results div {
    padding: 8px 12px;
    cursor: pointer;
}

.search-results div:hover {
    background: #f0f0f0;
}

.tools-block {
    margin-top: 30px;
}

.tools-block h3 {
    margin-bottom: 12px;
    border-bottom: 1px solid #ccc;
    padding-bottom: 4px;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin-top: 8px;
}

.tool-item {
    background: #fff;
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
    cursor: pointer;
    transition: 0.2s;
}

.tool-item:hover {
    background: #e8f5e9;
}

.tool-item .emoji {
    font-size: 24px;
    margin-bottom: 6px;
}

.tool-item .desc {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

.ad-slot {
    margin: 30px 0;
    padding: 15px;
    background: #ffe0b2;
    text-align: center;
    border: 1px dashed #ff9800;
    font-weight: bold;
}

footer {
    background: #333;
    color: #fff;
    padding: 20px;
    text-align: center;
    margin-top: 40px;
}

footer a {
    color: #4CAF50;
    text-decoration: none;
    margin: 0 8px;
}

footer a:hover {
    text-decoration: underline;
}