* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}


.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: 15px;
    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: 6px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    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: 6px;
    min-height: 40px;
    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: 56px;
    height: 56px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1.8rem;
    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-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.category-wrapper.hidden {
    display: none;
}

.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;
    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;
    margin-left: 10px;
}

.toggle-icon {
    font-size: 1.5rem;
    transition: all 0.2s ease;
    color: #64748b;
    user-select: none;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
}

.toggle-icon:hover {
    color: #e94560;
    background: rgba(233, 69, 96, 0.1);
    border-color: #e94560;
}

.category.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.category.collapsed .symbols-grid {
    display: none !important;
}

.category.collapsed .category-header {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.category.collapsed .category-description {
    display: none !important;
}

.symbols-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(56px, 1fr));
    gap: 10px;
}

.symbol-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1.8rem;
    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;
}

.category-description {
    font-size: 1rem;
    line-height: 1.8;
    color: #374151;
    margin: 20px 0 0 0;
    padding: 0 5px;
    background: none;
    border: none;
    display: none;
}

.category-description.show {
    display: block;
}

.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: 280px;
    overflow: hidden;
}

.popup-overlay.show .popup-content {
    transform: scale(1);
}

.popup-body {
    padding: 30px 40px 25px;
}

.popup-symbol {
    font-size: 4rem;
    margin-bottom: 15px;
    line-height: 1;
}

.popup-message {
    font-size: 1rem;
    color: #333333;
    margin-bottom: 0;
    line-height: 1.5;
}

.popup-message .highlight {
    color: #e67e22;
    font-weight: 700;
}

.popup-close-bar {
    background: #3d8eb9;
    padding: 12px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.popup-close-bar:hover {
    background: #2d7aa3;
}

.popup-close {
    color: #ffffff;
    font-size: 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: 12px;
    }
    
    .clipboard-history-header {
        flex-direction: column;
        gap: 10px;
    }
    
    .clipboard-item {
        width: 48px;
        height: 48px;
        font-size: 1.5rem;
    }

    .toc-container {
        padding: 15px 20px;
    }
    
    .symbols-grid {
        grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
        gap: 8px;
    }
    
    .symbol-btn {
        width: 48px;
        height: 48px;
        font-size: 1.5rem;
    }
    
    .category-title {
        font-size: 1.1rem;
    }
    
    .popup-content {
        padding: 25px 20px;
    }
    
    .popup-symbol {
        font-size: 3rem;
    }
    
    .popup-message {
        font-size: 0.95rem;
    }
}

#symbol-cleaner .symbols-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)) !important;
    gap: 10px !important;
}

#symbol-cleaner .category.collapsed .symbols-grid {
    display: none !important;
}

#symbol-cleaner .symbol-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 56px !important;
    height: 56px !important;
    min-width: 56px !important;
    min-height: 56px !important;
    max-width: 56px !important;
    max-height: 56px !important;
    font-size: 1.8rem !important;
    line-height: 1 !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    margin: 0 !important;
}

#symbol-cleaner .symbol-btn:hover {
    background: #e0f2fe !important;
    border-color: #7dd3fc !important;
    transform: scale(1.1) !important;
}

#symbol-cleaner .clipboard-item {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 56px !important;
    height: 56px !important;
    min-width: 56px !important;
    min-height: 56px !important;
    max-width: 56px !important;
    max-height: 56px !important;
    font-size: 1.8rem !important;
    line-height: 1 !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    margin: 0 !important;
}

#symbol-cleaner .clipboard-item:hover {
    background: #e0f2fe !important;
    border-color: #7dd3fc !important;
    transform: scale(1.1) !important;
}

@media (max-width: 768px) {
    #symbol-cleaner .symbols-grid {
        grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)) !important;
        gap: 8px !important;
    }
    
    #symbol-cleaner .symbol-btn {
        width: 48px !important;
        height: 48px !important;
        min-width: 48px !important;
        min-height: 48px !important;
        max-width: 48px !important;
        max-height: 48px !important;
        font-size: 1.5rem !important;
    }
    
    #symbol-cleaner .clipboard-item {
        width: 48px !important;
        height: 48px !important;
        min-width: 48px !important;
        min-height: 48px !important;
        max-width: 48px !important;
        max-height: 48px !important;
        font-size: 1.5rem !important;
    }
}
