/*
 * 中文注释：Advanced Charts v31 警报面板样式；按官方警报编辑器层级组织，并适配窄屏。
 */

.lhjy-alert-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10120;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.45);
  color: #d1d4dc;
  font:
    14px/1.4 Arial,
    sans-serif;
}

.lhjy-alert-backdrop.is-open {
  display: flex;
}

.lhjy-alert-dialog {
  width: min(480px, 100%);
  max-height: min(720px, calc(100vh - 32px));
  overflow: hidden;
  border: 1px solid #363a45;
  border-radius: 6px;
  background: #1f1f1f;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.lhjy-alert-head,
.lhjy-alert-head-actions,
.lhjy-alert-summary-row,
.lhjy-alert-notification-options,
.lhjy-alert-form-footer,
.lhjy-alert-row {
  display: flex;
  align-items: center;
}

.lhjy-alert-head {
  min-height: 68px;
  padding: 0 18px 0 20px;
  border-bottom: 1px solid #3a3a3a;
}

.lhjy-alert-head h2 {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: #f0f3fa;
  font-size: 19px;
  font-weight: 600;
}

.lhjy-alert-title-main {
  flex: 0 0 auto;
}

.lhjy-alert-symbol {
  overflow: hidden;
  color: #e6e6e6;
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lhjy-alert-symbol::before {
  display: inline-grid;
  width: 18px;
  height: 18px;
  margin-right: 6px;
  place-items: center;
  border-radius: 50%;
  background: #f0b90b;
  color: #212121;
  content: "⌁";
  font-size: 12px;
}

.lhjy-alert-head-actions {
  flex: 0 0 auto;
  gap: 5px;
  margin-left: auto;
}

.lhjy-alert-header-icon,
.lhjy-alert-close {
  display: inline-grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #b2b5be;
  cursor: pointer;
}

/* 中文注释：标题栏按创建/列表模式切换操作，显式覆盖图标按钮的 grid display。 */
.lhjy-alert-header-icon[hidden] {
  display: none;
}

.lhjy-alert-header-icon:hover,
.lhjy-alert-close:hover {
  background: #2b2b2b;
  color: #fff;
}

.lhjy-alert-header-icon.is-new {
  font-size: 21px;
}
.lhjy-alert-close {
  font-size: 25px;
  font-weight: 300;
}

.lhjy-alert-grid-icon {
  display: grid;
  grid-template-columns: repeat(2, 5px);
  gap: 3px;
}

.lhjy-alert-grid-icon i {
  width: 5px;
  height: 5px;
  border: 1px solid currentColor;
}

.lhjy-alert-body {
  max-height: calc(100vh - 102px);
  overflow: auto;
}

.lhjy-alert-form-content {
  padding: 16px 24px 10px 20px;
}

.lhjy-alert-editor-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
}

.lhjy-alert-editor-row.is-condition {
  align-items: start;
}
.lhjy-alert-editor-label {
  padding-top: 9px;
  color: #9b9da5;
}

.lhjy-alert-condition-stack {
  display: grid;
  min-width: 0;
  gap: 8px;
}

.lhjy-alert-condition-stack select,
.lhjy-alert-value-row select,
.lhjy-alert-value-row input,
.lhjy-alert-editor-row.is-message input {
  box-sizing: border-box;
  width: 100%;
  height: 36px;
  min-width: 0;
  padding: 0 10px;
  border: 1px solid #4a4a4a;
  border-radius: 6px;
  outline: 0;
  background: #202020;
  color: #f0f3fa;
  font: inherit;
}

.lhjy-alert-condition-stack select:focus,
.lhjy-alert-value-row input:focus,
.lhjy-alert-editor-row.is-message input:focus {
  border-color: #2962ff;
}

.lhjy-alert-condition-stack select:disabled,
.lhjy-alert-value-row select:disabled {
  color: #d6d6d6;
  opacity: 1;
}

.lhjy-alert-value-row {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) minmax(130px, 1fr);
  gap: 8px;
}

.lhjy-alert-divider {
  height: 1px;
  margin: 16px 0 11px 130px;
  background: #333;
}

.lhjy-alert-summary-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  min-height: 31px;
  gap: 18px;
}

.lhjy-alert-summary-row span {
  color: #9b9da5;
}

.lhjy-alert-summary-row strong {
  color: #e3e3e3;
  font-weight: 500;
}

.lhjy-alert-editor-row.is-message {
  min-height: 44px;
}
.lhjy-alert-editor-row.is-message .lhjy-alert-editor-label {
  padding-top: 0;
}
.lhjy-alert-editor-row.is-message input {
  height: 34px;
  border-color: transparent;
  padding-left: 0;
}
.lhjy-alert-editor-row.is-message input:hover {
  border-color: #4a4a4a;
  padding-left: 10px;
}

.lhjy-alert-editor-row.is-notification {
  min-height: 40px;
  align-items: start;
}

.lhjy-alert-editor-row.is-notification .lhjy-alert-editor-label {
  padding-top: 8px;
}

.lhjy-alert-notification-options {
  min-height: 40px;
  flex-wrap: wrap;
  gap: 18px;
}

