*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #050608;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
}

/* 根容器：对应 .pen 中的 Mobile Calculator（bi8Au） */
.calc-app {
  width: 100%;
  max-width: 428px;
  padding: 16px;
}

.calc-phone {
  position: relative;
  margin: 0 auto;
  width: 428px;
  max-width: 100%;
  height: 926px;
  border-radius: 44px;
  padding: 20px;
  background: #000000;
  clip-path: inset(0 round 44px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.9);

  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 顶部虚拟听筒（不是 .pen 里的节点，但常见于手机外观） */
.calc-phone::before {
  content: "";
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

/* 状态栏：对应 Status Bar（MT6jD） */
.calc-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
  padding: 0 8px;
  font-size: 16px;
}

.calc-status-time {
  font-weight: 600;
}

.calc-status-icons {
  font-size: 16px;
}

/* 顶部工具栏：List / Spacer / Calc（gZcvw） */
.calc-toolbar {
  display: flex;
  align-items: center;
  height: 44px;
  gap: 12px;
  padding: 0 4px;
}

.calc-toolbar-spacer {
  flex: 1;
}

.calc-toolbar-btn {
  width: 44px;
  height: 44px;
  border-radius: 22px;
  background: #1c1c1e;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 18px;
}

.calc-toolbar-btn--list {
  font-size: 20px;
}

/* 显示区域：Display（aD3Hq），含 History + Result */
.calc-display {
  flex: 1;
  width: 100%;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-end;
  gap: 4px;
}

.calc-display-history {
  font-size: 30px;
  color: #8e8e93;
  text-align: right;
}

.calc-display-result {
  font-size: 80px;
  font-weight: 300;
  color: #ffffff;
  text-align: right;
  line-height: 1;
}

/* 按键区域：Keypad（2wl7y） */
.calc-keypad {
  width: 100%;
  height: 488px;
  display: flex;
  flex-direction: column;
  gap: 12px; /* 与 .pen 中 Keypad 的 gap 一致 */
}

.calc-key-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px; /* 对应 RowX 的 gap */
  height: 88px; /* 每一行高度 88 */
}

/* 单个按键：行内的圆角 Frame（cornerRadius:44, fill:#333333） */
.calc-key {
  border: none;
  border-radius: 44px;
  background: #333333;
  color: #ffffff;
  font-size: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  outline: none;
  user-select: none;
  transition: background 0.12s ease, transform 0.08s ease;
}

.calc-key:active {
  transform: translateY(1px);
  background: #3f3f3f;
}

/* 顶部行中的灰色功能键：Backspace / AC / Percent（fill:#A5A5A5） */
.calc-key--func {
  background: #a5a5a5;
  color: #000000;
  font-size: 26px;
}

/* 运算符列：÷ × − + =（fill:#FF9F0A） */
.calc-key--op {
  background: #ff9f0a;
  color: #ffffff;
}

.calc-key--equal {
  box-shadow: 0 0 16px rgba(255, 159, 10, 0.55);
}

/* 底部 Home Indicator（Otj03） */
.calc-home-indicator {
  width: 134px;
  height: 5px;
  border-radius: 3px;
  background: #ffffff;
  opacity: 0.6;
  align-self: center;
  margin-top: 12px;
}

/* 响应式缩放：小屏整体按比例缩小 */
@media (max-width: 430px) {
  .calc-phone {
    width: 100%;
    height: auto;
    aspect-ratio: 428 / 926;
  }

  .calc-display-result {
    font-size: clamp(40px, 9vw, 80px);
  }

  .calc-key {
    font-size: clamp(20px, 5vw, 32px);
  }
}

