/* ===== 陶关每日记录 · 全站样式（移动端优先） ===== */

:root {
  --bg: #faf6ef;
  --bg-card: #fffdf8;
  --text: #3c3730;
  --text-soft: #7a7268;
  --accent: #c96f4a;
  --accent-dark: #a95636;
  --accent-soft: #f7e6dd;
  --border: #ece4d8;
  --shadow: 0 2px 10px rgba(96, 74, 54, 0.08);
  --shadow-hover: 0 6px 18px rgba(96, 74, 54, 0.14);
  --radius: 14px;
  --max-width: 860px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  line-height: 1.7;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

/* ===== 顶部导航 ===== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 253, 248, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.site-nav {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.site-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.05em;
}

.site-name:hover {
  color: var(--accent);
}

.nav-toggle {
  display: block;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1.1rem;
  padding: 0.2rem 0.6rem;
  color: var(--text);
  cursor: pointer;
}

.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: none;
  flex-direction: column;
  width: 100%;
  gap: 0.15rem;
}

.nav-links.open {
  display: flex;
}

.nav-links a {
  display: block;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  color: var(--text-soft);
  text-decoration: none;
  font-size: 0.95rem;
}

.nav-links a:hover {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.nav-links a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 600;
}

@media (min-width: 720px) {
  .nav-toggle {
    display: none;
  }

  .nav-links {
    display: flex;
    flex-direction: row;
    width: auto;
    gap: 0.25rem;
  }
}

/* ===== 首页 Hero ===== */

.hero {
  text-align: center;
  padding: 2.8rem 0 2rem;
}

.hero h1 {
  font-size: 1.9rem;
  margin: 0 0 0.6rem;
  letter-spacing: 0.08em;
}

.hero p {
  color: var(--text-soft);
  margin: 0;
}

/* ===== 频道卡片 ===== */

.channel-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 560px) {
  .channel-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 860px) {
  .channel-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.channel-card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.4rem 1.2rem;
  text-decoration: none;
  color: var(--text);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.channel-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.channel-card h2 {
  font-size: 1.1rem;
  margin: 0.6rem 0 0.3rem;
}

.channel-card p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.92rem;
}

.channel-icon {
  font-size: 1.8rem;
}

/* ===== 卡片通用 ===== */

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.2rem 1rem;
}

@media (min-width: 560px) {
  .card {
    padding: 1.5rem 1.5rem;
  }
}

.page-title {
  font-size: 1.5rem;
  margin: 0.5rem 0 1.2rem;
}

.card-title {
  font-size: 1.15rem;
  margin: 0 0 1rem;
}

/* ===== 本地模式提示条 / 令牌设置 ===== */

.local-banner {
  background: #fff3cd;
  color: #6b5410;
  border-bottom: 1px solid #f0dfa8;
  padding: 0.55rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.4rem 0.75rem;
  font-size: 0.9rem;
}

.local-banner-main {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1 1 260px;
  min-width: 0;
}

.local-banner-text {
  line-height: 1.5;
}

