/* 霖小助原型 - 全局样式（可按客户 VI 调整色板） */
:root {
  --primary: #0066b3;
  --primary-dark: #004d8a;
  --primary-light: #e8f4fc;
  --accent: #00a86b;
  --bg: #f5f7fa;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #1a2332;
  --text-muted: #64748b;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.1);
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* 布局 */
.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 18px;
  color: var(--primary);
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 14px;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-muted);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
}

.main-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* 聊天区 */
.chat-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  min-width: 0;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.message {
  display: flex;
  gap: 12px;
  max-width: 85%;
  animation: fadeIn 0.3s ease;
}

.message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}

.message.assistant .message-avatar {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
}

.message.user .message-avatar {
  background: var(--primary-light);
  color: var(--primary);
}

.message-body {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 14px;
}

.message.user .message-body {
  background: var(--primary);
  color: white;
}

.message-body p + p {
  margin-top: 8px;
}

.message-body .highlight {
  color: var(--primary);
  font-weight: 600;
}

.message.user .message-body .highlight {
  color: #b3e0ff;
}

/* 富文本卡片（AI 回复内嵌） */
.rich-card {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
}

.rich-card-header {
  background: var(--primary-light);
  padding: 10px 14px;
  font-weight: 600;
  font-size: 13px;
  color: var(--primary-dark);
}

.rich-card-body {
  padding: 14px;
  font-size: 13px;
}

.rich-card-body table {
  width: 100%;
  border-collapse: collapse;
}

.rich-card-body th,
.rich-card-body td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.rich-card-body th {
  color: var(--text-muted);
  font-weight: 500;
  width: 100px;
}

.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* 流程步骤条 */
.process-steps {
  display: flex;
  align-items: flex-start;
  gap: 0;
  margin: 12px 0;
  overflow-x: auto;
  padding-bottom: 4px;
}

.process-step {
  flex: 1;
  min-width: 80px;
  text-align: center;
  position: relative;
}

.process-step::after {
  content: "";
  position: absolute;
  top: 14px;
  left: 50%;
  width: 100%;
  height: 2px;
  background: var(--border);
  z-index: 0;
}

.process-step:last-child::after {
  display: none;
}

.step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  position: relative;
  z-index: 1;
}

.process-step.done .step-dot {
  background: var(--accent);
  color: white;
}

.process-step.active .step-dot {
  background: var(--primary);
  color: white;
  box-shadow: 0 0 0 4px var(--primary-light);
}

.step-label {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

.process-step.active .step-label,
.process-step.done .step-label {
  color: var(--text);
  font-weight: 500;
}

/* 输入区 */
.chat-input-area {
  border-top: 1px solid var(--border);
  padding: 16px 24px;
  background: var(--surface);
}

.suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.suggestion-chip {
  padding: 6px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
}

.suggestion-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.input-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.chat-input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  min-height: 48px;
  max-height: 120px;
  outline: none;
  transition: border-color 0.2s;
}

.chat-input:focus {
  border-color: var(--primary);
}

/* 资讯侧栏 */
.news-panel {
  width: 340px;
  border-left: 1px solid var(--border);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.news-panel-header {
  padding: 16px 20px;
  font-weight: 600;
  font-size: 15px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.news-tabs {
  display: flex;
  gap: 4px;
  padding: 12px 16px 0;
}

.news-tab {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-muted);
  background: transparent;
  border: none;
}

.news-tab.active {
  background: var(--primary);
  color: white;
}

.news-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.news-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid transparent;
}

.news-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

.news-tag {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--primary-light);
  color: var(--primary);
  margin-bottom: 8px;
}

.news-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 6px;
}

.news-meta {
  font-size: 12px;
  color: var(--text-muted);
}

/* 导航页 */
.proto-nav {
  max-width: 960px;
  margin: 0 auto;
  padding: 48px 24px;
}

.proto-nav h1 {
  font-size: 28px;
  margin-bottom: 8px;
}

.proto-nav .subtitle {
  color: var(--text-muted);
  margin-bottom: 40px;
}

.proto-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.proto-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.proto-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
}

.proto-card h3 {
  font-size: 16px;
  margin-bottom: 8px;
}

.proto-card p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.proto-card .tag {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--bg);
  color: var(--text-muted);
  margin-right: 6px;
}

.proto-badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  background: #fef3c7;
  color: #92400e;
  margin-bottom: 12px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.back-link:hover {
  color: var(--primary);
}

/* 打字光标 */
.typing-cursor::after {
  content: "▋";
  animation: blink 0.8s infinite;
  color: var(--primary);
  margin-left: 2px;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 场景页简化布局 */
.scene-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px;
}

.scene-page .chat-panel {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  height: calc(100vh - 120px);
  min-height: 500px;
}

@media (max-width: 900px) {
  .main-layout {
    flex-direction: column;
  }

  .news-panel {
    width: 100%;
    max-height: 280px;
    border-left: none;
    border-top: 1px solid var(--border);
  }
}
