/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8fafc;
}

/* 移除所有链接的下划线 */
a {
    text-decoration: none !important;
    color: inherit;
}

a:hover {
    text-decoration: none !important;
}

/* Flexbox 工具类 */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.flex-1 {
    flex: 1;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.space-x-3 > * + * {
    margin-left: 0.75rem;
}

/* 布局样式 */
.h-screen {
    height: 100vh;
}

.h-16 {
    height: 4rem;
}

.h-10 {
    height: 2.5rem;
}

.h-8 {
    height: 2rem;
}

.w-10 {
    width: 2.5rem;
}

.w-8 {
    width: 2rem;
}

.w-56 {
    width: 14rem;
}

/* 边框样式 */
.border {
    border-width: 1px;
    border-style: solid;
    border-color: #e5e7eb;
}

.border-r {
    border-right-width: 1px;
    border-right-style: solid;
    border-right-color: #e5e7eb;
}

.border-b {
    border-bottom-width: 1px;
    border-bottom-style: solid;
    border-bottom-color: #e5e7eb;
}

.rounded {
    border-radius: 0.375rem;
}

.rounded-lg {
    border-radius: 0.5rem;
}

.rounded-full {
    border-radius: 9999px;
}

/* 背景颜色 */
.bg-white {
    background-color: #ffffff;
}

.bg-gray-100 {
    background-color: #f3f4f6;
}

.bg-gray-200 {
    background-color: #e5e7eb;
}

.bg-blue-500 {
    background-color: #3b82f6;
}

.bg-green-500 {
    background-color: #10b981;
}

.bg-red-500 {
    background-color: #ef4444;
}

.bg-yellow-500 {
    background-color: #f59e0b;
}

/* 文字颜色 */
.text-white {
    color: #ffffff;
}

.text-gray-500 {
    color: #6b7280;
}

.text-gray-700 {
    color: #374151;
}

.text-gray-800 {
    color: #1f2937;
}

.text-blue-500 {
    color: #3b82f6;
}

.text-red-500 {
    color: #ef4444;
}

.text-yellow-500 {
    color: #f59e0b;
}

/* 字体大小和权重 */
.text-xs {
    font-size: 0.75rem;
}

.text-sm {
    font-size: 0.875rem;
}

.text-base {
    font-size: 1rem;
}

.font-medium {
    font-weight: 500;
}

.font-semibold {
    font-weight: 600;
}

.font-bold {
    font-weight: 700;
}

/* 内外边距 */
.p-4 {
    padding: 1rem;
}

.p-6 {
    padding: 1.5rem;
}

.p-8 {
    padding: 2rem;
}

.px-6 {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.py-2 {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.py-3 {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
}

.py-4 {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 0.75rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.mr-3 {
    margin-right: 0.75rem;
}

.ml-3 {
    margin-left: 0.75rem;
}

/* 位置和显示 */
.relative {
    position: relative;
}

.absolute {
    position: absolute;
}

.fixed {
    position: fixed;
}

.top-2 {
    top: 0.5rem;
}

.right-2 {
    right: 0.5rem;
}

.top-1\/2 {
    top: 50%;
}

.left-1\/2 {
    left: 50%;
}

.transform {
    transform: translate(-50%, -50%);
}

.z-50 {
    z-index: 50;
}

.hidden {
    display: none;
}

.block {
    display: block;
}

.grid {
    display: grid;
}

.overflow-hidden {
    overflow: hidden;
}

.overflow-y-auto {
    overflow-y: auto;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.min-w-0 {
    min-width: 0;
}

.flex-shrink-0 {
    flex-shrink: 0;
}

.object-cover {
    object-fit: cover;
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-primary {
    background-color: #10b981;
    color: white;
}

.btn-primary:hover {
    background-color: #059669;
}

.btn:hover {
    opacity: 0.9;
}

/* 表单样式 */
input[type="text"],
input[type="url"],
input[type="password"],
input[type="number"],
textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.25rem;
}

/* 模态框样式 */
.modal {
    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: 1000;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease-out;
}

.modal-content {
    background: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    max-width: 32rem;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease-out;
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 搜索结果优化 */
#search-results {
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 密码弹窗优化 */
#password-lock {
    animation: fadeIn 0.3s ease-out;
}

#password-lock > div {
    animation: slideUp 0.3s ease-out;
}

/* 过渡效果 */
.transition-opacity {
    transition: opacity 0.2s;
}

.opacity-0 {
    opacity: 0;
}

.opacity-100 {
    opacity: 1;
}

/* 群组悬停效果 */
.group:hover .group-hover\:opacity-100 {
    opacity: 1;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .w-56 {
        width: 12rem;
    }
    
    .modal-content {
        margin: 1rem;
        width: calc(100% - 2rem);
    }
    
    .grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)) !important;
    }
}

@media (max-width: 480px) {
    .w-56 {
        width: 10rem;
    }
    
    .px-6 {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .p-6 {
        padding: 1rem;
    }
    
    .grid {
        grid-template-columns: 1fr !important;
    }
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

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

/* 复选框样式 */
input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #3b82f6;
}

/* 复制按钮优化样式 */
.copy-url-btn {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    opacity: 0 !important;
    transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out !important;
    background: #3b82f6 !important;
    color: white !important;
    border: none !important;
    border-radius: 6px !important;
    width: 32px !important;
    height: 32px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    z-index: 10 !important;
}

.copy-url-btn:hover {
    background: #2563eb !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15) !important;
    transform: translateY(-1px) !important;
}

.group:hover .copy-url-btn {
    opacity: 1 !important;
}

/* 网站卡片优化 */
.bg-white.rounded-lg {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    border: 1px solid #e5e7eb;
}

.bg-white.rounded-lg:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
    border-color: #d1d5db;
}

/* 搜索框优化 */
#global-search {
    transition: border-color 0.2s, box-shadow 0.2s;
}

