/* SpaceX研究站 全局样式（PC + 移动端自适应） */

:root {
  --primary: #005288;
  --primary-dark: #003a5c;
  --primary-light: #eaf3f9;
  --accent: #4a9eff;
  --text-main: #22262e;
  --text-sub: #8a919e;
  --bg-page: #f4f7fa;
  --bg-card: #ffffff;
  --border: #e3e8ef;
  --up: #dc2626;
  --down: #16a34a;
  --navy: #0b0e1a;
  --radius: 8px;
  --shadow: 0 2px 10px rgba(11, 14, 26, 0.08);
}

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

body {
  font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", sans-serif;
  background: var(--bg-page);
  color: var(--text-main);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

/* ========== 顶部导航 ========== */
.site-header {
  background: linear-gradient(135deg, var(--navy) 0%, var(--primary) 160%);
  color: #ffffff;
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  gap: 12px;
  flex-wrap: wrap;
}

.site-logo {
  font-size: 20px;
  font-weight: bold;
  color: #ffffff;
  letter-spacing: 1px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-logo:hover {
  color: #ffffff;
  text-decoration: none;
}

.site-logo .logo-rocket {
  display: inline-block;
  width: 26px;
  height: 26px;
  background: radial-gradient(circle at 50% 65%, #ffffff 0%, #cfd8e6 45%, #7c8ea6 100%);
  border-radius: 50%;
  position: relative;
}

.site-logo .logo-rocket::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 12px;
  transform: translate(-50%, -50%) rotate(45deg);
  background: #ff9f43;
  border-radius: 2px;
}

.main-nav {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
}

.main-nav a {
  color: rgba(255, 255, 255, 0.85);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 15px;
  white-space: nowrap;
}

.main-nav a:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  text-decoration: none;
}

.main-nav a.active {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.auth-area {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  white-space: nowrap;
}

.auth-area .welcome-text {
  color: rgba(255, 255, 255, 0.9);
}

.auth-area .welcome-text .nick {
  color: var(--accent);
  font-weight: bold;
}

.auth-area .my-info-link {
  color: #ffffff;
  text-decoration: underline;
}

.pm-badge {
  display: inline-block;
  min-width: 18px;
  height: 18px;
  line-height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #ff5252;
  color: #fff;
  font-size: 12px;
  text-align: center;
  margin-left: 4px;
}

/* ========== 按钮 ========== */
.btn {
  display: inline-block;
  border: none;
  cursor: pointer;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 14px;
  line-height: 1.5;
  transition: opacity 0.2s;
}

.btn:hover {
  opacity: 0.9;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

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

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

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

.btn-light {
  background: #ffffff;
  color: var(--primary);
}

.btn-outline-light {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.6);
  color: #ffffff;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 13px;
}

.btn-block {
  width: 100%;
}

.link-btn {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 13px;
  padding: 0;
}

.link-btn:hover {
  text-decoration: underline;
}

/* ========== 页面主体 ========== */
.page-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 16px 40px;
  width: 100%;
  flex: 1;
}

.section-title {
  font-size: 20px;
  font-weight: bold;
  color: var(--navy);
  margin: 32px 0 16px;
  border-left: 4px solid var(--primary);
  padding-left: 12px;
}

.section-title .sub {
  font-size: 13px;
  color: var(--text-sub);
  font-weight: normal;
  margin-left: 8px;
}

.empty-tip {
  text-align: center;
  color: var(--text-sub);
  padding: 28px 0;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

/* ========== 首页 Hero ========== */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, #12203c 70%, var(--primary) 130%);
  color: #ffffff;
  border-radius: 12px;
  padding: 36px 28px;
  position: relative;
  overflow: hidden;
}

.hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.hero-text h1 {
  font-size: 34px;
  letter-spacing: 2px;
}

.hero-theme {
  font-size: 18px;
  color: var(--accent);
  margin-top: 10px;
}

.hero-sub {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 6px;
}

.hero-quote-card {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 10px;
  padding: 18px 22px;
  min-width: 240px;
  text-align: right;
}

.hero-quote-card .quote-label {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
}

.hero-quote-card .quote-price {
  font-size: 30px;
  font-weight: bold;
  color: #ffffff;
  margin: 6px 0;
}

.quote-change.up {
  color: #4ade80;
}

.quote-change.down {
  color: #f87171;
}

.hero-quote-card .quote-meta {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
}

/* ========== K线面板 ========== */
.kline-panel {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
}

.kline-summary {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--text-sub);
  margin-bottom: 10px;
}

.kline-summary b {
  color: var(--text-main);
  font-weight: bold;
}

.kline-summary .up {
  color: var(--up);
}

.kline-summary .down {
  color: var(--down);
}

.kline-summary .kline-date {
  margin-left: auto;
  color: var(--primary);
  font-weight: bold;
}

#klineChart {
  width: 100%;
  height: auto;
  max-height: 480px;
  display: block;
}

.kline-tip {
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 8px;
}

/* ========== 帖子列表 ========== */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.post-list-item {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
}

