/* ============================================================================
 * R91 · 自动化 工作流（对齐图4）· R94 奶油白
 * ----------------------------------------------------------------------------
 * 独立奶油白皮肤：与业务中台的红色点缀呼应，页面更接近参考图的“工具页”。
 * ========================================================================== */

.auto-page {
  max-width: 1040px;
  margin: 0 auto;
  padding: 6px 0 40px;
  color: #4a3a32;
}

/* 自动化页用奶油白顶栏/画布，贴近图4；离开页面时由 app.js 移除 gov-auto-mode。 */
html.gov-auto-mode body,
body.gov-auto-mode {
  background: #faf5ea;
  background-image: none;
  color: #4a3a32;
}
body.gov-auto-mode .main,
body.gov-auto-mode .content { background: transparent; }
body.gov-auto-mode .topbar {
  background: rgba(250, 245, 234, .94);
  border-bottom-color: #ecdfca;
}
body.gov-auto-mode .topbar h1 { color: #2b211c; }
body.gov-auto-mode .topbar .crumb { color: #8a7868; }
body.gov-auto-mode .topbar .clock { color: #a08d76; font-size: 11.5px; min-width: 118px; text-align: right; }
body.gov-auto-mode .status-pill {
  background: #fffdf8;
  color: #6b5a4c;
  border-color: #e6d9c2;
}
body.gov-auto-mode .status-pill i { background: #b07d1a; box-shadow: 0 0 0 3px rgba(176, 125, 26, .16); }
body.gov-auto-mode .btn-ghost { color: #8a7868; border-color: transparent; background: transparent; }
body.gov-auto-mode .btn-ghost:hover { color: #7c0a10; background: #f1e6d4; border-color: #e6d9c2; }
body.gov-auto-mode .btn-ghost.active { color: #7c0a10; background: #efe2cd; }

.auto-head { margin: 4px 0 22px; }
.auto-title {
  display: flex;
  align-items: baseline;
  gap: 12px;
  color: #2b211c;
  font-family: var(--sans);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -.02em;
}
.auto-title span { color: #8a7868; font-size: 23px; font-weight: 500; }
.auto-sub { margin-top: 4px; color: #8a7868; font-size: 13px; }

.auto-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.auto-tab {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 13px;
  border: 1px solid #e6d9c2;
  border-radius: 999px;
  background: #fffdf8;
  color: #4a3a32;
  font-size: 12.5px;
}
.auto-bar-right { display: flex; align-items: center; gap: 10px; }
.auto-round {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid #e6d9c2;
  border-radius: 50%;
  background: #fffdf8;
  color: #8a7868;
  cursor: pointer;
}
.auto-round:hover { background: #f6efe1; color: #7c0a10; }
.auto-round.spin .nav-ico { animation: auto-spin .8s linear infinite; }
@keyframes auto-spin { to { transform: rotate(360deg); } }

.auto-create {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #f8d77a 0%, #e0a82e 100%);
  color: #4a050b;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(224, 168, 46, .22);
}
.auto-create:hover { background: linear-gradient(135deg, #ffe39a 0%, #e8b84a 100%); }

.auto-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 26px;
  padding: 12px 14px;
  border: 1px solid #e9dcc6;
  border-radius: 10px;
  background: #fffdf8;
}
.auto-banner-ico { display: grid; place-items: center; flex: none; color: #b07d1a; }
.auto-banner-text { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 1px; }
.auto-banner-text b { color: #4a3a32; font-size: 12.5px; font-weight: 500; }
.auto-banner-text span { color: #8a7868; font-size: 11.5px; }
.auto-switch {
  width: 36px;
  height: 20px;
  flex: none;
  padding: 2px;
  border: 0;
  border-radius: 999px;
  background: #e2d5bf;
  cursor: pointer;
  transition: background .15s;
}
.auto-switch i {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fffdf8;
  box-shadow: 0 1px 2px rgba(74, 48, 20, .18);
  transition: transform .15s, background .15s;
}
.auto-switch.on { background: #c8102e; }
.auto-switch.on i { background: #fffdf8; transform: translateX(16px); }

.auto-section { margin-top: 26px; }
.auto-sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.auto-sec-head h3 { color: #8a6210; font-size: 13.5px; font-weight: 500; }
.auto-sec-head span { color: #a08d76; font-size: 11.5px; }

.auto-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

.auto-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 15px;
  border: 1px solid #e9dcc6;
  border-radius: 10px;
  background: #fffdf8;
}
.auto-card:hover { border-color: rgba(176, 125, 26, .45); box-shadow: 0 10px 24px rgba(90, 60, 25, .07); }
.auto-card-head { display: flex; align-items: center; gap: 10px; }
.auto-card-head h3 {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: #2b211c;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.auto-state { display: inline-flex; align-items: center; gap: 5px; flex: none; color: #8a7868; font-size: 10.5px; }
.auto-state i { width: 6px; height: 6px; border-radius: 50%; background: #1f7a4d; }
.auto-state.warn i { background: #b07d1a; }
.auto-state.bad i { background: #b23b32; }
.auto-state.off i { background: #b3a18a; }
.auto-card-desc {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  min-height: 40px;
  margin: 0;
  overflow: hidden;
  color: #8a7868;
  font-size: 12px;
  line-height: 1.7;
}
.auto-card-meta { display: flex; align-items: center; gap: 10px; color: #a08d76; font-size: 11px; }
.auto-meta-main {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.auto-dot { width: 6px; height: 6px; flex: none; border-radius: 50%; background: #1f7a4d; }
.auto-dot.warn { background: #b07d1a; }
.auto-dot.bad { background: #b23b32; }
.auto-dot.off { background: #b3a18a; }
.auto-count { flex: none; margin-left: auto; }
.auto-card-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 7px;
  border-top: 1px solid #f0e6d4;
}
.auto-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: none;
  color: #7c6a56;
  font-size: 11.5px;
  font-family: inherit;
  cursor: pointer;
}
.auto-link:hover { color: #7c0a10; }
.auto-link.danger { margin-left: auto; color: #b06a63; }
.auto-link.danger:hover { color: #a02a22; }
.auto-link:disabled { opacity: .5; cursor: default; }

.auto-empty {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 22px 18px;
  border: 1px dashed #ddceb4;
  border-radius: 10px;
  color: #8a7868;
  font-size: 12px;
}
.auto-empty b { color: #4a3a32; font-size: 13px; font-weight: 500; }
.auto-empty.small { padding: 14px; }

.auto-tpl {
  display: flex;
  gap: 11px;
  padding: 14px;
  border: 1px solid #e9dcc6;
  border-radius: 10px;
  background: #fffdf8;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.auto-tpl:hover { border-color: rgba(176, 125, 26, .45); background: #fdf7ea; }
.auto-tpl:focus-visible { outline: 2px solid #b07d1a; outline-offset: 2px; }
.auto-tpl-ico {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 7px;
  background: #f6efe1;
  color: #b07d1a;
}
.auto-tpl-body { flex: 1; min-width: 0; }
.auto-tpl-body b { display: block; margin-bottom: 3px; color: #2b211c; font-size: 13px; font-weight: 600; }
.auto-tpl-body p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  margin: 0;
  overflow: hidden;
  color: #8a7868;
  font-size: 11.5px;
  line-height: 1.65;
}
.auto-tpl-sch { display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; color: #a08d76; font-size: 10.5px; }
.auto-tpl-go { align-self: center; flex: none; color: #a08d76; font-size: 11px; }
.auto-tpl:hover .auto-tpl-go { color: #7c0a10; }

/* 弹窗内表单 */
.auto-form .field { margin-bottom: 14px; }
.auto-form-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.auto-form-hint {
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.7;
}

/* 运行记录 */
.auto-detail-meta { display: flex; gap: 14px; margin-bottom: 8px; color: var(--muted); font-size: 12px; }
.auto-detail-instruction {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.7;
}
.auto-run-list { display: flex; flex-direction: column; gap: 6px; }
.auto-run-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
}
.auto-run-state {
  flex: none;
  padding: 1px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
}
.auto-run-state.ok { color: var(--ok); border-color: rgba(31, 122, 77, .35); }
.auto-run-state.warn { color: var(--warn); border-color: rgba(176, 125, 26, .35); }
.auto-run-state.bad { color: var(--danger); border-color: rgba(178, 59, 50, .35); }
.auto-run-msg {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--ink-2);
  white-space: nowrap;
  text-overflow: ellipsis;
}
.auto-run-at { flex: none; color: var(--muted); font-size: 11px; }

@media (max-width: 1000px) {
  .auto-grid { grid-template-columns: 1fr; }
  .auto-form-row { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .auto-title { font-size: 25px; }
  .auto-title span { font-size: 19px; }
  .auto-bar { flex-wrap: wrap; }
  .auto-form-row { grid-template-columns: 1fr; }
  .auto-card-actions { flex-wrap: wrap; }
}
