@import url("./chatAgyCommon.css");

/* ============================================================
 * 门户 AI 助手 AGY 默认政务蓝样式表
 * ============================================================
 * 基础变量已定义在 chatAgyCommon.css 中
 * 本文件仅定义政务蓝主题特有的样式和覆盖
 */

/* 政务蓝主题特有的 RGB 变量（用于 alpha 透明度） */
:root {
  --brand-50-rgb: 240 246 255;
  --brand-100-rgb: 224 237 255;
  --brand-200-rgb: 194 219 254;
  --brand-300-rgb: 155 191 252;
  --brand-400-rgb: 95 149 244;
  --brand-500-rgb: 59 113 219;
  --brand-600-rgb: 46 84 161;
  --brand-700-rgb: 36 68 133;
  --brand-800-rgb: 27 53 106;
  --brand-900-rgb: 20 39 80;
  --brand-950-rgb: 13 26 54;
}

body {
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  background-color: #f8fafc;
  color: #1e293b;
  overflow: hidden;
  text-rendering: optimizeLegibility;
}

html,
body,
#app {
  height: 100%;
  min-height: 0;
}

@supports (height: 100dvh) {
  body,
  #app {
    height: 100dvh;
  }
}

/* 默认政务红页面滚动条 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* 氛围光斑与玻璃拟态 */
.hero-glow {
  background: radial-gradient(circle at 50% 20%, rgba(46, 84, 161, 0.09) 0%, rgba(255, 255, 255, 0) 70%);
}

.glass-card {
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.04);
  transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

.glass-card:hover {
  box-shadow: 0 12px 30px -4px rgba(46, 84, 161, 0.14);
  border-color: rgba(95, 149, 244, 0.4);
  transform: translateY(-2px);
}

/* 公共 Markdown 样式由 chatAgyCommon.css 提供，这里仅覆盖主题色。 */
.md-content code {
  color: var(--brand-700);
}

/* 政务风扇形卡片轮播与翻面交互 */
.government-fan-carousel {
  position: relative;
  width: 100%;
  max-width: 1120px;
  min-height: 500px;
  margin: 0 auto 28px;
  padding: 0 58px 24px;
  overflow: hidden;
}

.government-fan-viewport {
  position: relative;
  width: 100%;
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1500px;
  transform-style: preserve-3d;
  cursor: grab;
  user-select: none;
  touch-action: pan-y;
}

.government-fan-viewport.is-dragging,
.government-fan-viewport.is-dragging .government-fan-card {
  cursor: grabbing;
}

.government-fan-card {
  position: absolute;
  width: 300px;
  height: 360px;
  outline: none;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 700ms cubic-bezier(0.22, 1, 0.36, 1), opacity 550ms ease, filter 550ms ease;
  will-change: transform, opacity;
}

.government-fan-card:focus-visible .government-fan-card-inner {
  outline: 3px solid rgba(100, 116, 139, 0.2);
  outline-offset: 4px;
}

.government-fan-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 24px;
  transform-style: preserve-3d;
  transition: transform 760ms cubic-bezier(0.4, 0, 0.2, 1), box-shadow 300ms ease;
  box-shadow: 0 16px 42px rgba(15, 23, 42, 0.08);
}

.government-fan-card.is-active .government-fan-card-inner {
  box-shadow: 0 22px 52px rgba(15, 23, 42, 0.13);
}

.government-fan-card.is-flipped .government-fan-card-inner {
  transform: rotateY(180deg);
}

.government-fan-card-front,
.government-fan-card-back {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  border: 1px solid #e5e7eb;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.98);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.government-fan-card-front {
  z-index: 2;
  align-items: center;
  padding: 28px 24px 22px;
  text-align: center;
  transform: rotateY(0deg);
}

