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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f5f5f5;
}

/* 页面容器 */
.page {
    min-height: 100vh;
}

/* 登录/注册容器 */
.login-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 40px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.login-container h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

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

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

.form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #409eff;
}

/* 按钮样式 */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-primary {
    width: 100%;
    background-color: #409eff;
    color: white;
}

.btn-primary:hover {
    background-color: #66b1ff;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    background-color: #409eff;
    color: white;
}

.btn-small:hover {
    background-color: #66b1ff;
}

/* 注册链接 */
.register-link {
    text-align: center;
    margin-top: 20px;
    color: #666;
}

.register-link a {
    color: #409eff;
    text-decoration: none;
}

.register-link a:hover {
    text-decoration: underline;
}

/* 顶部导航栏 */
.header {
    height: 60px;
    background: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.header-left h2 {
    color: #333;
    font-size: 18px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

#userInfo {
    color: #666;
}

/* 侧边栏 */
.sidebar {
    width: 200px;
    background: white;
    position: fixed;
    top: 60px;
    left: 0;
    bottom: 0;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.05);
}

.sidebar nav ul {
    list-style: none;
    /* padding: 20px 0; */
}

.sidebar nav ul li {
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.3s;
    color: #666;
    /* display: flex; */
    align-items: center;
    gap: 10px;
}

.sidebar nav ul li:hover {
    background-color: #f5f7fa;
    color: #409eff;
}

.sidebar nav ul li.active {
    background-color: #ecf5ff;
    color: #409eff;
    border-right: 3px solid #409eff;
}

/* 菜单组 */
.menu-group {
    margin-bottom: 5px;
    display: block;
}

.menu-title {
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.3s;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-weight: 500;
    width: 100%;
}

.menu-title:hover {
    background-color: #f5f7fa;
    color: #409eff;
}

.arrow {
    font-size: 12px;
    transition: transform 0.3s;
}

.menu-title.collapsed .arrow {
    transform: rotate(-90deg);
}

/* 子菜单 */
.submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.submenu.collapsed {
    max-height: 0;
}

.submenu li {
    padding: 10px 20px 10px 50px;
    cursor: pointer;
    transition: all 0.3s;
    color: #666;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.submenu li:hover {
    background-color: #f5f7fa;
    color: #409eff;
}

.submenu li.active {
    background-color: #ecf5ff;
    color: #409eff;
    border-right: 3px solid #409eff;
}

/* 主内容区 */
.content {
    margin-left: 200px;
    margin-top: 60px;
    padding: 20px;
    min-height: calc(100vh - 60px);
}

.section {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
}

.section-header h3 {
    color: #333;
    font-size: 16px;
}

#searchUser {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    width: 250px;
    transition: border-color 0.3s;
}

#searchUser:focus {
    outline: none;
    border-color: #409eff;
}

#searchAdAccount {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    width: 250px;
    transition: border-color 0.3s;
}

#searchAdAccount:focus {
    outline: none;
    border-color: #409eff;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 15px 0;
}

.pagination-info {
    color: #666;
    font-size: 14px;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.page-size-select {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    background-color: #fff;
}

.page-size-select:focus {
    outline: none;
    border-color: #409eff;
}

.pagination-buttons {
    display: flex;
    gap: 8px;
}

.btn-pagination {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background-color: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-pagination:hover:not(.disabled) {
    border-color: #409eff;
    color: #409eff;
}

.btn-pagination.active {
    background-color: #409eff;
    color: #fff;
    border-color: #409eff;
}

.btn-pagination.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #e8eaec;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover,
.close:focus {
    color: #333;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #e8eaec;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

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

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #606266;
    font-size: 14px;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #409eff;
}

.btn-secondary {
    background-color: #fff;
    border: 1px solid #dcdfe6;
    color: #606266;
}

.btn-secondary:hover {
    color: #409eff;
    border-color: #c6e2ff;
    background-color: #ecf5ff;
}

.btn-primary {
    background-color: #409eff;
    border: 1px solid #409eff;
    color: #fff;
}

.btn-primary:hover {
    background-color: #66b1ff;
    border-color: #66b1ff;
}

/* 表格样式 */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background-color: #f5f7fa;
}

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

th {
    color: #606266;
    font-weight: 600;
    font-size: 14px;
}

td {
    color: #606266;
    font-size: 14px;
}

tbody tr:hover {
    background-color: #f5f7fa;
}

/* 状态标签 */
.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

.status-active {
    background-color: #f0f9ff;
    color: #409eff;
}

.status-inactive {
    background-color: #fef0f0;
    color: #f56c6c;
}

/* 开关样式 */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #409eff;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider:hover {
    background-color: #bbb;
}

input:checked + .slider:hover {
    background-color: #66b1ff;
}

