/* Nokia 8110 4G — 机身外壳 (Firefox 48 安全子集: 无 grid / 无 flex gap / 无 CSS 变量) */

*, *:before, *:after { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: #07090c;
  background-image: radial-gradient(70% 50% at 50% 0%, #19222c 0%, #07090c 66%);
  color: #dbe4ee;
  font-family: "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

#stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 20px 16px;
}

/* ---------- 机身 ---------- */

#device {
  position: relative;
  width: 300px;
  padding: 10px 10px 16px;
  border-radius: 92px 92px 118px 118px / 54px 54px 98px 98px;
  background: linear-gradient(178deg, #ffe25a 0%, #f8cd0d 26%, #eec000 60%, #cf9d00 100%);
  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.66),
    0 1px 0 rgba(255, 255, 255, 0.55) inset,
    0 -12px 28px rgba(96, 64, 0, 0.5) inset;
  transform-origin: 50% 50%;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

#device:before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 0; bottom: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(120% 46% at 50% -6%, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0) 62%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0) 9%, rgba(0, 0, 0, 0) 91%, rgba(0, 0, 0, 0.24) 100%);
}

.cap, .bezel, .deck { position: relative; z-index: 1; }

/* 顶部: 听筒 + 品牌 */
.cap { height: 36px; }

.grille {
  position: absolute;
  left: 50%;
  top: 6px;
  width: 46px;
  height: 5px;
  margin-left: -23px;
  border-radius: 3px;
  background: #23262a;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.35) inset, 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.brand {
  position: absolute;
  left: 0; right: 0;
  bottom: 5px;
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.34em;
  color: #2b2200;
  opacity: 0.78;
  text-indent: 0.34em;
}

.dot {
  position: absolute;
  right: 14px;
  top: 9px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #2b2200;
  opacity: 0.3;
}

/* 屏幕 */
.bezel {
  width: 262px;
  margin: 0 auto;
  padding: 11px;
  border-radius: 15px;
  background: linear-gradient(158deg, #24282d 0%, #0f1216 54%, #05070a 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.16) inset,
    0 10px 22px rgba(0, 0, 0, 0.5);
}

#lcd {
  display: block;
  width: 240px;
  height: 320px;
  background: #0b0f14;
  border-radius: 3px;
  -webkit-transition: -webkit-filter 0.25s ease;
  transition: filter 0.25s ease;
}

.glass {
  position: absolute;
  left: 11px;
  top: 11px;
  width: 240px;
  height: 320px;
  border-radius: 3px;
  pointer-events: none;
  background: linear-gradient(118deg, rgba(255, 255, 255, 0.13) 0%, rgba(255, 255, 255, 0.04) 20%, rgba(255, 255, 255, 0) 40%);
}

/* ---------- 键盘区 ---------- */

.deck {
  position: relative;
  overflow: hidden;
  margin: 8px 8px 0;
  border-radius: 0 0 34px 34px;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 50px;
  padding: 0 2px;
}

