/* ===== 毕设选题分享平台 - 前台样式（墨绿 PCB 风格） ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg0: #071310;
  --bg1: #0B1D18;
  --bg2: #0F2A22;
  --bg3: #14382D;
  --line: rgba(140,255,202,.13);
  --line2: rgba(140,255,202,.26);
  --ink: #EAF7F0;
  --ink2: #9DC6B4;
  --ink3: #6E9B89;
  --accent: #59E3A3;
  --accent-dim: rgba(89,227,163,.16);
  --gold: #D9A95F;
  --gold-dim: rgba(217,169,95,.16);
  --c-agri: #7FC96B;
  --c-env: #45C4B0;
  --c-home: #5E9BFF;
  --c-safe: #FF6B5E;
  --c-health: #F27CA6;
  --c-traffic: #FFB14D;
  --c-biz: #C9A16B;
  --c-industry: #8FA6B5;
  --c-other: #B98AE8;
  --r: 18px;
  --shadow: 0 18px 50px rgba(0,0,0,.45);
}
html { scroll-behavior: smooth; }
body {
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(1200px 600px at 85% -10%, rgba(89,227,163,.07), transparent 60%),
    radial-gradient(900px 500px at -10% 20%, rgba(217,169,95,.06), transparent 55%),
    var(--bg0);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }
.num { font-family: "Space Grotesk", Consolas, monospace; }
.view { display: none; }
.view.active { display: block; animation: viewIn .35s ease; }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.container.narrow { max-width: 900px; }

/* ===== Hero ===== */
.hero { position: relative; padding: 64px 0 30px; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; pointer-events: none; opacity: .5; }
.hero-bg svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.trace-line { stroke-dasharray: 6 10; animation: dash 14s linear infinite; }
@keyframes dash { to { stroke-dashoffset: -320; } }
.kicker {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 13px; letter-spacing: .32em; color: var(--accent);
  text-transform: uppercase; margin-bottom: 18px; font-family: "Space Grotesk", sans-serif;
}
.kicker::before { content: ""; width: 34px; height: 1px; background: linear-gradient(90deg, transparent, var(--accent)); }
h1.title {
  font-size: clamp(34px, 5.4vw, 62px); font-weight: 900;
  letter-spacing: .02em; line-height: 1.12; margin-bottom: 14px;
}
h1.title .gold { color: var(--gold); }
.sub { color: var(--ink2); font-size: clamp(14px, 1.6vw, 17px); max-width: 640px; margin-bottom: 30px; }
.stats { display: flex; gap: 14px; flex-wrap: wrap; }
.stat {
  background: var(--bg1); border: 1px solid var(--line); border-radius: 14px;
  padding: 13px 24px; display: flex; align-items: baseline; gap: 9px;
  transition: border-color .25s, transform .25s;
}
.stat:hover { border-color: var(--line2); transform: translateY(-2px); }
.stat b { font-size: 25px; color: var(--accent); }
.stat span { font-size: 13px; color: var(--ink2); }

/* ===== 工具栏 ===== */
.toolbar { margin: 26px 0 22px; }
.search {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg1); border: 1px solid var(--line);
  border-radius: 999px; padding: 11px 19px; margin-bottom: 16px;
  color: var(--ink3); transition: border-color .25s, box-shadow .25s;
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-dim); color: var(--accent); }
.search input { flex: 1; background: transparent; border: none; outline: none; color: var(--ink); font-size: 15px; }
.search input::placeholder { color: var(--ink3); }
.chips { display: flex; gap: 9px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); background: var(--bg1); color: var(--ink2);
  border-radius: 999px; padding: 9px 16px; font-size: 13.5px;
  transition: all .22s;
}
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.chip:hover { border-color: var(--line2); color: var(--ink); transform: translateY(-2px); }
.chip.active { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); font-weight: 500; }
.chip b { font-family: "Space Grotesk", sans-serif; font-weight: 600; opacity: .8; }

/* ===== 排序切换 ===== */
.sortbar { display: flex; align-items: center; gap: 8px; justify-content: flex-end; margin: 14px 0 10px; }
.sort-label { font-size: 12px; color: var(--ink3); letter-spacing: .08em; margin-right: 2px; }
.sort-btn {
  font-size: 13px; color: var(--ink2); background: var(--bg1);
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 16px;
  cursor: pointer; transition: all .22s; display: inline-flex; align-items: center; gap: 6px;
}
.sort-btn:hover { border-color: var(--accent); color: var(--accent); }
.sort-btn.active {
  background: var(--accent-dim); border-color: var(--accent); color: var(--accent); font-weight: 500;
  box-shadow: 0 0 14px rgba(89,227,163,.18);
}
.sort-btn svg { opacity: .85; }

