* {
    box-sizing: border-box;
}

body {
    font-family: 'Google Sans', 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #ffffff;
    color: #202124;
    line-height: 1.5;
}

.app-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: #ffffff;
    border-bottom: 1px solid #dadce0;
    padding: 16px 24px;
}

.app-bar-content {
    max-width: 1200px;
    margin: 0 auto;
}

.app-bar h1 {
    margin: 0 0 24px 0;
    font-size: 32px;
    font-weight: 400;
    color: #202124;
}

.controls {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.search-container {
    flex: 1;
    min-width: 280px;
    position: relative;
}

.search-field {
    width: 100%;
    height: 48px;
    padding: 0 16px 0 48px;
    border: 1px solid #dadce0;
    border-radius: 24px;
    font-size: 16px;
    font-family: 'Google Sans', 'Roboto', sans-serif;
    background-color: #ffffff;
    color: #202124;
}

.search-field:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

.search-field::placeholder {
    color: #5f6368;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #5f6368;
    font-size: 20px;
}

.style-toggle {
    display: flex;
    border: 1px solid #dadce0;
    border-radius: 8px;
    overflow: hidden;
    background-color: #ffffff;
}

.style-toggle button {
    height: 36px;
    padding: 0 16px;
    border: none;
    background-color: transparent;
    color: #3c4043;
    cursor: pointer;
    font-family: 'Google Sans', 'Roboto', sans-serif;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.style-toggle button:hover {
    background-color: #f8f9fa;
}

.style-toggle button.active {
    background-color: #1a73e8;
    color: #ffffff;
}

.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

.icons-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 24px;
    border-radius: 8px;
    overflow: hidden;
}

.icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 16px;
    cursor: pointer;
    background-color: #ffffff;
    position: relative;
    border-radius: 8px;
}

.icon-item:hover {
    background-color: #ededed;
}

.icon-item:active {
    background-color: #e8f0fe;
}

.icon-symbol {
    font-size: 48px;
    margin-bottom: 16px;
    color: #444746;
    user-select: none;
    transition: all 0.2s ease;
}

.icon-name {
    font-size: 15px;
    text-align: center;
    color: #444746;
    word-break: break-word;
    line-height: 1.3;
    user-select: none;
    transition: all 0.2s ease;
}

.icon-item:hover .icon-name {
    color: #202124;
}

.snackbar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: #202124;
    color: #ffffff;
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 400;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(32, 33, 36, 0.28);
}

.snackbar.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .app-bar {
        padding: 16px;
    }

    .app-bar h1 {
        font-size: 28px;
        margin-bottom: 16px;
    }

    .controls {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .search-container {
        min-width: auto;
    }

    .main-content {
        padding: 16px;
    }

    .icons-container {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .icon-item {
        padding: 16px 8px;
    }
}

/* 平板适配 */
@media (min-width: 769px) and (max-width: 1024px) {
    .icons-container {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #dadce0;
    border-radius: 4px;
    transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: #bdc1c6;
}

/* Firefox滚动条 */
* {
    scrollbar-width: thin;
    scrollbar-color: #dadce0 #f8f9fa;
}

/* 选择状态样式 */
::selection {
    background-color: #e8f0fe;
    color: #1967d2;
}

::-moz-selection {
    background-color: #e8f0fe;
    color: #1967d2;
}

/* 加载状态和空状态样式 */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 48px;
    color: #5f6368;
    font-size: 16px;
    background-color: #ffffff;
    border-radius: 8px;
    border: 1px dashed #dadce0;
}

/* 自定义下拉框样式 */
.custom-select {
    position: relative;
    min-width: 180px;
    user-select: none;
}

.select-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
    padding: 0 16px;
    border: 1px solid #dadce0;
    border-radius: 8px;
    background-color: #ffffff;
    color: #3c4043;
    cursor: pointer;
    font-size: 14px;
    font-family: 'Google Sans', 'Roboto', sans-serif;
    position: relative;
}

.select-display:hover {
    background-color: #f8f9fa;
    border-color: #1a73e8;
}

.select-display.active {
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

.select-text {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.select-arrow {
    font-size: 20px;
    color: #5f6368;
    margin-left: 8px;
    flex-shrink: 0;
}

.select-display.active .select-arrow {
    transform: rotate(180deg);
    color: #1a73e8;
}

.select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #ffffff;
    border: 1px solid #dadce0;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    margin-top: 4px;
}

.select-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.select-option {
    padding: 12px 16px;
    cursor: pointer;
    color: #3c4043;
    font-size: 14px;
    border-bottom: 1px solid #f8f9fa;
    position: relative;
}

.select-option:last-child {
    border-bottom: none;
}

.select-option:hover {
    background-color: #f8f9fa;
    color: #1a73e8;
}

.select-option.selected {
    background-color: #e8f0fe;
    color: #1967d2;
    font-weight: 500;
}

.select-option.selected::after {
    content: '✓';
    position: absolute;
    right: 16px;
    color: #1a73e8;
    font-weight: bold;
}

/* 键盘导航支持 */
.select-option:focus {
    outline: none;
    background-color: #f8f9fa;
    color: #1a73e8;
}

.select-display:focus-visible {
    outline: 2px solid #1a73e8;
    outline-offset: 2px;
}

/* 应用栏头部布局 */
.app-bar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.app-bar h1 {
    margin: 0;
    font-size: 32px;
    font-weight: 400;
    color: #202124;
}

/* 主题切换按钮 */
.theme-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 20px;
    background-color: #ffffff;
    color: #5f6368;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.theme-toggle-btn:hover {
    background-color: #f8f9fa;
    border-color: #1a73e8;
    color: #1a73e8;
}

