/* 
 * 本程序由【小马克程序定制】设计与制作，如有售后和开发需求请联系：微信同号：19918881666，官网：https://xiaomaker.cn 
 */

:root {
    --primary-color: #1890ff;
    --primary-hover: #40a9ff;
    --bg-color: #f0f2f5;
    --white: #ffffff;
    --text-color: #333333;
    --text-secondary: #666666;
    --border-color: #d9d9d9;
    --danger-color: #ff4d4f;
    --success-color: #52c41a;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    font-size: 14px;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color 0.3s;
}

a:hover {
    color: var(--primary-hover);
}

/* 布局容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 登录页面 */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #e6f7ff;
}

.login-box {
    background: var(--white);
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-title {
    margin-bottom: 30px;
    font-size: 24px;
    color: var(--primary-color);
    font-weight: 500;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s;
}

.form-control:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.btn {
    display: inline-block;
    font-weight: 400;
    text-align: center;
    cursor: pointer;
    background-image: none;
    border: 1px solid transparent;
    white-space: nowrap;
    padding: 10px 20px;
    font-size: 14px;
    border-radius: 4px;
    transition: all 0.3s;
    user-select: none;
}

.btn-primary {
    color: var(--white);
    background-color: var(--primary-color);
    border-color: var(--primary-color);
/*    width: 100%;*/
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

.btn-danger {
    color: var(--white);
    background-color: var(--danger-color);
    border-color: var(--danger-color);
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
    width: auto;
}

/* 后台布局 */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    background: #001529;
    color: var(--white);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.logo {
    height: 64px;
    line-height: 64px;
    background: #002140;
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    color: var(--white);
}

.menu {
    flex: 1;
    padding-top: 20px;
}

.menu-item {
    display: block;
    padding: 12px 24px;
    color: rgba(255,255,255,0.65);
    cursor: pointer;
}

.menu-item:hover, .menu-item.active {
    color: var(--white);
    background: var(--primary-color);
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.header {
    height: 64px;
    background: var(--white);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: flex-end; /* Logout on right */
    box-shadow: 0 1px 4px rgba(0,21,41,0.08);
}

.content-body {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.card {
    background: var(--white);
    border-radius: 4px;
    padding: 24px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* 表格样式 */
.table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.table th, .table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

.table th {
    background: #fafafa;
    font-weight: 500;
}

/* 模态框 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--white);
    width: 500px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    font-weight: 500;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    text-align: right;
}

.close-btn {
    cursor: pointer;
    font-size: 20px;
    color: var(--text-secondary);
}

/* 前端收集页 */
.collection-page {
    background: var(--bg-color);
    min-height: 100vh;
    padding: 20px;
}

.collection-header {
    text-align: center;
    margin-bottom: 30px;
}

.collection-title {
    font-size: 24px;
    color: var(--primary-color);
    margin-bottom: 10px;
}

.shop-info {
    background: #e6f7ff;
    padding: 15px;
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 14px;
    display: inline-block;
}

.section-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 15px;
    padding-left: 10px;
    border-left: 4px solid var(--primary-color);
}

.upload-area {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.upload-item {
    width: 100px;
    height: 100px;
    border: 1px dashed var(--border-color);
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    position: relative;
    background: #fafafa;
    overflow: hidden;
}

.upload-item:hover {
    border-color: var(--primary-color);
}

.upload-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload-add {
    font-size: 30px;
    color: #999;
}

.upload-delete {
    position: absolute;
    top: 0;
    right: 0;
    background: rgba(0,0,0,0.5);
    color: white;
    width: 20px;
    height: 20px;
    text-align: center;
    line-height: 20px;
    font-size: 14px;
    cursor: pointer;
}

/* Loading遮罩 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.8);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 10px;
}

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

/* 技术支持脚标 */
.tech-support {
    position: fixed;
    bottom: 10px;
    right: 10px;
    font-size: 12px;
    color: #999;
    cursor: default;
    z-index: 9999;
    background: rgba(255,255,255,0.8);
    padding: 5px 10px;
    border-radius: 4px;
    box-shadow: 0 0 5px rgba(0,0,0,0.1);
}

.tech-support-tooltip {
    display: none;
    position: absolute;
    bottom: 100%;
    right: 0;
    width: 300px;
    padding: 10px;
    background: #333;
    color: #fff;
    border-radius: 4px;
    margin-bottom: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.tech-support:hover .tech-support-tooltip {
    display: block;
}

/* 响应式 */
@media (max-width: 768px) {
    .admin-layout {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
    }
    .main-content {
        height: calc(100vh - 64px); /* Rough estimate */
    }
    .card {
        padding: 15px;
    }
    .table th, .table td {
        padding: 10px;
    }
    .modal-content {
        width: 90%;
        margin: 0 auto;
    }
}
