﻿* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #f4f6f8;
  color: #111827;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

.page {
  width: min(100%, 820px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 12px 12px 28px;
}

.app-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 8px 0;
  background: rgba(244, 246, 248, 0.94);
  backdrop-filter: blur(10px);
}

.account-workbench {
  margin-top: 12px;
  padding: 16px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.account-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.account-title {
  font-size: 20px;
  font-weight: 900;
}

.account-subtitle {
  margin-top: 4px;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.5;
}

.account-card {
  padding: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f9fafb;
}

.account-form {
  display: grid;
  gap: 10px;
}

.account-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.profile-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.profile-name {
  font-size: 20px;
  font-weight: 900;
}

.profile-phone {
  margin-top: 4px;
  color: #6b7280;
  font-size: 13px;
}

.profile-member {
  min-width: 64px;
  padding: 6px 10px;
  border-radius: 8px;
  background: #111827;
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.profile-meta {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  color: #6b7280;
  font-size: 12px;
}

.tab-button {
  height: 42px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #ffffff;
  color: #374151;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
}

.tab-button.active {
  border-color: #111827;
  background: #111827;
  color: #ffffff;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.search-panel,
.section {
  margin-top: 12px;
  padding: 14px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.search-row,
.hero-top,
.price-row,
.trend-row,
.section-head,
.ma-main,
.ma-meta,
.table-row,
.legend,
.result-item {
  display: flex;
  align-items: center;
}

.search-row {
  gap: 8px;
}

.stealth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.stealth-title {
  font-size: 17px;
  font-weight: 900;
}

.stealth-subtitle {
  margin-top: 3px;
  color: #6b7280;
  font-size: 12px;
}

.stealth-toggle {
  flex-shrink: 0;
  min-width: 88px;
  height: 34px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #ffffff;
  color: #374151;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.stealth-toggle.active {
  border-color: #6b7280;
  background: #6b7280;
  color: #ffffff;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.search-input {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 38px 0 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  outline: none;
  background: #f9fafb;
  color: #111827;
  font-size: 15px;
}

.search-input:focus {
  border-color: #111827;
  background: #ffffff;
}

.clear-search {
  position: absolute;
  top: 50%;
  right: 8px;
  width: 24px;
  height: 24px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 50%;
  background: #e5e7eb;
  color: #4b5563;
  font-size: 18px;
  font-weight: 800;
  line-height: 22px;
  cursor: pointer;
}

.clear-search:hover {
  background: #d1d5db;
  color: #111827;
}

.search-button {
  flex-shrink: 0;
  width: 72px;
  height: 42px;
  border: 0;
  border-radius: 8px;
  background: #111827;
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
}

.search-button:disabled {
  background: #9ca3af;
}

.history-item {
  padding: 5px 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #ffffff;
  color: #374151;
  font-size: 13px;
  cursor: pointer;
}

.history-block {
  margin-top: 10px;
}

.history-title {
  margin-bottom: 7px;
  color: #6b7280;
  font-size: 12px;
}

.history-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.history-item {
  background: #f9fafb;
}

.result-list {
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.result-item {
  justify-content: space-between;
  min-height: 48px;
  padding: 0 10px;
  border-top: 1px solid #eef2f7;
  cursor: pointer;
}

.result-item:first-child {
  border-top: 0;
}

.result-item:hover {
  background: #f9fafb;
}

.result-main {
  min-width: 0;
}

.result-name {
  overflow: hidden;
  font-size: 15px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-code {
  margin-top: 2px;
  color: #6b7280;
  font-size: 12px;
}

.result-price {
  flex-shrink: 0;
  min-width: 72px;
  text-align: right;
  font-size: 13px;
  font-weight: 800;
}

.search-error {
  margin-top: 10px;
  color: #b45309;
  font-size: 13px;
  line-height: 1.45;
}

.support-note {
  margin-top: 8px;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.45;
}

.hidden {
  display: none;
}

.hero {
  margin-top: 12px;
  padding: 18px;
  border-radius: 8px;
  color: #ffffff;
  background: #1f2937;
  box-shadow: 0 8px 24px rgba(31, 41, 55, 0.18);
}

.hero.bearish {
  background: linear-gradient(135deg, #334155 0%, #7f1d1d 100%);
}

.hero.watch {
  background: linear-gradient(135deg, #374151 0%, #92400e 100%);
}

.hero.bullish {
  background: linear-gradient(135deg, #164e63 0%, #166534 100%);
}

.hero-top,
.price-row,
.trend-row,
.section-head,
.ma-main,
.ma-meta {
  justify-content: space-between;
}

.market-line,
.source,
.time,
.section-subtitle,
.metric-label,
.risk {
  color: #6b7280;
  font-size: 13px;
}

.hero .market-line,
.hero .source,
.hero .time {
  color: rgba(255, 255, 255, 0.74);
}

.stock-name {
  margin-top: 4px;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
}

.source {
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
}

.price-row {
  margin-top: 20px;
  gap: 12px;
}

.price-block {
  min-width: 0;
}

.currency {
  margin-right: 5px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.price {
  font-size: clamp(34px, 11vw, 48px);
  font-weight: 900;
  line-height: 1;
}

.change-pill {
  flex-shrink: 0;
  padding: 7px 10px;
  border-radius: 8px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.15;
  text-shadow: none;
  -webkit-font-smoothing: antialiased;
}

.change-pill.rise {
  background: #991b1b;
}

.change-pill.fall {
  background: #064e3b;
}

.trend-row {
  margin-top: 16px;
}

.trend-badge {
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 14px;
  font-weight: 800;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 8px;
  background: #e5e7eb;
}

.metric {
  min-width: 0;
  padding: 12px 10px;
  background: #ffffff;
}

.metric-label,
.metric-value {
  display: block;
}

.metric-value {
  margin-top: 4px;
  font-size: 16px;
  font-weight: 800;
}

.rise,
.up {
  color: #dc2626;
}

.fall,
.down {
  color: #059669;
}

.section-title {
  font-size: 17px;
  font-weight: 900;
}

.section-subtitle {
  margin-top: 3px;
}

.signal-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.signal-dot.bearish {
  background: #059669;
  box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.12);
}

.signal-dot.watch {
  background: #d97706;
  box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.12);
}

.signal-dot.bullish {
  background: #dc2626;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.12);
}

.ma-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.ma-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-left-width: 4px;
  border-radius: 8px;
  background: #ffffff;
}

.ma-card.pressure {
  border-left-color: #059669;
}

.ma-card.support {
  border-left-color: #dc2626;
}

.ma-name,
.ma-value {
  font-size: 15px;
  font-weight: 900;
}

.ma-meta {
  margin-top: 7px;
}

.distance {
  font-size: 16px;
  font-weight: 900;
}

.state {
  padding: 3px 6px;
  border-radius: 6px;
  background: #f3f4f6;
  color: #374151;
  font-size: 12px;
}

.ma-signal {
  margin-top: 8px;
  color: #4b5563;
  font-size: 13px;
  line-height: 1.45;
}

.chart-wrap {
  position: relative;
  margin-top: 12px;
}

.trend-chart {
  width: 100%;
  height: 250px;
  border: 1px solid #edf0f3;
  border-radius: 8px;
  background: #ffffff;
  touch-action: none;
  cursor: crosshair;
}

.chart-tooltip {
  position: absolute;
  top: 10px;
  z-index: 2;
  width: min(220px, calc(100% - 20px));
  padding: 9px 10px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
  color: #111827;
  font-size: 12px;
  line-height: 1.45;
  pointer-events: none;
}

.chart-tooltip.right {
  transform: translateX(10px);
}

.chart-tooltip.left {
  transform: translateX(calc(-100% - 10px));
}

.stealth-chart-note {
  display: none;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f9fafb;
  color: #4b5563;
  font-size: 13px;
  line-height: 1.55;
}

.tooltip-date {
  margin-bottom: 5px;
  font-size: 13px;
  font-weight: 900;
}

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

.tooltip-volume {
  margin: 5px 0;
  color: #4b5563;
}

.legend {
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 10px;
  color: #4b5563;
  font-size: 13px;
}

.legend-item {
  display: flex;
  align-items: center;
}

.legend-line {
  width: 16px;
  height: 3px;
  margin-right: 5px;
  border-radius: 4px;
  background: #111827;
}

.legend-item.ma5 .legend-line {
  background: #f59e0b;
}

.legend-item.ma10 .legend-line {
  background: #2563eb;
}

.legend-item.ma20 .legend-line {
  background: #16a34a;
}

.legend-item.ma60 .legend-line {
  background: #7c3aed;
}

.summary {
  margin-top: 12px;
  color: #374151;
  font-size: 15px;
  line-height: 1.65;
}

.alert-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.alert-field {
  display: grid;
  gap: 6px;
  color: #4b5563;
  font-size: 12px;
  font-weight: 700;
}

.alert-field .tp-input {
  width: 100%;
  padding-right: 34px;
}

.alert-input-with-suffix {
  position: relative;
  display: block;
}

.alert-input-with-suffix > span {
  position: absolute;
  top: 50%;
  right: 13px;
  transform: translateY(-50%);
  color: #6b7280;
  font-size: 14px;
  pointer-events: none;
}

.alert-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.alert-rule-note {
  margin-top: 10px;
  color: #6b7280;
  font-size: 12px;
  line-height: 1.55;
}

.alert-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.alert-item {
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f9fafb;
}

.alert-item-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
  font-weight: 900;
}

.alert-item-title-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.alert-delete-button {
  border: 0;
  padding: 2px 0;
  background: transparent;
  color: #b91c1c;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.alert-delete-button:disabled {
  color: #9ca3af;
  cursor: wait;
}

.alert-item-meta {
  margin-top: 5px;
  color: #6b7280;
  font-size: 12px;
  line-height: 1.55;
}

.table {
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.table-row {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1.1fr 1.35fr;
  min-height: 40px;
  padding: 0 10px;
  border-top: 1px solid #eef2f7;
  font-size: 13px;
}

.table-row:first-child {
  border-top: 0;
}

.table-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-head {
  min-height: 36px;
  background: #f9fafb;
  color: #6b7280;
  font-weight: 800;
}

.risk {
  padding: 10px 0 0;
  line-height: 1.5;
  text-align: center;
}

.stealth-mode #maTabPanel,
.stealth-mode #maTabPanel .hero,
.stealth-mode #maTabPanel .section,
.stealth-mode #maTabPanel .search-panel,
.stealth-mode #maTabPanel .metric,
.stealth-mode #maTabPanel .ma-card,
.stealth-mode #maTabPanel .table,
.stealth-mode #maTabPanel .table-head,
.stealth-mode #maTabPanel .result-list,
.stealth-mode #maTabPanel .result-item {
  background: #f9fafb;
  color: #374151;
  box-shadow: none;
}

.stealth-mode #maTabPanel .hero {
  border: 1px solid #e5e7eb;
  display: grid;
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.stealth-mode #maTabPanel .hero .market-line,
.stealth-mode #maTabPanel .hero .source,
.stealth-mode #maTabPanel .hero .time,
.stealth-mode #maTabPanel .currency,
.stealth-mode #maTabPanel .section-subtitle,
.stealth-mode #maTabPanel .metric-label,
.stealth-mode #maTabPanel .support-note,
.stealth-mode #maTabPanel .risk,
.stealth-mode #maTabPanel .ma-signal,
.stealth-mode #maTabPanel .summary,
.stealth-mode #maTabPanel .legend,
.stealth-mode #maTabPanel .result-code {
  color: #6b7280;
}

.stealth-mode #maTabPanel .hero-top,
.stealth-mode #maTabPanel .price-row,
.stealth-mode #maTabPanel .trend-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 34px;
  margin: 0;
  padding: 8px 10px;
  border-top: 1px solid #e5e7eb;
}

.stealth-mode #maTabPanel .hero-top {
  border-top: 0;
}

.stealth-mode #maTabPanel .hero-top::before {
  content: "标的";
}

.stealth-mode #maTabPanel .price-row::before {
  content: "价格";
}

.stealth-mode #maTabPanel .trend-row::before {
  content: "状态";
}

