/* SeqKan 质粒工具 · 独立版本页
   参考小米社区：左内容卡片流 + 右功能模块，浅灰底 + 白色卡片 */

:root {
  --bg: #f5f5f5;
  --card: #ffffff;
  --ink: #1a1a1a;
  --ink-2: #4a4a4a;
  --sub: #8a8a8a;
  --line: #f0f0f0;
  --blue: #1554c1;
  --blue-d: #0f46a5;
  --blue-soft: #eef4ff;
  --orange: #ff6700;
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.6 "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* ============ 顶部栏 ============ */
.site-head {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}

.head-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.brand img { border-radius: 7px; }
.brand-name { font-size: 16.5px; font-weight: 700; letter-spacing: .4px; }
.brand-sub {
  font-size: 11.5px;
  color: var(--sub);
  padding-left: 9px;
  border-left: 1px solid #e2e2e2;
  line-height: 1.2;
}

.head-nav { display: flex; align-items: center; gap: 20px; font-size: 13.5px; color: var(--ink-2); }
.head-nav a { transition: color .15s; }
.head-nav a:hover { color: var(--blue); }

/* ============ 页面骨架 ============ */
.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px 16px 40px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  grid-template-rows: auto auto;
  grid-template-areas:
    "hero side"
    "feed .";
  gap: 18px;
  align-items: start;
}

.hero { grid-area: hero; }
.col-main { grid-area: feed; min-width: 0; }

/* 右列整体高度锁定在轮播图所在行：与轮播图上下水平 */
.col-side {
  grid-area: side;
  align-self: stretch;
  position: relative;
  min-height: 0;
}
.side-stack {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.side-news {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.side-more { flex: none; }

/* ============ 主推广轮播 ============ */
.hero {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: #eef4fb;
  aspect-ratio: 1370 / 720;
}

.hero-viewport { position: absolute; inset: 0; overflow: hidden; }

.hero-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform .5s cubic-bezier(.4, .1, .2, 1);
}

.hero-slide {
  flex: 0 0 100%;
  display: block;
  height: 100%;
  line-height: 0;
}

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

.hero-dots {
  position: absolute;
  left: 18px;
  bottom: 14px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.hero-dots button {
  width: 7px;
  height: 7px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(22, 35, 58, .26);
  cursor: pointer;
  transition: width .2s, background .2s;
}

.hero-dots button.is-on {
  width: 20px;
  background: var(--blue);
}

/* ============ 左侧版本卡片流（小米社区帖子样式） ============ */
#releases { scroll-margin-top: 72px; }

.feed-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 4px 2px 10px;
}
.feed-head h2 { margin: 0; font-size: 17px; font-weight: 600; }
.feed-meta { font-size: 12.5px; color: var(--sub); }

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

.rel-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px 20px 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .025);
  transition: box-shadow .18s;
  scroll-margin-top: 72px;
}
.rel-card:hover { box-shadow: 0 4px 16px rgba(0, 0, 0, .055); }

.rel-card.is-focus {
  animation: cardFocus 1.4s ease;
}

@keyframes cardFocus {
  0% { box-shadow: 0 0 0 3px rgba(21, 84, 193, .28); }
  100% { box-shadow: 0 0 0 3px rgba(21, 84, 193, 0); }
}

.post-head {
  display: flex;
  align-items: center;
  gap: 9px;
}
.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex: none;
}
.who { display: flex; align-items: center; gap: 6px; min-width: 0; }
.who .name { font-size: 13.5px; font-weight: 600; color: #2b2b2b; }
.who .badge {
  font-size: 10px;
  line-height: 1;
  color: var(--blue);
  background: var(--blue-soft);
  border-radius: 3px;
  padding: 2px 5px;
}
.post-date { margin-left: auto; font-size: 12.5px; color: var(--sub); white-space: nowrap; }

.post-title {
  margin: 13px 0 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .2px;
}
.rel-badge {
  font-size: 11px;
  font-weight: 500;
  color: var(--blue);
  background: var(--blue-soft);
  border-radius: 4px;
  padding: 1px 7px;
  letter-spacing: 0;
}

.rel-note {
  margin: 7px 0 0;
  font-size: 14px;
  line-height: 1.72;
  color: var(--ink-2);
}

.rel-foot {
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.rel-dl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.dl-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 15px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  transition: background .15s, color .15s;
}
.dl-btn svg { flex: none; }
.dl-win { background: var(--blue); color: #fff; }
.dl-win:hover { background: var(--blue-d); }
.dl-mac {
  background: #f5f5f5;
  color: #a3a3a3;
  cursor: not-allowed;
}
.dl-mac.is-disabled { pointer-events: none; }

.like {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: none;
  padding: 6px 4px;
  font: inherit;
  font-size: 13px;
  color: var(--sub);
  cursor: pointer;
  transition: color .15s;
}
.like svg { width: 18px; height: 18px; transition: transform .18s; }
.like em { font-style: normal; font-size: 12.5px; color: var(--sub); min-width: 10px; }
.like:hover { color: var(--orange); }
.like.is-liked { color: var(--orange); }
.like.is-liked svg { fill: var(--orange); stroke: var(--orange); }
.like.is-liked em { color: var(--orange); }
.like.pop svg { transform: scale(1.22); }

.state-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 34px 20px;
  text-align: center;
  color: var(--sub);
  font-size: 13.5px;
}
.state-card a { color: var(--blue); }

/* ============ 右侧模块 ============ */
.side-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px 16px 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .025);
}

