/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

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

.login-box {
    background-color: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    text-align: center;
    color: #1890ff;
    margin-bottom: 10px;
    font-size: 24px;
}

.login-box h2 {
    text-align: center;
    color: #666;
    margin-bottom: 30px;
    font-size: 18px;
    font-weight: normal;
}

.error-message {
    background-color: #fff1f0;
    border: 1px solid #ffccc7;
    color: #f5222d;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
    text-align: center;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #666;
    font-weight: bold;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
}

.form-group input:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.form-group input[type="submit"] {
    background-color: #1890ff;
    color: white;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
}

.form-group input[type="submit"]:hover {
    background-color: #40a9ff;
}

/* 后台页面样式 */
.admin-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* 左侧菜单（10%宽度） */
.sidebar {
    width: 10%;
    background-color: #001529;
    color: white;
    overflow-y: auto;
}

.sidebar-header {
    padding: 10px;
    background-color: #002140;
    border-bottom: 1px solid #1890ff;
    text-align: center;
}

.sidebar-header h1 {
    font-size: 14px;
    margin: 0;
    color: white;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
}

.sidebar-menu li {
    border-bottom: 1px solid #1f2d3d;
}

.sidebar-menu a {
    display: block;
    padding: 12px 5px;
    color: white;
    text-decoration: none;
    transition: background-color 0.3s;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
}

.sidebar-menu a:hover {
    background-color: #1f2d3d;
}

.sidebar-menu a.active {
    background-color: #1890ff;
}

/* 右侧内容（90%宽度） */
.main-content {
    width: 90%;
    background-color: #f0f2f5;
    overflow-y: auto;
    padding: 20px;
}

.content-header {
    background-color: white;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.content-header h2 {
    margin: 0;
    color: #333;
    font-size: 20px;
}

.content-body {
    background-color: white;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.3s;
}

.btn-primary {
    background-color: #1890ff;
    color: white;
}

.btn-primary:hover {
    background-color: #40a9ff;
}

.btn-danger {
    background-color: #f5222d;
    color: white;
}

.btn-danger:hover {
    background-color: #ff4d4f;
}

.btn-success {
    background-color: #52c41a;
    color: white;
}

.btn-success:hover {
    background-color: #73d13d;
}

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

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e8e8e8;
}

.table th {
    background-color: #fafafa;
    font-weight: bold;
    color: #333;
}

.table tr:hover {
    background-color: #f5f5f5;
}

/* 表单样式 */
.form {
    margin-top: 20px;
}

.form-row {
    margin-bottom: 20px;
}

.form-row label {
    display: block;
    margin-bottom: 5px;
    color: #666;
    font-weight: bold;
}

.form-row input[type="text"],
.form-row input[type="password"],
.form-row textarea,
.form-row select {
    width: 100%;
    padding: 10px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.form-row textarea {
    resize: vertical;
    min-height: 100px;
}

.form-row input:focus,
.form-row textarea:focus,
.form-row select:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

/* 卡片样式 */
.card {
    background-color: white;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.card h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 16px;
}

/* 消息提示样式 */
.message {
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.message.success {
    background-color: #f6ffed;
    border: 1px solid #b7eb8f;
    color: #52c41a;
}

.message.error {
    background-color: #fff2f0;
    border: 1px solid #ffccc7;
    color: #f5222d;
}

.message.info {
    background-color: #e6f7ff;
    border: 1px solid #91d5ff;
    color: #1890ff;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.pagination a {
    padding: 8px 12px;
    margin: 0 5px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    text-decoration: none;
    color: #1890ff;
}

.pagination a:hover {
    background-color: #f5f5f5;
}

.pagination a.active {
    background-color: #1890ff;
    color: white;
    border-color: #1890ff;
}

/* 分类管理样式 */
.subcategory-row {
    display: none; /* 默认隐藏二级分类行 */
}

/* OSS设置区域样式 */
#oss-settings {
    border: 1px solid #eee !important;
    background-color: #f9f9f9 !important;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .admin-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
    }
    
    .main-content {
        width: 100%;
        height: calc(100vh - 100px);
    }
    
    .subcategory-container {
        margin-left: 20px;
    }
}