.stealth-mode #maTabPanel .hero-top::before,
.stealth-mode #maTabPanel .price-row::before,
.stealth-mode #maTabPanel .trend-row::before {
  color: #9ca3af;
  font-size: 12px;
  font-weight: 700;
}

.stealth-mode #maTabPanel .stock-name,
.stealth-mode #maTabPanel .price,
.stealth-mode #maTabPanel .change-pill,
.stealth-mode #maTabPanel .trend-badge {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.stealth-mode #maTabPanel .stock-name {
  margin-top: 2px;
}

.stealth-mode #maTabPanel .market-line,
.stealth-mode #maTabPanel .source,
.stealth-mode #maTabPanel .currency,
.stealth-mode #maTabPanel .time {
  font-size: 12px;
}

.stealth-mode #maTabPanel .price-block {
  display: flex;
  align-items: baseline;
  min-width: 0;
}

.stealth-mode #maTabPanel .change-pill,
.stealth-mode #maTabPanel .trend-badge,
.stealth-mode #maTabPanel .source {
  padding: 0;
  border: 0;
  background: transparent;
  text-align: right;
}

.stealth-mode #maTabPanel .hero.bearish,
.stealth-mode #maTabPanel .hero.watch,
.stealth-mode #maTabPanel .hero.bullish,
.stealth-mode #maTabPanel .change-pill,
.stealth-mode #maTabPanel .trend-badge,
.stealth-mode #maTabPanel .search-button {
  background: #e5e7eb;
  color: #374151;
}

