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

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
    padding: 20px;
}

.container, .admin-container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* 头部样式 - 使用深色系 */
.header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 30px 30px 25px;
    text-align: center;
    position: relative; /* 新增：为伪元素定位 */
    overflow: hidden; /* 新增：隐藏溢出的背景 */
}

/* 头部背景图片遮罩 */
/* 头部背景图片遮罩 - 修复版本 */
.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    
    /* 背景图片设置 - 使用绝对路径或正确相对路径 */
    /* background-image: url('../uploads/bg.png');  默认路径 */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    
    /* 添加遮罩层 - 确保文字可读 */
    background-color: rgba(44, 62, 80, 0.6); /* 与原背景色混合 */
}

/* 双重确保文字在上层 */
.header > * {
    position: relative;
    z-index: 1;
}

/* 特别确保这些元素在上层 */
.header h1,
.header .subtitle,
.datetime-display {
    position: relative;
    z-index: 2;
}

.header {
    background: 
        linear-gradient(rgba(44, 62, 80, 0.85), rgba(44, 62, 80, 0.85)),
        url('../uploads/bg.png') center/cover no-repeat !important;
    background-blend-mode: overlay;
}


/* ========== 日期和时间显示区域 ========== */
.datetime-display {
    display: flex;
    justify-content: space-between; /* 改为平均分布 */
    flex-wrap: nowrap;
    gap: 4px; /* 最小间隙 */
    margin-top: 15px;
    padding: 20px 10px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    overflow: hidden;
}
.date-info, .time-info {
    display: flex;
    align-items: center;
    justify-content: center; /* 内容居中 */
    gap: 5px;
    font-size: 0.95rem; /* 减小字体 */
    background: rgba(255, 255, 255, 0.1);
    padding: 6px 8px; /* 最小内边距 */
    border-radius: 6px; /* 减小圆角 */
    flex: 1; /* 关键：每个模块平均分配空间 */
    min-width: 0; /* 允许缩小到0 */
    max-width: calc(25% - 3px); /* 每个模块最多占25%宽度 */
    white-space: nowrap;
    overflow: hidden; /* 隐藏溢出的内容 */
    text-overflow: ellipsis; /* 显示省略号 */
    box-sizing: border-box;
}

.date-info:hover, .time-info:hover {
    background: rgba(255, 255, 255, 0.15); /* 悬停效果 */
    transform: translateY(-1px);
}

.date-info i, .time-info i {
    font-size: 1rem; /* 优化图标大小 */
    color: #3498db;
    flex-shrink: 0; /* 防止图标被压缩 */
}

/* 音乐播放器样式 - 稍微调整使其更紧凑 */
.music-info {
    flex: 1;
    min-width: 0; /* 允许缩小 */
    max-width: none; /* 移除最大宽度限制 */
    overflow: visible; /* 改为可见 */
}

.music-player {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
    width: 100%;
    min-width: 0;
    overflow: visible; /* 改为可见 */
}
#music-info {
    font-size: 1rem; /* 更小字体 */
    color: #2ecc71;
    font-weight: 500;
    min-width: 0;
    max-width: none; /* 限制最大宽度 */
    overflow: visible; /* 改为可见 */
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 0;
    padding: 0 8px;
}


/* 音乐标签极简 */
.music-label {
    display: none; /* 隐藏"背景音乐："文字 */
}

/* 音乐播放器控制按钮极小化 */
.music-controls {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}

.music-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 50%;
    width: 18px; /* 更小按钮 */
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.55rem; /* 更小图标 */
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
}
.music-player.compact .music-controls {
    margin-left: auto;
    margin-right: auto;
}
.music-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.music-btn:active {
    transform: translateY(0);
}

.datetime-display {
    -ms-overflow-style: none !important; /* IE 10+ */
    scrollbar-width: none !important; /* Firefox */
}

/* 确保时间显示区域 */
.time-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 15px; /* 统一内边距 */
    border-radius: 8px;
    min-width: 250px; /* 统一最小宽度 */
}

#current-time {
    font-weight: bold;
    color: #2ecc71;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    flex-shrink: 0; /* 防止时间被压缩 */
}

