/* Hand-drawn Style Variables */
:root {
    --primary-color: #2b3a42;
    --text-color: #333;
    --bg-color: #f9f7f1; /* Warm paper color */
    --card-bg: #fff;
    --highlight: #ffd700;
    
    /* Category Colors */
    --finance-color: #f7b731;
    --career-color: #4b7bec;
    --transport-color: #20bf6b;
    --health-color: #fc5c65;
    --family-color: #a55eea;

    --doodle-border: 2px solid #333;
    --doodle-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
    --shadow-doodle: 4px 4px 0 #333;
}

body {
    font-family: "Noto Sans SC", "Patrick Hand", cursive, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Paper Texture Overlay */
.paper-texture {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' opacity='0.5'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.08'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: -1;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    text-align: center;
    padding: 60px 0 40px;
}

.logo-text {
    font-family: "Long Cang", "Patrick Hand", cursive;
    font-size: 4rem;
    color: var(--text-color);
    margin-bottom: 5px;
    position: relative;
    display: inline-block;
}

.doodle-star {
    font-size: 2rem;
    vertical-align: super;
}

.subtitle {
    font-family: "Patrick Hand", cursive;
    font-size: 1.5rem;
    color: #666;
    margin-bottom: 30px;
}

/* Search */
.search-container {
    max-width: 500px;
    margin: 0 auto;
    position: relative;
    display: flex;
    gap: 10px;
}

#searchInput {
    flex: 1;
    padding: 15px 20px;
    font-family: "Patrick Hand", cursive;
    font-size: 1.2rem;
    border: var(--doodle-border);
    border-radius: 255px 25px 225px 25px / 25px 225px 25px 255px;
    background: #fff;
    outline: none;
    transition: all 0.3s ease;
}

#searchInput:focus {
    box-shadow: var(--shadow-doodle);
    transform: translateY(-2px);
}

#searchBtn {
    background: var(--finance-color);
    border: var(--doodle-border);
    border-radius: 50%;
    width: 55px;
    height: 55px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#searchBtn:hover {
    box-shadow: var(--shadow-doodle);
    transform: rotate(10deg);
}

/* Navigation */
.category-nav {
    position: sticky;
    top: 0;
    background: rgba(249, 247, 241, 0.95);
    z-index: 100;
    padding: 15px 0;
    overflow-x: auto;
    border-bottom: 2px dashed rgba(0,0,0,0.1);
}

.category-nav .container {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.cat-btn {
    font-family: "Patrick Hand", cursive;
    font-size: 1.1rem;
    padding: 8px 16px;
    background: #fff;
    border: 2px solid #333;
    border-radius: 20px 225px 15px 25px / 225px 15px 225px 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.cat-btn:hover, .cat-btn.active {
    background: var(--text-color);
    color: #fff;
    transform: scale(1.05) rotate(-2deg);
}

/* Tools Grid */
.tools-grid {
    padding: 40px 0;
}

.category-section {
    margin-bottom: 60px;
}

.category-title {
    font-family: "Ma Shan Zheng", cursive;
    font-size: 2rem;
    margin-bottom: 30px;
    position: relative;
    padding-left: 15px;
}

.category-title small {
    font-family: "Patrick Hand", cursive;
    font-size: 1.2rem;
    color: #888;
    margin-left: 10px;
}

.marker-highlight {
    position: relative;
    z-index: 1;
}

.marker-highlight::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: -5px;
    right: -5px;
    height: 12px;
    background: rgba(255, 215, 0, 0.4);
    z-index: -1;
    border-radius: 4px;
    transform: rotate(-1deg);
}

.cards-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.tool-card {
    background: #fff;
    border: var(--doodle-border);
    border-radius: 12px; /* Fallback */
    border-radius: 20px 225px 15px 255px / 255px 15px 225px 15px;
    padding: 25px;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: relative;
}

.tool-card:hover {
    box-shadow: var(--shadow-doodle);
    transform: translateY(-5px) rotate(1deg);
}

.icon-box {
    width: 50px;
    height: 50px;
    margin-bottom: 15px;
    padding: 10px;
    /* Hand-drawn circle bg */
    border: 2px solid currentColor;
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Category Colors for Icons */
.color-finance { color: var(--finance-color); }
.color-career { color: var(--career-color); }
.color-transport { color: var(--transport-color); }
.color-health { color: var(--health-color); }
.color-family { color: var(--family-color); }

.tool-card h3 {
    margin: 0 0 5px 0;
    font-size: 1.25rem;
    font-weight: 700;
}

.en-name {
    display: block;
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 15px;
    font-family: "Patrick Hand", cursive;
}

.tool-card p {
    margin: 0;
    font-size: 0.95rem;
    color: #555;
    line-height: 1.5;
}

/* Ad Container */
.ad-container {
    margin: 40px auto;
    padding: 20px;
    border: 2px dashed #ddd;
    border-radius: 15px;
    background: rgba(255,255,255,0.5);
    text-align: center;
    min-height: 100px;
}

/* Footer */
.site-footer {
    text-align: center;
    padding: 40px 0;
    margin-top: 60px;
    border-top: 2px solid #333;
    background: #fff;
}

/* Responsive */
@media (max-width: 768px) {
    .category-nav {
        justify-content: flex-start;
        padding-left: 20px;
    }
    
    .category-nav .container {
        flex-wrap: nowrap;
        justify-content: flex-start;
    }
    
    .logo-text {
        font-size: 3rem;
    }
}
