/* YouTube-Dubbing 激活码管理后台样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f5f7fa;
  color: #333;
  min-height: 100vh;
}

/* 登录页 */
.login-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
.login-box {
  background: #fff;
  padding: 40px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  width: 360px;
}
.login-box h1 {
  font-size: 24px;
  margin-bottom: 8px;
  color: #1a1a1a;
}
.login-box p {
  color: #666;
  margin-bottom: 24px;
  font-size: 14px;
}
.login-box input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
  outline: none;
  transition: border-color 0.2s;
}
.login-box input:focus { border-color: #4f46e5; }
.login-box button {
  width: 100%;
  padding: 12px;
  background: #4f46e5;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.login-box button:hover { background: #4338ca; }
.login-error {
  color: #dc2626;
  font-size: 13px;
  margin-top: 12px;
  display: none;
}

/* 布局 */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px;
  background: #1e1e2e;
  color: #cdd6f4;
  padding: 20px 0;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
}
.sidebar-logo {
  padding: 0 20px 20px;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  border-bottom: 1px solid #313244;
  margin-bottom: 12px;
}
.sidebar-nav a {
  display: block;
  padding: 12px 20px;
  color: #cdd6f4;
  text-decoration: none;
  font-size: 14px;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}
.sidebar-nav a:hover, .sidebar-nav a.active {
  background: #313244;
  color: #fff;
  border-left-color: #89b4fa;
}
.sidebar-logout {
  position: absolute;
  bottom: 20px;
  left: 20px;
  right: 20px;
}
.sidebar-logout button {
  width: 100%;
  padding: 10px;
  background: transparent;
  color: #f38ba8;
  border: 1px solid #f38ba8;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}
.sidebar-logout button:hover { background: #f38ba8; color: #1e1e2e; }

.main {
  margin-left: 220px;
  flex: 1;
  padding: 24px 32px;
}
.page-header {
  margin-bottom: 24px;
}
.page-header h1 {
  font-size: 24px;
  color: #1a1a1a;
  margin-bottom: 4px;
}
.page-header p { color: #666; font-size: 14px; }

/* 卡片 */
.card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  margin-bottom: 20px;
}
.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: #1a1a1a;
}

/* 统计卡片 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.stat-card .label {
  font-size: 13px;
  color: #666;
  margin-bottom: 8px;
}
.stat-card .value {
  font-size: 32px;
  font-weight: 700;
  color: #1a1a1a;
}
.stat-card .value.green { color: #16a34a; }
.stat-card .value.red { color: #dc2626; }
.stat-card .value.yellow { color: #ca8a04; }
.stat-card .value.blue { color: #2563eb; }

/* 表格 */
.table-wrapper { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
th, td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid #eee;
}
th {
  background: #f8f9fa;
  font-weight: 600;
  color: #555;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
tr:hover { background: #f8f9fa; }

/* 状态标签 */
.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.badge.active { background: #dcfce7; color: #16a34a; }
.badge.revoked { background: #fee2e2; color: #dc2626; }
.badge.expired { background: #f3f4f6; color: #6b7280; }
.badge.suspicious { background: #fef3c7; color: #ca8a04; }

/* 按钮 */
.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-primary { background: #4f46e5; color: #fff; }
.btn-primary:hover { background: #4338ca; }
.btn-danger { background: #fee2e2; color: #dc2626; }
.btn-danger:hover { background: #fecaca; }
.btn-sm { padding: 6px 12px; font-size: 12px; }

/* 表单 */
.form-row {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.form-group { flex: 1; min-width: 150px; }
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  margin-bottom: 6px;
}
.form-group input, .form-group select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
}
.form-group input:focus, .form-group select:focus { border-color: #4f46e5; }

/* 分页 */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}
.pagination button {
  padding: 8px 14px;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}
.pagination button:hover:not(:disabled) { background: #f5f5f5; }
.pagination button:disabled { opacity: 0.5; cursor: not-allowed; }
.pagination button.active { background: #4f46e5; color: #fff; border-color: #4f46e5; }

/* 提示 */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  z-index: 9999;
  animation: slideIn 0.3s ease;
}
.toast.success { background: #16a34a; }
.toast.error { background: #dc2626; }
@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* 加载 */
.loading {
  text-align: center;
  padding: 40px;
  color: #666;
}
.spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid #ddd;
  border-top-color: #4f46e5;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 响应式 */
@media (max-width: 768px) {
  .sidebar { width: 60px; }
  .sidebar-logo, .sidebar-nav a span { display: none; }
  .main { margin-left: 60px; padding: 16px; }
}