/* 天气显示优化 */
#weather-display {
    font-weight: 500;
    color: #f1c40f; /* 使用醒目的黄色 */
    flex-shrink: 0;
}
/* 搜索框样式 */
.search-section {
    padding: 25px 30px;
    background: linear-gradient(135deg, #ecf0f1 0%, #dfe6e9 100%);
    border-bottom: 1px solid #ddd;
}

.search-form {
    max-width: 700px;
    margin: 0 auto;
}

.search-box {
    display: flex;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    background: white;
    border: 2px solid #2c3e50;
    height: 60px; /* 添加固定高度 */
    align-items: center; /* 让所有子元素垂直居中 */
}

.search-icon {
    padding: 0 20px;
    color: #2c3e50;
    font-size: 1.2rem;
    /* 移除 display: flex 和 align-items: center */
    line-height: 1; /* 防止图标受行高影响 */
}

.search-input {
    flex: 1;
    border: none;
    padding: 0 10px; /* 调整padding，让垂直方向由父容器控制 */
    font-size: 1.1rem;
    outline: none;
    color: #2c3e50;
    height: 100%; /* 继承父容器高度 */
    box-sizing: border-box; /* 确保padding不会影响高度 */
}

.search-btn {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    border: none;
    padding: 0 35px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    height: 100%; /* 按钮也继承父容器高度 */
}

.search-btn:hover {
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
}

/* 主要内容区域 */
.main-content {
    padding: 25px 30px;
}

.category-section {
    margin-bottom: 35px;
}

/* 链接图标样式 */
.link-icon-container {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    flex-shrink: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    position: relative;
    overflow: hidden;
}

.link-icon-emoji {
    font-size: 1.8rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.link-icon-image {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 6px;
    display: block;
}

/* 确保所有链接卡片高度一致 */
.link-card {
    display: flex;
    align-items: center;
    padding: 15px;
    background-color: white;
    border-radius: 10px;
    text-decoration: none;
    color: #2c3e50;
    transition: all 0.3s;
    border: 1px solid #ecf0f1;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
    min-height: 80px;
    box-sizing: border-box;
    margin: 0;
}

/* 修复网格布局，确保对齐 */
.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    align-items: stretch;
}

/* 确保链接名称不换行 */
.link-name {
    font-size: 1.1rem;
    font-weight: 500;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

/* 图标加载错误时的备用样式 */
.icon-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f1f3f5 0%, #e9ecef 100%);
    border-radius: 10px;
    font-size: 1.5rem;
    color: #6c757d;
}

/* 分类标题 */
.category-title {
    font-size: 1.4rem;
    margin: 25px 0 15px;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ecf0f1;
}

/* 照片墙样式 */
.photo-wall-section {
    padding: 25px 30px;
    background-color: #f8f9fa;
    border-top: 1px solid #ecf0f1;
}

.photo-wall-section h2 {
    font-size: 1.4rem;
    margin-bottom: 20px;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
}

.photo-wall {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

.photo-item {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s;
    background: white;
}

.photo-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.15);
}

.photo-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px 8px 0 0;
    display: block;
}

.photo-title {
    padding: 14px;
    text-align: center;
    font-weight: 500;
    color: #2c3e50;
    background: white;
    border-top: 1px solid #ecf0f1;
    text-decoration: none;
}

.photo-item a {
    text-decoration: none !important;
    color: inherit; /* 确保颜色继承，而不是链接的蓝色 */
}

.photo-item a:hover {
    text-decoration: none !important;
    color: inherit;
}

.photo-item a .photo-title {
    text-decoration: none !important;
}

/* 页脚 - 与头部统一颜色 */
.footer {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: #ecf0f1;
    padding: 30px;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 25px;
    margin-bottom: 25px;
}

.footer-links a {
    color: #bdc3c7;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.3s;
    font-weight: 500;
}

.footer-links a:hover {
    color: #3498db;
    transform: translateY(-2px);
}

.footer-info p {
    margin: 10px 0;
    font-size: 0.95rem;
    opacity: 0.9;
}

.icp a {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
}

.icp a:hover {
    text-decoration: underline;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 30px;
    color: #6c757d;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 2px dashed #ced4da;
    margin: 30px 0;
}

