* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    color: #1a1a2e;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
}

h1 {
    font-size: 2.5rem;
    background: linear-gradient(90deg, #e94560, #ff6b6b, #feca57);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.subtitle {
    color: #64748b;
    font-size: 1.1rem;
}

.clipboard-history-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
}

.clipboard-history-header {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
    max-width: 800px;
    justify-content: center;
}

.clipboard-history-label {
    font-size: 1rem;
    font-weight: 600;
    color: #64748b;
}

.clear-history-btn {
    background: #e94560;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clear-history-btn:hover {
    background: #d63851;
    transform: scale(1.05);
}

.clear-history-btn:active {
    transform: scale(0.95);
}

.clipboard-history {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    min-height: 50px;
    align-items: center;
    width: 100%;
    max-width: 800px;
}

.clipboard-empty {
    color: #94a3b8;
    font-size: 0.95rem;
    font-style: italic;
}

.clipboard-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1.4rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clipboard-item:hover {
    background: #e0f2fe;
    border-color: #7dd3fc;
    transform: scale(1.1);
}

.categories {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-bottom: 30px;
}

.category {
    background: #f8fafc;
    border-radius: 16px;
    padding: 20px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.category.hidden {
    display: none;
}

.category:hover {
    background: #f1f5f9;
    border-color: rgba(233, 69, 96, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding-bottom: 15px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 15px;
}

.category-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #1e293b;
}

.category-count {
    background: rgba(233, 69, 96, 0.1);
    color: #e94560;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.9rem;
}

.toggle-icon {
    font-size: 1.5rem;
    transition: transform 0.3s ease;
    color: #64748b;
}

.category.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.category.collapsed .symbols-grid {
    display: none;
}

.symbols-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 12px;
}

.symbol-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 2.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #1a1a2e;
}

.symbol-btn:hover {
    background: #e0f2fe;
    border-color: #7dd3fc;
    transform: scale(1.1);
}

.symbol-btn:active {
    transform: scale(0.95);
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
    font-size: 1.2rem;
}

.toc-container {
    margin-top: 30px;
    padding: 20px 30px;
    background: #f8fafc;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
}

.toc-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 15px;
}

.toc-list {
    list-style-type: disc;
    padding-left: 25px;
    margin: 0;
}

.toc-list li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.toc-link {
    color: #5b8fb9;
    text-decoration: none;
    font-size: 1rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.toc-link:hover {
    color: #3d7a9e;
    text-decoration: underline;
}

.toc-link.active {
    color: #e94560;
    font-weight: 600;
}

.show-all-item {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
}

.show-all-link {
    color: #e94560;
    font-weight: 600;
}

.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.popup-overlay.show {
    opacity: 1;
    visibility: visible;
}

.popup-content {
    background: #7ec8e3;
    border-radius: 0;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.8);
    transition: all 0.3s ease;
    max-width: 90%;
    min-width: 320px;
    overflow: hidden;
}

.popup-overlay.show .popup-content {
    transform: scale(1);
}

.popup-body {
    padding: 40px 50px 30px;
}

.popup-symbol {
    font-size: 5rem;
    margin-bottom: 15px;
    line-height: 1;
}

.popup-message {
    font-size: 1.1rem;
    color: #333333;
    margin-bottom: 0;
    line-height: 1.5;
}

.popup-message .highlight {
    color: #e67e22;
    font-weight: 700;
}

.popup-close-bar {
    background: #3d8eb9;
    padding: 15px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.popup-close-bar:hover {
    background: #2d7aa3;
}

.popup-close {
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

@media (max-width: 768px) {
    h1 {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
    
    .clipboard-history-container {
        padding: 15px;
    }
    
    .clipboard-history-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .clipboard-item {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .toc-container {
        padding: 15px 20px;
    }
    
    .symbols-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
        gap: 10px;
    }
    
    .symbol-btn {
        width: 60px;
        height: 60px;
        font-size: 1.8rem;
    }
    
    .category-title {
        font-size: 1.1rem;
    }
    
    .popup-content {
        padding: 30px 25px;
    }
    
    .popup-symbol {
        font-size: 4rem;
    }
    
    .popup-message {
        font-size: 1rem;
    }
}
