/* 自定义区域容器 */
#customCardGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    padding: 20px;
    min-height: 120px;
    background: rgba(0,0,0,0.02);
    border-radius: 15px;
    border: 2px dashed #ddd;
    margin: 10px 0;
    position: relative;
}

#customCardGrid:empty::before {
    content: '可以自定义你经常使用的网站';
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: #999;
    font-size: 14px;
}

/* 自定义区域的卡片样式 */
#customCardGrid .card {
    position: relative;
    background: #fff;
    border-radius: 12px;
    padding: 0;
    border: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 8px;
    cursor: pointer;
}

/* 编辑模式样式 */
#customCardGrid .card.editing {
    border-color: var(--primary-color);
    background: rgba(80, 196, 237, 0.05);
}

/* 删除按钮 */
#customCardGrid .card.editing::after {
    display: none;
}

/* 空状态提示 */
#customCardGrid .empty-tip {
    text-align: center;
    color: var(--text-light);
    padding: 30px;
    font-size: 14px;
}

/* 卡片内容布局 */
#customCardGrid .card-content {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
}

/* 卡片图标 */
#customCardGrid .card-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 2px solid rgba(80, 196, 237, 0.1);
    padding: 2px;
    background: #fff;
}

/* 卡片信息 */
#customCardGrid .card-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* 卡片标题 */
#customCardGrid .card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 卡片描述 */
#customCardGrid .card-desc {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 卡片悬停效果 */
#customCardGrid .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

/* 卡片图标悬停效果 */
#customCardGrid .card:hover .card-icon {
    border-color: rgba(80, 196, 237, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#customCardGrid .card:hover .card-icon img {
    transform: scale(1.1);
}

/* 链接样式 */
#customCardGrid .card a {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

/* 添加和编辑按钮 */
.custom-add-btns {
    display: flex;
    gap: 15px;
}

.btn-add,
.btn-edit {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    border: none;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-add {
    background: var(--primary-color);
    color: #fff;
}

.btn-add:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.btn-edit {
    background: #f0f0f0;
    color: var(--text-secondary);
}

.btn-edit:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

/* 添加弹窗相关样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal[style*="display: flex"] {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: #fff;
    border-radius: 15px;
    width: 90%;
    max-width: 1000px;
    height: 80vh;
    display: flex;
    flex-direction: column;
    position: relative;
    transform: translateY(0);
    transition: transform 0.3s ease;
}

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

.modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #333;
}

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 0;
}

.modal-search-area {
    padding: 20px;
    background: #fff;
    border-bottom: 1px solid #eee;
}

#modalSearch {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    margin-bottom: 15px;
}

.modal-tabs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.modal-tabs .tab {
    padding: 6px 16px;
    border-radius: 20px;
    background: #f5f5f5;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.modal-tabs .tab:hover {
    background: #eee;
}

.modal-tabs .tab.active {
    background: var(--primary-color);
    color: #fff;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.card-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.modal-footer button {
    padding: 8px 24px;
    border-radius: 20px;
    border: none;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cancel {
    background: #f0f0f0;
    color: #666;
}

.btn-confirm {
    background: var(--primary-color);
    color: #fff;
}

.btn-cancel:hover {
    background: #e0e0e0;
}

.btn-confirm:hover {
    background: var(--primary-hover);
}

/* 卡片选择样式 */
.card-selection-grid .card {
    cursor: pointer;
    position: relative;
}

.card-selection-grid .card.selected {
    border: 2px solid var(--primary-color);
    box-shadow: 0 4px 12px rgba(80, 196, 237, 0.15);
}

.card-selection-grid .card.selected::before {
    content: '\f00c';
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    background: var(--primary-color);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    z-index: 3;
}

.card-selection-grid .card.added {
    opacity: 0.6;
    background: #f5f5f5;
    border-color: #ddd;
    position: relative;
    cursor: not-allowed;
}

.card-selection-grid .card.added .added-mark {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #999;
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 3;
}

/* 禁用状态 */
.card-selection-grid .card.disabled {
    pointer-events: none;
}

/* 拖拽排序相关样式 */
.sortable-ghost {
    opacity: 0.5;
    background: #f5f5f5;
}

/* 删除按钮样式 */
.delete-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 24px;
    height: 24px;
    background: #ff4757;
    color: #fff;
    border: none;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(255, 71, 87, 0.3);
    z-index: 10;
}

.delete-btn:hover {
    background: #ff3344;
    transform: scale(1.1);
}

/* 编辑模式样式 */
.edit-mode .card {
    cursor: move;
    user-select: none;
}

/* 提示信息样式 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 24px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 8px;
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1100;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast i {
    font-size: 18px;
}

.toast-success i {
    color: #2ecc71;
}

.toast-error i {
    color: #ff4757;
}

/* 卡片动画效果 */
.card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

/* 卡片选择模态框样式 */
.modal-search-area {
    margin-bottom: 20px;
}

.modal-search-area input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 15px;
}

.modal-tabs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.modal-tabs .tab {
    padding: 6px 16px;
    border-radius: 20px;
    background: #f5f5f5;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.modal-tabs .tab.active {
    background: var(--primary-color);
    color: white;
}

.card-selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
} 