body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    background-color: #f4f7f9;
    color: #333;
    margin: 0;
}

.container {
    width: 100%;
    min-height: 100vh;
    background-color: #fff;
    padding: 20px 30px;
    box-sizing: border-box;
}

h1 {
    font-size: 2em;
    color: #1a202c;
    margin-bottom: 0.5em;
}

p {
    color: #4a5568;
    margin-bottom: 1.5em;
}

.actions {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
}

button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s ease;
}

#add-new-btn {
    background-color: #6666FF;
    color: white;
}

#add-new-btn:hover {
    opacity: 0.9;
}

#bulk-import-btn {
    background-color: transparent;
    border: 1px solid #ccc;
    color: #555;
}

#bulk-import-btn:hover {
    background-color: #f0f0f0;
    border-color: #aaa;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th, td {
    border-bottom: 1px solid #e2e8f0;
    padding: 12px 15px;
    text-align: left;
    vertical-align: top;
}

td:first-child, th:first-child {
    padding-left: 30px;
    width: 160px;
}
td:last-child, th:last-child {
    padding-right: 30px;
    width: 40px;
    text-align: center;
}

th {
    background-color: #f7fafc;
    font-weight: 600;
    color: #2d3748;
    position: sticky;
    top: 0;
    z-index: 10;
}

.col-theme {
    width: 240px;
}

.col-keywords {
    width: 320px;
    min-width: 320px;
    max-width: 320px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.col-actions {
    width: 60px;
    text-align: center;
}

.col-icons {
    width: auto;
}

.keyword-toggle {
    font-size: 12px;
    margin-left: 8px;
    color: #6666FF;
    cursor: pointer;
    font-weight: normal;
}

.keyword-toggle:hover {
    text-decoration: underline;
}

/* 关键词显示样式 - 确保固定宽度 */
.keywords-display {
    width: 100%;
    box-sizing: border-box;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.keywords-display .keyword-item {
    display: inline-block;
    margin: 2px 4px 2px 0;
    padding: 2px 6px;
    background-color: #f0f0f0;
    border-radius: 3px;
    font-size: 14px;
    line-height: 1.2;
    white-space: nowrap;
}

/* 修改图标卡片的相对定位，使提示气泡能够正确显示 */
.icon-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    position: relative; /* 确保相对定位 */
}

.icon-card {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #fdfdfd;
    width: 52px; 
    height: 52px;
}

.icon-card:hover {
    border-color: #6666FF;
    box-shadow: 0 2px 8px rgba(102, 102, 255, 0.2);
    transform: translateY(-2px);
}

/* 使用不同的方式显示提示气泡 */
.icon-tooltip {
    position: fixed; /* 使用固定定位而非绝对定位 */
    display: none;
    background-color: white;
    color: #333;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 10000; /* 非常高的z-index */
    pointer-events: none; /* 避免干扰鼠标事件 */
}

/* 移除旧的悬停提示 */
.icon-card:hover::after {
    display: none;
}

.icon-card .icon-preview {
    font-size: 32px;
    color: #2d3748;
}

.icon-card .icon-name {
    display: none;
}


.empty-state {
    color: #a0aec0;
    font-style: italic;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 30px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
    border-radius: 8px;
    position: relative;
}

.close-btn {
    color: #aaa;
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-btn:hover,
.close-btn:focus {
    color: black;
    text-decoration: none;
}

textarea, #search-input, input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 1em;
    box-sizing: border-box;
    font-family: inherit; /* 继承父元素的字体 */
}

.delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    color: #666;
}

.delete-btn svg {
    stroke: #666;
    transition: stroke 0.2s;
}

.delete-btn:hover {
    background-color: #f0f0f0;
}

.delete-btn:hover svg {
    stroke: #e53e3e;
}

.toast-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #2d3748;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    z-index: 1001;
    opacity: 0;
    transition: opacity 0.5s, bottom 0.5s;
}

.toast-notification.show {
    opacity: 1;
    bottom: 30px;
}

/* 扩展关键词样式 */
.extended-keywords {
    margin-bottom: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.extended-keywords h4 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #333;
}

.keywords-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.keyword-tag {
    display: inline-block;
    padding: 5px 10px;
    background-color: #e9ecef;
    border-radius: 16px;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #495057;
}

.search-result-count {
    margin-bottom: 15px;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #6c757d;
}

/* 加载状态样式 */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100px;
    width: 100%;
}

.loading-spinner::after {
    content: "";
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #6666FF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 设置按钮样式 */
.settings-btn {
    background: none;
    border: 1px solid #ccc;
    border-radius: 8PX;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: auto;
    padding: 0;
}

.settings-btn:hover {
    background-color: #f0f0f0;
}

/* 移除不需要的样式 */
.settings-icon {
    display: none;
}

/* 设置面板样式 */
.settings-panel {
    position: absolute;
    top: 80px;
    right: 30px;
    width: 250px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 15px;
    z-index: 100;
    display: none;
}

.settings-panel.show {
    display: block;
}

.setting-item {
    margin-bottom: 15px;
}

.setting-item label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.radio-group {
    display: flex;
    gap: 15px;
}

.radio-group label {
    display: flex;
    align-items: center;
    font-weight: normal;
    cursor: pointer;
}

.radio-group input {
    margin-right: 5px;
}

.library-select {
    width: 100%;
    padding: 8px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    color: #333;
    background-color: white;
    cursor: pointer;
}

.library-select:focus {
    outline: none;
    border-color: #6666FF;
    box-shadow: 0 0 0 1px #6666FF;
}

.library-badge {
    display: inline-block;
    padding: 2px 6px;
    background-color: #e9ecef;
    border-radius: 4px;
    font-size: 12px;
    color: #495057;
    margin-left: 5px;
}

/* 关键词分组样式 */
.keyword-group {
    margin-bottom: 30px;
}

.keyword-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid #e2e8f0;
}

/* 搜索模态框样式 */
.search-input-container {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

#search-input {
    flex: 1;
    padding: 10px;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    font-size: 1em;
}

#submit-search-btn {
    background-color: #6666FF;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0 20px;
    cursor: pointer;
}

.search-results {
    max-height: 400px;
    overflow-y: auto;
    padding: 10px 0;
}

#search-modal .modal-content {
    width: 720px;
    max-width: 90%;
    height: 600px;
    max-height: 90vh;
}