#global-search:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 分类按钮优化 */
.category-btn {
    transition: all 0.2s ease-in-out;
    border-radius: 0.5rem;
    margin: 0.125rem 0.5rem;
}

.category-btn:hover {
    background-color: #f3f4f6 !important;
    transform: translateX(4px);
}

.category-btn:active {
    transform: translateX(2px);
}

/* 复制提示优化 */
#copy-toast {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: 1px solid rgba(16, 185, 129, 0.2);
    animation: slideInScale 0.3s ease-out;
}

/* 通用提示样式 */
.toast {
    min-width: 300px;
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInRight 0.3s ease-out;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.toast.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.toast.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.toast.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.toast.info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.toast-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    background: rgba(255, 255, 255, 0.2);
}

.toast.error .toast-icon {
    background: rgba(255, 255, 255, 0.2);
}

.toast.warning .toast-icon {
    background: rgba(255, 255, 255, 0.2);
}

.toast.info .toast-icon {
    background: rgba(255, 255, 255, 0.2);
}

.toast-content {
    flex: 1;
    font-weight: 500;
    font-size: 14px;
}

.toast-close {
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
    padding: 4px;
}

.toast-close:hover {
    opacity: 1;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

@keyframes slideInScale {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* 加载状态 */
.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f4f6;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 网站链接样式优化 */
.bg-white.rounded-lg a {
    color: inherit !important;
    text-decoration: none !important;
}

.bg-white.rounded-lg a:hover {
    color: inherit !important;
    text-decoration: none !important;
}

/* 网站标题样式优化 */
.font-medium.text-gray-800 {
    color: #1f2937 !important;
    font-weight: 600 !important;
    text-decoration: none !important;
}

/* 网站描述样式优化 */
.text-xs.text-gray-500 {
    color: #6b7280 !important;
    line-height: 1.4 !important;
    text-decoration: none !important;
}

/* 响应式网格布局 */
#sites {
    gap: 1.5rem !important;
}

@media (max-width: 1024px) {
    #sites {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 1.5rem !important;
    }
}

@media (max-width: 768px) {
    #sites {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.5rem !important;
    }
}

@media (max-width: 480px) {
    #sites {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
}