/* ===== 卡片网格 ===== */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); gap: 18px; }
.card {
  position: relative; background: linear-gradient(165deg, var(--bg2), var(--bg1));
  border: 1px solid var(--line); border-radius: var(--r);
  padding: 22px 20px 18px; overflow: hidden;
  transition: transform .28s cubic-bezier(.2,.7,.2,1), border-color .28s, box-shadow .28s;
  cursor: pointer; opacity: 0; transform: translateY(24px);
}
.card.reveal { opacity: 1; transform: none; }
.card:hover { transform: translateY(-6px); border-color: var(--cat, var(--accent)); box-shadow: var(--shadow); }
/* 焊盘 + 走线：PCB 签名元素 */
.pads { position: absolute; inset: 0; pointer-events: none; opacity: .75; }
.pads .pad {
  position: absolute; width: 9px; height: 9px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--gold), #6b4f1f 70%);
  box-shadow: 0 0 0 1.5px rgba(217,169,95,.35), 0 0 10px rgba(217,169,95,.25);
}
.pads .p1 { top: 10px; left: 10px; } .pads .p2 { top: 10px; right: 10px; }
.pads .p3 { bottom: 10px; left: 10px; } .pads .p4 { bottom: 10px; right: 10px; }
.pads .route {
  position: absolute; height: 1px; background: linear-gradient(90deg, rgba(217,169,95,.55), transparent);
  transform-origin: left center; transition: all .4s;
}
.pads .r1 { top: 14px; left: 19px; width: 44px; transform: rotate(18deg); }
.pads .r2 { top: 14px; right: 19px; width: 44px; transform: rotate(-18deg); }
.pads .r3 { bottom: 14px; left: 19px; width: 44px; transform: rotate(-18deg); }
.pads .r4 { bottom: 14px; right: 19px; width: 44px; transform: rotate(18deg); }
.card:hover .pads .route { background: linear-gradient(90deg, var(--accent), transparent); width: 58px; }
.card-id {
  position: absolute; top: 14px; right: 16px; font-size: 38px; font-weight: 700;
  color: transparent; -webkit-text-stroke: 1px var(--cat, var(--accent));
  opacity: .9; line-height: 1;
}
.card-tag {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px;
  color: var(--cat, var(--accent)); border: 1px solid var(--cat, var(--accent));
  border-radius: 999px; padding: 3px 10px; background: color-mix(in srgb, var(--cat, var(--accent)) 10%, transparent);
}
.card-tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 6px currentColor; }
.card-name {
  font-size: 17px; font-weight: 700; line-height: 1.45; margin: 12px 0 9px;
  padding-right: 26px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 49px;
}
.card-fn { font-size: 13px; color: var(--ink2); line-height: 1.65; min-height: 21px;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.card-comps { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; min-height: 24px; }
.mini-chip {
  font-size: 11px; color: var(--ink3);
  border: 1px solid rgba(140,255,202,.16); border-radius: 8px; padding: 2px 8px;
}
.card-foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 14px; padding-top: 13px; border-top: 1px solid rgba(140,255,202,.09);
}
.card-foot .no { font-size: 12px; color: var(--ink3); }
.card-foot .go {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--accent); font-weight: 500;
  transition: gap .2s;
}
.card:hover .go { gap: 10px; }
.empty { text-align: center; color: var(--ink3); padding: 70px 0; font-size: 14px; }
.empty b { display: block; font-size: 17px; color: var(--ink2); margin-bottom: 6px; }

/* ===== 卡片主图 + 无限滚动 ===== */
.card-img {
  position: relative; margin: -22px -20px 14px; border-radius: 14px 14px 0 0; overflow: hidden;
  background: rgba(140,255,202,.05);
}
.card-img img { display: block; width: 100%; height: 150px; object-fit: cover; }
.card:not(.reveal) .card-img img { opacity: 0; }
.card.reveal .card-img img { animation: imgIn .8s ease both; }
@keyframes imgIn { from { opacity: 0; transform: scale(1.04); } to { opacity: 1; transform: scale(1); } }
/* 有主图的卡片：大编号移到图片下方，避免重叠 */
.card:has(.card-img) .card-id { top: 168px; }
.sentinel {
  text-align: center; padding: 26px 0 6px; font-size: 13px; color: var(--ink3);
  letter-spacing: .12em;
}
.sentinel::before {
  content: ''; display: inline-block; width: 10px; height: 10px; margin-right: 8px;
  border-radius: 50%; border: 2px solid rgba(140,255,202,.25); border-top-color: var(--accent);
  animation: spin 1s linear infinite; vertical-align: -1px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 详情视图 ===== */
.detail-top { display: flex; align-items: center; gap: 14px; margin: 26px 0 22px; }
.back {
  display: inline-flex; align-items: center; gap: 8px; background: var(--bg1);
  border: 1px solid var(--line); border-radius: 999px; padding: 9px 18px;
  font-size: 14px; color: var(--ink2); transition: all .22s;
}
.back:hover { color: var(--accent); border-color: var(--accent); transform: translateX(-3px); }
.detail { animation: viewIn .35s ease; }
.detail-hero {
  width: 100%; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--bg1); overflow: hidden; margin-bottom: 24px;
}
.detail-hero img { width: 100%; display: block; max-height: 480px; object-fit: contain; background: var(--bg1); }
.detail-hero .ph {
  height: 280px; display: flex; align-items: center; justify-content: center;
  color: var(--ink3); letter-spacing: 4px; font-size: 14px;
}

