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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: #f5f7fa;
  color: #333;
}

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

.login-box {
  background: white;
  padding: 40px;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  width: 380px;
  text-align: center;
}

.login-box h1 {
  font-size: 24px;
  margin-bottom: 8px;
  color: #333;
}

.login-subtitle {
  color: #888;
  font-size: 14px;
  margin-bottom: 24px;
}

.login-tabs {
  display: flex;
  margin-bottom: 20px;
  border-bottom: 2px solid #eee;
}

.tab-btn {
  flex: 1;
  padding: 12px;
  border: none;
  background: none;
  font-size: 16px;
  cursor: pointer;
  color: #888;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}

.tab-btn.active {
  color: #667eea;
  border-bottom-color: #667eea;
}

.login-form input {
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
}

.login-form input:focus {
  outline: none;
  border-color: #667eea;
}

.login-tip {
  margin-top: 12px;
  font-size: 12px;
  color: #999;
}

/* 按钮 */
.btn-primary {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-primary:hover {
  opacity: 0.9;
}

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

.btn-secondary {
  background: #f0f0f0;
  color: #333;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}

.btn-secondary:hover {
  background: #e0e0e0;
}

.btn-danger {
  background: #ff4d4f;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
}

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

/* 主界面布局 */
.main-app {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 220px;
  background: #1a1d29;
  color: white;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
}

.logo {
  padding: 24px;
  font-size: 20px;
  font-weight: 600;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.nav-menu {
  flex: 1;
  padding: 12px 0;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 12px 24px;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}

.nav-item:hover {
  background: rgba(255,255,255,0.05);
  color: white;
}

.nav-item.active {
  background: rgba(102, 126, 234, 0.2);
  color: white;
  border-left: 3px solid #667eea;
}

.nav-icon {
  margin-right: 10px;
  font-size: 16px;
}

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.user-info {
  margin-bottom: 12px;
  font-size: 14px;
}

.user-role {
  font-size: 11px;
  background: #667eea;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 6px;
}

.btn-logout {
  width: 100%;
  padding: 8px;
  background: rgba(255,255,255,0.1);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}

.btn-logout:hover {
  background: rgba(255,255,255,0.2);
}

/* 主内容区 */
.main-content {
  flex: 1;
  margin-left: 220px;
  padding: 24px;
}

.page h2 {
  margin-bottom: 20px;
  font-size: 22px;
}

/* 统计卡片 */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.stat-label {
  color: #888;
  font-size: 13px;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 28px;
  font-weight: 600;
  color: #333;
}

/* 面板 */
.panel {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  margin-bottom: 20px;
}

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

/* 表单 */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

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

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

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

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

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.btn-row {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

/* 数据表格 */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  background: #f8f9fa;
  padding: 12px;
  text-align: left;
  font-weight: 600;
  color: #555;
  border-bottom: 2px solid #eee;
}

.data-table td {
  padding: 12px;
  border-bottom: 1px solid #f0f0f0;
}

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

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

.status-pending { background: #fff7e6; color: #fa8c16; }
.status-scripting { background: #e6f7ff; color: #1890ff; }
.status-voicing { background: #e6f7ff; color: #1890ff; }
.status-generating { background: #f9f0ff; color: #722ed1; }
.status-done { background: #f6ffed; color: #52c41a; }
.status-failed { background: #fff1f0; color: #ff4d4f; }
.status-living { background: #f6ffed; color: #52c41a; }
.status-ended { background: #f0f0f0; color: #888; }

/* 商品网格 */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.product-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: transform 0.2s;
}

.product-card:hover {
  transform: translateY(-2px);
}

.product-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  background: #f0f0f0;
}

.product-info {
  padding: 12px;
}

.product-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
}

.product-price {
  color: #ff4d4f;
  font-size: 16px;
  font-weight: 600;
}

.product-category {
  font-size: 12px;
  color: #888;
  margin-top: 4px;
}

/* 数字人设置 */
.avatar-setup {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.avatar-preview {
  width: 200px;
  height: 200px;
  border: 2px dashed #ddd;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.avatar-placeholder {
  color: #aaa;
  font-size: 13px;
}

.avatar-actions {
  flex: 1;
}

.avatar-actions p {
  margin-bottom: 12px;
  color: #666;
  font-size: 13px;
}

/* 弹窗 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  padding: 24px;
  border-radius: 12px;
  width: 500px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-content h3 {
  margin-bottom: 16px;
}

/* Toast */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  z-index: 2000;
  display: none;
  font-size: 14px;
}

.toast.show {
  display: block;
}

.toast.success { background: #52c41a; }
.toast.error { background: #ff4d4f; }

/* 响应式 */
@media (max-width: 768px) {
  .sidebar {
    width: 60px;
  }
  .logo, .nav-item span:not(.nav-icon), .user-info, .btn-logout {
    display: none;
  }
  .main-content {
    margin-left: 60px;
  }
}

/* ===== 视频生产页面 ===== */
.page-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.page-header-row h2 {
  margin: 0;
}
.video-tabs {
  display: flex;
  gap: 8px;
}
.tab-btn {
  padding: 8px 16px;
  border: 1px solid #e5e7eb;
  background: white;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}
.tab-btn:hover {
  border-color: #6366f1;
  color: #6366f1;
}
.tab-btn.active {
  background: #6366f1;
  color: white;
  border-color: #6366f1;
}
.video-tab-content {
  min-height: 600px;
}
.video-iframe-wrap {
  width: 100%;
  height: calc(100vh - 180px);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  background: #f9fafb;
}
.video-iframe-wrap iframe {
  width: 100%;
  height: 100%;
  border: none;
}