.token-form {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.token-form input {
  flex: 1 1 200px;
  min-width: 0;
  max-width: 340px;
  padding: 0.4rem 0.65rem;
  border: 1px solid #e3cf94;
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 0.9rem;
  font-family: inherit;
}

.token-form input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.token-save-btn {
  background: #6b5410;
  color: #fff;
}

.token-save-btn:hover {
  background: #57440c;
}

.token-help {
  flex: 1 1 100%;
  font-size: 0.85rem;
}

.token-help summary {
  cursor: pointer;
  color: #8a6d1a;
  font-weight: 600;
  user-select: none;
}

.token-help summary:hover {
  color: #6b5410;
}

.token-help ol {
  margin: 0.4rem 0 0.2rem;
  padding-left: 1.3rem;
}

.token-help li {
  margin-bottom: 0.25rem;
}

.token-help code {
  background: rgba(107, 84, 16, 0.1);
  border-radius: 4px;
  padding: 0.05rem 0.3rem;
  font-size: 0.82rem;
  overflow-wrap: anywhere;
}

.local-banner-close {
  background: none;
  border: none;
  font-size: 1.05rem;
  cursor: pointer;
  color: inherit;
  line-height: 1;
  padding: 0.15rem 0.3rem;
  flex-shrink: 0;
}

.token-clear-link {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
  font-family: inherit;
  cursor: pointer;
  text-decoration: underline;
}

.token-clear-link:hover {
  color: var(--accent-dark);
}

/* ===== 表单 ===== */

.form-card {
  margin-bottom: 2rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
}

@media (min-width: 560px) {
  .form-row {
    grid-template-columns: 1fr 1fr;
  }
}

.form-field {
  margin-bottom: 0.9rem;
  min-width: 0;
}

fieldset.form-field {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.8rem 0.9rem 0.4rem;
}

fieldset.form-field legend {
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0 0.3rem;
  color: var(--text);
}

fieldset.form-field label {
  margin-top: 0.35rem;
}

.form-field label,
.form-field legend {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

fieldset.form-field label {
  font-weight: 500;
  color: var(--text-soft);
  font-size: 0.88rem;
  margin-bottom: 0.2rem;
}

.form-field input,
.form-field textarea {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  line-height: 1.6;
}

.form-field textarea {
  resize: vertical;
}

.form-field input:focus,
.form-field textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.weekday {
  display: inline-block;
  margin-top: 0.3rem;
  font-size: 0.88rem;
  color: var(--accent-dark);
  font-weight: 600;
}

.form-actions {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
  align-items: center;
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 0.6rem 1.3rem;
  font-size: 1rem;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s ease, opacity 0.2s ease;
}

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

.btn-primary {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

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

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

.btn-ghost:hover {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.btn-small {
  padding: 0.3rem 0.85rem;
  font-size: 0.88rem;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.btn-small:hover {
  background: #f0d5c7;
}

/* ===== 历史记录列表 ===== */

.history-title {
  margin: 0 0 0.8rem;
}

.record-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.empty-hint {
  text-align: center;
  color: var(--text-soft);
  padding: 2.2rem 0;
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.record-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.9rem 1rem;
}

.record-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.6rem;
}

.record-date {
  font-weight: 700;
  font-size: 1.02rem;
}

.badge-today {
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  border-radius: 999px;
  padding: 0.05rem 0.55rem;
  font-weight: 600;
}

.badge-edit {
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.75rem;
  border-radius: 999px;
  padding: 0.05rem 0.55rem;
  font-weight: 600;
}

.record-meta {
  color: var(--text-soft);
  font-size: 0.88rem;
}

.record-preview {
  margin: 0.4rem 0 0.7rem;
  color: var(--text-soft);
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.record-actions {
  display: flex;
  gap: 0.5rem;
  margin-left: auto;
}

.record-detail {
  border-top: 1px dashed var(--border);
  margin-top: 0.8rem;
  padding-top: 0.8rem;
}

.detail-section {
  margin-bottom: 0.9rem;
}

.detail-section:last-child {
  margin-bottom: 0;
}

.detail-section h4 {
  margin: 0 0 0.25rem;
  font-size: 0.88rem;
  color: var(--accent-dark);
  font-weight: 600;
}

.detail-section p {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.97rem;
}

/* ===== 占位页 ===== */

.placeholder-card {
  text-align: center;
  padding: 2.5rem 1.5rem;
}

.placeholder-desc {
  color: var(--text-soft);
  margin: 0 0 1rem;
}

.placeholder-note {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent-dark);
  margin: 0;
}

/* ===== 页脚 ===== */

.site-footer {
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-soft);
  font-size: 0.88rem;
  padding: 1rem;
}

.site-footer p {
  margin: 0;
}

/* ===== Toast ===== */

.toast-container {
  position: fixed;
  left: 50%;
  bottom: 1.6rem;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
  pointer-events: none;
  width: max-content;
  max-width: 90vw;
}

.toast {
  background: rgba(60, 55, 48, 0.92);
  color: #fff;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  font-size: 0.92rem;
  box-shadow: var(--shadow-hover);
  animation: toast-in 0.25s ease;
}

.toast.toast-error {
  background: rgba(178, 58, 42, 0.94);
}

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

/* ===== 日期行 / 健康栏 / 体重单位 ===== */

.date-row {
  align-items: start;
}

@media (min-width: 560px) {
  .date-row {
    grid-template-columns: minmax(170px, 220px) 1fr;
  }
}

.health-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 720px) {
  .health-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.sub-group {
  min-width: 0;
}

.sub-head {
  font-weight: 700;
  font-size: 0.98rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.unit-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.unit-toggle button {
  border: none;
  background: transparent;
  padding: 0.12rem 0.75rem;
  font-size: 0.82rem;
  cursor: pointer;
  color: var(--text-soft);
  font-family: inherit;
  line-height: 1.5;
}

.unit-toggle button.active {
  background: var(--accent);
  color: #fff;
}

.input-with-unit {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.input-with-unit input {
  flex: 1;
  min-width: 0;
}

.unit-label {
  color: var(--text-soft);
  font-size: 0.9rem;
  min-width: 2em;
}

/* ===== 历史记录表格 ===== */

.table-wrap {
  padding: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.records-table {
  width: 100%;
  min-width: 800px;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.records-table th,
.records-table td {
  text-align: left;
  padding: 0.6rem 0.65rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  overflow-wrap: anywhere;
}

.records-table thead th {
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-weight: 600;
  font-size: 0.86rem;
  white-space: nowrap;
}

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

.records-table tbody tr:hover {
  background: rgba(201, 111, 74, 0.04);
}

col.col-date { width: 13%; }
col.col-sleep { width: 11%; }
col.col-weight { width: 10%; }
col.col-diet { width: 13%; }
col.col-today { width: 17%; }
col.col-work { width: 14%; }
col.col-parenting { width: 15%; }
col.col-actions { width: 7%; }

.clamp2,
.clamp3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.clamp2 {
  -webkit-line-clamp: 2;
}

.clamp3 {
  -webkit-line-clamp: 3;
}

.cell-line + .cell-line {
  margin-top: 0.15rem;
}

.cell-label {
  color: var(--accent-dark);
  font-weight: 600;
  font-size: 0.82em;
}

.cell-empty {
  color: var(--text-soft);
}

.cell-date {
  font-weight: 700;
}

.cell-weekday {
  color: var(--text-soft);
  font-size: 0.85rem;
}

.cell-summary {
  color: var(--text-soft);
  font-size: 0.85rem;
  margin-top: 0.15rem;
}

/* ===== 编辑模态框 ===== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(60, 50, 40, 0.45);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-overlay[hidden] {
  display: none;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(60, 45, 30, 0.25);
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1.2rem;
  border-bottom: 1px solid var(--border);
}

.modal-head h3 {
  margin: 0;
  font-size: 1.1rem;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--text-soft);
  line-height: 1;
  padding: 0.2rem 0.35rem;
}

.modal-close:hover {
  color: var(--accent-dark);
}

.modal-body {
  overflow-y: auto;
  padding: 1rem 1.2rem 1.4rem;
}

body.modal-open {
  overflow: hidden;
}

@media (max-width: 560px) {
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .modal {
    max-width: 100%;
    max-height: 94vh;
    border-radius: 16px 16px 0 0;
  }
}

/* ===== 知识点积累频道 ===== */

.loading-hint {
  color: var(--text-soft);
  text-align: center;
  padding: 0.8rem 0;
}

.knowledge-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.knowledge-item {
  padding: 0.9rem 1rem;
}

.knowledge-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.6rem;
  margin-bottom: 0.5rem;
}

.knowledge-date {
  font-weight: 700;
}

.knowledge-weekday {
  color: var(--text-soft);
  font-size: 0.88rem;
}

.knowledge-source {
  color: var(--accent-dark);
  font-size: 0.85rem;
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 0.05rem 0.6rem;
}

.knowledge-point {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.knowledge-insight {
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px dashed var(--border);
  color: var(--text-soft);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.95rem;
}

.knowledge-insight-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-dark);
  margin-bottom: 0.15rem;
}

/* ===== 知识点附件区（表单） ===== */

.attach-area {
  border: 1.5px dashed var(--border);
  border-radius: 10px;
  background: #fff;
  padding: 0.9rem 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  cursor: pointer;
  color: var(--text-soft);
  font-size: 0.95rem;
  text-align: center;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.attach-area:hover,
.attach-area:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
  outline: none;
}

.attach-area-icon {
  font-size: 1.15rem;
}

.attach-folder-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.attach-folder-status {
  font-size: 0.85rem;
  color: var(--text-soft);
}

.attach-list {
  list-style: none;
  margin: 0.6rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.attach-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.4rem 0.7rem;
}

.attach-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.attach-thumb-file {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  background: var(--accent-soft);
}

.attach-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.92rem;
}

.attach-size {
  color: var(--text-soft);
  font-size: 0.82rem;
  flex-shrink: 0;
}

.attach-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-soft);
  font-size: 0.95rem;
  line-height: 1;
  padding: 0.25rem 0.4rem;
  border-radius: 6px;
  flex-shrink: 0;
}

.attach-remove:hover {
  color: #b23a2a;
  background: var(--accent-soft);
}

/* ===== 知识点附件展示（历史记录） ===== */

.knowledge-attachments {
  margin-top: 0.7rem;
  padding-top: 0.6rem;
  border-top: 1px dashed var(--border);
}

.knowledge-attachments-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-dark);
  margin-bottom: 0.4rem;
}

