/* PC 首页布局：左侧导航 + 中间对话 + 底部资讯（参考需求确认稿） */

.pc-home {
  --sidebar-bg: #1a2744;
  --sidebar-hover: #243556;
  --sidebar-active: #2d4270;
  --sidebar-text: #b8c5d9;
  --sidebar-text-bright: #ffffff;
  --accent-coral: #e85d4c;
  --accent-coral-hover: #d14a3a;
}

.pc-home .app-shell {
  min-height: 100vh;
}

.pc-layout {
  display: flex;
  min-height: 100vh;
}

/* ── 左侧导航 ── */
.sidebar {
  width: 220px;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-logo {
  padding: 20px 20px 16px;
  font-size: 22px;
  font-weight: 700;
  color: var(--sidebar-text-bright);
  letter-spacing: 0.5px;
}

.btn-new-chat {
  margin: 0 16px 16px;
  padding: 10px 16px;
  background: var(--accent-coral);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
  text-align: left;
}

.btn-new-chat:hover {
  background: var(--accent-coral-hover);
}

.sidebar-nav {
  padding: 0 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--sidebar-text);
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}

.sidebar-nav-item:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-bright);
}

.sidebar-nav-item.active {
  background: var(--sidebar-active);
  color: var(--sidebar-text-bright);
}

.sidebar-nav-item .nav-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

.sidebar-history {
  flex: 1;
  overflow-y: auto;
  padding: 12px 8px;
  margin-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-history-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(184, 197, 217, 0.6);
  padding: 8px 12px 6px;
}

.history-item {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--sidebar-text);
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.15s;
}

.history-item:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-bright);
}

.history-item.active {
  background: var(--sidebar-active);
  color: var(--sidebar-text-bright);
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-footer-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--sidebar-text);
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 8px;
  width: 100%;
  text-align: left;
}

.sidebar-footer-btn:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-bright);
}

/* ── 主内容区 ── */
.pc-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--surface);
}

.pc-main-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 0 32px;
}

.chat-center-zone {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  width: 100%;
  min-height: 0;
  padding: 8vh 0 4vh;
}

.chat-center-zone.has-messages {
  justify-content: flex-start;
  padding: 24px 0 16px;
}

.welcome-header {
  text-align: center;
  padding: 0 0 28px;
  transition: opacity 0.3s, max-height 0.3s;
}

.welcome-header.hidden {
  display: none;
}

.welcome-header h1 {
  font-size: 26px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.welcome-header p {
  font-size: 14px;
  color: var(--text-muted);
}

.pc-home .chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 0 8px;
  gap: 16px;
}

.pc-home .chat-messages:empty {
  display: none;
}

/* 输入区 */
.chat-composer {
  padding: 0;
  flex-shrink: 0;
  width: 100%;
}

.composer-box {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}

.composer-box:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.composer-box .chat-input {
  border: none;
  border-radius: 0;
  box-shadow: none;
  min-height: 96px;
  padding: 18px 20px;
  width: 100%;
  font-size: 15px;
  line-height: 1.6;
}

.composer-box .chat-input:focus {
  outline: none;
}

.composer-toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.composer-tool-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: background 0.15s;
}

.composer-tool-btn:hover {
  background: var(--border);
}

.composer-send-btn {
  padding: 6px 18px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

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

.pc-home .suggestions {
  justify-content: center;
  margin-top: 12px;
  margin-bottom: 0;
}

.pc-home .suggestion-chip {
  border-radius: 20px;
  background: var(--surface);
}

/* ── 底部资讯模块 ── */
.news-bottom {
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, #f8fafc 0%, var(--bg) 100%);
  padding: 20px 32px 24px;
  flex-shrink: 0;
}

.news-bottom-header {
  display: flex;
  align-items: center;
  margin-bottom: 14px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.news-bottom-header h2 {
  font-size: 16px;
  font-weight: 600;
}

.news-carousel {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-behavior: auto;
  padding: 4px 2px 8px;
  max-width: 100%;
  margin: 0 auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.news-carousel::-webkit-scrollbar {
  display: none;
}

.news-module-card {
  flex: 0 0 300px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  display: flex;
  flex-direction: column;
}

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

.news-module-cover {
  position: relative;
  height: 150px;
  overflow: hidden;
  background: var(--bg);
}

.news-module-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.news-module-cover .news-module-label {
  position: absolute;
  left: 10px;
  bottom: 10px;
  margin: 0;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--primary);
  font-weight: 600;
  backdrop-filter: blur(4px);
}

.news-module-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.news-module-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 10px;
}

.news-module-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-module-preview {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-module-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.news-module-date {
  font-size: 11px;
  color: var(--text-muted);
}

.news-module-link {
  font-size: 12px;
  color: var(--primary);
  font-weight: 500;
}

@media (max-width: 900px) {
  .sidebar {
    width: 64px;
  }

  .sidebar-logo,
  .btn-new-chat span,
  .sidebar-nav-item span.label,
  .sidebar-history,
  .sidebar-footer-btn span {
    display: none;
  }

  .btn-new-chat {
    text-align: center;
    padding: 10px;
  }

  .btn-new-chat::before {
    content: "+";
    font-size: 18px;
  }

  .sidebar-nav-item {
    justify-content: center;
    padding: 12px;
  }

  .news-bottom {
    padding: 16px;
  }

  .news-module-card {
    flex: 0 0 260px;
  }

  .news-module-cover {
    height: 130px;
  }
}