.post-title {
  font-size: 17px;
  font-weight: bold;
  color: var(--navy);
  display: block;
}

.post-title:hover {
  color: var(--primary);
  text-decoration: none;
}

/* 列表页标题双行：原文在上、译文在下 */
.post-title-trs {
  display: block;
  font-size: 12px;
  font-weight: normal;
  color: #888;
  line-height: 1.4;
  margin-top: 3px;
}
.post-title-trs:hover {
  color: var(--primary);
  text-decoration: none;
}

.post-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-sub);
  margin-top: 8px;
}

.post-author {
  color: var(--primary);
  cursor: pointer;
  font-weight: bold;
}

.post-author:hover {
  text-decoration: underline;
}

.post-excerpt {
  font-size: 14px;
  color: var(--text-main);
  margin-top: 8px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* 列表内容摘要译文层（原文在上、译文在下） */
.post-excerpt-trs {
  font-size: 12px;
  color: #888;
  margin-top: 4px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.more-link {
  text-align: center;
  margin-top: 16px;
}

/* ========== 分页 ========== */
.pagination {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 24px;
  flex-wrap: wrap;
}

.pagination a,
.pagination .current {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 14px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--primary);
}

.pagination .current {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ========== 帖子详情 ========== */
.page-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.page-title {
  font-size: 24px;
  color: var(--navy);
}

.post-detail {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.post-detail-title {
  font-size: 24px;
  color: var(--navy);
  line-height: 1.4;
}

.post-detail-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-sub);
  margin: 12px 0 16px;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
}

.post-detail-content {
  font-size: 15px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.9;
}

/* 帖子标题/内容译文层（原文在上、译文在下） */
.post-detail-title-trs {
  font-size: 13px;
  font-weight: normal;
  color: #888;
  margin: 6px 0 12px;
}
.post-detail-content-trs {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed #e5e7eb;
  font-size: 14px;
  color: #6b7280;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.8;
}

/* ========== 评论 ========== */
.comment-box {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 16px;
}

.comment-input-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.comment-textarea {
  width: 100%;
  min-height: 80px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  outline: none;
}

.comment-textarea:focus {
  border-color: var(--primary);
}

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.comment-item {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
}

.comment-item.comment-reply {
  margin-left: 28px;
  background: #f8fafc;
  box-shadow: none;
  border: 1px solid var(--border);
}

.comment-head {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 13px;
  color: var(--text-sub);
}

.comment-body {
  font-size: 14px;
  margin: 8px 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.comment-actions {
  text-align: right;
}

/* ========== 个人中心 ========== */
.profile-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.profile-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.profile-label {
  width: 130px;
  color: var(--text-sub);
  font-size: 14px;
}

.profile-value {
  font-size: 15px;
  font-weight: bold;
}

.profile-edit-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.profile-edit-row input {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 14px;
  width: 240px;
  outline: none;
}

.profile-edit-row input:focus {
  border-color: var(--primary);
}

.my-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 20px 0 16px;
}

.tab-btn {
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-main);
  padding: 8px 18px;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
}

.tab-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.tab-panel {
  display: none;
}

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

.my-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.my-item {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 18px;
  font-size: 14px;
}

.my-item .my-item-title {
  font-weight: bold;
  font-size: 15px;
  color: var(--navy);
}

.my-item .my-item-meta {
  color: var(--text-sub);
  font-size: 13px;
  margin-top: 6px;
}

.my-item .my-item-time {
  color: var(--text-sub);
  font-size: 12px;
  margin-top: 4px;
}

.empty-list {
  color: var(--text-sub);
  text-align: center;
  padding: 20px 0;
}

/* ========== 弹窗 ========== */
.modal-mask {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(11, 14, 26, 0.55);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-mask.show {
  display: flex;
}

.modal-box {
  background: #ffffff;
  border-radius: 12px;
  padding: 24px;
  width: 100%;
  max-width: 440px;
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.modal-box-wide {
  max-width: 520px;
}

.modal-close {
  position: absolute;
  right: 14px;
  top: 10px;
  background: none;
  border: none;
  font-size: 26px;
  color: var(--text-sub);
  cursor: pointer;
  line-height: 1;
}

.modal-box h3 {
  font-size: 18px;
  margin-bottom: 16px;
  color: var(--navy);
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 13px;
  color: var(--text-sub);
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 9px 12px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--primary);
}

.form-group input[readonly] {
  background: #f5f7fa;
  color: var(--text-sub);
}

.required {
  color: var(--down);
}

.code-row {
  display: flex;
  gap: 8px;
}

.code-row input {
  flex: 1;
}

.form-tip {
  font-size: 12px;
  color: var(--text-sub);
}

/* 私信弹窗 */
.pm-view-header {
  font-size: 15px;
  font-weight: bold;
  color: var(--navy);
  margin-bottom: 10px;
}

.pm-messages {
  height: 300px;
  overflow-y: auto;
  background: #f6f8fa;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pm-message {
  display: flex;
  flex-direction: column;
}

.pm-message.mine {
  align-items: flex-end;
}

.pm-bubble {
  max-width: 78%;
  padding: 8px 12px;
  border-radius: 10px;
  background: #e7f0f7;
  color: var(--text-main);
  font-size: 14px;
  word-break: break-word;
}

.pm-message.mine .pm-bubble {
  background: var(--primary);
  color: #ffffff;
}

.pm-time {
  font-size: 11px;
  color: var(--text-sub);
  margin-top: 3px;
}

.pm-send-area {
  display: flex;
  gap: 8px;
}

.pm-send-area textarea {
  flex: 1;
  min-height: 60px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  outline: none;
}

.pm-send-area textarea:focus {
  border-color: var(--primary);
}

/* ========== Toast ========== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 60px;
  transform: translateX(-50%) translateY(20px);
  background: rgba(11, 14, 26, 0.92);
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 2000;
  max-width: 90vw;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ========== 页脚 ========== */
.site-footer {
  background: var(--navy);
  color: rgba(255, 255, 255, 0.75);
  padding: 20px 16px;
  text-align: center;
  font-size: 13px;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.85);
}

