/* ========== 后台管理专用样式 ========== */

/* 登录页面样式 */
body.login-page {
    background: url('https://www.dldnas.top/uploads/1767850934_695f43b611114_your-photo.jpg') no-repeat center center fixed !important;
    background-size: cover !important;
    background-color: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    min-height: 100vh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif !important;
}

body.login-page::before {
    content: '' !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(0, 0, 0, 0.5) !important;
    z-index: 1 !important;
}

body.login-page .login-container {
    position: relative !important;
    z-index: 2 !important;
    width: 100% !important;
    max-width: 400px !important;
    padding: 20px !important;
    margin: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

body.login-page .login-box {
    background-color: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 15px !important;
    padding: 40px !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25) !important;
    width: 100% !important;
}

body.login-page .login-box h2 {
    color: #2c3e50 !important;
    text-align: center !important;
    margin-bottom: 25px !important;
    font-size: 1.8rem !important;
    font-weight: 600 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 12px !important;
}

body.login-page .login-form input {
    width: 100% !important;
    padding: 12px 15px !important;
    border: 1px solid rgba(221, 221, 221, 0.8) !important;
    border-radius: 8px !important;
    font-size: 1rem !important;
    background: rgba(255, 255, 255, 0.9) !important;
    margin-bottom: 20px !important;
    box-sizing: border-box !important;
}

body.login-page .login-btn {
    width: 100% !important;
    padding: 12px !important;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%) !important;
    color: white !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 1rem !important;
    cursor: pointer !important;
    font-weight: 500 !important;
    margin-top: 10px !important;
    transition: all 0.3s !important;
}

body.login-page .login-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2) !important;
}

/* 后台管理主页面样式 */

/* 页面整体布局 */
.admin-container {
    display: flex;
    min-height: 100vh;
    background: #f8f9fa;
    max-width: none !important;
    margin: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* 侧边菜单栏 */
.admin-sidebar {
    width: 240px;
    background: #2c3e50;
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    z-index: 100;
    left: 0;
    top: 0;
}

.admin-sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #34495e;
    text-align: center;
}

.admin-sidebar-header h2 {
    margin: 0;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.admin-nav {
    padding: 15px 0;
}

.admin-nav-item {
    display: block;
    padding: 12px 20px;
    color: #bdc3c7;
    text-decoration: none;
    border-left: 4px solid transparent;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.admin-nav-item:hover {
    background: #34495e;
    color: white;
    border-left-color: #3498db;
}

.admin-nav-item.active {
    background: #34495e;
    color: white;
    border-left-color: #3498db;
}

.nav-badge {
    margin-left: auto;
    background: #3498db;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
}

/* 主内容区域 */
.admin-main {
    flex: 1;
    margin-left: 240px;
    padding: 30px 200px;
    min-height: 100vh;
    box-sizing: border-box;
    width: calc(100% - 240px);
    overflow-x: auto;
}

/* 内容区域头部 */
.admin-main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px 30px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.08);
    min-width: 800px;
}

.admin-main-title {
    font-size: 1.8rem;
    color: #2c3e50;
    margin: 0;
    white-space: nowrap;
}

.admin-main-actions {
    display: flex;
    gap: 15px;
    flex-shrink: 0;
}

/* 功能模块布局 */
.admin-modules {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    min-width: 800px;
}

/* 紧凑的表单样式 */
.compact-form {
    background: white;
    border-radius: 12px;
    padding: 30px;
    border: 1px solid #e9ecef;
    box-shadow: 0 3px 15px rgba(0,0,0,0.08);
    min-width: 0;
    overflow: hidden;
}

.compact-form h3 {
    margin-top: 0;
    margin-bottom: 25px;
    color: #2c3e50;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f1f2f6;
    white-space: nowrap;
}

.form-row-compact {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

@media (min-width: 1081px) {
    .form-row-compact {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 1081px) {
    .admin-main {
        padding: 20px 15px !important; /* 手机端减小间距 */
        margin-left: 0 !important;
        width: 100% !important;
    }
}

.form-group-compact {
    margin-bottom: 20px;
    min-width: 0;
}

.form-group-compact label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
    font-size: 0.95rem;
    white-space: nowrap;
}

.form-group-compact input,
.form-group-compact textarea,
.form-group-compact select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
    background: #f8f9fa;
    box-sizing: border-box;
    min-width: 0;
}

