/* LanDrive 桌面外壳 —— 深色玻璃拟态 */

* { box-sizing: border-box; }
:root {
  --glass: rgba(28, 32, 46, .72);
  --glass-2: rgba(36, 41, 58, .86);
  --line: rgba(255, 255, 255, .10);
  --line-2: rgba(255, 255, 255, .18);
  --txt: #eef1f8;
  --txt-dim: rgba(238, 241, 248, .62);
  --accent: #5b7cfa;
  --shadow: 0 18px 50px rgba(0, 0, 0, .45);
  --radius: 12px;
}
html, body { height: 100%; margin: 0; }
body {
  font: 14px/1.5 -apple-system, "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--txt);
  background: #10121a;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
.ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px;
  border-radius: 9px; background: rgba(255, 255, 255, .10); color: var(--txt);
  border: 1px solid var(--line); transition: background .15s;
}
.btn:hover { background: rgba(255, 255, 255, .17); }
.btn.primary { background: var(--accent); border-color: transparent; }
.btn.primary:hover { background: #6c8bff; }
.btn.block { width: 100%; justify-content: center; }

/* ============ 登录 ============ */
.login-layer {
  position: fixed; inset: 0; z-index: 9500;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 800px at 20% 10%, #2a3358 0%, #141726 55%, #0d0f16 100%);
}
.login-card {
  width: 340px; padding: 30px 28px; border-radius: 18px;
  background: var(--glass-2); border: 1px solid var(--line);
  backdrop-filter: blur(18px); box-shadow: var(--shadow);
}
.login-card .brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.brand-mark {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  background: linear-gradient(140deg, #6d88ff, #4453e0);
  font-weight: 700; letter-spacing: .5px; color: #fff; font-size: 17px;
}
.brand-text h1 { margin: 0; font-size: 17px; }
.brand-text p { margin: 2px 0 0; font-size: 12px; color: var(--txt-dim); }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 12px; color: var(--txt-dim); margin-bottom: 6px; }
.field input {
  width: 100%; padding: 10px 12px; border-radius: 9px; outline: none;
  background: rgba(0, 0, 0, .28); border: 1px solid var(--line); color: var(--txt);
}
.field input:focus { border-color: var(--accent); }
.hint { min-height: 18px; margin: 10px 0 0; font-size: 12px; color: #ff8b8b; text-align: center; }

/* ============ 桌面 ============ */
.desktop { position: fixed; inset: 0; }
.desktop::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(1100px 700px at 18% 8%, rgba(93, 124, 250, .38) 0%, transparent 60%),
    radial-gradient(900px 700px at 82% 92%, rgba(150, 90, 250, .30) 0%, transparent 62%),
    linear-gradient(150deg, #1b2140 0%, #151827 46%, #0e1018 100%);
  transition: background-image .3s;
}
.desktop.has-wall::before { background-image: var(--wall) !important; }

/* 顶栏 */
.topbar {
  position: absolute; top: 0; left: 0; right: 0; height: 42px; z-index: 5000;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px; background: rgba(12, 14, 22, .55);
  border-bottom: 1px solid var(--line); backdrop-filter: blur(16px);
}
.tb-left { display: flex; align-items: center; gap: 9px; }
.tb-left .logo {
  width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center;
  background: linear-gradient(140deg, #6d88ff, #4453e0); font-size: 11px; font-weight: 700;
}
.tb-title { font-size: 13.5px; letter-spacing: .2px; }
.tb-right { display: flex; align-items: center; gap: 8px; }
.tb-chip {
  padding: 4px 10px; border-radius: 8px; font-size: 12px; color: var(--txt-dim);
  background: rgba(255, 255, 255, .07); border: 1px solid var(--line); white-space: nowrap;
}
.tb-chip.clock { color: var(--txt); font-variant-numeric: tabular-nums; }
.tb-userwrap { position: relative; }
.tb-user { padding: 0; border-radius: 50%; }
.avatar {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(140deg, #6d88ff, #8b5cf6); font-size: 12px; font-weight: 600;
}
.avatar.big { width: 38px; height: 38px; font-size: 15px; }
.user-menu {
  position: absolute; top: 34px; right: 0; width: 208px; padding: 8px;
  background: var(--glass-2); border: 1px solid var(--line-2); border-radius: 12px;
  box-shadow: var(--shadow); backdrop-filter: blur(20px); z-index: 6000;
}
.um-head { display: flex; align-items: center; gap: 10px; padding: 6px 8px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.um-head b { display: block; font-size: 13.5px; }
.um-sub { font-size: 11.5px; color: var(--txt-dim); }
.um-item {
  display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 8px;
  font-size: 13px; color: var(--txt);
}
.um-item:hover { background: rgba(255, 255, 255, .10); }
.um-item.danger { color: #ff8b8b; }

/* 桌面图标 */
.icons {
  position: absolute; top: 54px; left: 10px; bottom: 20px; z-index: 10;
  display: grid; grid-auto-flow: column; grid-template-rows: repeat(auto-fill, 96px);
  gap: 4px; align-content: start; justify-content: start; padding: 4px;
}
.icon {
  width: 88px; height: 92px; padding: 8px 4px 6px; border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  cursor: default; user-select: none; transition: background .12s;
}
.icon:hover { background: rgba(255, 255, 255, .10); }
.icon.sel { background: rgba(91, 124, 250, .34); outline: 1px solid rgba(255, 255, 255, .25); }
.icon .art {
  width: 44px; height: 44px; border-radius: 11px; display: grid; place-items: center;
  background: rgba(255, 255, 255, .13); border: 1px solid var(--line-2);
}
.icon .art svg { width: 24px; height: 24px; fill: none; stroke: #fff; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon .nm {
  font-size: 11.5px; text-align: center; line-height: 1.25; max-width: 82px;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
}

/* ============ 窗口 ============ */
.win-layer { position: absolute; inset: 42px 0 0 0; z-index: 100; pointer-events: none; }
.win {
  position: absolute; display: flex; flex-direction: column; pointer-events: auto;
  background: #f4f6fb; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); border: 1px solid rgba(255, 255, 255, .14);
  min-width: 380px; min-height: 260px;
}
.win.max { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; border-radius: 0; }
.win.dragging { transition: none; }
/* 非当前窗口：标题栏压暗 + 阴影收紧，一眼看出哪个是活动的 */
.win-bar { transition: filter .18s ease; }
.win:not(.focused) .win-bar { filter: brightness(.66) saturate(.75); }
.win:not(.focused) .win-bar .wt { opacity: .78; }
.win:not(.focused) { box-shadow: 0 10px 26px rgba(0, 0, 0, .30); }
.win-bar {
  height: 38px; flex: 0 0 38px; display: flex; align-items: center; gap: 8px;
  padding: 0 8px 0 12px;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--bar-tint, #2a3040) 86%, #ffffff),
    var(--bar-tint, #2a3040));
  color: #e9edf8; cursor: grab; user-select: none;
}
.win-bar:active { cursor: grabbing; }
.win-bar .wi { width: 16px; height: 16px; fill: none; stroke: #a9b6e8; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.win-bar .wt { flex: 1; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.win-btns { display: flex; gap: 2px; }
.win-btns button {
  width: 28px; height: 24px; border-radius: 6px; color: #c9d2ee; display: grid; place-items: center; font-size: 13px;
}
.win-btns button:hover { background: rgba(255, 255, 255, .14); }
.win-btns button.close:hover { background: #e5484d; color: #fff; }
.win-body { flex: 1; position: relative; background: #fff; }
.win-body iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* 顶栏里的窗口图标（代替底部任务栏） */
.win-icons {
  display: flex; align-items: center; gap: 3px; padding-right: 7px; margin-right: 3px;
  border-right: 1px solid var(--line);
}
.win-icons:empty { display: none; }
.wi-btn {
  position: relative; width: 30px; height: 26px; border-radius: 8px;
  display: grid; place-items: center; color: var(--txt-dim);
}
.wi-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.wi-btn:hover { background: rgba(255, 255, 255, .14); color: var(--txt); }
.wi-btn.active { background: rgba(91, 124, 250, .34); color: #fff; }
.wi-btn i.dot {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 3px;
  width: 5px; height: 5px; border-radius: 50%; background: #8fa6ff;
}
.wi-btn.active i.dot { background: #fff; }

/* 右键菜单 */
.ctx {
  position: fixed; z-index: 9000; min-width: 178px; padding: 6px;
  background: var(--glass-2); border: 1px solid var(--line-2); border-radius: 11px;
  box-shadow: var(--shadow); backdrop-filter: blur(20px);
}
.ctx button { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 8px; font-size: 13px; }
.ctx button:hover { background: rgba(255, 255, 255, .12); }
.ctx hr { border: 0; border-top: 1px solid var(--line); margin: 5px 6px; }

/* 换壁纸面板 */
.sheet {
  position: absolute; left: 50%; bottom: 76px; transform: translateX(-50%); z-index: 8000;
  width: min(620px, calc(100% - 32px)); padding: 14px 16px 16px;
  background: var(--glass-2); border: 1px solid var(--line-2); border-radius: 16px;
  box-shadow: var(--shadow); backdrop-filter: blur(20px);
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sheet-head .x { width: 28px; height: 28px; border-radius: 8px; font-size: 16px; color: var(--txt-dim); }
.sheet-head .x:hover { background: rgba(255, 255, 255, .12); }
.wall-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.wall-item {
  height: 58px; border-radius: 10px; border: 2px solid transparent; cursor: pointer;
  background-size: cover; background-position: center;
}
.wall-item.sel { border-color: var(--accent); }
.sheet-foot { display: flex; gap: 8px; margin-top: 12px; }
.sheet-foot input {
  flex: 1; padding: 9px 12px; border-radius: 9px; outline: none;
  background: rgba(0, 0, 0, .28); border: 1px solid var(--line); color: var(--txt);
}

/* 提示条 */
.hint-bar {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 24px; z-index: 7000;
  padding: 8px 16px; border-radius: 10px; font-size: 12.5px;
  background: var(--glass-2); border: 1px solid var(--line-2); backdrop-filter: blur(16px);
}

/* toast */
#toast-root { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  padding: 9px 16px; border-radius: 10px; font-size: 13px; color: #fff;
  background: rgba(30, 34, 48, .94); border: 1px solid var(--line-2); box-shadow: var(--shadow);
}
.toast.err { background: #b3343a; border-color: transparent; }
.toast.ok { background: #1f7a52; border-color: transparent; }

/* ============ 手机：退化成单窗口 ============ */
@media (max-width: 820px), (pointer: coarse) and (max-width: 900px) {
  .desktop { display: none !important; }
  .login-layer { display: flex; }
}