.theme-toggle-btn:focus-visible {
    outline: 2px solid #1a73e8;
    outline-offset: 2px;
}

.theme-toggle-btn .material-icons {
    font-size: 24px;
    transition: all 0.3s ease;
}

/* 主题切换动画 */
.theme-toggle-btn.switching {
    animation: themeToggleRotate 0.6s ease;
}

@keyframes themeToggleRotate {
    0% { transform: rotate(0deg); }
    50% { transform: rotate(180deg) scale(1.05); }
    100% { transform: rotate(360deg); }
}

/* 深色主题样式 */
body.dark-theme {
    background-color: #202124;
    color: #e8eaed;
}

body.dark-theme .app-bar {
    background-color: #202124;
    border-bottom-color: #5f6368;
}

body.dark-theme .app-bar h1 {
    color: #e8eaed;
}

body.dark-theme .theme-toggle-btn {
    background-color: #202124;
    border-color: #5f6368;
    color: #9aa0a6;
}

body.dark-theme .theme-toggle-btn:hover {
    background-color: #3c4043;
    border-color: #8ab4f8;
    color: #8ab4f8;
}

body.dark-theme .search-field {
    background-color: #303134;
    border-color: #5f6368;
    color: #e8eaed;
}

body.dark-theme .search-field::placeholder {
    color: #9aa0a6;
}

body.dark-theme .search-icon {
    color: #9aa0a6;
}

body.dark-theme .search-field:hover {
    background-color: #3c4043;
    border-color: #8ab4f8;
}

body.dark-theme .search-field:focus {
    border-color: #8ab4f8;
    box-shadow: 0 0 0 2px rgba(138, 180, 248, 0.2);
}

body.dark-theme .select-display {
    background-color: #303134;
    border-color: #5f6368;
    color: #e8eaed;
}

body.dark-theme .select-display:hover {
    background-color: #3c4043;
    border-color: #8ab4f8;
}

body.dark-theme .select-display.active {
    border-color: #8ab4f8;
    box-shadow: 0 0 0 2px rgba(138, 180, 248, 0.2);
}

body.dark-theme .select-arrow {
    color: #9aa0a6;
}

body.dark-theme .select-display.active .select-arrow {
    color: #8ab4f8;
}

