/* ============================================================
 * 原理解读：列表、文章排版、首页入口条
 * ============================================================ */

/* ---------------- 页头 ---------------- */
.theory-head {
  max-width: 860px;
  margin: 0 auto;
  padding: 34px 28px 10px;
}

.theory-head .back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 18px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13.5px;
  box-shadow: var(--sh-1);
  transition: .16s;
}

.theory-head .back-link:hover {
  color: var(--brand);
  border-color: rgba(79, 70, 229, .35);
  background: var(--brand-soft);
}

.theory-h1 {
  font-size: 30px;
  letter-spacing: -.02em;
  margin-bottom: 12px;
}

.theory-sub {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
  margin-bottom: 16px;
}

.theory-meta {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.theory-crumb {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--brand-soft-2);
  color: var(--brand-2);
  font-size: 12px;
  font-weight: 600;
}

/* ---------------- 列表 ---------------- */
.theory-grid {
  max-width: 1180px;
  margin: 0 auto;
  padding: 20px 28px 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px 30px;
}

.theory-sec-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.theory-sec-t {
  font-size: 16px;
  color: var(--ink);
}

.theory-sec-t::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 14px;
  margin-right: 8px;
  border-radius: 2px;
  background: var(--grad);
  vertical-align: -1px;
}

.theory-sec-d {
  color: var(--muted-2);
  font-size: 12.5px;
}

.theory-card {
  display: block;
  padding: 15px 17px 14px;
  margin-bottom: 10px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--sh-1);
  transition: .16s;
}

.theory-card:hover {
  transform: translateY(-2px);
  border-color: rgba(79, 70, 229, .35);
  box-shadow: var(--sh-2);
}

.theory-card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.theory-card-t {
  color: var(--ink);
  font-size: 15px;
  font-weight: 650;
}

.theory-card:hover .theory-card-t {
  color: var(--brand);
}

.theory-card-m {
  flex: none;
  color: var(--muted-2);
  font-size: 11.5px;
  font-family: var(--mono);
}

.theory-card-s {
  margin: 6px 0 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.68;
}

/* ---------------- 文章主体 ---------------- */
.theory-body {
  max-width: 860px;
  margin: 0 auto 26px;
  padding: 34px 40px 38px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-2);
}

.theory-body h3 {
  margin: 30px 0 12px;
  padding-left: 12px;
  font-size: 17.5px;
  color: var(--ink);
  border-left: 3px solid var(--brand);
}

.theory-body h3:first-child {
  margin-top: 4px;
}

.theory-body p {
  margin-bottom: 13px;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.88;
}

.theory-body strong {
  color: var(--ink);
  font-weight: 650;
}

.theory-body code {
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--bg-soft);
  color: var(--brand-2);
  font-family: var(--mono);
  font-size: .9em;
}

.theory-body p.formula {
  margin: 16px 0;
  padding: 14px 20px;
  border-radius: 10px;
  background: linear-gradient(100deg, rgba(79, 70, 229, .055), rgba(8, 145, 178, .055));
  border-left: 3px solid var(--brand);
  font-size: 15px;
  line-height: 2;
  overflow-x: auto;
  color: var(--ink);
}

.theory-body p.formula .eq {
  font-size: 1.14em;
}

.theory-body .eq {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.06em;
  letter-spacing: .01em;
  white-space: nowrap;
}

.theory-body sup {
  font-size: .72em;
}

.theory-body sub {
  font-size: .72em;
}

/* 无序列表 */
.theory-body ul.t-list {
  margin: 6px 0 16px;
}

.theory-body ul.t-list li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 11px;
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 1.82;
}

.theory-body ul.t-list li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 11px;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--brand);
  opacity: .55;
}

/* 提示框 */
.theory-body .t-note {
  margin: 20px 0;
  padding: 16px 20px 6px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-left: 3px solid var(--brand-2);
}

.theory-body .t-note-t {
  margin-bottom: 8px;
  color: var(--brand-2);
  font-size: 13.5px;
  font-weight: 650;
}

.theory-body .t-note p {
  font-size: 14.5px;
  line-height: 1.82;
}

.theory-body .t-note ul.t-list li {
  font-size: 14px;
}