.stealth-mode #maTabPanel .change-pill,
.stealth-mode #maTabPanel .trend-badge,
.stealth-mode #maTabPanel .source {
  border-color: #d1d5db;
}

.stealth-mode #maTabPanel .change-pill,
.stealth-mode #maTabPanel .trend-badge,
.stealth-mode #maTabPanel .source {
  border: 0;
  background: transparent;
}

.stealth-mode #maTabPanel .rise,
.stealth-mode #maTabPanel .fall,
.stealth-mode #maTabPanel .up,
.stealth-mode #maTabPanel .down,
.stealth-mode #maTabPanel .distance {
  color: #4b5563;
}

.stealth-mode #maTabPanel .signal-dot,
.stealth-mode #maTabPanel .signal-dot.bearish,
.stealth-mode #maTabPanel .signal-dot.watch,
.stealth-mode #maTabPanel .signal-dot.bullish {
  background: #9ca3af;
  box-shadow: 0 0 0 4px rgba(156, 163, 175, 0.14);
}

.stealth-mode #maTabPanel .ma-card,
.stealth-mode #maTabPanel .ma-card.support,
.stealth-mode #maTabPanel .ma-card.pressure {
  border-left-color: #d1d5db !important;
}

.stealth-mode #maTabPanel .chart-wrap,
.stealth-mode #maTabPanel .legend {
  display: none;
}