/* ===== 图片左右滑动轮播 + 水印 ===== */
.carousel { position: relative; width: 100%; margin-bottom: 24px; user-select: none; }
.carousel-track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch; scrollbar-width: none; cursor: grab;
}
.carousel-track.dragging { scroll-snap-type: none; cursor: grabbing; }
.carousel-track::-webkit-scrollbar { display: none; }
.carousel-slide {
  flex: 0 0 100%; scroll-snap-align: center; position: relative;
  border: 1px solid var(--line); border-radius: var(--r);
  background: var(--bg1); overflow: hidden; cursor: grab;
}
.carousel-slide:active { cursor: grabbing; }
.carousel-slide img { width: 100%; display: block; max-height: 480px; object-fit: contain; background: var(--bg1); }
.carousel-slide .img-name {
  position: absolute; top: 0; left: 0; right: 0; z-index: 3;
  padding: 10px 14px 26px; font-size: 14px; font-weight: 600; color: #eafff6;
  background: linear-gradient(180deg, rgba(0,0,0,.82), rgba(0,0,0,.45) 60%, rgba(0,0,0,0));
  text-align: left; letter-spacing: .5px; pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.carousel-slide .ph {
  height: 280px; display: flex; align-items: center; justify-content: center;
  color: var(--ink3); letter-spacing: 4px; font-size: 14px;
}
/* 水印 */
/*.carousel-slide .wm {*/
/*  position: absolute; inset: 0; pointer-events: none; z-index: 2;*/
/*  display: flex; align-items: flex-start; justify-content: center;*/
/*  padding-top: 12%;*/
/*}*/
/*.carousel-slide .wm::before {*/
/*  content: 'HG电子设计毕设分享';*/
/*  color: #FF3B30; font-size: clamp(24px, 5vw, 40px); font-weight: 900;*/
/*  font-family: '楷体', KaiTi, STKaiti, '华文楷体', serif;*/
/*  letter-spacing: 10px; white-space: nowrap; transform: none;*/
/*  text-shadow: 0 0 3px rgba(255,255,255,.92), 0 0 12px rgba(255,59,48,.5), 0 3px 10px rgba(0,0,0,.6);*/
/*}*/
/* 轮播箭头 */
.car-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
  width: 42px; height: 42px; border-radius: 50%; cursor: pointer;
  background: rgba(7,19,16,.55); color: var(--accent); font-size: 20px; line-height: 1;
  border: 1px solid var(--line2); display: flex; align-items: center; justify-content: center;
  transition: all .2s; backdrop-filter: blur(4px);
}
.car-arrow:hover { background: var(--accent); color: #071310; box-shadow: 0 0 16px rgba(89,227,163,.4); }
.car-arrow.prev { left: 12px; }
.car-arrow.next { right: 12px; }
.car-dots { display: flex; gap: 8px; justify-content: center; margin-top: 10px; }
.car-dots i {
  width: 8px; height: 8px; border-radius: 50%; background: var(--line2);
  cursor: pointer; transition: all .25s;
}
.car-dots i.on { background: var(--accent); box-shadow: 0 0 8px rgba(89,227,163,.6); width: 22px; border-radius: 999px; }
.detail-head { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 22px; }
.detail-id {
  font-size: 15px; font-weight: 700; color: var(--accent);
  border: 1px solid var(--accent); background: var(--accent-dim);
  border-radius: 10px; padding: 5px 13px; white-space: nowrap;
}
.detail-cat {
  font-size: 14px; font-weight: 600; border-radius: 999px; padding: 5px 14px; white-space: nowrap;
  color: var(--cat, var(--accent)); border: 1px solid var(--cat, var(--accent));
  background: color-mix(in srgb, var(--cat, var(--accent)) 12%, transparent);
}
h2.detail-name { font-size: clamp(22px, 3vw, 32px); font-weight: 900; line-height: 1.3; width: 100%; }
.detail-views { margin-left: auto; font-size: 12px; color: var(--ink3); align-self: center; }
.sec-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 16px; font-weight: 700; color: var(--ink);
  margin: 26px 0 13px; letter-spacing: 1px;
}
.sec-title::before { content: ""; width: 4px; height: 17px; background: var(--accent); border-radius: 2px; box-shadow: 0 0 9px rgba(89,227,163,.8); }
.func-list { list-style: none; }
.func-list li {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--bg1); border: 1px solid var(--line);
  border-radius: 13px; padding: 12px 16px; margin-bottom: 9px;
  font-size: 14.5px; line-height: 1.7;
  transition: border-color .2s, transform .2s;
}
.func-list li:hover { border-color: var(--cat, var(--accent)); transform: translateX(3px); }
.func-list .idx { font-weight: 700; color: var(--cat, var(--accent)); flex-shrink: 0; font-style: normal; }
.comp-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.comp-tag {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--bg1); border: 1px solid var(--line2);
  border-radius: 999px; padding: 8px 15px; font-size: 13.5px; color: var(--ink);
  transition: border-color .2s, transform .2s;
}
.comp-tag:hover { border-color: var(--accent); transform: translateY(-2px); }
.comp-tag .idx { color: var(--accent); font-weight: 700; }
.detail-actions { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.btn {
  flex: 1; min-width: 150px; padding: 13px 20px;
  border-radius: 12px; font-size: 14.5px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line2); background: var(--bg1); color: var(--ink);
  transition: all .22s; letter-spacing: 1px;
}
.btn:hover { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 4px var(--accent-dim); transform: translateY(-2px); }
.btn.wx { border-color: rgba(89,227,163,.45); background: linear-gradient(135deg, rgba(89,227,163,.18), rgba(89,227,163,.05)); color: var(--accent); }
.btn.wx:hover { box-shadow: 0 0 0 4px rgba(89,227,163,.14), 0 0 24px rgba(89,227,163,.25); }
.btn.copy { border-color: rgba(217,169,95,.5); background: linear-gradient(135deg, rgba(217,169,95,.16), rgba(217,169,95,.04)); color: #D9A95F; }
.btn.copy:hover { border-color: #D9A95F; color: #E9C07A; box-shadow: 0 0 0 4px rgba(217,169,95,.15), 0 0 24px rgba(217,169,95,.22); }
.btn.copy.copied { border-color: var(--accent); color: var(--accent); }
.btn.dim { opacity: .5; cursor: default; }
.btn.dim:hover { border-color: var(--line2); color: var(--ink); box-shadow: none; transform: none; }

/* ===== 加微信弹窗 ===== */
.modal-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(4, 10, 8, .78); backdrop-filter: blur(5px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--bg2); border: 1px solid var(--line2);
  border-radius: 16px; position: relative;
  animation: popIn .28s cubic-bezier(.2,.9,.3,1.2);
}
.wx-modal { max-width: 380px; width: 100%; text-align: center; padding: 34px 30px 28px; }
.wx-modal h3 { font-size: 18px; margin-bottom: 18px; letter-spacing: 2px; color: var(--ink); }
.modal-close {
  position: absolute; top: 12px; right: 14px;
  background: rgba(255,255,255,.06); border: 1px solid var(--line);
  color: var(--ink2); width: 34px; height: 34px; border-radius: 50%;
  font-size: 15px; transition: all .2s;
}
.modal-close:hover { background: rgba(255,107,94,.2); border-color: #FF6B5E; color: #FF6B5E; }
.wx-qr {
  width: 200px; height: 200px; margin: 0 auto 16px;
  border: 1px dashed var(--line2); border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink3); font-size: 13px; overflow: hidden; background: var(--bg1);
}
.wx-qr img { width: 100%; height: 100%; object-fit: contain; }
.wx-hint { font-size: 14px; margin-bottom: 16px; color: var(--ink2); }
.wx-hint b { color: var(--accent); font-size: 17px; letter-spacing: 1px; }
.btn-copy {
  width: 100%; padding: 11px; border-radius: 10px;
  background: linear-gradient(135deg, rgba(89,227,163,.2), rgba(89,227,163,.08));
  border: 1px solid rgba(89,227,163,.5); color: var(--ink); font-size: 14px;
  transition: all .2s;
}
.btn-copy:hover { box-shadow: 0 0 18px rgba(89,227,163,.3); }
.btn-copy.copied { background: rgba(89,227,163,.3); }
.wx-tip { margin-top: 12px; font-size: 12px; color: var(--ink3); }

/* ===== 页脚 ===== */
.foot { text-align: center; padding: 34px 0 40px; color: var(--ink3); font-size: 13px; border-top: 1px solid var(--line); margin-top: 50px; }

/* ===== 滚动条 ===== */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: var(--bg0); }
::-webkit-scrollbar-thumb { background: rgba(89,227,163,.25); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: rgba(89,227,163,.45); }

@media (max-width: 640px) {
  .hero { padding: 42px 0 22px; }
  .stat b { font-size: 20px; }
  .grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .card { padding: 18px 15px 15px; }
  .card-id { font-size: 30px; }
}
