/* ============================================================
   Odboy 个人主页 - 公共样式
   主题：浅色绿色系 / 零依赖 / 纯静态
   ============================================================ */

:root {
  --bg: #f3f9f5;
  --bg-2: #eaf4ee;
  --bg-card: #ffffff;
  --border: #d8e7dd;
  --text: #1e3328;
  --text-dim: #57705f;
  --text-faint: #86a091;
  --accent: #2ba471;
  --accent-2: #1e8f5e;
  --accent-3: #1d7a52;
  --accent-glow: rgba(43, 164, 113, 0.1);
  --danger: #e05252;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SF Mono", "JetBrains Mono", Consolas, "Courier New", monospace;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 背景装饰网格 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(43, 164, 113, 0.07), transparent 60%),
    radial-gradient(700px 420px at -10% 20%, rgba(43, 164, 113, 0.05), transparent 60%),
    linear-gradient(rgba(43, 164, 113, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(43, 164, 113, 0.06) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 42px 42px, 42px 42px;
}

a {
  color: var(--accent-3);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: var(--accent);
}

/* ============ 顶部导航 ============ */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(243, 249, 245, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

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

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text);
}

.nav-brand .brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #06281c;
  font-size: 15px;
  font-weight: 800;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
}

.nav-links a {
  display: block;
  padding: 8px 16px;
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 15px;
  transition: color 0.2s, background 0.2s;
}

.nav-links a:hover {
  color: var(--text);
  background: rgba(43, 164, 113, 0.1);
}

.nav-links a.active {
  color: var(--accent);
  background: var(--accent-glow);
  font-weight: 600;
}

/* 移动端菜单按钮 */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 40px;
  height: 40px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.nav-toggle svg {
  stroke: var(--text-dim);
}

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

  .nav-links {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    background: rgba(243, 249, 245, 0.97);
    border-bottom: 1px solid var(--border);
    padding: 12px 20px 16px;
    display: none;
  }

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

  .nav-links a {
    padding: 12px 16px;
  }
}

/* ============ 主容器 ============ */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

main {
  flex: 1;
}

/* ============ Hero 区 ============ */
.hero {
  padding: 90px 0 56px;
  text-align: center;
}

.hero .badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid rgba(43, 164, 113, 0.35);
  background: var(--accent-glow);
  color: var(--accent-3);
  font-size: 13.5px;
  letter-spacing: 0.3px;
}

.hero .badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.hero h1 {
  margin: 24px 0 14px;
  font-size: clamp(34px, 6vw, 54px);
  font-weight: 800;
  letter-spacing: 1px;
}

