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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
.header {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.header h1 {
    font-size: 24px;
    color: #2c3e50;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

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

.btn-primary {
    background: #3498db;
    color: #fff;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-secondary {
    background: #95a5a6;
    color: #fff;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-danger {
    background: #e74c3c;
    color: #fff;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-link {
    background: none;
    color: #3498db;
    padding: 5px 10px;
}

.btn-link:hover {
    color: #2980b9;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* 素材网格 */
.materials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.material-card {
    background: #fff;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.material-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.material-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.material-card h2 {
    font-size: 20px;
    margin-bottom: 10px;
    color: #2c3e50;
}

.material-card .count {
    color: #7f8c8d;
    margin-bottom: 20px;
}

/* 后台仪表盘 */
.admin-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 10px;
}

.admin-card {
    background: #fff;
    border-radius: 10px;
    padding: 24px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid rgba(0,0,0,0.06);
}

.admin-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.admin-card-icon {
    font-size: 34px;
    margin-bottom: 10px;
}

.admin-card-title {
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 6px;
}

.admin-card-meta {
    font-size: 13px;
    color: #7f8c8d;
}

/* 后台通用块/表格 */
.admin-section {
    background: #fff;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.admin-section h2 {
    margin-bottom: 20px;
    color: #2c3e50;
}

.admin-form {
    max-width: 520px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

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

.admin-table th {
    background: #f8f9fa;
    font-weight: 700;
    color: #2c3e50;
}

.admin-table tr:hover {
    background: #fafafa;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    background: #e9ecef;
    color: #495057;
}

.badge-admin {
    background: #3498db;
    color: #fff;
}

.text-muted {
    color: #95a5a6;
}

/* 工具栏 */
.toolbar {
    margin-bottom: 20px;
}

/* 素材列表 */
.materials-list {
    display: grid;
    gap: 20px;
}

.material-item {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.material-preview {
    flex-shrink: 0;
    width: 200px;
    height: 150px;
    overflow: hidden;
    border-radius: 4px;
    background: #f0f0f0;
}

.material-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.material-preview video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.material-info {
    flex: 1;
}

.material-info h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #2c3e50;
}

.material-info .description {
    color: #7f8c8d;
    margin-bottom: 10px;
}

.material-info .content {
    color: #555;
    margin-bottom: 10px;
    white-space: pre-wrap;
}

.material-meta {
    display: flex;
    gap: 15px;
    font-size: 12px;
    color: #95a5a6;
    margin-top: 10px;
}

.material-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

/* 文案列表项样式 */
.material-item-text {
    flex-direction: column;
}

.material-item-text .material-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.material-item-text .material-header h3 {
    margin: 0;
    flex: 1;
}

.material-item-text .material-info {
    width: 100%;
}

.material-item-text .content {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    border-left: 3px solid #3498db;
    margin: 10px 0;
}

.file-link a {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
}

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

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #95a5a6;
}

/* 登录注册页面 */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.auth-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.auth-box {
    background: #fff;
    border-radius: 8px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.auth-box h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
}

.auth-footer {
    text-align: center;
    margin-top: 20px;
    color: #7f8c8d;
}

.auth-footer a {
    color: #3498db;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

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

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

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

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* 提示信息 */
.alert {
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert-error {
    background: #fee;
    color: #c33;
    border: 1px solid #fcc;
}

.alert-success {
    background: #efe;
    color: #3c3;
    border: 1px solid #cfc;
}

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

.modal-content {
    background: #fff;
    margin: 50px auto;
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    position: relative;
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
}

.close:hover {
    color: #000;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .materials-grid {
        grid-template-columns: 1fr;
    }
    
    .material-item {
        flex-direction: column;
    }
    
    .material-preview {
        width: 100%;
        height: 200px;
    }
    
    .header .container {
        flex-direction: column;
        gap: 15px;
    }
}