.lhjy-alert-notification-fixed,
.lhjy-alert-notification-options label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #e3e3e3;
}

.lhjy-alert-notification-fixed > span {
  display: inline-grid;
  width: 16px;
  height: 16px;
  place-items: center;
  border-radius: 3px;
  background: #2962ff;
  color: #fff;
  font-size: 11px;
}

.lhjy-alert-notification-options label {
  cursor: pointer;
}
.lhjy-alert-notification-options input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #2962ff;
}

/* 中文注释：System3 信号分组开关与价格警报共用弹窗，但作为独立偏好区展示。 */
.lhjy-alert-system3-groups {
  margin: 10px 0 4px 130px;
  padding-top: 12px;
  border-top: 1px solid #333;
}

.lhjy-alert-system3-title {
  margin-bottom: 9px;
  color: #9b9da5;
  font-size: 12px;
}

.lhjy-alert-system3-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.lhjy-alert-system3-options label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #e3e3e3;
  cursor: pointer;
}

.lhjy-alert-system3-options input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #2962ff;
}
.lhjy-alert-error {
  min-height: 18px;
  margin: 4px 0 0 130px;
  color: #f23645;
  font-size: 12px;
}

.lhjy-alert-form-footer {
  min-height: 66px;
  justify-content: flex-end;
  gap: 12px;
  padding: 0 20px;
  border-top: 1px solid #3a3a3a;
}

.lhjy-alert-button {
  min-width: 86px;
  min-height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  background: #f0f3fa;
  color: #131722;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

.lhjy-alert-button.is-secondary {
  min-width: auto;
  border: 1px solid #555;
  background: transparent;
  color: #e0e0e0;
}

.lhjy-alert-button:hover {
  background: #d9dce5;
}
.lhjy-alert-button.is-secondary:hover {
  background: #2b2b2b;
}
.lhjy-alert-button:disabled {
  cursor: default;
  opacity: 0.55;
}

.lhjy-alert-list {
  min-height: 160px;
}
.lhjy-alert-empty {
  padding: 42px 18px;
  color: #787b86;
  text-align: center;
}

.lhjy-alert-row {
  min-height: 58px;
  gap: 10px;
  padding: 8px 14px 8px 18px;
  border-bottom: 1px solid #333;
}

.lhjy-alert-row-main {
  min-width: 0;
  flex: 1;
}

.lhjy-alert-row-title {
  overflow: hidden;
  color: #f0f3fa;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lhjy-alert-row-meta {
  margin-top: 3px;
  color: #787b86;
  font-size: 12px;
}

.lhjy-alert-status {
  flex: 0 0 auto;
  padding: 2px 6px;
  border-radius: 3px;
  background: #2a2e39;
  color: #b2b5be;
  font-size: 11px;
}

.lhjy-alert-status.is-active {
  background: rgba(8, 153, 129, 0.18);
  color: #22ab94;
}
.lhjy-alert-status.is-triggered {
  background: rgba(242, 54, 69, 0.18);
  color: #f23645;
}
.lhjy-alert-row-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 2px;
}

.lhjy-alert-icon-button {
  min-width: 32px;
  height: 32px;
  padding: 0 7px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #b2b5be;
  cursor: pointer;
  font-size: 12px;
}

.lhjy-alert-icon-button:hover {
  background: #2a2e39;
  color: #fff;
}

@media (max-width: 560px) {
  .lhjy-alert-backdrop {
    align-items: flex-end;
    padding: 0;
  }
  .lhjy-alert-dialog {
    width: 100%;
    max-height: 92vh;
    border-radius: 6px 6px 0 0;
  }
  .lhjy-alert-head {
    min-height: 58px;
    padding: 0 10px 0 16px;
  }
  .lhjy-alert-head h2 {
    gap: 7px;
    font-size: 17px;
  }
  .lhjy-alert-form-content {
    padding: 14px 16px 8px;
  }
  .lhjy-alert-editor-row {
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 10px;
  }
  .lhjy-alert-divider {
    margin-left: 94px;
  }
  .lhjy-alert-summary-row {
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 10px;
  }
  .lhjy-alert-system3-groups {
    margin-left: 94px;
  }
  .lhjy-alert-error {
    margin-left: 94px;
  }
  .lhjy-alert-value-row {
    grid-template-columns: minmax(72px, 0.75fr) minmax(104px, 1.25fr);
  }
  .lhjy-alert-form-footer {
    min-height: 62px;
    padding: 0 16px;
  }
  .lhjy-alert-row {
    align-items: flex-start;
    flex-wrap: wrap;
  }
  .lhjy-alert-row-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

@media (max-width: 360px) {
  .lhjy-alert-symbol::before {
    display: none;
  }
  .lhjy-alert-editor-row {
    grid-template-columns: 72px minmax(0, 1fr);
  }
  .lhjy-alert-divider {
    margin-left: 82px;
  }
  .lhjy-alert-summary-row {
    grid-template-columns: 72px minmax(0, 1fr);
  }
  .lhjy-alert-system3-groups {
    margin-left: 82px;
  }
  .lhjy-alert-error {
    margin-left: 82px;
  }
}