.empty-state i {
    font-size: 3.5rem;
    margin-bottom: 20px;
    color: #adb5bd;
}

.empty-state p {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 20px;
}

.empty-state .btn {
    padding: 12px 28px;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.empty-state .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);
}

/* 简约隐私访问区域 */
.private-access-section {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    margin: 15px 0;
    border: 1px solid #e9ecef;
}

.private-access-section.unlocked {
    background: #e8f5e9;
    border-color: #c8e6c9;
}

.private-access-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.private-access-title {
    font-size: 1.1rem;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
}

.private-status-badge {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-locked {
    background: #ffecb3;
    color: #856404;
}

.status-unlocked {
    background: #c8e6c9;
    color: #2e7d32;
}

.private-password-form-simple {
    margin-top: 10px;
}

.password-input-group-simple {
    display: flex;
    gap: 8px;
}

.password-input-simple {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 0.95rem;
    background: white;
}

.password-input-simple:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.password-btn-simple {
    padding: 10px 18px;
    background: #2c3e50;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    min-width: 70px;
}

.password-btn-simple:hover {
    background: #34495e;
}

.logout-btn-simple {
    padding: 6px 12px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
}

.logout-btn-simple:hover {
    background: #5a6268;
}

.access-expiry-info {
    color: #28a745;
    font-size: 0.8rem;
    margin-top: 8px;
}

/* 错误信息占位符 */
.error-placeholder {
    height: 18px;
    margin-top: 8px;
}

/* === 紧凑版隐私访问表单 - 一行显示 === */
.private-password-form-compact {
    margin-top: 10px;
}

.password-input-group-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    width: 100%;
}

/* 密码输入框 - 占据剩余空间 */
.password-input-compact {
    flex: 1;
    min-width: 0; /* 重要：允许缩小 */
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: border-color 0.3s;
    background: white;
}

.password-input-compact:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* 记住设备复选框 - 紧凑样式 */
.remember-device-compact {
    flex-shrink: 0;
    white-space: nowrap;
}

.remember-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 13px;
    color: #666;
    white-space: nowrap;
    padding: 2px 4px;
    border-radius: 4px;
    transition: background-color 0.2s;
    line-height: 1;
}

.remember-checkbox:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.remember-checkbox input[type="checkbox"] {
    margin: 0;
    margin-right: 4px;
    width: 14px;
    height: 14px;
    cursor: pointer;
    vertical-align: middle;
}

.checkbox-label {
    font-size: 13px;
    white-space: nowrap;
    vertical-align: middle;
}

/* 搜索按钮 - 紧凑样式 */
.password-btn-compact {
    flex-shrink: 0;
    padding: 8px 16px;
    background: #2c3e50;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.3s;
    min-width: 60px;
}

.password-btn-compact:hover {
    background: #34495e;
}

/* 设备已认证提示 - 紧凑 */
.device-auth-info {
    margin-top: 8px;
    font-size: 12px;
    color: #4CAF50;
    text-align: center;
    padding: 3px 8px;
    background: rgba(76, 175, 80, 0.1);
    border-radius: 12px;
    display: inline-block;
}

