:root {
  --sidebar-bg: #304156;
  --sidebar-active: #263445;
  --primary: #409eff;
  --primary-hover: #66b1ff;
  --success: #67c23a;
  --warning: #e6a23c;
  --danger: #f56c6c;
  --info: #909399;
  --text: #303133;
  --muted: #606266;
  --border: #dcdfe6;
  --page-bg: #f0f2f5;
  --card-bg: #ffffff;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  color: var(--text);
  background: var(--page-bg);
}

.hidden {
  display: none !important;
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at top right, rgba(64, 158, 255, 0.25), transparent 35%),
    linear-gradient(135deg, #2b5876 0%, #4e4376 100%);
}

.login-box {
  width: 420px;
  padding: 36px 40px 30px;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
}

.login-title {
  text-align: center;
  margin-bottom: 28px;
}

.login-title h2 {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 600;
}

.login-title p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.form-item {
  margin-bottom: 18px;
}

input,
select,
textarea,
button {
  font: inherit;
}

input,
select,
textarea {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  outline: none;
  transition: border-color 0.2s;
}

textarea {
  height: auto;
  padding: 10px 12px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--primary);
}

.btn-primary,
.btn-default,
.btn-text,
.btn-link {
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-default {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-default:hover {
  color: var(--primary);
  border-color: #c6e2ff;
  background: #ecf5ff;
}

.btn-block {
  width: 100%;
  height: 40px;
}

.btn-text {
  background: transparent;
  color: var(--muted);
}

.btn-link {
  background: transparent;
  color: var(--primary);
  padding: 0 6px;
}

.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 210px;
  background: var(--sidebar-bg);
  color: #bfcbd9;
  flex-shrink: 0;
}

.logo {
  height: 50px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  background: #2b2f3a;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
}

.logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  background: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 10px;
  font-size: 14px;
}

.menu {
  padding: 8px 0;
}

.menu-item {
  display: block;
  padding: 14px 20px;
  color: #bfcbd9;
  text-decoration: none;
  font-size: 14px;
}

.menu-item:hover,
.menu-item.active {
  background: var(--sidebar-active);
  color: #409eff;
}

.main-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.navbar {
  height: 50px;
  background: #fff;
  border-bottom: 1px solid #e6e6e6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

.breadcrumb {
  color: var(--muted);
  font-size: 14px;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-name {
  color: var(--muted);
  font-size: 14px;
}

.app-main {
  padding: 20px;
}

.page-card {
  background: var(--card-bg);
  border-radius: 4px;
  padding: 20px;
  box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
}

.search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #ebeef5;
}

.search-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-item label {
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.search-item input,
.search-item select {
  width: 220px;
}

.search-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

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

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 12px 10px;
  border-bottom: 1px solid #ebeef5;
  text-align: left;
}

th {
  background: #fafafa;
  color: var(--muted);
  font-weight: 600;
}

tbody tr:hover {
  background: #f5f7fa;
}

.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 20px;
}

.tag-success {
  background: #f0f9eb;
  color: var(--success);
}

.tag-warning {
  background: #fdf6ec;
  color: var(--warning);
}

.tag-danger {
  background: #fef0f0;
  color: var(--danger);
}

.tag-info {
  background: #f4f4f5;
  color: var(--info);
}

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 20px;
}

.modal {
  width: 560px;
  max-width: 100%;
  max-height: calc(100vh - 40px);
  background: #fff;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal.modal-wide {
  width: 920px;
}

.modal-body {
  padding: 20px;
  overflow: auto;
}

.modal-header,
.modal-footer {
  padding: 16px 20px;
  border-bottom: 1px solid #ebeef5;
}

.modal-footer {
  border-bottom: 0;
  border-top: 1px solid #ebeef5;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
}

.modal-close {
  border: 0;
  background: transparent;
  font-size: 22px;
  cursor: pointer;
  color: var(--muted);
}

.dialog-form .form-row {
  margin-bottom: 18px;
}

.dialog-form label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 14px;
}

.empty-tip {
  text-align: center;
  color: var(--muted);
  padding: 40px 0;
}

.settings-form {
  max-width: 720px;
  padding-top: 8px;
}

.settings-form .form-row {
  margin-bottom: 18px;
}

.settings-form label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 14px;
}

.settings-form input[type="text"] {
  width: 100%;
}

.settings-form .switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.settings-meta {
  margin-top: 24px;
  padding: 16px;
  background: #f5f7fa;
  border-radius: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.form-hint {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.form-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.form-checks label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--text);
}

.form-section-title {
  margin: 8px 0 12px;
  padding-top: 8px;
  border-top: 1px solid #ebeef5;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.upload-guide {
  margin: 0 0 16px;
  padding: 14px 16px;
  background: #f5f7fa;
  border-radius: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.episode-manager__meta {
  margin-bottom: 16px;
  line-height: 1.6;
}

.batch-panel {
  margin-bottom: 16px;
  padding: 14px;
  background: #f8fafc;
  border: 1px solid #ebeef5;
  border-radius: 4px;
}

.batch-panel__title {
  margin-bottom: 12px;
  font-weight: 600;
}

.batch-panel__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.batch-panel__grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.batch-panel__grid input,
.batch-panel__grid select {
  width: 100%;
}

.batch-panel__full {
  grid-column: 1 / -1;
}

.episode-manager__toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.episode-manager__table {
  max-height: 360px;
  overflow: auto;
}

.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3000;
  background: #fff;
  color: var(--text);
  border: 1px solid #ebeef5;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
  padding: 12px 18px;
  border-radius: 4px;
}

@media (max-width: 960px) {
  .batch-panel__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
  }

  .menu {
    display: flex;
    overflow-x: auto;
  }

  .menu-item {
    white-space: nowrap;
  }

  .search-form {
    flex-direction: column;
    align-items: stretch;
  }

  .search-item {
    flex-direction: column;
    align-items: stretch;
  }

  .search-item input,
  .search-item select {
    width: 100%;
  }
}

.hot-pool-header h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.hot-pool-header p {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.hot-pool-switch {
  margin-bottom: 16px;
}

.hot-pool-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.hot-pool-count {
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
}

.hot-pool-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
  max-height: 520px;
  overflow: auto;
  padding: 4px;
  margin-bottom: 20px;
}

.hot-pool-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fafafa;
  cursor: pointer;
}

.hot-pool-item input {
  margin: 0;
}

.hot-pool-title {
  flex: 1;
  min-width: 120px;
  font-weight: 500;
}

.hot-pool-meta {
  width: 100%;
  padding-left: 24px;
  color: var(--muted);
  font-size: 12px;
}

.hot-pool-empty {
  grid-column: 1 / -1;
  padding: 32px 16px;
  text-align: center;
  color: var(--muted);
  background: #fafafa;
  border: 1px dashed var(--border);
  border-radius: 6px;
}

.hot-pool-footer {
  display: flex;
  justify-content: flex-end;
}
