/* ============ 基础 ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: Tahoma, "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 12px;
  user-select: none;
}
button { font-family: inherit; font-size: inherit; cursor: pointer; }
.hidden { display: none !important; }
.screen { position: fixed; inset: 0; }

/* ============ Windows 旗帜 ============ */
.winflag {
  display: grid; grid-template-columns: 34px 34px; grid-template-rows: 34px 34px;
  gap: 4px; transform: perspective(200px) rotateY(-12deg) skewY(-3deg);
}
.winflag span { border-radius: 3px 8px 3px 8px; }
.winflag .f1 { background: #e34e26; }
.winflag .f2 { background: #7db700; }
.winflag .f3 { background: #1a6dd8; }
.winflag .f4 { background: #f7b500; }
.winflag.small { grid-template-columns: 18px 18px; grid-template-rows: 18px 18px; gap: 2px; }
.winflag.tiny  { grid-template-columns: 6px 6px;  grid-template-rows: 6px 6px;  gap: 1px; transform: none; display: inline-grid; margin-right: 5px; vertical-align: -2px; }
.winflag.tiny span { border-radius: 1px; }

/* ============ 开机画面 ============ */
#boot {
  background: #000; color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 48px;
}
.boot-logo { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.boot-title { font-size: 34px; font-weight: 300; letter-spacing: 1px; }
.boot-title sup { font-size: 12px; }
.boot-title b { color: #f7b500; font-style: italic; font-weight: 700; }
.boot-bar {
  width: 220px; height: 18px; border: 2px solid #8a8a8a; border-radius: 9px;
  overflow: hidden; padding: 2px;
}
.boot-blocks { display: flex; gap: 3px; animation: bootmove 1.6s linear infinite; }
.boot-blocks i { width: 12px; height: 10px; background: linear-gradient(180deg, #7ba8f0, #2a63c9); border-radius: 2px; flex: none; }
@keyframes bootmove {
  from { transform: translateX(-50px); }
  to   { transform: translateX(230px); }
}
.boot-copy { position: absolute; bottom: 30px; color: #9a9a9a; }

/* ============ 登录画面 ============ */
#login { display: flex; flex-direction: column; background: #5a7edc; }
.login-top, .login-bottom {
  height: 90px; flex: none;
  background: linear-gradient(180deg, #16308f, #003399);
}
.login-top { border-bottom: 3px solid #f7b500; }
.login-bottom {
  border-top: 3px solid #f7b500;
  display: flex; align-items: center; justify-content: flex-end;
  color: #cfd8f5; padding: 0 40px;
}
.login-mid {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 50px;
  background: radial-gradient(ellipse at 30% 40%, #7d9ce8, #5a7edc 60%, #3a5dc0);
}
.login-left { display: flex; flex-direction: column; align-items: flex-end; gap: 20px; color: #fff; }
.login-hint { font-size: 15px; }
.login-sep { width: 2px; height: 260px; background: linear-gradient(180deg, transparent, #fff8, transparent); }
.user-tile {
  display: flex; align-items: center; gap: 14px; padding: 12px 40px 12px 14px;
  border-radius: 8px; background: transparent; border: none; color: #fff; cursor: pointer;
}
.user-tile:hover { background: #ffffff2e; }
.avatar { width: 48px; height: 48px; border: 2px solid #fff; border-radius: 6px; }
.user-name { font-size: 18px; text-align: left; }
.user-desc { color: #d8e0f8; text-align: left; }

/* ============ 桌面 ============ */
#desktop { overflow: hidden; }
#bliss { position: absolute; inset: 0; width: 100%; height: 100%; }

#icons {
  position: absolute; top: 8px; left: 8px; bottom: 40px;
  display: flex; flex-direction: column; flex-wrap: wrap; gap: 6px;
  align-content: flex-start;
}
.dicon {
  width: 84px; padding: 6px 2px; background: none; border: 1px solid transparent;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: #fff;
}
.dicon svg { width: 40px; height: 40px; filter: drop-shadow(1px 2px 2px #0006); }
.dicon span {
  text-shadow: 1px 1px 2px #000; line-height: 1.25; padding: 1px 3px;
  overflow-wrap: anywhere;
}
.dicon.selected span { background: #316ac5; }
.dicon:focus-visible { outline: 1px dotted #fff; }

/* ============ 窗口 ============ */
.window {
  position: absolute; min-width: 280px;
  display: none; flex-direction: column;
  border: 3px solid #0855dd; border-top: none; border-radius: 8px 8px 3px 3px;
  background: #ece9d8;
  box-shadow: 2px 4px 14px #0007;
}
.window.open { display: flex; }
.window.minimized { display: none; }
.window.maximized { left: 0 !important; top: 0 !important; width: 100% !important; height: calc(100% - 34px); border-radius: 0; }
.window:not(.active) { border-color: #7b9be0; }

.titlebar {
  height: 28px; flex: none;
  display: flex; align-items: center; gap: 5px; padding: 0 4px 0 7px;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, #0997ff 0%, #0053ee 10%, #0050ee 45%, #0066ff 90%, #0053ee 100%);
  color: #fff; font-weight: 700; text-shadow: 1px 1px 1px #0a1a52;
  cursor: default; touch-action: none;
}
.window:not(.active) .titlebar {
  background: linear-gradient(180deg, #9ab6ef, #7b9be0 45%, #86a7ec);
  text-shadow: none;
}
.ticon { width: 16px; height: 16px; flex: none; }
.ttext { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.tb {
  width: 21px; height: 21px; flex: none;
  border: 1px solid #fff; border-radius: 3px;
  background: linear-gradient(135deg, #7ba2e8, #3a6ad0 60%, #2a55b8);
  color: #fff; font-weight: 700; font-size: 11px; line-height: 1;
  box-shadow: inset 0 1px 1px #fff8;
}
.tb:hover { filter: brightness(1.15); }
.tb:active { filter: brightness(.9); }
.tb.close { background: linear-gradient(135deg, #f0a08a, #dd4b2a 55%, #b83010); }
.tbtns { display: flex; gap: 2px; }

.menubar {
  flex: none; display: flex; gap: 2px; padding: 2px 4px;
  background: #ece9d8; border-bottom: 1px solid #d4d0c0;
}
.menubar span { padding: 2px 7px; }
.menubar span:hover { background: #316ac5; color: #fff; }
.addrbar {
  flex: none; display: flex; align-items: center; padding: 3px 6px; gap: 4px;
  background: #ece9d8; border-bottom: 1px solid #d4d0c0; color: #444;
}
.addr {
  flex: 1; background: #fff; border: 1px solid #7f9db9; padding: 3px 6px;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #000;
}
.winbody { flex: 1; overflow: auto; background: #fff; padding: 12px; }
.statusbar {
  flex: none; padding: 3px 8px; background: #ece9d8;
  border-top: 1px solid #d4d0c0; color: #444;
}

/* 通用 XP 按钮 */
.xpbtn {
  min-width: 74px; padding: 4px 12px;
  border: 1px solid #003c74; border-radius: 3px;
  background: linear-gradient(180deg, #fff, #ece9d8 85%, #d8d0bf);
  box-shadow: inset -1px -1px 0 #d8d0bf;
}
.xpbtn:hover { box-shadow: inset 0 0 0 2px #f8b76b66, inset -1px -1px 0 #d8d0bf; }
.xpbtn:active { background: #d8d4c8; }
.xpbtn.go { min-width: 0; }
.dlg-btns { display: flex; justify-content: flex-end; gap: 8px; padding-top: 12px; }

/* ============ 关于我（系统属性）============ */
#win-about .winbody { background: #ece9d8; }
.tabstrip { display: flex; padding: 6px 8px 0; }
.tab {
  padding: 4px 12px; border: 1px solid #999; border-bottom: none;
  border-radius: 4px 4px 0 0; background: #ded9c8; margin-right: 2px;
}
.tab.active { background: #fdfcf8; position: relative; top: 1px; padding-top: 5px; }
.tabpage {
  margin: 0 8px 8px; border: 1px solid #999; background: #fdfcf8; padding: 16px;
}
.about-grid { display: flex; gap: 20px; }
.about-logo { display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 6px; }
.about-xp { font-size: 17px; }
.about-xp b { color: #d86a1a; font-style: italic; }
.about-info { flex: 1; line-height: 1.7; }
.about-info .grp { font-weight: 700; margin-top: 8px; }
.about-info .grp:first-child { margin-top: 0; }
.about-info .ind { padding-left: 16px; color: #333; }
.skill { display: flex; align-items: center; gap: 8px; padding-left: 16px; margin: 4px 0; }
.skill label { width: 80px; flex: none; }
.pbar {
  flex: 1; height: 14px; border: 1px solid #7f9db9; background: #fff; padding: 1px;
}
.pbar i {
  display: block; height: 100%;
  background: repeating-linear-gradient(90deg, #4bcf4b 0 8px, #2fa82f 8px 10px);
}

/* ============ 文件网格 ============ */
.filegrid { display: flex; flex-wrap: wrap; gap: 10px; align-content: flex-start; }
.ficon {
  width: 96px; display: flex; flex-direction: column; align-items: center; gap: 4px;
  text-decoration: none; color: #000; padding: 6px 2px; border-radius: 3px;
}
.ficon:hover { background: #cfe0f7; }
.ficon svg { width: 38px; height: 38px; }
.ficon span { text-align: center; line-height: 1.3; overflow-wrap: anywhere; }

/* ============ IE 页面 ============ */
.iepage h2 { font-size: 16px; margin-bottom: 6px; }
.iehint { color: #666; margin-bottom: 10px; }
.favlist { list-style: none; }
.favlist li { margin: 8px 0; }
.favlist a { color: #0645ad; }
.favlist a:hover { color: #d8341c; }

/* ============ 对话框 ============ */
.dialog .winbody { background: #ece9d8; }
.dlgbody { display: flex; align-items: center; gap: 14px; padding: 18px 16px 6px; line-height: 1.6; }
.dlgicon { width: 36px; height: 36px; flex: none; }
.dialog .dlg-btns { padding: 0 16px 14px; justify-content: center; }

/* ============ 扫雷 ============ */
.minebody { background: #c0c0c0; padding: 8px; border: 2px solid; border-color: #fff #808080 #808080 #fff; }
.mine-top {
  display: flex; justify-content: space-between; align-items: center;
  border: 2px solid; border-color: #808080 #fff #fff #808080;
  padding: 4px 6px; margin-bottom: 8px;
}
.led {
  background: #000; color: #f00; font: 700 18px "Courier New", monospace;
  padding: 1px 4px; letter-spacing: 2px;
}
#mine-face {
  width: 30px; height: 30px; font-size: 16px; padding: 0;
  background: #c0c0c0; border: 2px solid; border-color: #fff #808080 #808080 #fff;
}
#mine-face:active { border-color: #808080 #fff #fff #808080; }
#mine-grid {
  display: grid; grid-template-columns: repeat(9, 24px);
  border: 2px solid; border-color: #808080 #fff #fff #808080;
  width: max-content;
}
.mcell {
  width: 24px; height: 24px; padding: 0;
  background: #c0c0c0; border: 2px solid; border-color: #fff #808080 #808080 #fff;
  font-weight: 700; font-size: 13px; line-height: 1;
}
.mcell.open { border: 1px solid #9a9a9a; border-width: 1px 0 0 1px; cursor: default; }
.mcell.boom { background: #f00; }
.mcell.n1 { color: #0000ff; } .mcell.n2 { color: #008000; }
.mcell.n3 { color: #ff0000; } .mcell.n4 { color: #000080; }
.mcell.n5 { color: #800000; } .mcell.n6 { color: #008080; }
.mcell.n7 { color: #000000; } .mcell.n8 { color: #808080; }

/* ============ 任务栏 ============ */
#taskbar {
  position: absolute; left: 0; right: 0; bottom: 0; height: 34px;
  display: flex; align-items: stretch; z-index: 5000;
  background: linear-gradient(180deg, #3d7ff0 0%, #2a63d8 8%, #245edb 42%, #2a68e0 88%, #1941a5 100%);
  box-shadow: 0 -1px 3px #0004;
}
#startbtn {
  flex: none; padding: 0 22px 0 12px; border: none;
  border-radius: 0 12px 12px 0; margin-right: 10px;
  background: linear-gradient(180deg, #7ede63 0%, #3fa62e 12%, #2f8f22 50%, #3fa62e 90%, #1e6a14 100%);
  color: #fff; font-size: 17px; font-weight: 700; font-style: italic;
  text-shadow: 1px 1px 2px #0a3a08;
  box-shadow: inset 0 1px 2px #d0ffc0aa, 2px 0 4px #0005;
}
#startbtn:hover { filter: brightness(1.1); }
#startbtn.pressed { filter: brightness(.85); }
#task-buttons { flex: 1; display: flex; gap: 4px; padding: 4px 4px 4px 0; overflow: hidden; }
.taskbtn {
  flex: 0 1 170px; min-width: 60px;
  display: flex; align-items: center; gap: 5px; padding: 0 8px;
  border: none; border-radius: 3px;
  background: linear-gradient(180deg, #4a86ee, #3a70dd 50%, #2f63cf);
  color: #fff; box-shadow: inset 0 1px 1px #ffffff55;
  overflow: hidden; white-space: nowrap;
}
.taskbtn svg { width: 16px; height: 16px; flex: none; }
.taskbtn span { overflow: hidden; text-overflow: ellipsis; }
.taskbtn.on {
  background: linear-gradient(180deg, #1b47a8, #2453b8);
  box-shadow: inset 1px 1px 3px #0008;
}
#tray {
  flex: none; display: flex; align-items: center; gap: 8px; padding: 0 12px 0 14px;
  background: linear-gradient(180deg, #2aa2e8 0%, #1489dd 50%, #0f6fc0 100%);
  border-left: 1px solid #0a5aa8; box-shadow: inset 2px 0 3px #0003;
  color: #fff;
}
#mute { background: none; border: none; font-size: 14px; }
#clock { font-size: 12px; }

/* ============ 开始菜单 ============ */
#startmenu {
  position: absolute; left: 0; bottom: 34px; width: 380px; z-index: 6000;
  border: 1px solid #0a3a8c; border-radius: 6px 6px 0 0;
  box-shadow: 3px -3px 12px #0006; overflow: hidden;
  background: #fff;
}
.sm-head {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  background: linear-gradient(180deg, #1c62d8, #2a70e8 50%, #1650b8);
  color: #fff; font-size: 15px; font-weight: 700; text-shadow: 1px 1px 2px #0a2a6a;
}
.sm-head .avatar { width: 38px; height: 38px; }
.sm-cols { display: flex; border-top: 2px solid #f7b500; }
.sm-left  { flex: 1; background: #fff; padding: 6px; }
.sm-right { flex: 1; background: #d3e5fa; padding: 6px; border-left: 1px solid #a8c8ee; }
.sm-left hr { border: none; border-top: 1px solid #ddd; margin: 5px 8px; }
.sm-item {
  width: 100%; display: flex; align-items: center; gap: 8px; padding: 5px 8px;
  background: none; border: none; text-align: left; border-radius: 3px;
}
.sm-item:hover { background: #316ac5; color: #fff; }
.sm-item:hover small { color: #d8e4f8; }
.sm-item svg { width: 26px; height: 26px; flex: none; }
.sm-item small { display: block; color: #888; }
.sm-foot {
  display: flex; justify-content: flex-end; gap: 6px; padding: 7px 10px;
  background: linear-gradient(180deg, #1c62d8, #1650b8); color: #fff;
}
.sm-foot button { background: none; border: none; color: #fff; padding: 4px 8px; border-radius: 3px; }
.sm-foot button:hover { background: #ffffff2e; }

/* ============ 蓝屏 ============ */
#bsod {
  background: #0827a0; color: #d8d8d8; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-family: "Lucida Console", "Courier New", monospace; font-size: 14px;
}
.bsod-text { max-width: 640px; line-height: 1.5; padding: 20px; }
.blink { animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ============ 关机 ============ */
#shutdown {
  background: #000; color: #f7b500;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; text-align: center; line-height: 2;
}

/* ============ 小屏适配 ============ */
@media (max-width: 640px) {
  .window { max-width: calc(100vw - 8px); }
  #startmenu { width: calc(100vw - 20px); }
  .login-mid { flex-direction: column; gap: 24px; }
  .login-sep { display: none; }
  .login-left { align-items: center; }
}

/* 托盘访客计数 */
#visits { font-size: 11px; opacity: .85; }
#visits:empty { display: none; }