body.dark-theme .select-dropdown {
    background-color: #303134;
    border-color: #5f6368;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

body.dark-theme .select-option {
    color: #e8eaed;
    border-bottom-color: #3c4043;
}

body.dark-theme .select-option:hover {
    background-color: #3c4043;
    color: #8ab4f8;
}

body.dark-theme .select-option.selected {
    background-color: #1a73e8;
    color: #ffffff;
}

body.dark-theme .select-option.selected::after {
    color: #ffffff;
}

body.dark-theme .style-toggle {
    background-color: #303134;
    border-color: #5f6368;
}

body.dark-theme .style-toggle button {
    color: #9aa0a6;
}

body.dark-theme .style-toggle button:hover {
    background-color: #3c4043;
    color: #e8eaed;
}

body.dark-theme .style-toggle button.active {
    background-color: #1a73e8;
    color: #ffffff;
}

body.dark-theme .icon-item {
    background-color: #202124;
}

body.dark-theme .icon-item:hover {
    background-color: #3c4043;
}

body.dark-theme .icon-item:active {
    background-color: #1a73e8;
}

body.dark-theme .icon-symbol {
    color: #e8eaed;
}

body.dark-theme .icon-name {
    color: #9aa0a6;
}

body.dark-theme .icon-item:hover .icon-name {
    color: #e8eaed;
}

body.dark-theme .snackbar {
    background-color: #3c4043;
    color: #e8eaed;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

body.dark-theme .empty-state {
    background-color: #202124;
    border-color: #5f6368;
    color: #9aa0a6;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .app-bar-header {
        margin-bottom: 16px;
    }

    .app-bar h1 {
        font-size: 28px;
    }

    .theme-toggle-btn {
        width: 36px;
        height: 36px;
    }

    .theme-toggle-btn .material-icons {
        font-size: 18px;
    }

    .custom-select {
        min-width: auto;
        width: 100%;
    }

    .select-dropdown {
        max-height: 250px;
    }

    .select-option {
        padding: 16px;
        font-size: 14px;
    }
}

/* 类别头部样式 */
.category-header {
    grid-column: 1 / -1;
    padding: 0 8px;
    display: flex;
    align-items: center;
    position: relative;
    margin-top: 8px;
}

.category-header:first-child {
    margin-top: 0;
}

.category-title {
    font-size: 18px;
    font-weight: 500;
    color: #3c4043;
    background-color: #ffffff;
    padding: 0 12px 0 0;
    margin: 0;
    letter-spacing: 0.25px;
    position: relative;
    z-index: 1;
}

/* 深色主题下的类别头部样式 */
body.dark-theme .category-title {
    color: #e8eaed;
    background-color: #202124;
}

/* 类别头部的响应式调整 */
@media (max-width: 768px) {
    .category-header {
        margin: 24px 0 12px 0;
        padding: 0 4px;
    }

    .category-title {
        font-size: 16px;
        padding-right: 8px;
    }
}

/* 优化图标容器在有类别头部时的间距 */
.icons-container.with-categories {
    gap: 16px;
}

.icons-container.with-categories .icon-item {
    margin-bottom: 8px;
}

/* 深色主题下的滚动条样式 */
body.dark-theme ::-webkit-scrollbar-track {
    background: #303134;
}

body.dark-theme ::-webkit-scrollbar-thumb {
    background: #5f6368;
}

body.dark-theme ::-webkit-scrollbar-thumb:hover {
    background: #9aa0a6;
}

body.dark-theme * {
    scrollbar-color: #5f6368 #303134;
}

/* 弹窗样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.show .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e0e0e0;
    background-color: #fafafa;
}

.modal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 500;
    color: #202124;
}

.modal-close-btn {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background-color: transparent;
    color: #5f6368;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.modal-close-btn:hover {
    background-color: #e8eaed;
}

.modal-close-btn .material-icons {
    font-size: 20px;
}

.modal-body {
    display: flex;
    padding: 24px;
    gap: 24px;
    align-items: center;
}

.modal-icon-section {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 140px;
    height: 140px;
    border-radius: 12px;
    background-color: #f8f9fa;
    border: 2px solid #e8eaed;
}

.modal-icon-large {
    font-size: 76px !important;
    color: #1a73e8;
}

.modal-info-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    overflow: hidden;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.info-item label {
    font-size: 14px;
    font-weight: 500;
    color: #5f6368;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-value {
    font-size: 14px;
    color: #202124;
    background-color: #f8f9fa;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #e8eaed;
    font-family: 'Roboto Mono', monospace;
    line-height: 1.4;
    white-space: nowrap;
    overflow-x: auto;
    word-break: normal;
    min-width: 0;
    max-width: 100%;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid #e0e0e0;
    background-color: #fafafa;
}

.modal-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Google Sans', 'Roboto', sans-serif;
}

.modal-btn.primary {
    background-color: #1a73e8;
    color: #ffffff;
}

.modal-btn.primary:hover {
    background-color: #1557b0;
    box-shadow: 0 2px 8px rgba(26, 115, 232, 0.3);
}

.modal-btn.secondary {
    background-color: #ffffff;
    color: #1a73e8;
    border: 1px solid #dadce0;
}

.modal-btn.secondary:hover {
    background-color: #f8f9fa;
    border-color: #1a73e8;
}

.modal-btn .material-icons {
    font-size: 18px;
}

/* 深色主题下的弹窗样式 */
body.dark-theme .modal-overlay {
    background-color: rgba(0, 0, 0, 0.7);
}

body.dark-theme .modal-content {
    background-color: #303134;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

body.dark-theme .modal-header {
    background-color: #202124;
    border-bottom-color: #5f6368;
}

body.dark-theme .modal-title {
    color: #e8eaed;
}

body.dark-theme .modal-close-btn {
    color: #9aa0a6;
}

body.dark-theme .modal-close-btn:hover {
    background-color: #3c4043;
}

body.dark-theme .modal-icon-section {
    background-color: #202124;
    border-color: #5f6368;
}

body.dark-theme .modal-icon-large {
    color: #8ab4f8;
}

body.dark-theme .info-item label {
    color: #9aa0a6;
}

body.dark-theme .info-value {
    color: #e8eaed;
    background-color: #202124;
    border-color: #5f6368;
}

body.dark-theme .modal-footer {
    background-color: #202124;
    border-top-color: #5f6368;
}

body.dark-theme .modal-btn.primary {
    background-color: #1a73e8;
    color: #ffffff;
}

body.dark-theme .modal-btn.primary:hover {
    background-color: #1557b0;
}

body.dark-theme .modal-btn.secondary {
    background-color: #303134;
    color: #8ab4f8;
    border-color: #5f6368;
}

body.dark-theme .modal-btn.secondary:hover {
    background-color: #3c4043;
    border-color: #8ab4f8;
}

/* 移动端弹窗适配 */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 90vh;
        margin: 20px;
    }

    .modal-body {
        flex-direction: column;
        gap: 24px;
        align-items: center;
        text-align: center;
    }

    .modal-icon-section {
        width: 100px;
        height: 100px;
    }

    .modal-icon-large {
        font-size: 88px !important;
    }

    .modal-info-section {
        width: 100%;
        min-width: 0;
    }

    .modal-footer {
        flex-direction: column;
        gap: 8px;
    }

    .modal-btn {
        width: 100%;
        justify-content: center;
    }

    .info-value {
        font-size: 14px;
        word-break: break-all;
    }
}