.att-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.att-image {
  margin: 0;
  width: 120px;
}

.att-image img {
  width: 120px;
  height: 90px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  cursor: zoom-in;
  display: block;
  background: #fff;
}

.att-image figcaption {
  font-size: 0.78rem;
  color: var(--text-soft);
  margin-top: 0.2rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.att-file {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  padding: 0.5rem 0.8rem;
  text-decoration: none;
  color: var(--text);
  font-size: 0.9rem;
  max-width: 100%;
}

.att-file:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.att-file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}

.att-file-size {
  color: var(--text-soft);
  font-size: 0.8rem;
  flex-shrink: 0;
}

.att-file-dl {
  color: var(--accent-dark);
  font-weight: 600;
  font-size: 0.82rem;
  flex-shrink: 0;
}

/* ===== 附件图片放大预览 ===== */

.kl-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(40, 32, 24, 0.82);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
  cursor: zoom-out;
}

.kl-lightbox[hidden] {
  display: none;
}

.kl-lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  background: #fff;
}

/* ===== 股票频道：左侧抽屉页签 ===== */

.stocks-main {
  max-width: 1280px;
}

.stocks-layout {
  position: relative;
}

.drawer-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  padding: 0.35rem 0.8rem;
  color: var(--text);
  cursor: pointer;
  margin-bottom: 0.8rem;
}