.stealth-mode #maTabPanel .stealth-chart-note {
  display: block;
}

.stealth-mode #maTabPanel .alert-section {
  display: none;
}

.trend-workbench,
.ai-workbench {
  margin-top: 12px;
  padding: 16px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.trend-head,
.ai-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.trend-title,
.ai-title {
  font-size: 22px;
  font-weight: 900;
}

.trend-subtitle,
.ai-subtitle {
  margin-top: 4px;
  color: #6b7280;
  font-size: 13px;
  line-height: 1.5;
}

.trend-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.tp-input,
.tp-textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #f9fafb;
  color: #111827;
  font-size: 14px;
  outline: none;
}

.tp-input {
  height: 42px;
  padding: 0 10px;
}

.tp-textarea {
  grid-column: 1 / -1;
  min-height: 96px;
  padding: 10px;
  line-height: 1.55;
  resize: vertical;
}

.tp-input:focus,
.tp-textarea:focus {
  border-color: #111827;
  background: #ffffff;
}

.trend-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.tp-primary,
.tp-secondary {
  height: 40px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
}

.tp-primary {
  border: 0;
  background: #111827;
  color: #ffffff;
}

.tp-secondary {
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #374151;
}

.tp-message {
  min-height: 18px;
  margin-top: 8px;
  color: #b45309;
  font-size: 13px;
}