.hero h1 .grad {
  background: linear-gradient(90deg, var(--accent-3), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero .subtitle {
  max-width: 640px;
  margin: 0 auto 30px;
  color: var(--text-dim);
  font-size: 17px;
}

.hero .terminal {
  max-width: 100%;
  margin: 0 auto;
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.terminal .term-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.03);
  border-bottom: 1px solid var(--border);
}

.terminal .term-bar .t-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.terminal .term-bar .t-dot:nth-child(1) { background: #f87171; }
.terminal .term-bar .t-dot:nth-child(2) { background: #fbbf24; }
.terminal .term-bar .t-dot:nth-child(3) { background: #2ba471; }

.terminal .term-bar .t-title {
  margin-left: 8px;
  font-size: 12.5px;
  color: var(--text-faint);
  font-family: var(--mono);
}

.terminal pre {
  padding: 18px 20px;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.9;
  color: var(--text-dim);
  overflow-x: auto;
}

.terminal .tok-green { color: var(--accent-3); }
.terminal .tok-dim { color: var(--text-faint); }
.terminal .tok-white { color: var(--text); }

/* ============ 区块标题 ============ */
.section {
  padding: 56px 0 72px;
}

.section-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 34px;
}

.section-head .sec-no {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--accent);
  border: 1px solid rgba(43, 164, 113, 0.35);
  border-radius: 8px;
  padding: 4px 10px;
  background: var(--accent-glow);
}

.section-head h2 {
  font-size: 26px;
  font-weight: 700;
}

.section-head .sec-desc {
  color: var(--text-faint);
  font-size: 14px;
}

/* ============ 作品卡片 ============ */
/* Hero 终端窗口、作品展示区、软件推荐区占满页面全宽，不受容器宽度限制 */
.hero .container,
#works .container,
#software .container {
  max-width: none;
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}

/* 宽屏下排 3 列：主推卡独占整行，6 张普通卡正好 2 行排满 */
@media (min-width: 1080px) {
  .works-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.work-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 26px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.work-card:hover {
  transform: translateY(-4px);
  border-color: rgba(43, 164, 113, 0.4);
  box-shadow: 0 14px 34px rgba(31, 51, 40, 0.12), 0 0 0 1px rgba(43, 164, 113, 0.1);
}

.work-card.featured {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  gap: 28px;
  background:
    linear-gradient(120deg, rgba(43, 164, 113, 0.08), transparent 55%),
    var(--bg-card);
}

.work-card.featured .card-main { flex: 1; }

.card-icon {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--accent-glow);
  border: 1px solid rgba(43, 164, 113, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.card-icon svg {
  width: 28px;
  height: 28px;
}

.work-card.featured .card-icon {
  width: 72px;
  height: 72px;
}

.work-card.featured .card-icon svg {
  width: 36px;
  height: 36px;
}

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

.card-title {
  font-size: 18.5px;
  font-weight: 700;
  font-family: var(--mono);
  word-break: break-all;
}

.card-badge {
  flex-shrink: 0;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(43, 164, 113, 0.4);
  color: var(--accent-3);
  background: var(--accent-glow);
  white-space: nowrap;
}

.card-desc {
  color: var(--text-dim);
  font-size: 14.5px;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* 软件推荐卡片：简介固定 3 行高度（卡片等高），hover 显示 tooltip 完整简介 */
.software-card {
  position: relative;
}

.software-card .card-desc {
  height: 74px;
  overflow: hidden;
}

/* tooltip 气泡：显示在卡片右侧，带小三角箭头 */
.software-card::after {
  content: attr(data-desc);
  display: none;
  position: absolute;
  left: calc(100% + 14px);
  top: 20px;
  z-index: 100;
  width: 300px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-dim);
  box-shadow: 0 10px 26px rgba(31, 51, 40, 0.12);
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
}

/* 小三角箭头（指向左侧卡片） */
.software-card::before {
  content: "";
  display: none;
  position: absolute;
  left: calc(100% + 9px);
  top: 26px;
  z-index: 101;
  width: 10px;
  height: 10px;
  background: var(--bg-2);
  border-left: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transform: rotate(45deg);
}

.software-card:hover::after,
.software-card:hover::before {
  display: block;
}

.card-features {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  color: var(--text-faint);
  font-size: 13px;
}

.card-features li::before {
  content: "›";
  color: var(--accent);
  margin-right: 6px;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 4px;
}

.tag {
  font-size: 12px;
  font-family: var(--mono);
  padding: 3px 10px;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid var(--border);
  color: var(--text-dim);
}

.card-foot {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 2px;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  color: var(--accent-3);
}

.card-link svg {
  width: 15px;
  height: 15px;
}

.card-link:hover { color: var(--accent); }

.card-license {
  font-size: 12px;
  color: var(--text-faint);
  font-family: var(--mono);
}

@media (max-width: 900px) {
  .works-grid { grid-template-columns: 1fr; }
  .work-card.featured { flex-direction: column; align-items: flex-start; }
}

/* ============ 预留页面 ============ */
.page-hero {
  padding: 72px 0 40px;
  text-align: center;
}

.page-hero h1 {
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 800;
}

.page-hero .crumbs {
  font-size: 13px;
  color: var(--text-faint);
  margin-bottom: 10px;
}

.page-hero .crumbs a { color: var(--text-faint); }
.page-hero .crumbs a:hover { color: var(--accent-3); }

.page-hero p {
  margin-top: 10px;
  color: var(--text-dim);
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
}

.placeholder-card {
  background: var(--bg-card);
  border: 1px dashed rgba(43, 164, 113, 0.35);
  border-radius: var(--radius);
  padding: 64px 30px;
  text-align: center;
  margin-bottom: 72px;
}

.placeholder-card .ph-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  border-radius: 18px;
  background: var(--accent-glow);
  border: 1px solid rgba(43, 164, 113, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.placeholder-card .ph-icon svg { width: 30px; height: 30px; }

.placeholder-card h3 {
  font-size: 19px;
  margin-bottom: 8px;
}

.placeholder-card p {
  color: var(--text-dim);
  font-size: 14.5px;
  max-width: 460px;
  margin: 0 auto;
}

.placeholder-card .ph-badge {
  display: inline-block;
  margin-top: 18px;
  font-size: 12.5px;
  color: var(--accent-3);
  border: 1px solid rgba(43, 164, 113, 0.4);
  background: var(--accent-glow);
  padding: 4px 14px;
  border-radius: 999px;
}

/* ============ 页脚 ============ */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 26px 0;
  text-align: center;
  color: var(--text-faint);
  font-size: 13.5px;
}

.site-footer .heart { color: var(--accent); }

.site-footer .footer-name {
  color: var(--text);
  font-weight: 700;
}

.site-footer .footer-beian {
  margin-top: 10px;
  font-size: 12.5px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.site-footer .footer-beian a {
  color: var(--text-faint);
}

.site-footer .footer-beian a:hover {
  color: var(--accent-3);
}

/* ============ 软件推荐列表 ============ */
.software-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
  margin-bottom: 72px;
}

/* 屏幕变窄时逐级降列，避免卡片过窄 */
@media (max-width: 1300px) {
  .software-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 900px) {
  .software-grid { grid-template-columns: repeat(2, 1fr); }
}

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

.software-state {
  padding: 60px 24px;
  text-align: center;
  color: var(--text-faint);
  font-size: 14.5px;
}

.software-note {
  text-align: center;
  margin: -8px 0 24px;
  font-size: 12.5px;
  color: var(--text-faint);
}

/* ============ 关于我 ============ */
.about-wrap {
  max-width: 860px;
  /* 页首标题居中，内容区同样居中保持对齐 */
  margin: 0 auto 72px;
}

.about-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 30px;
  margin-bottom: 22px;
}

.about-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.about-head .sec-no {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  border: 1px solid rgba(43, 164, 113, 0.35);
  border-radius: 8px;
  padding: 3px 9px;
  background: var(--accent-glow);
}

.about-head h2 {
  font-size: 19px;
  font-weight: 700;
}

.about-block p {
  color: var(--text-dim);
  font-size: 14.5px;
  line-height: 1.9;
  margin-bottom: 10px;
}

.about-block p:last-child {
  margin-bottom: 0;
}

.about-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
  color: var(--text-dim);
  font-size: 14.5px;
  line-height: 1.8;
}

.about-list li {
  padding-left: 18px;
  position: relative;
}

.about-list li::before {
  content: "›";
  position: absolute;
  left: 0;
  color: var(--accent);
}

.about-list .sub {
  margin-top: 2px;
  padding-left: 18px;
  color: var(--text-faint);
  font-size: 13.5px;
  position: relative;
}

.about-list .sub::before {
  content: "·";
  position: absolute;
  left: 4px;
  color: var(--accent);
}

.about-quote {
  border-left: 3px solid var(--accent);
  background: var(--accent-glow);
  border-radius: 0 10px 10px 0;
  padding: 16px 20px;
  color: var(--text-dim);
  font-size: 14.5px;
  line-height: 1.9;
}

.about-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.about-block .tag {
  font-size: 12.5px;
}

/* ============ 二维码 ============ */
.qr-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  max-width: 900px;
  margin: 0 auto;
}

