/* =================== 后台管理样式 =================== */

/* 全局 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: #f0f2f5;
    color: #333;
}

a {
    text-decoration: none;
    color: #667eea;
}

a:hover {
    color: #764ba2;
}

/* 登录页 */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0a0a2e 0%, #1a1a4e 100%);
}

.login-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    width: 400px;
    text-align: center;
}

.login-logo {
    font-size: 48px;
    margin-bottom: 10px;
}

.login-container h2 {
    color: #333;
    margin-bottom: 5px;
}

.login-form {
    margin-top: 30px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form input[type="text"],
.login-form input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.login-form input:focus {
    outline: none;
    border-color: #667eea;
}

/* 后台布局 */
.admin-container {
    display: flex;
    min-height: 100vh;
}

.admin-content {
    flex: 1;
    padding: 20px 30px;
    margin-left: 220px;
    min-height: 100vh;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e8e8e8;
}

.admin-header h1 {
    color: #333;
    font-size: 24px;
}

.admin-user {
    color: #666;
    font-size: 14px;
}

/* 侧边栏 */
.admin-sidebar {
    width: 220px;
    background: #1a1a2e;
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-header h2 {
    color: white;
    font-size: 18px;
}

.sidebar-nav {
    padding: 10px 0;
}

.nav-item {
    display: block;
    padding: 12px 20px;
    color: rgba(255,255,255,0.7);
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(255,255,255,0.1);
    color: white;
    border-left-color: #667eea;
}

.nav-divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 10px 0;
}

.badge {
    background: #f00;
    color: white;
    border-radius: 10px;
    padding: 2px 8px;
    font-size: 12px;
    margin-left: 5px;
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-icon {
    font-size: 32px;
}

.stat-number {
    font-size: 28px;
    font-weight: bold;
    color: #333;
}

.stat-label {
    color: #888;
    font-size: 13px;
}

/* 表单 */
.admin-form {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    max-width: 800px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="password"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-actions {
    margin-top: 30px;
    display: flex;
    gap: 10px;
}

/* 按钮 */
.btn {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 6px;
    border: 1px solid #ddd;
    background: white;
    color: #333;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn:hover {
    background: #f5f5f5;
    color: #333;
}

.btn-primary {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.btn-primary:hover {
    background: #764ba2;
    color: white;
}

.btn-small {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    border: 1px solid #ddd;
    background: white;
    color: #333;
    cursor: pointer;
    text-decoration: none;
}

.btn-small:hover {
    background: #f5f5f5;
}

.btn-danger {
    background: #ff4d4f;
    color: white;
    border-color: #ff4d4f;
}

.btn-danger:hover {
    background: #ff7875;
    color: white;
}

/* 表格 */
.admin-table {
    width: 100%;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-collapse: collapse;
    overflow: hidden;
}

.admin-table th,
.admin-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.admin-table th {
    background: #fafafa;
    font-weight: 500;
    color: #333;
}

.admin-table tr:hover {
    background: #fafafa;
}

/* 警告框 */
.alert {
    padding: 12px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.alert-success {
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    color: #52c41a;
}

.alert-error {
    background: #fff2e8;
    border: 1px solid #ffbb96;
    color: #fa541c;
}

/* 布局 */
.admin-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
}

.admin-main {
    background: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.admin-sidebar-right {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    align-self: start;
}

/* 快捷操作 */
.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.quick-action-btn {
    display: inline-block;
    padding: 10px 20px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    color: #333;
    transition: all 0.3s;
}

.quick-action-btn:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* 信息表格 */
.info-table {
    width: 100%;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.info-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
}

.info-table td:first-child {
    background: #fafafa;
    font-weight: 500;
    width: 120px;
}

/* =================== 授权状态卡片 =================== */
.license-status-card {
    background: #fafafa;
    border-radius: 8px;
    padding: 16px 20px;
    border: 1px solid #e8e8e8;
    margin-bottom: 16px;
}
.license-status-card.status-active {
    border-color: #b7eb8f;
    background: #f6ffed;
}
.license-status-card.status-trial {
    border-color: #ffe58f;
    background: #fffbe6;
}
.license-status-card.status-expired {
    border-color: #ffbb96;
    background: #fff2e8;
}
.license-status-row {
    display: flex;
    align-items: center;
    padding: 6px 0;
    font-size: 14px;
}
.license-label {
    color: #666;
    min-width: 80px;
}
.license-value {
    font-weight: 600;
    color: #333;
}
.license-days {
    color: #667eea;
    font-size: 16px;
}
.license-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
}
.license-badge-active {
    background: #b7eb8f;
    color: #135200;
}
.license-badge-trial {
    background: #ffe58f;
    color: #ad6800;
}
.license-badge-expired {
    background: #ffbb96;
    color: #a8071a;
}
.license-activate-box {
    background: white;
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-top: 8px;
}
.license-activate-box h4 {
    margin-bottom: 12px;
    color: #333;
}
.license-activate-form {
    display: flex;
    gap: 10px;
    align-items: center;
}
.license-code-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
    outline: none;
    transition: border-color 0.2s;
}
.license-code-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.15);
}
.license-contact-hint {
    margin-top: 12px;
    font-size: 13px;
    color: #999;
    text-align: center;
}

/* 响应式 */
@media (max-width: 768px) {
    .admin-sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .admin-content {
        margin-left: 0;
    }
    
    .admin-layout {
        grid-template-columns: 1fr;
    }
    
    .license-activate-form {
        flex-direction: column;
    }
}

/* 图片上传 */
.image-preview {
    max-width: 200px;
    max-height: 150px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
}
.image-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0;
}
.image-option {
    width: 100px;
    height: 100px;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.image-option.selected {
    border-color: #667eea;
}
.image-option img {
    max-width: 100%;
    max-height: 100%;
}
.upload-section {
    margin: 15px 0;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 4px;
}

/* =================== 描述媒体上传区域 =================== */
.media-upload-area {
    border: 2px dashed #d9d9d9;
    border-radius: 8px;
    padding: 16px;
    background: #fafafa;
    transition: border-color 0.2s;
}
.media-upload-area:hover {
    border-color: #667eea;
}
.media-upload-area .upload-hint {
    color: #999;
    font-size: 12px;
    margin: 8px 0 12px;
}
.media-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
    min-height: 20px;
}
.media-item {
    position: relative;
    width: 120px;
    height: 90px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    background: #fff;
    flex-shrink: 0;
}
.media-item img,
.media-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.media-type-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    pointer-events: none;
}
.media-delete-btn {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 22px;
    height: 22px;
    border: none;
    background: rgba(220,38,38,0.85);
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}
.media-delete-btn:hover {
    background: rgb(220,38,38);
}
.media-pending {
    opacity: 0.55;
    border-style: dashed;
    border-color: #667eea;
}
.media-pending-label {
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    background: #667eea;
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    white-space: nowrap;
    pointer-events: none;
}