/* 查看按钮 */
.btn-view {
    padding: 4px 12px;
    background-color: #409eff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.3s;
}

.btn-view:hover {
    background-color: #66b1ff;
}

/* 模态框样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #ebeef5;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 18px;
}

.modal-close {
    font-size: 28px;
    color: #909399;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s;
}

.modal-close:hover {
    color: #409eff;
}

.modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.detail-item {
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
}

.detail-item label {
    min-width: 100px;
    color: #606266;
    font-weight: 500;
    flex-shrink: 0;
}

.detail-item span {
    color: #303133;
    word-break: break-all;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #ebeef5;
    text-align: right;
}

/* 大模态框 */
.modal-large {
    max-width: 800px;
    width: 95%;
}

/* 详情区域 */
.detail-section {
    margin-bottom: 25px;
}

.detail-section h4 {
    margin: 0 0 15px 0;
    color: #303133;
    font-size: 16px;
    border-bottom: 2px solid #409eff;
    padding-bottom: 8px;
}

/* 广告账户列表 */
.ad-account-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ad-account-item {
    background: #f5f7fa;
    border-radius: 6px;
    padding: 15px;
    border-left: 4px solid #409eff;
}

.ad-account-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dcdfe6;
}

.ad-account-index {
    background: #409eff;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.ad-account-name {
    font-size: 16px;
    font-weight: 600;
    color: #303133;
}

.ad-account-details {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
}

.detail-row label {
    color: #909399;
    font-size: 13px;
    margin-right: 8px;
}

.detail-row span {
    color: #303133;
    font-size: 13px;
    font-weight: 500;
}

.no-data {
    text-align: center;
    color: #909399;
    padding: 30px;
    font-style: italic;
}

/* 提示信息 */
.message {
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    display: none;
}

.message.success {
    background-color: #f0f9ff;
    color: #409eff;
    border: 1px solid #d9ecff;
}

.message.error {
    background-color: #fef0f0;
    color: #f56c6c;
    border: 1px solid #fde2e2;
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 40px;
    color: #909399;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: relative;
        top: 0;
    }
    
    .content {
        margin-left: 0;
    }
    
    .login-container {
        margin: 50px 20px;
        padding: 30px 20px;
    }
}

/* 视频上传模态框样式 */
.modal-large {
    max-width: 900px;
}

.upload-area {
    border: 2px dashed #d0d5d9;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    background-color: #f7f8fa;
    transition: all 0.3s;
    cursor: pointer;
    margin-bottom: 20px;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: #1890ff;
    background-color: #e6f7ff;
}

.upload-icon {
    font-size: 48px;
    color: #1890ff;
    margin-bottom: 10px;
}

.upload-text {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.upload-link {
    color: #1890ff;
    cursor: pointer;
    text-decoration: underline;
}

.upload-link:hover {
    color: #40a9ff;
}

.upload-specs {
    font-size: 12px;
    color: #999;
    line-height: 1.8;
}

.upload-file-list {
    background-color: white;
    border: 1px solid #e8eaec;
    border-radius: 8px;
    overflow: hidden;
}

.upload-file-header {
    display: flex;
    justify-content: space-between;
    padding: 12px 20px;
    background-color: #f7f8fa;
    border-bottom: 1px solid #e8eaec;
    font-weight: 500;
    color: #333;
}

.upload-file-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

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

.upload-file-item:hover {
    background-color: #fafafa;
}

.upload-file-thumb {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
    overflow: hidden;
}

.upload-file-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload-file-info {
    flex: 1;
    min-width: 0;
}

.upload-file-name {
    font-size: 14px;
    color: #333;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-progress-bar {
    height: 6px;
    background-color: #f0f0f0;
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.upload-progress-fill {
    height: 100%;
    background-color: #1890ff;
    border-radius: 3px;
    transition: width 0.3s;
}

.upload-progress-fill.success {
    background-color: #52c41a;
}

.upload-progress-text {
    font-size: 12px;
    color: #999;
    margin-left: 8px;
    display: inline-block;
    vertical-align: middle;
}

.upload-file-status {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    font-size: 14px;
}

.upload-file-status.success {
    color: #52c41a;
}

.upload-file-actions {
    flex-shrink: 0;
}

.upload-file-delete {
    color: #ff4d4f;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
    border: none;
    background: none;
    font-size: 14px;
}

.upload-file-delete:hover {
    background-color: #fff1f0;
}

.upload-footer-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.upload-footer-info #uploadCount {
    font-size: 14px;
    color: #666;
    white-space: nowrap;
}

.upload-thumbnails {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    flex: 1;
}

.upload-thumb-item {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

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

.upload-thumb-remove {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 16px;
    height: 16px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    cursor: pointer;
}

.upload-thumb-remove:hover {
    background-color: rgba(255, 77, 79, 0.9);
}
