/* ============================================================
 * 像素办公室 · style.css
 * ============================================================ */
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%;
  background: #0a0a12;
  color: #e8e6f0;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  overflow: hidden;
  -webkit-user-select: none; user-select: none;
}

#stage {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse at 50% 40%, #1a1830 0%, #0a0a12 70%);
}

#cv {
  width: min(100vw, calc(100vh * 16 / 9));
  height: min(100vh, calc(100vw * 9 / 16));
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  box-shadow: 0 0 0 3px #2a2740, 0 0 60px rgba(120, 100, 255, .18);
  transition: filter .4s;
}
#cv.boss { filter: sepia(.55) saturate(3.2) hue-rotate(-18deg) brightness(1.12); }

/* 扫描线 */
#stage::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(to bottom, rgba(0,0,0,.16) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
}

/* ---------- 顶栏 ---------- */
#topbar {
  position: absolute; top: 14px; left: 14px; right: 14px;
  display: flex; align-items: center; gap: 8px; z-index: 5;
}
.grow { flex: 1; }
.chip, .tool {
  font-size: 12px; letter-spacing: .04em;
  padding: 6px 10px; border-radius: 2px;
  border: 2px solid #3a3657; background: rgba(20,18,36,.85);
  color: #cfc9e8; cursor: pointer; text-decoration: none;
  display: inline-block; line-height: 1;
}
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; }
.tool:hover { border-color: #6a5fa8; color: #fff; background: rgba(40,34,72,.95); }
.tool.off { opacity: .45; }

/* ---------- 悬停提示 ---------- */
#tip {
  position: absolute; display: none; z-index: 6;
  padding: 5px 8px; font-size: 12px;
  background: rgba(10,8,20,.94); border: 2px solid #4a4470;
  color: #ffe9a3; pointer-events: none; white-space: nowrap;
}

#bottomHint {
  position: absolute; bottom: 10px; left: 0; right: 0; text-align: center;
  font-size: 12px; color: #6d6790; z-index: 5;
}

/* ---------- Toast ---------- */
#toasts { position: absolute; right: 14px; bottom: 44px; display: flex; flex-direction: column; gap: 8px; z-index: 20; align-items: flex-end; }
.toast {
  background: rgba(18,16,34,.95); border: 2px solid #6a5fa8;
  padding: 8px 12px; font-size: 12px; color: #e6e0ff;
  animation: slideIn .25s ease both; max-width: 300px;
}
.toast.out { animation: slideOut .4s ease both; }
@keyframes slideIn { from { transform: translateX(30px); opacity: 0 } to { transform: none; opacity: 1 } }
@keyframes slideOut { to { transform: translateX(30px); opacity: 0 } }

/* ---------- 面板 ---------- */
#panelMask {
  position: fixed; inset: 0; background: rgba(4,4,12,.66);
  opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 30;
}
#panelMask.show { opacity: 1; pointer-events: auto; }
#panel {
  position: fixed; left: 50%; top: 50%;
  transform: translate(-50%, -46%) scale(.96);
  width: min(680px, 92vw); max-height: 82vh; overflow: auto;
  background: #16142a; border: 3px solid #4a4470;
  box-shadow: 0 24px 60px rgba(0,0,0,.6), 0 0 0 1px #2a2740 inset;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 31;
}
#panel.show { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.p-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; background: #221f3c; border-bottom: 2px solid #3a3657;
  font-size: 13px; letter-spacing: .06em; color: #cfc9e8;
}
#panelClose { background: none; border: 2px solid #4a4470; color: #cfc9e8; width: 24px; height: 22px; cursor: pointer; line-height: 1; }
#panelClose:hover { border-color: #d05f6a; color: #fff; }
#panelBody { padding: 16px 18px 20px; font-size: 13px; line-height: 1.75; }