.tp-result,
.tp-structure-result,
.trend-knowledge {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fafafa;
}

.tp-decision {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tp-label,
.tp-block-title {
  color: #6b7280;
  font-size: 13px;
  font-weight: 800;
}

.tp-decision-text {
  margin-top: 4px;
  font-size: 20px;
  font-weight: 900;
}

.tp-rr-badge {
  min-width: 76px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #111827;
  color: #ffffff;
  text-align: center;
  font-size: 16px;
  font-weight: 900;
}

.tp-levels {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.tp-level {
  min-width: 0;
  padding: 10px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
}

.tp-level-name {
  color: #6b7280;
  font-size: 12px;
}

.tp-level-value {
  margin-top: 4px;
  font-size: 18px;
  font-weight: 900;
}

.tp-rule-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.tp-list {
  margin: 8px 0 0;
  padding-left: 18px;
  color: #374151;
  font-size: 14px;
  line-height: 1.65;
}

.tp-structure-summary {
  margin-top: 12px;
  color: #374151;
  font-size: 14px;
  line-height: 1.65;
}

.method-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.method-open-button {
  width: 100%;
  height: 42px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
}

.ai-mode,
.ai-actions {
  display: flex;
  flex-shrink: 0;
  gap: 6px;
}

.ai-actions {
  flex-wrap: wrap;
  margin-top: 12px;
}

.ai-mode-button {
  height: 34px;
  padding: 0 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #ffffff;
  color: #374151;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.ai-mode-button.active {
  border-color: #111827;
  background: #111827;
  color: #ffffff;
}

.ai-result {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #fafafa;
}

.ai-factor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.ai-factor {
  min-width: 0;
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
}

.ai-factor-name {
  color: #6b7280;
  font-size: 13px;
}

.ai-factor-value {
  margin-top: 4px;
  font-size: 18px;
  font-weight: 900;
}

.ai-factor-note {
  margin-top: 5px;
  color: #6b7280;
  font-size: 12px;
  line-height: 1.45;
}

.ai-section-title {
  margin-top: 14px;
  color: #6b7280;
  font-size: 13px;
  font-weight: 900;
}

.ai-task-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.ai-task {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
  color: #374151;
  font-size: 14px;
  line-height: 1.5;
}

.ai-task-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #111827;
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.48);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 560px);
  max-height: min(78vh, 620px);
  overflow: auto;
  padding: 16px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.24);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.modal-title {
  font-size: 19px;
  font-weight: 900;
}

.modal-close {
  width: 32px;
  height: 32px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #ffffff;
  color: #374151;
  font-size: 22px;
  font-weight: 900;
  line-height: 28px;
  cursor: pointer;
}

.method-item {
  padding: 10px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #ffffff;
}

.method-item strong,
.method-item span {
  display: block;
}

.method-item strong {
  font-size: 15px;
}

.method-item span {
  margin-top: 5px;
  color: #4b5563;
  font-size: 13px;
  line-height: 1.55;
}

@media (max-width: 360px) {
  .metrics,
  .ma-list,
  .tp-levels {
    grid-template-columns: repeat(2, 1fr);
  }

  .search-row {
    gap: 6px;
  }

  .search-button {
    width: 62px;
  }

  .change-pill {
    font-size: 13px;
  }
}

@media (max-width: 560px) {
  .alert-form,
  .trend-form,
  .tp-rule-grid,
  .method-grid {
    grid-template-columns: 1fr;
  }

  .ai-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .ai-factor-grid {
    grid-template-columns: 1fr;
  }

  .tp-levels {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}




