/* ARA 运营后台 · 桌面屏内组件 */
:root {
  --ad-side: #2d323e;
  --ad-side-soft: #3a4050;
  --ad-side-text: rgba(255,255,255,.75);
  --ad-side-active: #1890ff;
  --ad-primary: #1890ff;
  --ad-primary-2: #096dd9;
  --ad-bg: #f0f2f5;
  --ad-card: #fff;
  --ad-border: #e8eaec;
  --ad-text: #515a6e;
  --ad-muted: #808695;
  --ad-ok: #19be6b;
  --ad-warn: #fa8c16;
  --ad-danger: #ed4014;
}

.desk .side {
  width: 200px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--ad-side) 0%, var(--ad-side-soft) 100%);
  color: var(--ad-side-text);
  display: flex;
  flex-direction: column;
  padding: 12px 0;
}
.desk .side .brand {
  padding: 4px 16px 16px;
  font-size: 18px;
  font-weight: 800;
  font-style: italic;
  letter-spacing: .04em;
  color: #fff;
}
.desk .side .brand small {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-style: normal;
  font-weight: 500;
  color: #8ea0b8;
  letter-spacing: 0;
}
.desk .side .g-title {
  padding: 10px 16px 4px;
  font-size: 11px;
  color: #7d8da3;
}
.desk .side a,
.desk .side .mi {
  display: block;
  padding: 8px 16px;
  color: inherit;
  text-decoration: none;
  font-size: 13px;
  border-left: 3px solid transparent;
}
.desk .side .mi.on,
.desk .side a.on {
  background: rgba(255, 96, 52, .16);
  color: #fff;
  border-left-color: var(--ad-side-active);
  font-weight: 600;
}

.desk .main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--ad-bg);
}
.desk .head {
  height: 48px;
  flex-shrink: 0;
  background: #fff;
  border-bottom: 1px solid var(--ad-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}
.desk .head .crumb {
  font-size: 13px;
  color: var(--ad-muted);
}
.desk .head .crumb b { color: var(--ad-text); font-weight: 600; }
.desk .head .tools {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ad-muted);
  font-size: 12px;
}
.desk .head .avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, #70b7ff, #2d8cf0);
}

.desk .body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 14px 16px;
}

.panel {
  background: var(--ad-card);
  border: 1px solid var(--ad-border);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 12px;
}
.panel:last-child { margin-bottom: 0; }
.panel-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.panel-hd h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--ad-text);
}
.panel-hd .sub {
  font-size: 12px;
  color: var(--ad-muted);
  font-weight: 400;
  margin-left: 8px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.filters label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--ad-muted);
}
.field, .select, .input {
  height: 30px;
  border: 1px solid var(--ad-border);
  border-radius: 4px;
  padding: 0 10px;
  font-size: 12px;
  background: #fff;
  color: var(--ad-text);
  min-width: 120px;
}
.field::placeholder,
.input::placeholder,
.textarea::placeholder {
  color: #c0c4cc;
  opacity: 1;
}
.field::-webkit-input-placeholder,
.input::-webkit-input-placeholder,
.textarea::-webkit-input-placeholder {
  color: #c0c4cc;
}
.field::-moz-placeholder,
.input::-moz-placeholder,
.textarea::-moz-placeholder {
  color: #c0c4cc;
  opacity: 1;
}
.textarea {
  width: 100%;
  min-height: 72px;
  border: 1px solid var(--ad-border);
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 12px;
  resize: none;
  font-family: inherit;
  color: var(--ad-text);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 12px;
  border-radius: 4px;
  border: 1px solid transparent;
  font-size: 12px;
  cursor: default;
  white-space: nowrap;
  background: #fff;
  color: var(--ad-text);
  border-color: var(--ad-border);
}
.btn.primary {
  background: var(--ad-primary);
  border-color: var(--ad-primary);
  color: #fff;
}
.btn.ghost {
  background: #e6f4ff;
  border-color: #91d5ff;
  color: var(--ad-primary);
}
.btn.danger {
  color: var(--ad-danger);
  border-color: #f3c2cb;
  background: #fff5f7;
}
.btn.link {
  border: none;
  background: transparent;
  color: var(--ad-primary);
  height: auto;
  padding: 0 4px;
}
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.table th,
.table td {
  padding: 9px 8px;
  border-bottom: 1px solid var(--ad-border);
  text-align: left;
  vertical-align: middle;
}
.table th {
  color: var(--ad-muted);
  font-weight: 600;
  background: #fafbfc;
}
.table .ops { white-space: nowrap; }
.table .ops .btn.link { margin-right: 4px; }

.tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 3px;
  font-size: 11px;
  background: #f3f5f8;
  color: var(--ad-muted);
}
.tag.orange { background: #fff1eb; color: #d34a1f; }
.tag.blue { background: #eaf2ff; color: #2f6fed; }
.tag.green { background: #e8f8ef; color: #18a058; }
.tag.purple { background: #f3eaff; color: #7c3aed; }
.tag.gray { background: #f0f2f5; color: #6b7280; }

.user-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}
.user-cell .av {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(145deg, #ffd0b8, #ff8a5c);
  flex-shrink: 0;
}
.user-cell .name { font-weight: 600; }
.user-cell .uid { color: var(--ad-muted); font-size: 11px; }

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
.stat {
  background: #fff;
  border: 1px solid var(--ad-border);
  border-radius: 8px;
  padding: 12px 14px;
}
.stat .k { font-size: 12px; color: var(--ad-muted); }
.stat .v { margin-top: 4px; font-size: 20px; font-weight: 700; color: var(--ad-text); }

.form-grid {
  display: grid;
  grid-template-columns: 100px 1fr;
  gap: 12px 10px;
  align-items: start;
  max-width: 520px;
}
.form-grid .lab {
  text-align: right;
  color: var(--ad-muted);
  font-size: 12px;
}
/* 标签只与字段首行控件（32px）居中对齐；多行字段的提示/附加输入在下方 */
.form-grid > .lab {
  box-sizing: border-box;
  height: 32px;
  min-height: 32px;
  max-height: 32px;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  line-height: 1.2;
}
.form-grid > .lab[hidden] { display: none !important; }
/* 仅单行 radio/checkbox/switch 行锁 32px；大卡片（.type-cards）等勿套用，否则会被裁切叠到下一行 */
.form-grid > :not(.lab):not(.type-cards):has(> label > input[type="radio"], > label > input[type="checkbox"], > .switch) {
  min-height: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
}
.form-grid .lab.req::before {
  content: "*";
  color: var(--ad-danger);
  margin-right: 3px;
}
.form-grid .full { grid-column: 1 / -1; }
.switch {
  width: 40px;
  height: 22px;
  border-radius: 11px;
  background: #d0d7e2;
  position: relative;
  display: inline-block;
}
.switch.on { background: var(--ad-primary); }
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: left .15s;
}
.switch.on::after { left: 20px; }

.pager {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  color: var(--ad-muted);
  font-size: 12px;
}
.pager .pg {
  min-width: 26px;
  height: 26px;
  border: 1px solid var(--ad-border);
  border-radius: 4px;
  display: grid;
  place-items: center;
  background: #fff;
}
.pager .pg.on {
  background: var(--ad-primary);
  border-color: var(--ad-primary);
  color: #fff;
}

.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}
.modal {
  width: 460px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 16px 40px rgba(0,0,0,.25);
  overflow: hidden;
}
.modal.wide { width: 640px; }
.modal-hd {
  height: 46px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--ad-border);
  font-weight: 700;
  font-size: 14px;
}
.modal-bd { padding: 16px; }
.modal-ft {
  padding: 12px 16px;
  border-top: 1px solid var(--ad-border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.muted { color: var(--ad-muted); }
.price { color: #1890ff; font-weight: 700; }
.level-bar {
  height: 6px;
  background: #eceff3;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 6px;
}
.level-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #70b7ff, #2d8cf0);
}
.config-block + .config-block {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--ad-border);
}
.config-block h4 {
  margin: 0 0 10px;
  font-size: 13px;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  height: 26px;
  padding: 0 10px;
  border-radius: 13px;
  border: 1px solid var(--ad-border);
  background: #fff;
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  color: var(--ad-text);
}
.chip.on {
  border-color: #91d5ff;
  background: #e6f4ff;
  color: #1890ff;
}
.toast {
  position: absolute;
  left: 50%;
  top: 64px;
  transform: translateX(-50%);
  background: rgba(15,23,42,.88);
  color: #fff;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 12px;
  z-index: 8;
}