/* ---------- 整屏应用弹窗（iframe） ---------- */
#panel.app { width: min(960px, 94vw); height: 90vh; max-height: 90vh; overflow: hidden; }
#panel.app #panelBody { padding: 0; height: calc(90vh - 43px); display: flex; flex-direction: column; }
.app-bar {
  display: flex; align-items: center; justify-content: flex-end;
  padding: 8px 12px; background: #1b1930; border-bottom: 2px solid #3a3657;
}
.app-open {
  font-size: 12px; color: #ffe9a3; text-decoration: none;
  border: 2px solid #6a5fa8; padding: 4px 10px; letter-spacing: .03em;
}
.app-open:hover { border-color: #ffe9a3; background: #2a2740; }
.app-frame { flex: 1; width: 100%; border: 0; background: #000; display: block; }

/* ---------- 内容组件 ---------- */
h3 { margin: 0 0 6px; font-size: 17px; color: #fff; }
p { margin: 6px 0; color: #bdb7d8; }
.mut { color: #7d77a0; font-size: 12px; }
.big { font-size: 15px; color: #ffe9a3; line-height: 1.9; }

.about .av {
  width: 64px; height: 64px; display: grid; place-items: center; float: right;
  background: linear-gradient(135deg, #4d6bd8, #c78afc);
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 15px; color: #fff;
  border: 3px solid #2a2740; margin-left: 14px;
}
.keys { margin: 8px 0; padding-left: 18px; }
.keys li { color: #bdb7d8; margin: 4px 0; }
.keys b { color: #ffe9a3; font-family: ui-monospace, Menlo, Consolas, monospace; }

/* 技能条 */
.skills { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; }
.sk { display: grid; grid-template-columns: 1fr 84px 30px; align-items: center; gap: 8px; font-size: 12px; }
.sk-n { color: #cfc9e8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sk-b { height: 8px; background: #2a2740; display: block; }
.sk-b i { display: block; height: 100%; background: linear-gradient(90deg, #4d6bd8, #7ec8ff); }
.sk-l { color: #7d77a0; text-align: right; font-family: ui-monospace, Menlo, Consolas, monospace; }

/* 卡片网格 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.card {
  text-align: left; padding: 10px 12px; cursor: pointer;
  background: #1e1b36; border: 2px solid #3a3657; color: #cfc9e8; font: inherit;
  display: block; width: 100%;
}
.card:hover { border-color: #7ec8ff; transform: translateY(-2px); }
.card b { display: block; font-size: 13px; color: #fff; margin-bottom: 4px; }
.card .yr { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11px; color: #7d77a0; }
.tags { display: block; margin-top: 6px; }
.tags em {
  font-style: normal; font-size: 10px; margin-right: 4px; padding: 2px 5px;
  background: #2a2740; color: #9ad0ff; border: 1px solid #3a3657;
}
.card.lock { opacity: .45; }
.card.got { border-color: #7ef29b; }
.proj ul { padding-left: 18px; }
.proj li { color: #bdb7d8; }
.btn {
  margin-top: 10px; padding: 6px 12px; cursor: pointer;
  background: #2a2740; border: 2px solid #4a4470; color: #cfc9e8; font: inherit; font-size: 12px;
}
.btn:hover { border-color: #7ec8ff; color: #fff; }

/* 时间线 */
.tl { border-left: 2px solid #3a3657; padding-left: 16px; }
.tl-i { position: relative; margin-bottom: 14px; }
.tl-i::before {
  content: ""; position: absolute; left: -22px; top: 6px;
  width: 8px; height: 8px; background: #7ec8ff; border: 2px solid #16142a;
}
.tl-y { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11px; color: #7d77a0; }
.tl-i b { display: block; color: #fff; font-size: 13px; }

/* 联系方式 */
.ct { display: grid; gap: 8px; }
.ct-i { display: grid; grid-template-columns: 70px 1fr; gap: 10px; align-items: center; font-size: 12px; }
.ct-i span { color: #7d77a0; }
.ct-i a { color: #7ec8ff; text-decoration: none; }
.ct-i a:hover { text-decoration: underline; }
.ct-i i { font-style: normal; color: #cfc9e8; }

/* 终端 */
#term { background: #0b0e18; border: 2px solid #3a3657; padding: 10px; font-family: ui-monospace, Menlo, Consolas, monospace; }
#termOut { max-height: 240px; overflow: auto; font-size: 12px; line-height: 1.6; margin-bottom: 8px; }
.t-l { color: #9ef0b4; white-space: pre-wrap; }
.t-l.cmd { color: #7ec8ff; }
.t-l.ok { color: #ffe9a3; }
.t-l.err { color: #ff8a8a; }
.term-in { display: flex; align-items: center; gap: 6px; border-top: 1px solid #2a2740; padding-top: 8px; }
.ps { color: #7ef29b; }
#termIn { flex: 1; background: none; border: none; outline: none; color: #e8e6f0; font: inherit; font-size: 12px; }
.term-tip { margin-top: 8px; font-size: 11px; color: #6a6488; }

/* 白板 */
#wb { width: 100%; height: auto; display: block; border: 2px solid #3a3657; cursor: crosshair; touch-action: none; }
.wb-c { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.wb-c i { width: 20px; height: 20px; display: block; cursor: pointer; border: 2px solid #2a2740; }
.wb-c .btn { margin: 0 0 0 auto; }

/* 望远镜面板 */
.scope p { font-size: 14px; color: #d8d2f0; line-height: 2; }

@media (max-width: 640px) {
  .skills { grid-template-columns: 1fr; }
  #bottomHint { font-size: 10px; }
}