.k {
  border: 0;
  outline: 0;
  font-family: inherit;
  cursor: pointer;
  position: relative;
  background: linear-gradient(180deg, #262a2f 0%, #1a1e22 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.14) inset,
    0 -1px 0 rgba(0, 0, 0, 0.5) inset,
    0 2px 3px rgba(0, 0, 0, 0.35);
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
  appearance: none;
}

.k:active, .k.pressed {
  background: linear-gradient(180deg, #1c2025 0%, #14181c 100%);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.6) inset;
  -webkit-transform: translateY(1px);
  transform: translateY(1px);
}

.k.call, .k.end { width: 30px; height: 42px; border-radius: 9px; }
.k.call { background: linear-gradient(180deg, #45d27c 0%, #23a55b 100%); }
.k.end  { background: linear-gradient(180deg, #f0655d 0%, #c33a35 100%); }
.k.call:active, .k.call.pressed { background: linear-gradient(180deg, #2fbb66 0%, #1c8749 100%); }
.k.end:active, .k.end.pressed   { background: linear-gradient(180deg, #d9524b 0%, #a52d29 100%); }

.handset {
  display: block;
  position: absolute;
  left: 50%; top: 50%;
  width: 15px; height: 15px;
  margin: -8px 0 0 -8px;
  border: 2px solid #0c2e1a;
  border-left-color: transparent;
  border-bottom-color: transparent;
  border-radius: 50%;
  -webkit-transform: rotate(-45deg);
  transform: rotate(-45deg);
  opacity: 0.85;
}

.power {
  display: block;
  position: absolute;
  left: 50%; top: 50%;
  width: 13px; height: 13px;
  margin: -7px 0 0 -7px;
  border: 2px solid #3d1010;
  border-radius: 50%;
  opacity: 0.8;
}

.power:after {
  content: '';
  position: absolute;
  left: 3px;
  top: -4px;
  width: 2px;
  height: 8px;
  background: #3d1010;
}

.k.soft { width: 44px; height: 32px; border-radius: 8px; }

.dash {
  display: block;
  position: absolute;
  left: 50%; top: 50%;
  width: 14px; height: 2px;
  margin: -1px 0 0 -7px;
  border-radius: 1px;
  background: #97a3b0;
}

/* 四向导航 */
.pad {
  position: relative;
  width: 96px;
  height: 50px;
  border-radius: 16px;
  background: linear-gradient(180deg, #20242a 0%, #14181c 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.1) inset,
    0 3px 6px rgba(0, 0, 0, 0.4);
}

.pad .k {
  position: absolute;
  width: 32px;
  height: 16px;
  background: transparent;
  box-shadow: none;
  border-radius: 6px;
}

.pad .k.pressed, .pad .k:active {
  background: rgba(255, 255, 255, 0.16);
  box-shadow: none;
}

.pad .a-up    { left: 32px; top: 1px; }
.pad .a-down  { left: 32px; bottom: 1px; }
.pad .a-left  { left: 1px; top: 17px; width: 16px; height: 16px; }
.pad .a-right { right: 1px; top: 17px; width: 16px; height: 16px; }
.pad .ok    { left: 32px; top: 17px; width: 32px; height: 16px; border-radius: 8px; }

.pad .k:after {
  content: '';
  position: absolute;
  left: 50%; top: 50%;
  border: 5px solid transparent;
}

.pad .a-up:after    { margin: -7px 0 0 -5px; border-bottom-color: #cbd5df; }
.pad .a-down:after  { margin: -3px 0 0 -5px; border-top-color: #cbd5df; }
.pad .a-left:after  { margin: -5px 0 0 -7px; border-right-color: #cbd5df; }
.pad .a-right:after { margin: -5px 0 0 -3px; border-left-color: #cbd5df; }

.pad .ok:after {
  width: 8px; height: 8px;
  left: 50%; top: 50%;
  margin: -4px 0 0 -4px;
  border: 0;
  border-radius: 50%;
  background: #8b98a6;
}

/* 数字键 */
.keypad {
  display: flex;
  flex-wrap: wrap;
  padding: 2px 1px 0;
}

.k.num {
  width: -webkit-calc(33.3333% - 5px);
  width: calc(33.3333% - 5px);
  height: 42px;
  margin: 0 2.5px 5px;
  border-radius: 10px;
  display: block;
  text-align: center;
  color: #eef3f8;
}

.k.num .n {
  display: block;
  font-size: 17px;
  font-weight: 600;
  line-height: 18px;
  margin-top: 7px;
}

.k.num .a {
  display: block;
  font-size: 8px;
  letter-spacing: 0.08em;
 color: #8e9aa7;
  line-height: 10px;
}

/* 下巴 */
.chin {
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.mic {
  width: 26px;
  height: 4px;
  border-radius: 2px;
  background: rgba(70, 46, 0, 0.45);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* 滑盖 */
.lid {
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 100%;
  border-radius: 0 0 30px 30px;
  background: linear-gradient(180deg, #f9d31c 0%, #ecc100 46%, #d9a900 100%);
  box-shadow:
    -2px 0 0 rgba(255, 255, 255, 0.25) inset,
    0 -12px 26px rgba(70, 46, 0, 0.45),
    0 -1px 0 rgba(255, 255, 255, 0.4) inset;
  -webkit-transform: translateY(-101%);
  transform: translateY(-101%);
  -webkit-transition: -webkit-transform 0.46s cubic-bezier(0.4, 0.05, 0.2, 1);
  transition: transform 0.46s cubic-bezier(0.4, 0.05, 0.2, 1);
  cursor: pointer;
}

.lid:after {
  content: '';
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 11px;
  height: 3px;
  border-radius: 2px;
  background: rgba(70, 46, 0, 0.28);
}

.lid-closed .lid {
  -webkit-transform: translateY(0);
  transform: translateY(0);
}

/* 合盖时按不到键盘 */
.lid-closed .deck { cursor: pointer; }

@media (max-width: 400px) {
  #stage { padding: 12px 6px; }
}
