﻿/* 基础样式 */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f5f5f5;
    color: #333;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
}

/* 登录页面样式 */
.login-body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.login-container {
    background: white;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-form {
    margin: 30px 0;
}

.login-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    font-size: 14px;
}

/* 容器样式 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid #eee;
}

/* 分类和链接样式 */
.category {
    margin-bottom: 40px;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.category h2 {
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
    margin-top: 0;
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.link-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: inherit;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.link-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    border-color: #3498db;
    text-decoration: none;
    color: inherit;
}

.link-icon {
    width: 48px;
    height: 48px;
    object-fit: contain;
    margin-bottom: 10px;
    border-radius: 8px;
}

.link-name {
    font-weight: 600;
    text-align: center;
    word-break: break-word;
}

/* 后台管理样式 */
.admin-panel {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.form-section {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid #eee;
}

.form-section:last-child {
    border-bottom: none;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #3498db;
}

/* 按钮样式 */
.btn {
    background: #3498db;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-danger {
    background: #e74c3c;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-primary {
    background: #2ecc71;
}

.btn-primary:hover {
    background: #27ae60;
}

/* 消息样式 */
.message {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid #c3e6cb;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid #f5c6cb;
}

/* 列表样式 */
.category-item {
    background: #f8f9fa;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid #3498db;
}

.links-list {
    margin-left: 20px;
}

.link-item {
    background: #e9ecef;
    padding: 12px 15px;
    margin-bottom: 10px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-state h3 {
    margin-bottom: 10px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .links-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 15px;
    }
    
    .admin-panel {
        padding: 20px;
    }
    
    .category-item,
    .link-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .link-item form {
        align-self: flex-end;
    }
}

/* 图片预览 */
img[alt="当前背景"] {
    border: 2px solid #ddd;
    border-radius: 8px;
}
/* 后台管理新样式 */
.breadcrumb {
    margin-bottom: 20px;
    color: #666;
    font-size: 14px;
}

.breadcrumb a {
    color: #3498db;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.admin-menu {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.menu-card {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.menu-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    border-color: #3498db;
}

.menu-icon {
    font-size: 48px;
    margin-bottom: 15px;
    color: #3498db;
}

.menu-card h3 {
    margin: 0 0 10px 0;
    color: #2c3e50;
}

.menu-card p {
    color: #7f8c8d;
    margin: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 30px 0;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-number {
    font-size: 2em;
    font-weight: bold;
    color: #3498db;
    margin-bottom: 5px;
}

.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.edit-form {
    display: none;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    margin-top: 10px;
}

.link-preview {
    display: flex;
    align-items: center;
    gap: 10px;
}

.link-preview img {
    width: 24px;
    height: 24px;
    border-radius: 4px;
}

.background-preview {
    max-width: 400px;
    margin: 15px 0;
    border: 2px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.background-preview img {
    width: 100%;
    height: auto;
    display: block;
}

.system-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.info-item {
    background: white;
    padding: 15px;
    border-radius: 5px;
}

.info-item strong {
    display: block;
    color: #2c3e50;
    margin-bottom: 5px;
}

/* 顶部按钮样式 */
.header-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.btn-home {
    background: #27ae60;
}

.btn-home:hover {
    background: #219653;
}

.btn-admin {
    background: #3498db;
}

.btn-admin:hover {
    background: #2980b9;
}

.btn-logout {
    background: #e74c3c;
}

.btn-logout:hover {
    background: #c0392b;
}

/* 分类折叠样式 */
.category-header {
    cursor: pointer;
}

.category-icon {
    transition: transform 0.3s;
}

.category-header.collapsed .category-icon {
    transform: rotate(-90deg);
}

.links-container {
    transition: all 0.3s ease;
    overflow: hidden;
}

.links-container.collapsed {
    max-height: 0;
    opacity: 0;
}

/* 默认图标选择样式 */
.default-icons {
    display: flex;
    gap: 10px;
    margin: 10px 0;
}

.default-icon-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.default-icon-option:hover {
    border-color: #3498db;
}

.default-icon-option.selected {
    border-color: #3498db;
    background-color: #e3f2fd;
}

.default-icon-option input {
    display: none;
}

.default-icon-preview {
    font-size: 24px;
    margin-bottom: 5px;
}