.site-footer a:hover {
  color: #ffffff;
}

.footer-links {
  max-width: 1100px;
  margin: 0 auto 10px;
  line-height: 2;
}

.footer-line a {
  color: rgba(255, 255, 255, 0.6);
}

/* ========== 对冲模型页 ========== */
.hedge-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px 14px;
}

.hedge-summary {
  margin-bottom: 12px;
}

.hedge-summary p {
  font-size: 14px;
  color: var(--text-main);
  margin-bottom: 4px;
}

.hedge-summary .hedge-note {
  font-size: 12px;
  color: var(--text-sub);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-main);
}

/* 每日明细表（横向滑块滚动） */
.hedge-table-title {
  font-size: 15px;
  color: var(--primary);
  margin-top: 16px;
  margin-bottom: 6px;
}

/* 对冲模型标签（佛系对冲 / 每日必冲 / 仙级对冲 / 反面教材） */
.hedge-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.hedge-tab {
  font-size: 14px;
  padding: 8px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.hedge-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.hedge-tab.is-active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* 标签内容面板：默认隐藏，当前标签显示 */
.hedge-tab-pane {
  display: none;
}

.hedge-tab-pane.is-visible {
  display: block;
}

/* 每日必冲对冲行 */
.hedge-extra td {
  background: #f1f5f9;
}

.hedge-extra .cell-hedge {
  color: var(--primary);
  font-weight: bold;
}

.hedge-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
}

.hedge-table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  font-size: 14px;
  text-align: center;
}

.hedge-table th {
  background: var(--primary);
  color: #ffffff;
  padding: 32px 12px;
  font-weight: normal;
  white-space: nowrap;
}

.hedge-table td {
  padding: 28px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.hedge-table tbody tr:last-child td {
  border-bottom: none;
}

.hedge-table .row-even {
  background: #ffffff;
}

.hedge-table .row-odd {
  background: #f6f9fc;
}

.hedge-table .cell-up {
  color: #dc2626;
}

.hedge-table .cell-down {
  color: #16a34a;
}

.hedge-table .cell-muted {
  color: var(--text-sub);
}

/* ========== 移动端适配 ========== */
@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    align-items: stretch;
    padding: 10px 0;
    gap: 8px;
  }

  .top-actions {
    order: 3;
  }

  .auth-area {
    order: 4;
    flex-wrap: wrap;
  }

  .hero-text h1 {
    font-size: 26px;
  }

  .hero-quote-card {
    text-align: left;
    min-width: 100%;
  }

  .profile-label {
    width: 100%;
  }

  .profile-edit-row input {
    width: 100%;
  }

  .comment-item.comment-reply {
    margin-left: 12px;
  }
}


/* ===== 双语排版：英文在上，中文在下 ===== */
.bi { display: block; }
.bi > .en { display: block; }
.bi > .cn { display: block; }

/* 按钮/标签紧凑两行 */
.bi-tight { display: inline-block; vertical-align: middle; line-height: 1.25; text-align: left; }
.bi-tight > .en { display: block; }
.bi-tight > .cn { display: block; }

/* 行内双语（英文 + 中文同一行） */
.bi-line { line-height: 1.5; }
.bi-line > .en { margin-right: 0.5em; }
.bi-line > .cn { margin-right: 0.5em; }

/* 表头双语两行（紧凑） */
th.bi-th { line-height: 1.25; font-size: 12px; white-space: nowrap; }
th.bi-th .en { display: block; font-weight: 600; }
th.bi-th .cn { display: block; color: var(--text-sub); font-weight: 400; font-size: 11px; }

/* 导航链接双语 */
.bi-nav { display: block; line-height: 1.15; text-align: center; }
.bi-nav .en { display: block; font-size: 11px; opacity: .85; }
.bi-nav .cn { display: block; font-size: 13px; }

/* toast 双语两行 */
#globalToast .en, #globalToast .cn { display: block; }
#globalToast .cn { font-size: 13px; opacity: .85; }

/* K线摘要双语标签（英文在上中文在下，紧凑） */
.kline-summary .bi-tight { text-align: center; }