.qr-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.qr-card:hover {
  transform: translateY(-4px);
  border-color: rgba(43, 164, 113, 0.45);
}

.qr-img {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 10px;
  padding: 10px;
  overflow: hidden;
}

.qr-img img {
  height: 200px;
  width: auto;
  max-width: 100%;
  display: block;
  border-radius: 6px;
}

.qr-label {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.qr-hint {
  font-size: 13px;
  color: var(--text-faint);
}

.qr-more {
  text-align: center;
  margin-top: 26px;
}

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

/* ============ 联系方式 ============ */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 72px;
}

.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.contact-card:hover {
  transform: translateY(-4px);
  border-color: rgba(43, 164, 113, 0.45);
}

.contact-card .cc-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--accent-glow);
  border: 1px solid rgba(43, 164, 113, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.contact-card .cc-icon svg { width: 24px; height: 24px; }

.contact-card .cc-label {
  font-size: 13px;
  color: var(--text-faint);
}

.contact-card .cc-value {
  font-size: 16.5px;
  font-weight: 600;
  font-family: var(--mono);
  color: var(--text);
  word-break: break-all;
}

.contact-card .cc-hint {
  font-size: 12px;
  color: var(--text-faint);
}

.contact-card .cc-copied {
  display: none;
  font-size: 12px;
  color: var(--accent);
}

.contact-card.copied .cc-hint { display: none; }
.contact-card.copied .cc-copied { display: block; }

/* ============ 入场动画 ============ */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}
