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

:root {
    --primary-color: #ffaaa5;
    --primary-hover: #ff8a85;
    --accent-color: #a8e6cf;
    --accent-secondary: #fdffab;
    --bg-color: #fff9f5;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #fff0ed;
    --text-primary: #4a4a4a;
    --text-secondary: #6b6b6b;
    --text-muted: #9a9a9a;
    --border-color: #ffd3b6;
    --shadow: 0 4px 12px rgba(255, 170, 165, 0.15);
    --shadow-hover: 0 8px 24px rgba(255, 170, 165, 0.25);
    --radius: 16px;
    --radius-sm: 10px;
    --transition: all 0.3s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #fff9f5 0%, #f0fff8 50%, #fffef0 100%);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 20% 80%, rgba(255, 170, 165, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(168, 230, 207, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 40% 40%, rgba(253, 255, 171, 0.06) 0%, transparent 50%);
    animation: bgFloat 20s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes bgFloat {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(120deg); }
    66% { transform: translate(-20px, 20px) rotate(240deg); }
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-header {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
    position: relative;
    border: 2px solid var(--border-color);
    overflow: hidden;
}

.app-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, #ffaaa5 0%, #fdffab 33%, #a8e6cf 66%, #ffd3b6 100%);
    background-size: 300% 100%;
    animation: gradientShift 8s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.header-content {
    position: relative;
    z-index: 1;
}

.header-top {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.header-content h1 {
    font-size: 2.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffaaa5 0%, #a8e6cf 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.header-decoration {
    height: 60px;
    width: auto;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

.header-content p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.hitokoto-container {
    background: linear-gradient(135deg, #fff0ed 0%, #f0fff8 50%, #fffef0 100%);
    border-radius: var(--radius-sm);
    padding: 20px 25px;
    border: 2px solid var(--border-color);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    position: relative;
    transition: var(--transition);
}

.hitokoto-container:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(255, 170, 165, 0.2);
    transform: translateY(-2px);
}

.hitokoto-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.hitokoto-text {
    flex: 1;
    color: var(--text-primary);
    font-size: 1rem;
    line-height: 1.6;
    font-style: italic;
    position: relative;
}

.hitokoto-text::before {
    content: '"';
    font-size: 2rem;
    color: var(--primary-color);
    opacity: 0.3;
    position: absolute;
    top: -10px;
    left: -15px;
    font-family: Georgia, serif;
}

.hitokoto-loading {
    color: var(--text-muted);
    font-style: normal;
}

.hitokoto-from {
    display: block;
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: right;
    font-style: normal;
}

.app-main {
    flex: 1;
}

.tools-list {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.category-section {
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.category-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--border-color);
}

.category-icon {
    font-size: 2rem;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.category-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.category-description {
    color: var(--text-muted);
    font-size: 0.9rem;
}

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

.tool-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 25px;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #ffaaa5 0%, #fdffab 50%, #a8e6cf 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.tool-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

.tool-card:hover::before {
    transform: scaleX(1);
}

.tool-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.tool-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #fff0ed 0%, #f0fff8 100%);
    border-radius: var(--radius-sm);
    border: 2px solid var(--border-color);
    transition: var(--transition);
}

.tool-card:hover .tool-icon {
    transform: scale(1.1) rotate(5deg);
    border-color: var(--primary-color);
}

.tool-info h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 5px;
}

.tool-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.tool-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.tool-tag {
    background: linear-gradient(135deg, #fff0ed 0%, #f0fff8 100%);
    color: var(--text-secondary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.tool-card:hover .tool-tag {
    border-color: var(--primary-color);
}

.empty-category {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 2px dashed var(--border-color);
}

.app-footer {
    text-align: center;
    padding: 30px;
    margin-top: 40px;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 2px solid var(--border-color);
    position: relative;
}

.footer-decoration {
    margin-bottom: 10px;
}

.footer-icon {
    font-size: 1.5rem;
    animation: spin 10s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.loading {
    text-align: center;
    padding: 60px;
    color: var(--text-muted);
    font-size: 1.2rem;
}

.error {
    text-align: center;
    padding: 60px;
    color: #ff6b6b;
    font-size: 1.1rem;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 2px solid #ff6b6b;
}

@media (max-width: 768px) {
    .app-container {
        padding: 10px;
    }

    .app-header {
        padding: 25px;
    }

    .header-content h1 {
        font-size: 2rem;
    }

    .tools-grid {
        grid-template-columns: 1fr;
    }

    .category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .hitokoto-container {
        padding: 15px;
    }

    .hitokoto-text {
        font-size: 0.9rem;
    }
}
