/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f8f9fa;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 顶部导航栏 */
.header {
    background: white;
    border-bottom: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.logo {
    font-size: 1.8rem;
    font-weight: 600;
    color: #333;
}

.nav {
    display: flex;
    align-items: center;
    gap: 25px;
}

.nav a {
    color: #666;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 8px 16px;
    border-radius: 6px;
}

.nav a:hover {
    color: #333;
    background: #f8f9fa;
}

.admin-btn {
    background: #ff69b4;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.admin-btn:hover {
    background: #ff1493;
}

/* 主要内容区域 */
.main {
    padding: 40px 0;
}

/* 搜索区域 */
.search-section {
    text-align: center;
    margin-bottom: 40px;
}

.search-box {
    display: inline-flex;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    width: 100%;
}

.search-box input {
    flex: 1;
    border: none;
    padding: 12px 16px;
    font-size: 1rem;
    border-radius: 6px;
    outline: none;
    background: transparent;
}

.search-box button {
    background: #ff69b4;
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-box button:hover {
    background: #ff1493;
}

/* 分类导航 */
.categories {
    margin-bottom: 40px;
}

.category-tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.tab-btn {
    background: white;
    color: #666;
    border: 1px solid #e9ecef;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    border-color: #ff69b4;
    color: #ff69b4;
}

.tab-btn.active {
    background: #ff69b4;
    color: white;
    border-color: #ff69b4;
}

/* 链接展示区域 */
.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.link-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
    position: relative;
}

.link-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    border-color: #ff69b4;
}

/* 卡片加载动画 */
@keyframes cardFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.link-card {
    animation: cardFadeIn 0.3s ease-out;
}

.link-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    position: relative;
}

.link-icon {
    font-size: 1.8rem;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 6px;
    flex-shrink: 0;
}

.link-icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.link-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    flex: 1;
}

.link-title:hover {
    color: #ff69b4;
}

.card-status {
    margin-left: auto;
    font-size: 1.2rem;
}

.status-checking-small {
    color: #ffc107;
    animation: pulse 1.5s ease-in-out infinite;
}

.status-online-small {
    color: #28a745;
    font-weight: bold;
    background: #d4edda;
    padding: 2px 6px;
    border-radius: 50%;
    font-size: 0.9rem;
}

.status-offline-small {
    color: #dc3545;
    font-weight: bold;
    background: #f8d7da;
    padding: 2px 6px;
    border-radius: 50%;
    font-size: 0.9rem;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.link-desc {
    color: #666;
    margin-bottom: 15px;
    line-height: 1.5;
}

.link-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.link-category {
    background: #ff69b4;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
}

.link-url {
    color: #999;
    font-size: 0.9rem;
    text-decoration: none;
}

/* 管理员面板 */
.admin-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.panel-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 8px;
    padding: 30px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
}

.panel-header h2 {
    color: #333;
    font-size: 1.5rem;
}

.close-btn {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #e9ecef;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: #ff69b4;
    color: white;
    border-color: #ff69b4;
}

/* 登录表单 */
.login-form {
    text-align: center;
}

.login-form h3 {
    color: #333;
    margin-bottom: 20px;
}

.login-form input {
    width: 100%;
    padding: 12px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
}

.login-form input:focus {
    border-color: #ff69b4;
}

.login-form button {
    background: #ff69b4;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.3s ease;
}

.login-form button:hover {
    background: #ff1493;
}

/* 管理界面 */
.admin-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}

.admin-tab-btn {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #e9ecef;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.admin-tab-btn.active {
    background: #ff69b4;
    color: white;
    border-color: #ff69b4;
}

.tab-content {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 表单样式 */
#addLinkForm {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#addLinkForm input,
#addLinkForm textarea,
#addLinkForm select {
    padding: 10px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
}

#addLinkForm input:focus,
#addLinkForm textarea:focus,
#addLinkForm select:focus {
    border-color: #ff69b4;
}

#addLinkForm textarea {
    resize: vertical;
    min-height: 80px;
}

#addLinkForm button {
    background: #ff69b4;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.3s ease;
}

#addLinkForm button:hover {
    background: #ff1493;
}

/* 管理列表 */
.manage-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.check-all-container {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    border: 2px dashed #ff69b4;
    text-align: center;
}

.check-all-btn {
    background: #ff69b4;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.check-all-btn:hover {
    background: #ff1493;
}

.check-all-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.check-hint {
    margin: 8px 0 0 0;
    color: #999;
    font-size: 0.85rem;
}

.manage-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.manage-item-info {
    flex: 1;
}

.manage-item-info h4 {
    color: #333;
    margin-bottom: 5px;
}

.manage-item-info p {
    color: #666;
    font-size: 0.9rem;
    margin: 5px 0;
}

.manage-item-info small {
    color: #999;
    font-size: 0.85rem;
}

.link-status {
    margin-top: 8px;
    font-size: 0.9rem;
}

.status-checking {
    color: #ffc107;
    font-weight: 500;
}

.status-online {
    color: #28a745;
    font-weight: 500;
}

.status-offline {
    color: #dc3545;
    font-weight: 500;
}

.manage-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.check-btn,
.edit-btn,
.delete-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: opacity 0.3s ease;
}

.check-btn {
    background: #17a2b8;
    color: white;
}

.check-btn:hover {
    opacity: 0.8;
}

.edit-btn {
    background: #ffc107;
    color: #333;
}

.edit-btn:hover {
    opacity: 0.8;
}

.delete-btn {
    background: #dc3545;
    color: white;
}

.delete-btn:hover {
    opacity: 0.8;
}

/* 页脚 */
.footer {
    background: white;
    border-top: 1px solid #e9ecef;
    text-align: center;
    padding: 20px 0;
    margin-top: 60px;
    color: #666;
}

/* 批量添加样式 */
.batch-instructions {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    border-left: 4px solid #ff69b4;
}

.batch-instructions p {
    margin: 5px 0;
    font-size: 0.9rem;
    color: #666;
}

.batch-instructions code {
    background: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    color: #ff69b4;
    font-size: 0.85rem;
}

#batchInput {
    width: 100%;
    min-height: 200px;
    padding: 12px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    resize: vertical;
    line-height: 1.6;
}

#batchInput:focus {
    border-color: #ff69b4;
    outline: none;
}

.batch-options {
    margin: 15px 0;
}

.batch-options label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #666;
}

.batch-options input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.batch-progress {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
}

.progress-bar {
    width: 100%;
    height: 24px;
    background: #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff69b4, #ff1493);
    transition: width 0.3s ease;
    border-radius: 12px;
}

.progress-text {
    text-align: center;
    color: #666;
    font-size: 0.9rem;
    margin: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .category-tabs {
        justify-content: center;
    }
    
    .links-grid {
        grid-template-columns: 1fr;
    }
    
    .panel-content {
        width: 95%;
        padding: 20px;
    }
    
    .admin-tabs {
        flex-direction: column;
    }
    
    .manage-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .manage-actions {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}
