/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 基础样式 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    transition: all 0.3s ease;
}

/* 深色模式 */
body.dark-mode {
    background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
    color: #e2e8f0;
}

/* 背景动画效果 */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.bg-circle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: float 20s infinite ease-in-out;
}

.bg-circle:nth-child(1) {
    width: 300px;
    height: 300px;
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.bg-circle:nth-child(2) {
    width: 200px;
    height: 200px;
    top: 50%;
    right: -100px;
    animation-delay: 5s;
}

.bg-circle:nth-child(3) {
    width: 150px;
    height: 150px;
    bottom: -75px;
    left: 20%;
    animation-delay: 10s;
}

.bg-circle:nth-child(4) {
    width: 100px;
    height: 100px;
    top: 20%;
    left: 60%;
    animation-delay: 15s;
}

.bg-circle:nth-child(5) {
    width: 250px;
    height: 250px;
    bottom: -125px;
    right: 20%;
    animation-delay: 20s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(50px, 50px) rotate(90deg);
    }
    50% {
        transform: translate(0, 100px) rotate(180deg);
    }
    75% {
        transform: translate(-50px, 50px) rotate(270deg);
    }
}

/* 容器样式 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
.header {
    padding: 20px 0;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 24px;
    font-weight: bold;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.logo i {
    margin-right: 10px;
    font-size: 28px;
    animation: rotate 10s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* 搜索框样式 */
.search-box {
    position: relative;
    flex: 1;
    max-width: 500px;
    margin: 0 40px;
}

.search-box input {
    width: 100%;
    padding: 12px 50px 12px 20px;
    border: none;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.9);
    font-size: 16px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.search-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-btn:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* 用户菜单 */
.user-menu {
    display: flex;
    gap: 15px;
}

.theme-toggle, .add-site {
    width: 45px;
    height: 45px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.theme-toggle:hover, .add-site:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* 主要内容 */
.main-content {
    padding: 40px 0;
}

/* 快速访问区域 */
.quick-access {
    margin-bottom: 40px;
}

.section-title {
    display: flex;
    align-items: center;
    font-size: 20px;
    font-weight: 600;
    color: white;
    margin-bottom: 20px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.section-title i {
    margin-right: 10px;
    font-size: 22px;
}

/* 网站网格 */
.site-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 20px;
}

/* 网站卡片 */
.site-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.site-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.site-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.site-card:hover::before {
    transform: scaleX(1);
}

.site-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.site-card:hover .site-icon {
    transform: scale(1.1) rotate(5deg);
}

.site-name {
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    margin-top: 10px;
}

/* 网站分类 */
.site-categories {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.category {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.category:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.category-title {
    display: flex;
    align-items: center;
    font-size: 18px;
    font-weight: 600;
    color: white;
    margin-bottom: 20px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.category-title i {
    margin-right: 10px;
    font-size: 20px;
}

/* 页脚 */
.footer {
    padding: 30px 0;
    margin-top: 60px;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.copyright {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
}

.footer-links a:hover {
    color: white;
    text-decoration: underline;
}

/* 模态框 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 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.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transform: translateY(-50px);
    transition: all 0.3s ease;
}

.modal.active .modal-content {
    transform: translateY(0);
}

.modal-content h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 600;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 图标选择器 */
.icon-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.icon-selector i {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
}

.icon-selector i:hover {
    background: #667eea;
    color: white;
    transform: scale(1.1);
}

.icon-selector i.selected {
    background: #667eea;
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* 表单操作按钮 */
.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 30px;
}

.cancel-btn, .save-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cancel-btn {
    background: #f5f5f5;
    color: #333;
}

.cancel-btn:hover {
    background: #e0e0e0;
}

.save-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }

    .search-box {
        margin: 0;
        width: 100%;
    }

    .user-menu {
        justify-content: center;
    }

    .site-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 15px;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-links {
        justify-content: center;
    }

    .category {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .site-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 10px;
    }

    .site-card {
        padding: 15px;
    }

    .site-icon {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .site-name {
        font-size: 12px;
    }

    .modal-content {
        padding: 20px;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* 深色模式下的调整 */
body.dark-mode .site-card {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

body.dark-mode .category {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .modal-content {
    background: #2d3748;
}

body.dark-mode .modal-content h3 {
    color: #e2e8f0;
}

body.dark-mode .form-group label {
    color: #a0aec0;
}

body.dark-mode .form-group input {
    background: #1a202c;
    border-color: #2d3748;
    color: #e2e8f0;
}

body.dark-mode .cancel-btn {
    background: #2d3748;
    color: #e2e8f0;
}

body.dark-mode .icon-selector i {
    background: #2d3748;
    color: #a0aec0;
}

body.dark-mode .icon-selector i:hover {
    background: #667eea;
    color: white;
}

body.dark-mode .icon-selector i.selected {
    background: #667eea;
    color: white;
}