/* 表格 */
.theory-body .t-tablewrap {
  margin: 16px 0 20px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.theory-body table.t-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.theory-body table.t-table th {
  padding: 10px 14px;
  text-align: left;
  white-space: nowrap;
  background: var(--bg-soft);
  color: var(--ink);
  font-weight: 650;
  font-size: 13px;
  border-bottom: 1px solid var(--line-2);
}

.theory-body table.t-table td {
  padding: 9px 14px;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.theory-body table.t-table tr:last-child td {
  border-bottom: none;
}

.theory-body table.t-table tbody tr:hover td {
  background: rgba(79, 70, 229, .035);
}

/* 关联仿真 */
.theory-body .t-sims {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 26px 0 0;
  padding-top: 20px;
  border-top: 1px dashed var(--line-2);
}

.theory-body .t-sims-k {
  color: var(--muted-2);
  font-size: 12.5px;
  margin-right: 2px;
}

.theory-body a.t-sim,
.theory-body a.t-sim:visited {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(79, 70, 229, .25);
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12.5px;
  font-weight: 600;
  transition: .16s;
}

.theory-body a.t-sim:hover {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

/* 正文里的交叉引用（指向另一篇文章） */
.theory-body a.t-ref,
.theory-body a.t-ref:visited {
  padding: 0 3px;
  border-bottom: 1.5px solid rgba(8, 145, 178, .4);
  color: var(--brand-2);
  font-weight: 600;
  transition: .16s;
}

.theory-body a.t-ref:hover {
  background: var(--brand-soft-2);
  border-bottom-color: var(--brand-2);
}

/* 上一篇 / 下一篇 */
.theory-nav {
  max-width: 860px;
  margin: 0 auto 30px;
  padding: 0 28px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.theory-nav-a {
  display: block;
  padding: 14px 18px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--sh-1);
  transition: .16s;
}

.theory-nav-a:hover {
  border-color: rgba(79, 70, 229, .35);
  box-shadow: var(--sh-2);
}

.theory-nav-a:last-child {
  text-align: right;
}

.theory-nav-k {
  display: block;
  margin-bottom: 4px;
  color: var(--muted-2);
  font-size: 12px;
}

.theory-nav-t {
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 600;
}

.theory-nav-a:hover .theory-nav-t {
  color: var(--brand);
}

/* ---------------- 首页入口条 ---------------- */
.theory-strip {
  max-width: var(--maxw);
  margin: 8px auto 44px;
  padding: 26px 32px 28px;
  border-radius: var(--r-xl);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--sh-2);
}

.theory-strip-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.theory-strip-t {
  font-size: 20px;
  margin-bottom: 6px;
}

.theory-strip-t::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 17px;
  margin-right: 10px;
  border-radius: 2px;
  background: var(--grad);
  vertical-align: -2px;
}

.theory-strip-s {
  max-width: 620px;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.75;
}

.theory-strip-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.theory-mini {
  display: block;
  padding: 15px 17px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface-2);
  transition: .16s;
}

.theory-mini:hover {
  transform: translateY(-2px);
  border-color: rgba(79, 70, 229, .35);
  background: var(--surface);
  box-shadow: var(--sh-2);
}

.theory-mini-t {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 650;
}

.theory-mini:hover .theory-mini-t {
  color: var(--brand);
}

.theory-mini-s {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.65;
}

.theory-mini-m {
  display: block;
  color: var(--muted-2);
  font-size: 11.5px;
  font-family: var(--mono);
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 1080px) {
  .theory-strip-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .theory-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .theory-head {
    padding: 22px 18px 6px;
  }

  .theory-h1 {
    font-size: 24px;
  }

  .theory-grid {
    padding: 14px 18px 6px;
  }

  .theory-body {
    margin: 0 12px 20px;
    padding: 24px 20px 26px;
  }

  .theory-body p {
    font-size: 14.5px;
  }

  .theory-body p.formula {
    font-size: 13.5px;
    padding: 12px 14px;
  }

  .theory-body .eq {
    white-space: normal;
  }

  .theory-nav {
    padding: 0 18px;
  }

  .theory-strip {
    margin: 8px 12px 30px;
    padding: 20px 18px 22px;
  }

  .theory-strip-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .theory-strip-row {
    grid-template-columns: 1fr;
  }
}
