* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(120, 80, 200, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(100, 150, 255, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 50% 80%, rgba(255, 100, 200, 0.2) 0%, transparent 50%);
    z-index: -1;
    animation: bgFloat 15s ease-in-out infinite;
}

@keyframes bgFloat {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(3deg); }
}

/* ==================== 前台样式 ==================== */
.hero-section {
    color: white;
    padding: 10px 30px 15px;
    position: relative;
}

.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
}

.nav-logo i {
    font-size: 20px;
    animation: spin 10s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.nav-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 6px 14px;
    border-radius: 25px;
    text-decoration: none;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 13px;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.hero-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: 26px;
    font-weight: 800;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.hero-subtitle {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 12px;
}

.search-box {
    background: white;
    padding: 3px 12px;
    border-radius: 50px;
    display: flex;
    align-items: center;
    max-width: 360px;
    margin: 0 auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.search-box i {
    color: #667eea;
    font-size: 14px;
}

.search-box input {
    flex: 1;
    border: none;
    padding: 8px;
    font-size: 13px;
    outline: none;
    background: transparent;
}

.content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px 40px;
}

.category-section {
    margin-bottom: 12px;
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.category-title {
    color: white;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-line {
    width: 3px;
    height: 16px;
    background: linear-gradient(180deg, #ffd93d, #ff6b6b);
    border-radius: 2px;
}

.category-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
}

.sites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.site-card {
    background: white;
    border-radius: 12px;
    padding: 12px 10px;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.site-card:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.site-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.site-card:hover::before {
    transform: scaleX(1);
}

.site-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    font-size: 20px;
    color: white;
    transition: all 0.3s ease;
}

.site-card:hover .site-icon {
    transform: rotate(10deg) scale(1.1);
}

.emoji-icon {
    font-size: 22px;
}

.site-name {
    font-size: 13px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 2px;
}

.site-url {
    font-size: 10px;
    color: #7f8c8d;
    word-break: break-all;
    line-height: 1.2;
}

.card-hover-effect {
    display: none;
}

.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    padding: 8px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 11px;
    background: linear-gradient(to bottom, transparent, rgba(102, 126, 234, 0.8));
    z-index: 10;
}

/* ==================== 登录页面样式 ==================== */
.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-container {
    background: white;
    padding: 50px;
    border-radius: 25px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.2);
    animation: slideIn 0.6s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-logo {
    text-align: center;
    margin-bottom: 35px;
}

.login-logo i {
    font-size: 50px;
    color: #667eea;
    margin-bottom: 15px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.login-logo h1 {
    font-size: 24px;
    color: #2c3e50;
    margin-bottom: 8px;
}

.login-logo p {
    color: #7f8c8d;
    font-size: 14px;
}

.login-error {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
    padding: 12px 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    margin-bottom: 8px;
    color: #2c3e50;
    font-weight: 600;
    font-size: 14px;
}

.login-form label i {
    color: #667eea;
    margin-right: 6px;
}

.login-form input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e1e8ed;
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s ease;
    outline: none;
}

.login-form input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.login-btn {
    width: 100%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 15px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.login-btn i {
    margin-right: 8px;
}

.login-tips {
    margin-top: 25px;
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    font-size: 13px;
    color: #7f8c8d;
}

.login-tips strong {
    color: #667eea;
}

.back-home {
    display: block;
    text-align: center;
    margin-top: 25px;
    color: #667eea;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.back-home:hover {
    color: #764ba2;
}

/* ==================== 后台管理样式 ==================== */
.admin-body {
    background: #f0f2f5;
}

.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 260px;
    background: linear-gradient(180deg, #2c3e50, #1a2530);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
}

.sidebar-header {
    padding: 30px 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-header i {
    font-size: 28px;
    color: #667eea;
}

.sidebar-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.sidebar-menu {
    flex: 1;
    padding: 20px 0;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 25px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.menu-item.active {
    background: rgba(102, 126, 234, 0.2);
    color: white;
    border-left-color: #667eea;
}

.menu-item i {
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 20px 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.logout-btn {
    width: 100%;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

.logout-btn:hover {
    background: rgba(255, 100, 100, 0.2);
    border-color: #ff6b6b;
}

.home-link {
    display: block;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 14px;
    padding: 10px;
    transition: color 0.3s ease;
}

.home-link:hover {
    color: white;
}

.admin-main {
    flex: 1;
    margin-left: 260px;
    padding: 30px 40px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e1e8ed;
}

.admin-header h1 {
    font-size: 28px;
    color: #2c3e50;
    font-weight: 700;
}

.admin-user {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #7f8c8d;
    font-size: 14px;
}

.admin-user i {
    font-size: 24px;
    color: #667eea;
}

.alert {
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.admin-section {
    margin-bottom: 40px;
    scroll-margin-top: 20px;
}

.section-header {
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 22px;
    color: #2c3e50;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-header h2 i {
    color: #667eea;
}

.card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.card h3 {
    font-size: 18px;
    color: #2c3e50;
    margin-bottom: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card h3 i {
    color: #667eea;
}

.admin-form .form-row {
    margin-bottom: 20px;
}

.admin-form label {
    display: block;
    margin-bottom: 8px;
    color: #2c3e50;
    font-weight: 600;
    font-size: 14px;
}

.admin-form input,
.admin-form select,
.admin-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e8ed;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
    outline: none;
    font-family: inherit;
}

.admin-form input:focus,
.admin-form select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.form-hint {
    display: block;
    margin-top: 6px;
    color: #95a5a6;
    font-size: 12px;
}

.inline-form {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.inline-form input {
    flex: 1;
    min-width: 200px;
    margin-bottom: 0;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #11998e, #38ef7d);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(17, 153, 142, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, #ee5a6f, #f29263);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(238, 90, 111, 0.3);
}

.btn-warning {
    background: linear-gradient(135deg, #f7b733, #fc4a1a);
    color: white;
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(247, 183, 51, 0.3);
}

.btn-small {
    padding: 8px 16px;
    font-size: 13px;
}

.category-item {
    padding: 20px 25px;
}

.category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-header h3 {
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.badge {
    background: #667eea;
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.sites-table {
    margin-top: 15px;
}

.site-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.site-row:hover {
    background: #eef0f2;
}

.site-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.site-icon-small {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    flex-shrink: 0;
}

.site-info strong {
    color: #2c3e50;
    font-size: 15px;
    display: block;
}

.text-muted {
    color: #7f8c8d;
    font-size: 12px;
}

.site-actions {
    display: flex;
    gap: 10px;
}

/* ==================== 弹窗样式 ==================== */
.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: 1000;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 30px;
    width: 100%;
    max-width: 450px;
    animation: modalIn 0.3s ease-out;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.modal-header h3 {
    font-size: 20px;
    color: #2c3e50;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #7f8c8d;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: #2c3e50;
}

/* ==================== 响应式样式 ==================== */
@media (max-width: 1024px) {
    .sites-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }
}

@media (max-width: 768px) {
    .hero-section {
        padding: 8px 10px 10px;
    }
    
    .top-nav {
        margin-bottom: 8px;
    }
    
    .hero-title {
        font-size: 22px;
        margin-bottom: 3px;
    }
    
    .hero-subtitle {
        font-size: 12px;
        margin-bottom: 10px;
    }
    
    .content {
        padding: 0 10px 8px;
    }
    
    .sites-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: 8px;
    }
    
    .site-card {
        padding: 10px 8px;
        border-radius: 10px;
    }
    
    .site-icon {
        width: 32px;
        height: 32px;
        font-size: 16px;
        border-radius: 8px;
        margin-bottom: 6px;
    }
    
    .emoji-icon {
        font-size: 18px;
    }
    
    .site-name {
        font-size: 12px;
        margin-bottom: 1px;
    }
    
    .site-url {
        font-size: 9px;
    }
    
    .category-title {
        font-size: 14px;
        margin-bottom: 6px;
    }
    
    .category-section {
        margin-bottom: 10px;
    }
    
    .footer {
        padding: 5px;
        font-size: 10px;
    }
    
    .search-box {
        max-width: 300px;
        padding: 2px 10px;
    }
    
    .search-box input {
        padding: 6px;
        font-size: 12px;
    }
    
    /* 后台响应式 */
    .admin-sidebar {
        width: 70px;
    }
    
    .sidebar-header h2,
    .menu-item span:not(.fas),
    .menu-item,
    .sidebar-footer button span,
    .sidebar-footer a span {
        display: none;
    }
    
    .sidebar-header {
        justify-content: center;
        padding: 25px 15px;
    }
    
    .menu-item {
        justify-content: center;
        padding: 15px;
    }
    
    .admin-main {
        margin-left: 70px;
        padding: 20px;
    }
    
    .site-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .site-actions {
        width: 100%;
    }
    
    .site-actions .btn {
        flex: 1;
        justify-content: center;
    }
    
    .login-container {
        padding: 30px 20px;
    }
}