* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  background-color: #f1f5f9;
  color: #1e293b;
}

[v-cloak] {
  display: none;
}

/* 登录页 */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top left, #1e293b 0%, #0f172a 55%, #020617 100%);
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 400px;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 14px;
  padding: 36px 32px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.35);
}

.login-header {
  text-align: center;
  margin-bottom: 24px;
}

.login-logo {
  font-size: 42px;
  line-height: 1;
  margin-bottom: 10px;
}

.login-header h1 {
  margin: 0;
  font-size: 21px;
  color: #0f172a;
}

.login-header p {
  margin: 6px 0 0;
  font-size: 12px;
  color: #64748b;
}

.login-btn {
  width: 100%;
  margin-top: 8px;
  font-weight: 600;
}

/* 主布局 */
.layout-container {
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  background-color: #0f172a;
  transition: width 0.2s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.brand {
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #f8fafc;
  font-size: 16px;
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  white-space: nowrap;
}

.brand-icon {
  font-size: 22px;
}

.side-menu {
  border-right: none;
  flex: 1;
  overflow-y: auto;
}

.main-wrapper {
  height: 100vh;
  overflow: hidden;
}

.top-header {
  height: 58px;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.page-title {
  font-size: 16px;
  font-weight: 600;
  color: #0f172a;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.engine-pill {
  display: flex;
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 4px 10px 4px 12px;
  font-size: 13px;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

.dot-running { background: #10b981; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2); }
.dot-paused { background: #f59e0b; }
.dot-stopped { background: #94a3b8; }
.dot-stopping { background: #ef4444; }

.user-dropdown {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: #334155;
  font-size: 14px;
}

.content-area {
  padding: 18px;
  overflow-y: auto;
  height: calc(100vh - 58px);
}

.page-section {
  max-width: 1480px;
  margin: 0 auto;
}

/* 仪表盘 */
.status-banner-card {
  margin-bottom: 16px;
  border-left: 4px solid #38bdf8;
}

.banner-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.banner-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.banner-stage {
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
}

.banner-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: #475569;
}

.banner-article {
  margin-top: 8px;
  font-size: 12px;
  color: #334155;
  word-break: break-all;
}

.banner-article a {
  color: #0284c7;
  margin-left: 6px;
}

.kpi-row {
  margin-bottom: 16px;
}

.kpi-card {
  border-radius: 10px;
}

.kpi-label {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 8px;
}

.kpi-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
}

.kpi-sub {
  font-size: 15px;
  color: #94a3b8;
  font-weight: 500;
}

.text-primary { color: #0284c7; }
.text-success { color: #10b981; }
.text-danger { color: #ef4444; }
.text-info { color: #6366f1; }

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}

.sys-metric {
  margin-bottom: 14px;
}

.sys-metric-head {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #475569;
  margin-bottom: 5px;
}

.sys-extra {
  font-size: 13px;
  color: #475569;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* 通用工具栏与表格 */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.sub-text {
  font-size: 12px;
  color: #64748b;
}

.note-text {
  font-size: 12px;
  color: #d97706;
}

.err-text {
  font-size: 12px;
  color: #dc2626;
}

.ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pagination-bar {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
}

/* 实时日志终端 */
.log-terminal {
  margin-top: 12px;
  height: calc(100vh - 220px);
  min-height: 420px;
  background: #0b1120;
  color: #e2e8f0;
  border-radius: 8px;
  padding: 12px 14px;
  overflow-y: auto;
  font-family: "JetBrains Mono", "Fira Code", Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.55;
}

.log-line {
  white-space: pre-wrap;
  word-break: break-all;
  padding: 1px 0;
}

.log-time { color: #64748b; margin-right: 8px; }
.log-lvl { font-weight: 700; margin-right: 8px; }
.log-mod { color: #38bdf8; margin-right: 8px; }

.lvl-DEBUG .log-lvl { color: #94a3b8; }
.lvl-INFO .log-lvl { color: #34d399; }
.lvl-WARNING .log-lvl { color: #fbbf24; }
.lvl-WARNING .log-msg { color: #fde68a; }
.lvl-ERROR .log-lvl { color: #f87171; }
.lvl-ERROR .log-msg { color: #fecaca; }

.log-empty {
  color: #64748b;
  text-align: center;
  padding-top: 60px;
}

/* 调试预览 */
.debug-result-box {
  margin-top: 14px;
}

.preview-text {
  max-height: 220px;
  overflow-y: auto;
  white-space: pre-wrap;
  font-size: 12.5px;
  line-height: 1.5;
}

/* 配置表单 */
.form-tip {
  margin-left: 10px;
  font-size: 12px;
  color: #64748b;
}

.keyword-box {
  width: 100%;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
}

.keyword-tags {
  max-height: 220px;
  overflow-y: auto;
}

/* 封面素材网格 */
.cover-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 14px;
}

.cover-item {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
  display: flex;
  flex-direction: column;
}

.cover-item img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  cursor: pointer;
  background: #f1f5f9;
}

.cover-meta {
  padding: 8px 10px;
  font-size: 12px;
}

.cover-ops {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
}

.compare-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
  text-align: center;
}

.compare-img {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #f8fafc;
}

.compare-placeholder {
  height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed #cbd5e1;
  border-radius: 6px;
  color: #94a3b8;
}