.drawer-toggle:hover {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.stocks-drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 230px;
  padding: 4rem 0.9rem 1rem;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  box-shadow: var(--shadow-hover);
  z-index: 40;
  transform: translateX(-105%);
  transition: transform 0.25s ease;
  overflow-y: auto;
}

.stocks-drawer.open {
  transform: translateX(0);
}

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(60, 50, 40, 0.4);
  z-index: 39;
}

.drawer-overlay[hidden] {
  display: none;
}

.drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.drawer-tab {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-size: 0.98rem;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.drawer-tab:hover {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.drawer-tab[aria-current="true"] {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent-dark);
  font-weight: 600;
}

.stocks-content {
  min-width: 0;
}

.tab-panel[hidden] {
  display: none;
}

.monitor-frame {
  display: block;
  width: 100%;
  height: calc(100vh - 8.5rem);
  min-height: 540px;
  border: none;
  border-radius: var(--radius);
  background: #f5f6f7;
}

@media (min-width: 900px) {
  .stocks-layout {
    display: flex;
    gap: 1.1rem;
    align-items: flex-start;
  }

  .drawer-toggle,
  .drawer-overlay {
    display: none;
  }

  .stocks-drawer {
    position: static;
    width: 190px;
    flex-shrink: 0;
    padding: 0;
    background: transparent;
    border-right: none;
    box-shadow: none;
    z-index: auto;
    transform: none;
    transition: none;
    overflow: visible;
  }

  .monitor-frame {
    height: calc(100vh - 7.5rem);
    min-height: 620px;
  }
}

/* ===== 交易体系学习 ===== */

.learning-name-tag {
  color: var(--accent-dark);
  font-size: 0.85rem;
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 0.05rem 0.6rem;
  font-weight: 600;
}

.learning-time {
  margin-left: auto;
  color: var(--text-soft);
  font-size: 0.85rem;
}