.form-group-compact input:focus,
.form-group-compact textarea:focus,
.form-group-compact select:focus {
    border-color: #3498db;
    outline: none;
    background: white;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.form-actions-compact {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
    flex-wrap: wrap;
}

/* 紧凑的按钮样式 */
.btn-compact {
    padding: 10px 20px;
    font-size: 0.95rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    text-decoration: none;
}

.btn-compact i {
    display: flex;
    align-items: center;
    justify-content: center;
    font-style: normal;
}

.btn-primary-compact {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
}

.btn-primary-compact:hover {
    background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.btn-success-compact {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    color: white;
}

.btn-success-compact:hover {
    background: linear-gradient(135deg, #218838 0%, #28a745 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.2);
}

.btn-danger-compact {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
}

.btn-danger-compact:hover {
    background: linear-gradient(135deg, #c82333 0%, #dc3545 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.2);
}

/* 管理链接网格布局 */
.links-grid-admin {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 768px) {
    .links-grid-admin {
        grid-template-columns: 1fr 1fr;
    }
}

.link-card-admin {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s;
    box-sizing: border-box;
    min-width: 0;
}

.link-card-admin:hover {
    border-color: #3498db;
    box-shadow: 0 3px 15px rgba(52, 152, 219, 0.15);
    transform: translateY(-2px);
}

.link-icon-compact {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    border: 1px solid #dee2e6;
    flex-shrink: 0;
}

.link-icon-emoji-compact {
    font-size: 1.5rem;
}

.link-icon-image-compact {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 6px;
}

.link-info-compact {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.link-name-compact {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
    font-size: 1.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.link-url-compact {
    display: block;
    color: #6c757d;
    font-size: 0.9rem;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.link-category-compact {
    display: inline-block;
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.link-actions-compact {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* 管理照片网格布局 */
.photos-grid-admin {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 640px) {
    .photos-grid-admin {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 1024px) {
    .photos-grid-admin {
        grid-template-columns: 1fr 1fr 1fr 1fr;
    }
}

.photo-card-admin {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s;
    min-width: 0;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
}

.photo-card-admin:hover {
    border-color: #3498db;
    box-shadow: 0 5px 20px rgba(52, 152, 219, 0.15);
    transform: translateY(-3px);
}

.photo-preview-compact {
    height: 150px;
    overflow: hidden;
}

.photo-preview-compact img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.photo-card-admin:hover .photo-preview-compact img {
    transform: scale(1.05);
}

.photo-info-compact {
    padding: 15px;
}

.photo-title-compact {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.photo-url-compact {
    color: #6c757d;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 10px;
}

.photo-actions-compact {
    display: flex;
    justify-content: flex-end;
}

/* 图标选择样式 */
.icon-grid-compact {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-top: 15px;
    max-height: 200px;
    overflow-y: auto;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    box-sizing: border-box;
}

.icon-option-compact {
    cursor: pointer;
    text-align: center;
}

.icon-option-compact input[type="radio"] {
    display: none;
}

.icon-option-compact input[type="radio"]:checked + .icon-preview-compact {
    border-color: #3498db;
    background: #e3f2fd;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.icon-preview-compact {
    width: 50px;
    height: 50px;
    padding: 5px;
    border: 2px solid transparent;
    border-radius: 8px;
    background: white;
    transition: all 0.3s;
    margin: 0 auto;
}

.icon-preview-compact img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    border-radius: 4px;
}

/* 上传按钮样式 */
.upload-group-compact {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.file-input-compact {
    display: none;
}

.upload-btn-compact {
    padding: 10px 18px;
    background: #3498db;
    border: 1px solid #2980b9;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    color: white;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
    white-space: nowrap;
    font-weight: 500;
}

.upload-btn-compact:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.file-hint-compact {
    margin-top: 8px;
    color: #6c757d;
    font-size: 0.85rem;
    white-space: normal;
    line-height: 1.4;
}

/* 来源选项并排显示 */
.source-options-horizontal {
    display: flex;
    gap: 25px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.source-option-horizontal {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.source-content-horizontal {
    margin-top: 15px;
    width: 100%;
}

/* 公告栏文本区域 */
.gonggao-textarea-compact {
    width: 100%;
    min-height: 150px;
    padding: 15px;
    border: 1px solid #ced4da;
    border-radius: 8px;
    font-size: 1rem;
    line-height: 1.5;
    resize: vertical;
    background: #f8f9fa;
    box-sizing: border-box;
    min-width: 0;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

/* 消息提示 */
.alert-compact {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: normal;
    font-weight: 500;
    border-left: 4px solid;
}

.alert-success-compact {
    background: #d4edda;
    color: #155724;
    border-color: #28a745;
    border: 1px solid #c3e6cb;
}

.alert-error-compact {
    background: #f8d7da;
    color: #721c24;
    border-color: #dc3545;
    border: 1px solid #f5c6cb;
}

/* 空状态 */
.empty-state-compact {
    text-align: center;
    padding: 50px 30px;
    color: #6c757d;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px dashed #ced4da;
}

.empty-state-compact i {
    font-size: 3rem;
    margin-bottom: 20px;
    color: #adb5bd;
}

.empty-state-compact p {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 0;
}

/* 编辑表单弹窗 */
.edit-form-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
    box-sizing: border-box;
    backdrop-filter: blur(5px);
}

.edit-form-container {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-sizing: border-box;
    min-width: 0;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.edit-form-container h3 {
    margin-top: 0;
    margin-bottom: 25px;
    color: #2c3e50;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f1f2f6;
}

/* 高亮当前模块 */
.compact-form:target {
    animation: highlight 2s ease;
}

@keyframes highlight {
    0% { 
        background-color: rgba(52, 152, 219, 0.1); 
        box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
    }
    100% { 
        background-color: white;
        box-shadow: 0 3px 15px rgba(0,0,0,0.08);
    }
}

/* 移动端适配 */
@media (max-width: 1024px) {
    .admin-main {
        min-width: 600px;
    }
    
    .admin-modules {
        min-width: 600px;
    }
    
    .icon-grid-compact {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .admin-container {
        flex-direction: column;
    }
    
    .admin-sidebar {
        width: 100%;
        height: auto;
        position: relative;
        margin-left: 0;
        height: auto;
        box-shadow: none;
        border-bottom: 1px solid #34495e;
    }
    
    .admin-main {
        margin-left: 0;
        width: 100%;
        padding: 20px;
        overflow-x: visible;
        min-width: 0;
    }
    
    .admin-nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        padding: 10px;
        gap: 5px;
    }
    
    .admin-nav-item {
        padding: 10px 12px;
        font-size: 0.85rem;
        border-left: none;
        border-bottom: 3px solid transparent;
        flex: 1;
        min-width: 140px;
        text-align: center;
        justify-content: center;
        border-radius: 6px;
        margin: 2px;
    }
    
    .admin-nav-item.active {
        border-left: none;
        border-bottom-color: #3498db;
        background: #34495e;
    }
    
    .admin-nav-item:hover {
        border-left: none;
        border-bottom-color: #3498db;
    }
    
    .nav-badge {
        position: absolute;
        top: 5px;
        right: 5px;
        font-size: 0.65rem;
        padding: 1px 5px;
    }
    
    .admin-main-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding: 20px 15px;
        min-width: 0;
        margin-bottom: 20px;
    }
    
    .admin-main-actions {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .admin-modules {
        min-width: 0;
        gap: 20px;
    }
    
    .compact-form {
        padding: 20px;
        border-radius: 10px;
    }
    
    .compact-form h3 {
        font-size: 1.2rem;
    }
    
    .form-row-compact {
        grid-template-columns: 1fr;
    }
    
    .links-grid-admin {
        grid-template-columns: 1fr;
    }
    
    .photos-grid-admin {
        grid-template-columns: 1fr;
    }
    
    .icon-grid-compact {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        padding: 10px;
    }
    
    .icon-preview-compact {
        width: 45px;
        height: 45px;
    }
    
    .source-options-horizontal {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn-compact {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    
    .link-card-admin {
        flex-wrap: wrap;
        padding: 15px;
        gap: 15px;
    }
    
    .link-actions-compact {
        width: 100%;
        justify-content: flex-end;
        margin-top: 10px;
    }
    
    .photo-preview-compact {
        height: 120px;
    }
}

@media (max-width: 480px) {
    .admin-nav-item {
        min-width: 120px;
        font-size: 0.8rem;
        padding: 8px 10px;
    }
    
    .admin-main {
        padding: 15px;
    }
    
    .compact-form {
        padding: 15px;
        border-radius: 8px;
    }
    
    .compact-form h3 {
        font-size: 1.1rem;
    }
    
    .form-group-compact label {
        font-size: 0.85rem;
    }
    
    .form-group-compact input,
    .form-group-compact textarea,
    .form-group-compact select {
        padding: 10px 12px;
        font-size: 0.95rem;
    }
    
    .icon-grid-compact {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .link-card-admin {
        padding: 12px;
    }
    
    .link-icon-compact {
        width: 45px;
        height: 45px;
    }
    
    .link-name-compact {
        font-size: 1rem;
    }
    
    .photo-preview-compact {
        height: 100px;
    }
    
    .btn-compact {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    .admin-main-title {
        font-size: 1.3rem;
    }
}

@media (max-width: 360px) {
    .admin-nav-item {
        min-width: 100px;
        font-size: 0.75rem;
        padding: 6px 8px;
    }
    
    .admin-main-header {
        padding: 15px 10px;
    }
    
    .admin-main-title {
        font-size: 1.2rem;
    }
    
    .compact-form {
        padding: 12px;
    }
    
    .compact-form h3 {
        font-size: 1rem;
    }
    
    .icon-grid-compact {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .icon-preview-compact {
        width: 40px;
        height: 40px;
    }
    
    .link-icon-compact {
        width: 40px;
        height: 40px;
    }
    
    .link-name-compact {
        font-size: 0.95rem;
    }
}

/* 横屏模式优化 */
@media (max-width: 768px) and (orientation: landscape) {
    .admin-sidebar {
        max-height: 150px;
        overflow-y: auto;
    }
    
    .admin-nav {
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
    }
    
    .admin-nav-item {
        min-width: 160px;
    }
    
    .links-grid-admin {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .photos-grid-admin {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 图标输入框 */
.icon-input {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 15px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 1rem;
    background: #f8f9fa;
    box-sizing: border-box;
}

.icon-input:focus {
    border-color: #3498db;
    outline: none;
    background: white;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.icon-selection {
    background: white;
    padding: 18px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}