* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: #f5f7fa; }

.admin-container { min-height: 100vh; }

.admin-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.admin-header h1 { font-size: 1.5rem; font-weight: 600; }

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    font-weight: 500;
}

.btn-primary { background: #667eea; color: white; }
.btn-primary:hover { background: #5a6fd6; }
.btn-secondary { background: #e8e8e8; color: #333; }
.btn-secondary:hover { background: #ddd; }
.btn-danger { background: #ff6b6b; color: white; }
.btn-danger:hover { background: #ff5252; }
.btn-logout { background: rgba(255,255,255,0.2); color: white; }
.btn-logout:hover { background: rgba(255,255,255,0.3); }

.admin-content { padding: 30px; max-width: 1400px; margin: 0 auto; }

.admin-toolbar { margin-bottom: 20px; display: flex; gap: 12px; }

.admin-table {
    width: 100%;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.admin-table th, .admin-table td { padding: 16px 20px; text-align: left; border-bottom: 1px solid #f0f0f0; }
.admin-table th { background: #fafafa; font-weight: 600; color: #333; font-size: 14px; }
.admin-table tr:hover { background: #f9f9f9; }
.admin-table tr:last-child td { border-bottom: none; }

.thumb-cell img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #eee;
}

/* 弹窗 */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    overflow-y: auto;
}

.modal.show { display: flex; align-items: flex-start; justify-content: center; padding: 40px 20px; }

.modal-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fafafa;
    border-radius: 16px 16px 0 0;
}

.modal-header h2 { font-size: 1.3rem; color: #333; }

.close {
    font-size: 28px;
    cursor: pointer;
    color: #999;
    line-height: 1;
}
.close:hover { color: #333; }

/* 表单 */
.form-group { padding: 18px 24px; border-bottom: 1px solid #f5f5f5; }
.form-group:last-child { border-bottom: none; }

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-group input[type="text"],
.form-group input[type="url"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
    background: #fafafa;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102,126,234,0.1);
}

.form-group textarea { 
    resize: vertical; 
    font-family: inherit;
    line-height: 1.6;
}

.thumb-preview { margin-top: 12px; }
.thumb-preview img {
    max-width: 150px;
    max-height: 100px;
    border-radius: 8px;
    border: 1px solid #eee;
}

.editor-toolbar {
    margin-bottom: 10px;
    display: flex;
    gap: 8px;
}

.editor-toolbar button {
    padding: 8px 14px;
    background: #f0f0f0;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}
.editor-toolbar button:hover { background: #e0e0e0; }

.form-actions {
    padding: 20px 24px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 12px;
    background: #fafafa;
    border-radius: 0 0 16px 16px;
}

.form-actions .btn { flex: 1; padding: 14px; font-size: 15px; }

/* 商品列表 */
.products-section { padding: 0 24px; margin-bottom: 15px; }

.product-edit-item {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
    align-items: center;
    padding: 12px;
    background: #f9f9f9;
    border-radius: 8px;
}

.product-edit-item input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 13px;
}

.product-edit-item .product-thumb-preview {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
}

/* 登录弹窗 */
#loginModal .modal-content { max-width: 400px; }
#loginModal h2 { padding: 24px; margin: 0; }
#loginModal .form-group { padding: 16px 24px; }
#loginModal .form-actions { justify-content: center; }

/* 空状态 */
.empty-row td { text-align: center; color: #999; padding: 40px; }

/* 响应式 */
@media (max-width: 768px) {
    .admin-content { padding: 15px; }
    .admin-table { overflow-x: auto; }
    .modal-content { max-width: 100%; margin: 10px; }
    .product-edit-item { flex-wrap: wrap; }
}
