/* 金金 OS · 样式。电脑 = 仿桌面系统；宽度 ≤ 740px = 仿手机主屏。 */
:root {
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: "SF Mono", Menlo, Consolas, monospace;
  --glass: rgba(30, 30, 38, .55);
  --glass-light: rgba(255, 255, 255, .78);
  --line: rgba(255, 255, 255, .14);
  --accent: #ffb020;
  --text: #1d1d1f;
  --sub: #6e6e73;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; overflow: hidden; }
body {
  font-family: var(--font);
  color: #fff;
  background:
    radial-gradient(1200px 700px at 15% 10%, #ff8a3d55, transparent 60%),
    radial-gradient(1000px 800px at 85% 90%, #6a5cff66, transparent 60%),
    radial-gradient(900px 600px at 70% 20%, #18c2a455, transparent 60%),
    linear-gradient(160deg, #141826, #241a33 55%, #10202a);
  -webkit-font-smoothing: antialiased;
  user-select: none;
}
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* ---------- 锁屏 ---------- */
.lockscreen {
  position: fixed; inset: 0; z-index: 9000;
  display: flex; flex-direction: column; align-items: center;
  padding-top: 11vh;
  background: inherit;
  backdrop-filter: blur(30px);
  transition: opacity .5s ease, transform .5s ease;
}
.lockscreen.out { opacity: 0; transform: scale(1.06); pointer-events: none; }
.lock-date { font-size: 20px; font-weight: 600; opacity: .85; }
.lock-time { font-size: clamp(72px, 12vw, 128px); font-weight: 700; letter-spacing: -2px; line-height: 1.05; }
.lock-user { margin-top: auto; margin-bottom: 12vh; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.lock-user img { width: 84px; height: 84px; border-radius: 50%; border: 2px solid rgba(255,255,255,.6); background: #333; object-fit: cover; }
.lock-user p { margin: 0; font-size: 18px; font-weight: 700; }
.lock-enter {
  padding: 9px 28px; border-radius: 999px;
  background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.3);
  font-weight: 700; transition: background .2s;
}
.lock-enter:hover { background: rgba(255,255,255,.3); }
.lock-hint { font-size: 12px; opacity: .55; }
body.is-locked .menubar, body.is-locked .dock, body.is-locked .desktop { visibility: hidden; }

/* ---------- 菜单栏 ---------- */
.menubar {
  position: fixed; top: 0; left: 0; right: 0; height: 28px; z-index: 5000;
  display: flex; align-items: center; gap: 18px; padding: 0 14px;
  font-size: 13px; background: rgba(20, 20, 28, .38); backdrop-filter: blur(24px) saturate(1.6);
}
.menubar .logo { color: var(--accent); font-size: 14px; }
.menubar .app-name { font-weight: 700; }
.menubar .menu { opacity: .85; }
.menubar .spacer { flex: 1; }
.menubar .online { padding: 1px 8px; border-radius: 999px; background: rgba(36, 196, 134, .25); font-size: 12px; }
.menubar .online::before { content: "●"; color: #24c486; margin-right: 4px; font-size: 9px; vertical-align: 1px; }

/* ---------- 桌面 ---------- */
.desktop { position: fixed; top: 28px; left: 0; right: 0; bottom: 0; }
.desk-icons { position: absolute; inset: 0; }
.desk-file {
  position: absolute; width: 104px; padding: 6px 4px; border-radius: 8px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  text-decoration: none; cursor: default; outline: none;
}
.desk-file.sel { background: rgba(255,255,255,.16); }
.desk-file.sel .fname { background: #2f6fde; }
.desk-thumb {
  width: 76px; height: 58px; border-radius: 8px; position: relative;
  display: grid; place-items: center; box-shadow: 0 6px 18px rgba(0,0,0,.35);
  font-size: 22px;
}
.desk-thumb .kind {
  position: absolute; right: 4px; bottom: 3px; font-size: 10px; font-weight: 700;
  padding: 1px 5px; border-radius: 4px; background: rgba(0,0,0,.45);
}
.fname {
  font-size: 12px; line-height: 1.3; text-align: center; padding: 1px 5px; border-radius: 4px;
  text-shadow: 0 1px 3px rgba(0,0,0,.7);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.select-box { position: absolute; border: 1px solid rgba(120,170,255,.9); background: rgba(80,140,255,.18); display: none; pointer-events: none; }
.hello {
  position: absolute; right: 40px; bottom: 110px; text-align: right; pointer-events: none;
}
.hello h1 { margin: 0; font-size: clamp(36px, 5vw, 64px); font-weight: 800; letter-spacing: -1px; }
.hello p { margin: 6px 0 0; font-size: 16px; opacity: .8; }

/* ---------- Dock ---------- */
.dock {
  position: fixed; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 5000;
  display: flex; align-items: flex-end; gap: 6px; padding: 6px 8px;
  border-radius: 20px; background: rgba(255,255,255,.16); border: 1px solid var(--line);
  backdrop-filter: blur(24px) saturate(1.6);
}
.dock-item { position: relative; display: flex; flex-direction: column; align-items: center; text-decoration: none; }
.dock-icon {
  width: 52px; height: 52px; border-radius: 13px; display: grid; place-items: center;
  font-size: 28px; transition: transform .18s ease, margin .18s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,.3);
}
.dock-item:hover .dock-icon { transform: translateY(-10px) scale(1.18); margin: 0 6px; }
.dock-item .tip {
  position: absolute; bottom: 74px; white-space: nowrap; font-size: 12px; padding: 3px 9px; border-radius: 6px;
  background: rgba(30,30,38,.85); opacity: 0; pointer-events: none; transition: opacity .15s;
}
.dock-item:hover .tip { opacity: 1; }
.dock-item .dot { width: 4px; height: 4px; border-radius: 50%; margin-top: 3px; background: transparent; }
.dock-item.running .dot { background: rgba(255,255,255,.85); }
.dock-sep { width: 1px; align-self: stretch; margin: 4px 4px; background: rgba(255,255,255,.25); }

/* ---------- 窗口 ---------- */
.win {
  position: absolute; display: flex; flex-direction: column; min-width: 280px; min-height: 160px;
  border-radius: 12px; overflow: hidden; color: var(--text);
  background: var(--glass-light); backdrop-filter: blur(30px) saturate(1.5);
  box-shadow: 0 24px 60px rgba(0,0,0,.45), 0 0 0 1px rgba(0,0,0,.12);
  animation: pop .22s ease;
}
@keyframes pop { from { transform: scale(.94); opacity: 0; } }
.win.closing { animation: shut .16s ease forwards; }
@keyframes shut { to { transform: scale(.94); opacity: 0; } }
.win.min { display: none; }
.win.max { left: 0 !important; top: 0 !important; width: 100% !important; height: calc(100% - 78px) !important; border-radius: 0; }
.titlebar {
  height: 38px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 12px;
  border-bottom: 1px solid rgba(0,0,0,.08); cursor: default;
}
.traffic { display: flex; gap: 8px; }
.traffic span { width: 12px; height: 12px; border-radius: 50%; display: block; cursor: pointer; }
.traffic .c { background: #ff5f57; } .traffic .m { background: #febc2e; } .traffic .x { background: #28c840; }
.titlebar .title { flex: 1; text-align: center; font-size: 13px; font-weight: 600; color: #444; margin-right: 52px; }
.win-body { flex: 1; overflow: auto; user-select: text; }
.resize { position: absolute; right: 0; bottom: 0; width: 16px; height: 16px; cursor: nwse-resize; }

/* 终端 */
.app-term { background: rgba(22, 22, 28, .92); color: #e6e6e6; }
.app-term .titlebar { border-color: rgba(255,255,255,.08); }
.app-term .titlebar .title { color: #aaa; }
.term { font: 13px/1.6 var(--mono); padding: 12px 14px; min-height: 100%; }
.term .hl { color: var(--accent); } .term .ok { color: #28c840; } .term .dim { color: #888; }
.term .prompt { color: #5ac8fa; }
.term-in { display: flex; gap: 8px; }
.term-in input { flex: 1; background: none; border: 0; outline: 0; color: inherit; font: inherit; caret-color: var(--accent); }

/* 访达 / 列表 */
.list { padding: 8px; }
.row {
  display: flex; align-items: flex-start; gap: 12px; padding: 10px 12px; border-radius: 8px;
  text-decoration: none; color: var(--text);
}
.row:hover { background: rgba(0,0,0,.06); }
.row .ic { width: 36px; height: 36px; border-radius: 8px; flex: none; display: grid; place-items: center; font-size: 18px; background: #eef1f7; }
.row b { display: block; font-size: 14px; }
.row small { color: var(--sub); font-size: 12px; }
.row .tag { margin-left: auto; font-size: 11px; padding: 2px 8px; border-radius: 999px; background: #fff3d6; color: #9a5b00; flex: none; }

/* 浏览器 */
.browser { display: flex; flex-direction: column; height: 100%; }
.tabs { display: flex; gap: 4px; padding: 6px 8px 0; background: rgba(0,0,0,.04); }
.tab { padding: 6px 14px; border-radius: 8px 8px 0 0; font-size: 12px; color: var(--sub); }
.tab.on { background: #fff; color: var(--text); font-weight: 600; }
.urlbar { display: flex; gap: 8px; align-items: center; padding: 6px 10px; background: #fff; border-bottom: 1px solid #eee; font-size: 12px; color: var(--sub); }
.urlbar .u { flex: 1; padding: 4px 10px; border-radius: 6px; background: #f2f2f5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.urlbar a { color: #2f6fde; text-decoration: none; }
.browser iframe { flex: 1; width: 100%; border: 0; background: #fff; }

/* 联系我 */
.card { padding: 22px; text-align: center; }
.card img.av { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; background: #ddd; }
.card h2 { margin: 10px 0 2px; font-size: 20px; }
.card .sub { color: var(--sub); font-size: 13px; }
.card dl { margin: 18px 0 0; text-align: left; display: grid; grid-template-columns: 56px 1fr; gap: 8px 12px; font-size: 13px; }
.card dt { color: var(--sub); }
.card dd { margin: 0; }
.card .qr { margin-top: 16px; width: 160px; height: 160px; border-radius: 10px; }
.card .qr-empty { margin: 16px auto 0; width: 160px; padding: 30px 10px; border-radius: 10px; border: 1px dashed #bbb; color: var(--sub); font-size: 12px; }

/* 访客光标 */
.peer { position: fixed; left: 0; top: 0; z-index: 8000; pointer-events: none; transition: transform .08s linear, opacity .3s; opacity: 0; }
.peer.on { opacity: 1; }
.peer i { display: block; width: 16px; height: 20px; background: var(--c); clip-path: polygon(0 0, 0 16px, 4px 12px, 7px 20px, 10px 19px, 7px 11px, 14px 11px); filter: drop-shadow(0 1px 3px rgba(0,0,0,.4)); }
.peer b { position: absolute; left: 14px; top: 14px; font-size: 11px; padding: 2px 7px; border-radius: 999px; background: var(--c); white-space: nowrap; }

/* ---------- 手机：仿 iOS 主屏 ---------- */
@media (max-width: 740px) {
  .menubar { height: 44px; padding: 0 22px; padding-top: env(safe-area-inset-top); background: transparent; backdrop-filter: none; }
  .menubar .logo, .menubar .app-name, .menubar .menu { display: none; }
  .menubar .clock { order: -1; font-weight: 700; font-size: 15px; }
  .desktop { top: 44px; }
  .desk-icons { position: static; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px 8px; padding: 18px 16px; }
  .desk-file { position: static !important; width: auto; padding: 0; }
  .desk-file.sel { background: none; }
  .desk-thumb { width: 60px; height: 60px; border-radius: 15px; font-size: 26px; }
  .desk-thumb .kind { display: none; }
  .fname { font-size: 11px; -webkit-line-clamp: 1; max-width: 76px; }
  .hello { right: 0; left: 0; bottom: 120px; text-align: center; }
  .hello h1 { font-size: 34px; }
  .dock { bottom: 14px; width: calc(100% - 24px); justify-content: space-around; border-radius: 28px; padding: 9px 6px; gap: 4px; overflow-x: auto; }
  .dock-sep, .dock-item .tip, .dock-item .dot { display: none; }
  .dock-icon { width: 50px; height: 50px; border-radius: 13px; font-size: 26px; }
  .dock-item:hover .dock-icon { transform: none; margin: 0; }
  .win, .win.max {
    position: fixed; left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important;
    border-radius: 0; z-index: 7000 !important; animation: slide .25s ease;
  }
  @keyframes slide { from { transform: translateY(100%); } }
  .titlebar { height: calc(48px + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top); }
  .traffic .m, .traffic .x { display: none; }
  .traffic .c { width: auto; height: auto; background: none; color: #2f6fde; font-size: 15px; }
  .traffic .c::before { content: "‹ 返回"; }
  .app-term .traffic .c { color: var(--accent); }
  .titlebar .title { margin-right: 60px; font-size: 15px; }
  .resize { display: none; }
  .peer { display: none; }
}
@media (max-width: 740px) {
  /* 手机上打开应用时，应用铺满全屏，盖住状态栏和 Dock */
  body.sheet .desktop { top: 0; z-index: 6000; }
  body.sheet .dock, body.sheet .menubar { display: none; }
}
