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

body {
    font-family: 'Noto Sans SC', 'Segoe UI', Arial, sans-serif;
    background-color: #121212;
    background-image: linear-gradient(135deg, #121212 0%, #1e1e1e 100%);
    line-height: 1.6;
    color: #e0e0e0;
    min-height: 100vh;
}

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

/* 网站标题 */
header {
    text-align: center;
    margin-bottom: 20px;
}

.site-title {
    font-size: 38px;
    font-weight: 700;
    color: #ffffff;
    margin: 30px 0;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    position: relative;
    display: inline-block;
}

.site-title::after {
    content: '';
    position: absolute;
    width: 60px;
    height: 4px;
    background: #4285f4;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
}

/* 搜索框样式 */
.search-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 30px auto 40px;
    max-width: 800px;
}

@media (min-width: 768px) {
    .search-container {
        flex-direction: row;
        justify-content: center;
        gap: 20px;
    }
}

.search-box {
    flex: 1;
}

.search-box form {
    display: flex;
    gap: 10px;
}

.search-box input {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    background: rgba(34, 34, 34, 0.8);
    color: #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    background: rgba(34, 34, 34, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.search-box button {
    padding: 12px 20px;
    background: #4285f4;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.search-box button:hover {
    background: #5294ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3);
}

/* 链接区域样式 */
.links-container {
    background: rgba(34, 34, 34, 0.8);
    border-radius: 12px;
    padding: 25px;
    margin-top: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.links-header {
    text-align: center;
    margin-bottom: 25px;
}

.links-header h2 {
    font-size: 28px;
    font-weight: 500;
    color: #ffffff;
    position: relative;
    display: inline-block;
}

.links-header h2:after {
    content: '';
    position: absolute;
    width: 60px;
    height: 3px;
    background: #4285f4;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 25px;
    padding: 10px 10px 30px 10px;
    justify-content: center;
}

.link-card {
    text-align: center;
    width: 60px;
    height: 60px;
    padding: 10px;
    border-radius: 12px;
    background: rgba(51, 51, 51, 0.8);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.link-card:hover {
    transform: translateY(-5px);
    background: #444;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.link-card img {
    width: 24px;
    height: 24px;
    border-radius: 6px;
}

/* 文本图标样式 */
.text-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: rgba(66, 133, 244, 0.7);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.link-card:hover .text-icon {
    background: rgba(66, 133, 244, 0.9);
    transform: scale(1.1);
}

.link-card p, .add-link-card p {
    position: absolute;
    bottom: -24px;
    left: 0;
    right: 0;
    font-size: 14px;
    color: #e0e0e0;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    user-select: none;
}

/* 已分类网站的标识 */
.categorized-link {
    position: relative;
    border: 1px solid rgba(66, 133, 244, 0.3);
    box-shadow: 0 2px 8px rgba(66, 133, 244, 0.1);
}

.categorized-link:hover {
    border: 1px solid rgba(66, 133, 244, 0.5);
    box-shadow: 0 5px 15px rgba(66, 133, 244, 0.2);
}

.category-indicator {
    position: absolute;
    top: -4px;
    left: -4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4285f4;
    box-shadow: 0 0 4px rgba(66, 133, 244, 0.6);
}

/* 链接编辑按钮 */
.link-card .edit-buttons {
    position: absolute;
    top: -8px;
    right: -8px;
    background: rgba(66, 133, 244, 0.2);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 5;
}

.link-card:hover .edit-buttons {
    opacity: 1;
}

.edit-buttons::before {
    content: '⋮';
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    line-height: 1;
}

.edit-menu {
    position: absolute;
    top: -5px;
    right: 18px;
    background: rgba(51, 51, 51, 0.95);
    border-radius: 6px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    display: none;
    z-index: 10;
    overflow: hidden;
    min-width: 80px;
}

/* 显示编辑菜单的样式通过JavaScript控制 */
.edit-menu.active {
    display: block;
    animation: fade-in 0.2s ease;
}

.edit-menu-item {
    padding: 8px 12px;
    font-size: 14px;
    color: #e0e0e0;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    text-align: center;
}

.edit-menu-item:hover {
    background: rgba(66, 133, 244, 0.3);
    color: #ffffff;
}

.add-link-card {
    text-align: center;
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: rgba(51, 51, 51, 0.7);
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    border: 1px dashed rgba(255, 255, 255, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.add-link-card::before {
    content: '+';
    font-size: 32px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* 禁止所有文本选择 */
body {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* 允许输入框可选 */
input, textarea {
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

.add-link-card:hover {
    background: rgba(66, 133, 244, 0.2);
    transform: translateY(-5px);
    border-color: rgba(66, 133, 244, 0.5);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.add-link-card:hover::before {
    color: #4285f4;
}

.save-button {
    background: #4285f4;
    color: white;
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.save-button:hover {
    background: #5294ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3);
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1000;
}

.modal-content {
    background: #222;
    margin: 15% auto;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    border-radius: 12px;
    position: relative;
    color: #e0e0e0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    color: #aaa;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.close:hover {
    color: #fff;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px;
    background: #333;
    border: 1px solid #444;
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 16px;
}

.form-group input:focus {
    outline: none;
    border-color: #4285f4;
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.3);
}

.modal-content button {
    padding: 12px 20px;
    background: #4285f4;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    margin-top: 10px;
    transition: all 0.3s;
}

.modal-content button:hover {
    background: #5294ff;
}

/* 添加网站文本 */
.add-link-card p {
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.3s;
}

.add-link-card:hover p {
    color: #4285f4;
}

/* Footer样式 */
footer {
    text-align: center;
    margin-top: auto;
    padding: 20px 0;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

/* 移动端编辑菜单 */
.mobile-edit-menu {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 12px;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    z-index: 20;
    animation: fade-in 0.2s ease;
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.mobile-edit-menu .edit-menu-item {
    padding: 8px 15px;
    background: rgba(66, 133, 244, 0.3);
    color: #ffffff;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    width: 80%;
    text-align: center;
}

.mobile-edit-menu .edit-menu-item:active {
    background: rgba(66, 133, 244, 0.5);
    transform: scale(0.95);
}

/* 分类选项卡样式 */
.categories-tabs {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 15px;
}

.category-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

.small-button {
    background: #0e294b;
    color: white;
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.small-button:hover {
    background: #173d6e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 33, 61, 0.3);
}

.categories-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.category-tab {
    padding: 6px 14px;
    background: rgba(51, 51, 51, 0.6);
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
}

.category-tab:hover {
    background: rgba(51, 51, 51, 0.9);
}

.category-tab.active {
    background: rgba(66, 133, 244, 0.2);
    border: 1px solid rgba(66, 133, 244, 0.3);
    color: #4285f4;
}

/* 分类拖拽样式 */
.category-tab.dragging {
    opacity: 0.7;
    cursor: grabbing;
    border: 1px dashed rgba(66, 133, 244, 0.7);
    background: rgba(66, 133, 244, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.category-tab.drag-over {
    border: 1px dashed rgba(66, 133, 244, 0.7);
    background: rgba(66, 133, 244, 0.1);
}

/* 鼠标指针样式 */
.category-tab {
    cursor: grab;
}

.category-inline-add {
    margin-top: 10px;
    display: flex;
    gap: 8px;
}

.category-inline-add input {
    flex: 1;
    padding: 8px 12px;
    background: #333;
    border: 1px solid #444;
    border-radius: 4px;
    color: #e0e0e0;
    font-size: 14px;
}

.category-inline-add button {
    padding: 0 15px;
    background: rgba(66, 133, 244, 0.2);
    color: #4285f4;
    border: 1px solid rgba(66, 133, 244, 0.3);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.category-inline-add button:hover {
    background: rgba(66, 133, 244, 0.3);
}

/* 分类管理样式 */
.categories-manager {
    margin: 15px 0;
}

.category-tip {
    background: rgba(66, 133, 244, 0.1);
    border-left: 3px solid rgba(66, 133, 244, 0.7);
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 4px;
    color: #e0e0e0;
    font-size: 14px;
}

.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: rgba(51, 51, 51, 0.5);
    border-radius: 6px;
    margin-bottom: 8px;
}

.category-name {
    flex: 1;
}

.category-actions button {
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    padding: 5px;
    font-size: 14px;
    transition: all 0.2s;
}

.category-actions button:hover {
    color: #fff;
}

.delete-category {
    color: #ff6b6b !important;
}

.delete-category:hover {
    color: #ff3333 !important;
}

/* 表单下拉菜单样式 */
select {
    width: 100%;
    padding: 12px;
    background: #333;
    border: 1px solid #444;
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 16px;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

select:focus {
    outline: none;
    border-color: #4285f4;
    box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.3);
}

/* 按钮组样式 */
.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
    justify-content: center;
}

.button-group button {
    padding: 10px 15px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    border: none;
}

/* 文本图标按钮样式 */
.text-icon-button {
    display: inline-block;
    margin-top: 8px;
    padding: 6px 12px;
    background: rgba(60, 60, 65, 0.7);
    color: white;
    border: 1px solid rgba(80, 80, 85, 0.5);
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.text-icon-button:hover {
    background: rgba(80, 80, 85, 0.8);
    border-color: rgba(100, 100, 105, 0.6);
}

.text-icon-button.active {
    background: rgba(100, 100, 105, 0.9);
    color: white;
    border-color: rgba(120, 120, 125, 0.9);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.export-button {
    background: #34a853;
    color: white;
}

.import-button {
    background: #fbbc05;
    color: #333;
}

.button-group button:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}