.government-card-visual {
  width: 104px;
  height: 104px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 104px;
  overflow: hidden;
  border-radius: 24px;
  background: linear-gradient(145deg, #f0f6ff, #f8fafc);
}

.government-card-visual img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.government-card-copy {
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 12px 0;
}

.government-card-copy h3,
.government-fan-card-back h3 {
  margin: 0;
  color: #172033;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.35;
}

.government-card-copy p {
  display: -webkit-box;
  width: 100%;
  margin: 8px 0 0;
  overflow: hidden;
  color: #64748b;
  font-size: 12px;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.government-card-front-action {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding-top: 13px;
  border-top: 1px solid #f1f5f9;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  transition: color 200ms ease;
}

.government-fan-card.is-active:hover .government-card-front-action {
  color: var(--brand-600);
}

.government-fan-card-back {
  padding: 25px;
  transform: rotateY(180deg);
  background: linear-gradient(145deg, #ffffff 0%, #f0f6ff 100%);
}

.government-card-back-mark {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  border-radius: 14px;
  background: var(--brand-50);
  color: var(--brand-600);
  font-size: 18px;
}

.government-card-back-eyebrow {
  margin-bottom: 6px;
  color: var(--brand-600);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.government-card-back-desc {
  flex: 1;
  margin: 14px 0 16px;
  padding-right: 4px;
  overflow-y: auto;
  color: #475569;
  font-size: 13px;
  line-height: 1.75;
  text-align: left;
  overscroll-behavior: contain;
}

.government-card-back-button {
  width: 100%;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 0 0 40px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand-700), var(--brand-600));
  color: #ffffff;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(46, 84, 161, 0.22);
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.government-card-back-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 11px 24px rgba(46, 84, 161, 0.3);
}

.government-fan-nav {
  position: absolute;
  top: 190px;
  z-index: 40;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e2e8f0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #172033;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.09);
  backdrop-filter: blur(8px);
  transition: color 200ms ease, background-color 200ms ease, transform 200ms ease, opacity 200ms ease;
}

.government-fan-nav.is-prev { left: 20px; }
.government-fan-nav.is-next { right: 20px; }

.government-fan-nav:hover:not(:disabled) {
  color: #ffffff;
  background: #172033;
  transform: scale(1.06);
}

.government-fan-nav:disabled {
  opacity: 0.28;
  cursor: not-allowed;
  box-shadow: none;
}

.government-fan-dots {
  height: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 3px;
}

.government-fan-dots button {
  width: 6px;
  height: 6px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #cbd5e1;
  cursor: pointer;
  transition: width 220ms ease, background-color 220ms ease;
}

.government-fan-dots button.is-active {
  width: 20px;
  background: #172033;
}

.government-fan-filter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
}

.government-fan-filter button {
  min-width: 72px;
  padding: 9px 18px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #ffffff;
  color: #334155;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.04);
  transition: color 200ms ease, background-color 200ms ease, border-color 200ms ease, transform 200ms ease;
}

.government-fan-filter button:hover {
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.government-fan-filter button.is-active {
  border-color: #172033;
  background: #172033;
  color: #ffffff;
  box-shadow: 0 7px 18px rgba(15, 23, 42, 0.18);
}

/* 信用修复：整体汇总入口 */
.repair-overview-section {
  padding: 12px 14px;
  border-bottom: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.repair-overview-card {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: 4px 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 11px 12px 11px 0;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #ffffff;
  color: #1e293b;
  text-align: left;
  font: inherit;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  transition: border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.repair-overview-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 7px 18px rgba(15, 23, 42, 0.08);
  transform: translateY(-1px);
}

.repair-overview-card:focus-visible {
  outline: 3px solid rgba(100, 116, 139, 0.18);
  outline-offset: 2px;
}

.repair-overview-card.is-active {
  border-color: #cbd5e1;
  background: linear-gradient(100deg, #f8fafc 0%, #ffffff 66%);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.repair-overview-card.is-active.is-pass {
  border-color: #cbd5e1;
  background: linear-gradient(100deg, #ecfdf5 0%, #ffffff 66%);
  box-shadow: 0 8px 20px rgba(5, 150, 105, 0.08);
}

.repair-overview-card.is-active.is-fail {
  border-color: #cbd5e1;
  background: linear-gradient(100deg, #fff1f2 0%, #ffffff 66%);
}

.repair-overview-accent {
  align-self: stretch;
  min-height: 36px;
  border-radius: 0 999px 999px 0;
  background: #cbd5e1;
  transition: background-color 180ms ease;
}

.repair-overview-icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 17px;
  transition: color 180ms ease, background-color 180ms ease;
}

.repair-overview-copy {
  display: block;
  min-width: 0;
}

.repair-overview-copy strong,
.repair-overview-copy small {
  display: block;
}

.repair-overview-copy strong {
  display: -webkit-box;
  overflow: hidden;
  color: #172033;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.repair-overview-copy small {
  min-width: 0;
  margin-top: 0;
  overflow: hidden;
  color: #64748b;
  font-size: 10px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.repair-overview-subline {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin-top: 4px;
}

.repair-overview-subline small {
  flex: 1;
}

.repair-overview-action {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.repair-overview-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 7px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.repair-overview-status .fa-circle {
  font-size: 5px;
}

.repair-overview-arrow {
  color: #94a3b8;
  font-size: 10px;
  transition: color 180ms ease, transform 180ms ease;
}

.repair-overview-card:hover .repair-overview-arrow,
.repair-overview-card.is-active .repair-overview-arrow {
  color: var(--brand-600);
  transform: translateX(2px);
}

.repair-overview-card.is-pending .repair-overview-accent {
  background: var(--brand-500);
}

.repair-overview-card.is-pending .repair-overview-icon {
  background: var(--brand-50);
  color: var(--brand-600);
}

.repair-overview-card.is-pass .repair-overview-accent {
  background: #10b981;
}

.repair-overview-card.is-pass .repair-overview-icon,
.repair-overview-card.is-pass .repair-overview-status {
  background: #ecfdf5;
  color: #059669;
}

.repair-overview-card.is-fail .repair-overview-accent {
  background: var(--brand-600);
}

.repair-overview-card.is-fail .repair-overview-icon,
.repair-overview-card.is-fail .repair-overview-status {
  background: var(--brand-50);
  color: var(--brand-700);
}

/* 默认政务风响应式：平板及手机使用抽屉导航，轮播只突出当前卡片 */
@media (max-width: 1023px) {
  .repair-workspace {
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .repair-workspace-grid {
    height: auto;
  }

  .repair-workspace-column {
    overflow: visible;
    padding-right: 0;
  }
}

@media (max-width: 639px) {
  .hero-glow {
    background: radial-gradient(circle at 50% 10%, rgba(46, 84, 161, 0.1) 0%, rgba(255, 255, 255, 0) 68%);
  }

  .md-content {
    font-size: 13px;
    overflow-wrap: anywhere;
  }

  .md-content pre {
    padding: 0.75rem;
    font-size: 12px;
  }

  .toast-wrap {
    top: 4.5rem;
    width: calc(100% - 2rem);
    text-align: center;
  }

  .toast-card {
    max-width: 100%;
  }

  .repair-overview-section {
    padding: 10px;
  }

  .repair-overview-card {
    grid-template-columns: 3px 38px minmax(0, 1fr) auto;
    gap: 9px;
    padding: 10px 10px 10px 0;
  }

  .repair-overview-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .repair-overview-arrow {
    display: none;
  }

  .government-fan-carousel {
    min-height: 420px;
    margin-bottom: 18px;
    padding: 0 12px 18px;
  }

  .government-fan-viewport {
    height: 325px;
  }

  .government-fan-card {
    width: min(240px, calc(100vw - 72px));
    height: 300px;
  }

  .government-fan-card:not(.is-active) {
    opacity: 0 !important;
    pointer-events: none !important;
  }

  .government-fan-card-front,
  .government-fan-card-back {
    border-radius: 19px;
  }

  .government-fan-card-inner {
    border-radius: 19px;
  }

  .government-fan-card-front {
    padding: 18px 17px 16px;
  }

  .government-card-visual {
    width: 78px;
    height: 78px;
    flex-basis: 78px;
    border-radius: 19px;
  }

  .government-card-copy {
    padding: 9px 0;
  }

  .government-card-copy h3,
  .government-fan-card-back h3 {
    font-size: 16px;
  }

  .government-card-copy p {
    font-size: 11px;
    -webkit-line-clamp: 2;
  }

  .government-fan-card-back {
    padding: 20px;
  }

  .government-fan-nav {
    display: none;
  }

  .government-fan-dots {
    margin-top: 0;
  }

  .government-fan-filter {
    justify-content: flex-start;
    gap: 8px;
    margin-top: 18px;
    padding: 0 4px 5px;
    overflow-x: auto;
  }

  .government-fan-filter button {
    min-width: auto;
    flex: 0 0 auto;
    padding: 8px 15px;
  }
}