.device-auth-info i {
    margin-right: 4px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .password-input-group-compact {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .password-input-compact {
        flex: 1 0 100%;
        order: 1;
        padding: 10px 12px;
    }
    
    .remember-device-compact {
        order: 2;
        flex: 1;
        text-align: left;
        font-size: 14px;
    }
    
    .remember-checkbox {
        font-size: 14px;
    }
    
    .remember-checkbox input[type="checkbox"] {
        width: 16px;
        height: 16px;
    }
    
    .password-btn-compact {
        order: 3;
        flex: 1;
        min-width: 80px;
        padding: 10px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .password-input-group-compact {
        flex-direction: column;
        align-items: stretch;
    }
    
    .password-input-compact,
    .remember-device-compact,
    .password-btn-compact {
        width: 100%;
        text-align: center;
    }
    
    .remember-checkbox {
        justify-content: center;
    }
}


/* 公告栏和记事本样式 */
.tools-section {
    margin: 25px 0;
}

.tools-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
    align-items: stretch;
}

.tool-card {
    background: white;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 400px;
}

.tool-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.tool-title {
    font-size: 1.2rem;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tool-badge {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    background: #3498db;
    color: white;
}

.tool-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.gonggao-content {
    flex: 1;
    min-height: 200px;
    max-height: 300px;
    overflow-y: auto;
    line-height: 1.6;
    color: #495057;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.gonggao-content p {
    margin-bottom: 10px;
}

.gonggao-content ul, .gonggao-content ol {
    padding-left: 20px;
    margin-bottom: 10px;
}

.jishi-form {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.jishi-textarea {
    width: 100%;
    flex: 1;
    min-height: 200px;
    padding: 15px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 1rem;
    line-height: 1.5;
    resize: vertical;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', Consolas, monospace;
    background: #f8f9fa;
}

.jishi-textarea:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
    background: white;
}

.jishi-actions {
    margin-top: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.jishi-status {
    font-size: 0.9rem;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 5px;
}

.jishi-save-btn {
    padding: 10px 20px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.jishi-save-btn:hover {
    background: #218838;
    transform: translateY(-2px);
}

.jishi-success {
    color: #28a745;
}

.jishi-error {
    color: #dc3545;
}

.tool-hint {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 10px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #3498db;
    flex-shrink: 0;
}

.tool-hint-small {
    font-size: 0.8rem;
    color: #6c757d;
}

.edit-notice {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 10px;
    font-style: italic;
    flex-shrink: 0;
}

/* 后台管理样式 */
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 22px 30px;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
}

.admin-header h1 {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.8rem;
}

.admin-actions {
    display: flex;
    gap: 15px;
}

.btn {
    padding: 10px 22px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    background: #3498db;
    color: white;
}

.btn-primary {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
}

.btn-secondary {
    background: #6c757d;
}

.btn-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.btn:hover {
    opacity: 0.95;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.logout-btn {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.admin-content {
    padding: 30px;
}

.admin-section {
    background-color: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
    border: 1px solid #ecf0f1;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.admin-section h2 {
    margin-bottom: 22px;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f1f2f6;
}

.admin-form {
    background: #f8f9fa;
    padding: 22px;
    border-radius: 10px;
    margin-bottom: 25px;
    border: 1px solid #e9ecef;
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 18px;
}

.form-row .form-group {
    flex: 1;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: #2c3e50;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 1rem;
    background: white;
    transition: all 0.3s;
}

.form-group input:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

/* 图标选择区域 */
.icon-options {
    margin-top: 10px;
}

.icon-selection {
    background: white;
    padding: 18px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.existing-icons {
    margin-top: 15px;
}

.small-label {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 10px;
    font-weight: 500;
}

.icon-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}

.icon-option {
    display: inline-block;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 5px;
    transition: all 0.2s;
}

.icon-option:hover {
    border-color: #3498db;
    background: #f1f8ff;
}

.icon-option input[type="radio"] {
    display: none;
}

.icon-option input[type="radio"]:checked + .icon-preview {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.3);
}

.icon-preview {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 8px;
    background: #f8f9fa;
    padding: 5px;
    border: 2px solid #e9ecef;
    transition: all 0.2s;
}

.upload-icon {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid #e9ecef;
}

/* 上传组样式 */
.upload-group {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.file-input {
    display: none;
}

.upload-btn {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    transition: all 0.3s;
    border: none;
}

.upload-btn:hover {
    background: linear-gradient(135deg, #2980b9 0%, #3498db 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.file-name {
    color: #6c757d;
    font-size: 0.9rem;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-hint {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 8px;
    line-height: 1.4;
}

/* 表单操作按钮 */
.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.btn-large {
    padding: 12px 30px;
    font-size: 1.05rem;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* 图标输入框 */
.icon-input {
    width: 100%;
    padding: 14px 16px;
    margin-bottom: 15px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 1rem;
}

/* 来源选项 */
.source-options {
    background: white;
    padding: 18px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.source-option {
    margin-bottom: 18px;
}

.source-option:last-child {
    margin-bottom: 0;
}

.source-option input[type="radio"] {
    margin-right: 10px;
}

.source-option label {
    font-weight: 500;
    color: #2c3e50;
    cursor: pointer;
    display: inline-block;
    margin-bottom: 8px;
}

.source-content {
    margin-top: 12px;
    padding-left: 24px;
}

/* 链接列表 */
.links-list {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e9ecef;
}

.link-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px;
    border-bottom: 1px solid #f1f2f6;
    transition: background 0.2s;
}

.link-item:hover {
    background: #f8f9fa;
}

.link-item:last-child {
    border-bottom: none;
}

.link-info {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    flex: 1;
}

.link-icon-preview {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    overflow: hidden;
}

.link-icon-emoji-admin {
    font-size: 1.8rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.link-icon-image-admin {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 6px;
}

.link-details {
    flex: 1;
    min-width: 300px;
}

.link-name {
    display: block;
    font-weight: 500;
    color: #2c3e50;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.link-url {
    display: block;
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 5px;
    word-break: break-all;
}

.link-category {
    display: inline-block;
    background: #e3f2fd;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #1976d2;
    font-weight: 500;
}

.link-actions {
    display: flex;
    gap: 10px;
}

/* 照片管理 */
.photos-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 22px;
}

.photo-item-admin {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
    transition: all 0.3s;
}

.photo-item-admin:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
}

.photo-preview img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    background: #f8f9fa;
}

.photo-info {
    padding: 18px;
}

.photo-info h4 {
    margin-bottom: 10px;
    color: #2c3e50;
    font-size: 1.1rem;
}

.photo-info p {
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 6px;
    word-break: break-all;
}

.photo-actions {
    padding: 0 18px 18px;
    text-align: right;
}

/* 提示信息 */
.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 22px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-left: 4px solid #28a745;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-left: 4px solid #dc3545;
}

/* 版本信息 */
.admin-footer {
    text-align: center;
    padding: 22px;
    background: #f8f9fa;
    color: #6c757d;
    border-top: 1px solid #e9ecef;
    font-size: 0.95rem;
}

.version {
    font-size: 0.85rem;
    color: #adb5bd;
    margin-top: 5px;
}

/* 旋转动画 */
.fa-spin {
    animation: fa-spin 1s infinite linear;
}

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

/* 照片大图模态框 */
#photo-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

#photo-modal > div {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    cursor: default;
}

#modal-photo {
    max-width: 100%;
    max-height: 90vh;
    display: block;
    border-radius: 5px;
}

#modal-title {
    color: white;
    text-align: center;
    margin-top: 10px;
    font-size: 16px;
    padding: 0 20px;
}

#photo-modal button {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 30px;
    cursor: pointer;
    padding: 5px 10px;
}

/* ========== 响应式设计 ========== */
/* ========== 针对手机端的全面修复 ========== */
@media (max-width: 768px) {
    /* 重置容器 */
    body {
        padding: 10px !important;
    }
    
    .container, .admin-container {
        border-radius: 8px !important;
        margin: 0 auto !important;
    }
    
    /* 头部修复 */
    .header {
        padding: 20px 15px !important;
    }
    
    .header h1 {
        font-size: 1.6rem !important;
        flex-direction: column !important;
        gap: 8px !important;
        text-align: center !important;
    }
    
    .subtitle {
        font-size: 0.9rem !important;
        margin-bottom: 15px !important;
    }
    
    /* 日期时间显示区域 - 完全重写 */
    .datetime-display {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
        padding: 15px 10px 0 !important;
        overflow-x: visible !important;
        white-space: normal !important;
        border-top: 1px solid rgba(255, 255, 255, 0.15) !important;
    }
    
    .date-info, .time-info {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        justify-content: flex-start !important;
        text-align: left !important;
        padding: 10px !important;
        margin: 0 !important;
        white-space: nowrap !important;
        overflow: visible !important;
        background: rgba(255, 255, 255, 0.1) !important;
        border-radius: 6px !important;
        font-size: 0.9rem !important;
    }
    
    .date-info i, .time-info i {
        font-size: 0.9rem !important;
        min-width: 16px !important;
    }
    
    /* 音乐播放器修复 */
    .music-info {
        flex: 1 0 100% !important;
        max-width: 100% !important;
        margin: 10px 0 0 0 !important;
    }
    
    .music-player {
        display: flex !important;
        flex-direction: row !important;
        width: 100% !important;
        background: rgba(0, 0, 0, 0.3) !important;
        border-radius: 12px !important;
        padding: 12px 15px !important;
        box-sizing: border-box !important;
    }
    
    #music-info {
        flex: 1 !important;
        min-width: 0 !important;
        max-width: none !important;
        font-size: 1.1rem !important;
        font-weight: 600 !important;
        color: #2ecc71 !important;
        
        /* 精确控制文本显示 */
        display: inline-block !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        padding-right: 10px !important;
        vertical-align: middle !important;
        line-height: 1.4 !important;
    }
    
    
    /* 修复4：按钮固定在最右边 */
    .music-controls {
        flex-shrink: 0 !important;
        min-width: 80px !important;
    }
    
    .music-btn {
        width: 30px !important;
        height: 30px !important;
        font-size: 0.8rem !important;
    }
    
    /* 搜索框修复 */
    .search-section {
        padding: 20px 15px !important;
    }
    
    .search-box {
        height: 50px !important;
        border-radius: 25px !important;
    }
    
    .search-input {
        font-size: 1rem !important;
        padding: 0 8px !important;
    }
    
    .search-btn {
        padding: 0 20px !important;
        font-size: 1rem !important;
    }
    
    /* 主要内容区域 */
    .main-content {
        padding: 20px 15px !important;
    }
    
    .category-title {
        font-size: 1.2rem !important;
        margin: 20px 0 12px !important;
        padding-bottom: 8px !important;
    }
    
    /* 链接网格 - 优化布局 */
    .links-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
    
    .link-card {
        min-height: 70px !important;
        height: 70px !important;
        padding: 10px !important;
        display: flex !important;
        align-items: center !important;
        border-radius: 8px !important;
    }
    
    .link-icon-container {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        max-width: 40px !important;
        margin-right: 10px !important;
        flex-shrink: 0 !important;
    }
    
    .link-icon-emoji {
        font-size: 1.4rem !important;
    }
    
    .link-icon-image {
        width: 24px !important;
        height: 24px !important;
    }
    
    .link-name {
        font-size: 1rem !important;
        flex: 1 !important;
        min-width: 0 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }
    
    /* 照片墙优化 */
    .photo-wall-section {
        padding: 20px 15px !important;
    }
    
    .photo-wall {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }
    
    .photo-item img {
        height: 100px !important;
        border-radius: 8px 8px 0 0 !important;
    }
    
    .photo-title {
        padding: 10px !important;
        font-size: 0.85rem !important;
        line-height: 1.3 !important;
    }
    
    /* 工具区域 - 公告栏和记事本 */
    .tools-section {
        margin: 20px 0 !important;
    }
    
    .tools-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    
    .tool-card {
        min-height: 350px !important;
    }
    
    .tool-header {
        padding: 12px 15px !important;
    }
    
    .tool-title {
        font-size: 1.1rem !important;
    }
    
    .tool-content {
        padding: 15px !important;
    }
    
    .gonggao-content {
        max-height: 250px !important;
        padding: 12px !important;
        font-size: 0.95rem !important;
    }
    
    .jishi-textarea {
        min-height: 180px !important;
        padding: 12px !important;
        font-size: 0.95rem !important;
    }
    
    .jishi-actions {
        flex-direction: column !important;
        gap: 10px !important;
        align-items: stretch !important;
    }
    
    .jishi-save-btn {
        width: 100% !important;
        justify-content: center !important;
        padding: 12px !important;
    }
    
    /* 隐私访问区域 */
    .private-access-section {
        padding: 12px !important;
        margin: 12px 0 !important;
    }
    
    .private-access-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
    }
    
    .password-input-group-simple {
        flex-direction: column !important;
        gap: 8px !important;
    }
    
    .password-btn-simple, .logout-btn-simple {
        width: 100% !important;
    }
    
    /* 页脚修复 */
    .footer {
        padding: 20px 15px !important;
    }
    
    .footer-links {
        flex-direction: column !important;
        gap: 12px !important;
        margin-bottom: 15px !important;
    }
    
    .footer-links a {
        justify-content: center !important;
    }
    
    .footer-info p {
        font-size: 0.85rem !important;
    }
    
}