.side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
}
.side-head h2 { margin: 0; font-size: 15.5px; font-weight: 600; }
.side-more { font-size: 12.5px; color: var(--sub); transition: color .15s; }
.side-more:hover { color: var(--blue); }

/* 版本速递列表 */
.news-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.side-news .news-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2px 0 4px;
}
.news-list li { margin: 0; min-width: 0; }
.news-list a {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 6px 0;
  font-size: 13.5px;
  color: #3d3d3d;
  line-height: 1.5;
}
.news-list a:hover .news-text { color: var(--blue); }
.news-num {
  flex: none;
  width: 15px;
  font-size: 14px;
  font-weight: 700;
  color: #b9b9b9;
  font-style: italic;
  text-align: left;
}
.news-list li:nth-child(-n+3) .news-num { color: #e04b3c; }
.news-text {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color .15s;
}
.news-empty { color: var(--sub); font-size: 13px; padding: 6px 0; }

/* 更多功能四格 */
.service-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2px;
  padding-top: 2px;
}

.service {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 12px 2px 8px;
  border-radius: 8px;
  font-size: 11.5px;
  color: var(--ink-2);
  text-align: center;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
button.service {
  border: 0;
  background: none;
  font-family: inherit;
  cursor: pointer;
}
.service svg { width: 24px; height: 24px; color: #9aa7bb; transition: color .15s; }
.service:hover { background: #f7f9fc; color: var(--blue); }
.service:hover svg { color: var(--blue); }

/* ============ 页脚 ============ */
.site-foot {
  border-top: 1px solid #ebebeb;
  padding: 24px 16px 34px;
  text-align: center;
  color: #a0a0a0;
  font-size: 12px;
  line-height: 1.9;
}
.site-foot p { margin: 0; }
.foot-links { display: flex; justify-content: center; gap: 16px; margin-top: 4px !important; }
.foot-links a:hover { color: var(--blue); }

/* ============ 反馈弹窗 ============ */
body.fb-open { overflow: hidden; }

.fb-mask {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(17, 24, 39, .42);
  backdrop-filter: blur(2px);
}
.fb-mask[hidden] { display: none; }

.fb-dialog {
  position: relative;
  width: 100%;
  max-width: 460px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 22px 24px 20px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(17, 24, 39, .18);
}

.fb-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #9aa3af;
  font-size: 21px;
  line-height: 1;
  cursor: pointer;
}
.fb-close:hover { background: #f3f5f7; color: #4b5563; }

.fb-title { margin: 0 0 4px; font-size: 18px; color: #222c39; }
.fb-sub { margin: 0 0 16px; font-size: 12.5px; color: #9aa3af; line-height: 1.6; }
.fb-label { display: block; margin: 0 0 6px; font-size: 13px; color: #4b5563; }
.fb-label i { font-style: normal; color: #dc2626; }

.fb-textarea,
.fb-input {
  display: block;
  width: 100%;
  margin-bottom: 14px;
  padding: 9px 11px;
  border: 1px solid #dce0e5;
  border-radius: 7px;
  background: #fff;
  color: #111827;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.6;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.fb-textarea { resize: vertical; min-height: 108px; }
.fb-textarea:focus,
.fb-input:focus {
  border-color: #2f67d9;
  box-shadow: 0 0 0 3px rgba(47, 103, 217, .12);
}

.fb-foot { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.fb-msg { flex: 1; min-width: 0; font-size: 12.5px; color: #9aa3af; }
.fb-msg.is-ok { color: #059669; }
.fb-msg.is-err { color: #d93025; }

.fb-submit {
  flex: none;
  height: 36px;
  padding: 0 20px;
  border: 0;
  border-radius: 7px;
  background: #2f67d9;
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.fb-submit:hover { background: #2557bd; }
.fb-submit:disabled { opacity: .65; cursor: default; }

@media (max-width: 520px) {
  .fb-dialog { padding: 20px 18px 18px; }
  .fb-foot { flex-direction: column-reverse; align-items: stretch; }
  .fb-submit { width: 100%; }
  .fb-msg { text-align: center; }
}

/* ============ 响应式 ============ */
@media (max-width: 900px) {
  .page {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "hero"
      "side"
      "feed";
    gap: 12px;
  }
  .col-side { position: static; }
  .side-stack {
    position: static;
    gap: 12px;
  }
  .side-news { overflow: visible; }
  .side-news .news-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 18px;
    justify-content: initial;
  }
  .service { padding: 10px 2px 6px; }
}

@media (max-width: 520px) {
  .brand-sub { display: none; }
  .head-nav { gap: 14px; }
  .rel-card { padding: 14px 15px 10px; }
  .rel-foot { flex-wrap: wrap; }
  .rel-dl { width: 100%; }
  .dl-btn { flex: 1; justify-content: center; }
  .like { margin-left: auto; }
  .side-news .news-list { grid-template-columns: minmax(0, 1fr); }
  .hero-dots { left: 12px; bottom: 9px; }
}
