/* ================================================
   金融研究仪表盘 - 蓝图视图样式 v1.3
   L4-2: 架构图/原型图/数据模型/决策记录
   ================================================ */

/* === 蓝图容器 === */
.blueprint-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100%;
}

/* === 蓝图Tab导航 === */
.bp-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg2);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.bp-tab {
  flex: 1;
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 500;
  color: var(--t3);
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.bp-tab:hover {
  color: var(--t2);
  background: var(--bg3);
}

.bp-tab.active {
  color: var(--accent);
  background: var(--accent-bg);
}

/* === 蓝图内容区 === */
.bp-content {
  flex: 1;
  overflow-y: auto;
  display: none;
}

.bp-content.active {
  display: block;
}

/* === 架构图Tab === */
.arch-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 版本时间线 */
.version-timeline {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 16px;
  background: var(--bg2);
  border-radius: 10px;
  border: 1px solid var(--border);
  overflow-x: auto;
}

.version-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.version-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--bg4);
  border: 2px solid var(--border);
  transition: all 0.2s;
}

.version-item.active .version-dot {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.version-item.current .version-dot {
  background: var(--accent2);
  border-color: var(--accent2);
  box-shadow: 0 0 12px var(--accent2);
}

.version-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--t3);
  cursor: pointer;
  transition: color 0.15s;
}

.version-item.active .version-label,
.version-item.current .version-label {
  color: var(--t1);
}

.version-item.current .version-label {
  color: var(--accent2);
}

.version-date {
  font-size: 9px;
  color: var(--t4);
}

.version-arrow {
  flex: 1;
  min-width: 40px;
  height: 2px;
  background: var(--border);
  position: relative;
  margin: 0 8px;
  margin-bottom: 24px;
}

.version-arrow::after {
  content: '→';
  position: absolute;
  right: -2px;
  top: -10px;
  color: var(--t4);
  font-size: 12px;
}

/* 架构图显示区 */
.arch-viewer {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  min-height: 400px;
  display: flex;
  flex-direction: column;
}

.arch-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.arch-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--t1);
}

.arch-controls {
  display: flex;
  gap: 8px;
}

.arch-btn {
  padding: 4px 10px;
  font-size: 10px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--t2);
  cursor: pointer;
  transition: all 0.15s;
}

.arch-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.arch-svg-container {
  flex: 1;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border-radius: 6px;
  min-height: 300px;
}

.arch-svg-container svg {
  max-width: 100%;
  height: auto;
}

/* 版本变更说明 */
.version-changelog {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}

.changelog-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--t1);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.changelog-content {
  font-size: 11px;
  color: var(--t2);
  line-height: 1.8;
}

.changelog-item {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border2);
}

.changelog-item:last-child {
  border-bottom: none;
}

.changelog-type {
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 600;
  flex-shrink: 0;
}

.changelog-type.add {
  background: rgba(63, 185, 80, 0.15);
  color: var(--accent2);
}

.changelog-type.update {
  background: rgba(88, 166, 255, 0.15);
  color: var(--accent);
}

.changelog-type.fix {
  background: rgba(210, 153, 34, 0.15);
  color: var(--warn);
}

/* === 原型图Tab === */
.proto-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.proto-render {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px;
  overflow-y: auto;
  max-height: calc(100vh - 250px);
}

.proto-content {
  font-size: 12px;
  line-height: 1.8;
  color: var(--t2);
}

.proto-content h1 {
  font-size: 18px;
  color: var(--t1);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
}

.proto-content h2 {
  font-size: 15px;
  color: var(--t1);
  margin: 20px 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.proto-content h3 {
  font-size: 13px;
  color: var(--t1);
  margin: 16px 0 8px;
}

.proto-content pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  overflow-x: auto;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 11px;
  line-height: 1.6;
  color: var(--t2);
}

.proto-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

.proto-content code {
  background: var(--bg3);
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 11px;
  color: var(--accent);
}

/* === 数据模型Tab === */
.er-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.er-viewer {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  min-height: 400px;
  display: flex;
  flex-direction: column;
}

.er-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.er-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--t1);
}

.er-svg-container {
  flex: 1;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border-radius: 6px;
  min-height: 300px;
}

.er-svg-container svg {
  max-width: 100%;
  height: auto;
}

/* === 决策记录Tab === */
.adr-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.adr-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.adr-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.15s;
}

.adr-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.adr-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.adr-id {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-bg);
  padding: 4px 10px;
  border-radius: 4px;
}

.adr-status {
  font-size: 10px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
}

.adr-status.accepted {
  background: rgba(63, 185, 80, 0.15);
  color: var(--accent2);
}

.adr-status.proposed {
  background: rgba(88, 166, 255, 0.15);
  color: var(--accent);
}

.adr-status.deprecated {
  background: rgba(139, 148, 158, 0.15);
  color: var(--t3);
}

.adr-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--t1);
  margin-bottom: 8px;
}

.adr-context {
  font-size: 11px;
  color: var(--t3);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.adr-meta {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 10px;
  color: var(--t4);
}

/* ADR详情弹框 */
.adr-detail {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 700px;
  max-height: 80vh;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  z-index: 1000;
  display: none;
  flex-direction: column;
}

.adr-detail.show {
  display: flex;
}

.adr-detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 999;
  display: none;
}

.adr-detail-overlay.show {
  display: block;
}

.adr-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.adr-detail-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--t1);
}

.adr-detail-close {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--t2);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.adr-detail-close:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.adr-detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.adr-detail-section {
  margin-bottom: 20px;
}

.adr-detail-section h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.adr-detail-section p,
.adr-detail-section li {
  font-size: 12px;
  color: var(--t2);
  line-height: 1.8;
}

.adr-detail-section ul {
  margin: 8px 0;
  padding-left: 20px;
}

.adr-detail-section li {
  margin-bottom: 4px;
}

/* === 加载状态 === */
.bp-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--t3);
}

.bp-loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 12px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.bp-loading-text {
  font-size: 12px;
}

/* === 空状态 === */
.bp-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.bp-empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.bp-empty-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--t2);
  margin-bottom: 8px;
}

.bp-empty-desc {
  font-size: 11px;
  color: var(--t4);
}

/* === 错误状态 === */
.bp-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
}

.bp-error-icon {
  font-size: 36px;
  margin-bottom: 12px;
}

.bp-error-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--danger);
  margin-bottom: 8px;
}

.bp-error-desc {
  font-size: 11px;
  color: var(--t4);
  margin-bottom: 16px;
}

.bp-error-retry {
  padding: 8px 20px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: opacity 0.15s;
}

.bp-error-retry:hover {
  opacity: 0.85;
}
