* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body {
  background: #000;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  font-family: 'MiSans', -apple-system, 'Helvetica Neue', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  overflow: auto;
}

.calculator {
  width: 100%;
  max-width: 430px;
  height: 100vh;
  max-height: 932px;
  background: #000;
  display: flex;
  flex-direction: column;
  position: relative;
  margin: 0 auto;
}

/* 顶部状态栏 */
.status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px 0;
  height: 50px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

.status-bar .time {
  font-size: 16px;
  font-weight: 700;
}

.status-bar .icons {
  display: flex;
  gap: 6px;
  align-items: center;
}

.status-bar .icons svg {
  width: 18px;
  height: 18px;
}

/* 显示区域 */
.display-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 28px 16px;
  min-height: 200px;
  overflow: hidden;
}

.expression {
  color: rgba(255, 255, 255, 0.4);
  font-size: 22px;
  text-align: right;
  min-height: 32px;
  line-height: 32px;
  font-weight: 300;
  letter-spacing: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.result {
  color: #fff;
  font-size: 64px;
  text-align: right;
  font-weight: 300;
  letter-spacing: 1px;
  line-height: 1.15;
  min-height: 74px;
  transition: font-size 0.15s ease;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result.small {
  font-size: 48px;
}

.result.xsmall {
  font-size: 36px;
}

/* 按钮区域 */
.buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 8px 16px 20px;
}

.btn {
  aspect-ratio: 1 / 0.62;
  border-radius: 28px;
  border: none;
  font-size: 28px;
  font-weight: 400;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.1s ease, transform 0.08s ease;
  position: relative;
  overflow: hidden;
  font-family: inherit;
  letter-spacing: 0.5px;
}

.btn:active {
  transform: scale(0.95);
}

/* 数字键 - 深灰色 */
.btn-number {
  background: #272729;
  color: #fff;
}

.btn-number:active {
  background: #3a3a3c;
}

/* 功能键 - 略浅灰色 */
.btn-func {
  background: #1c1c1e;
  color: #fff;
  font-size: 22px;
}

/* 操作键 - 橙色 */
.btn-op {
  background: #f09a37;
  color: #fff;
  font-size: 32px;
}

.btn-op:active {
  background: #d4862e;
}

.btn-op.active {
  background: #fff;
  color: #f09a37;
}

/* 等号键 - 绿色 */
.btn-equals {
  background: #46c45b;
  color: #fff;
  font-size: 32px;
}

.btn-equals:active {
  background: #3bab4e;
}

/* 0键 - 占两列 */
.btn-zero {
  grid-column: span 2;
  aspect-ratio: 2.12 / 0.62;
  border-radius: 28px;
}

/* AC / C 键 */
.btn-clear {
  background: #1c1c1e;
  color: #fff;
  font-size: 22px;
}

.btn-clear:active {
  background: #333;
}

/* 退格键 */
.btn-backspace {
  background: #1c1c1e;
  color: #fff;
}

.btn-backspace svg {
  width: 28px;
  height: 28px;
}

/* 百分号 */
.btn-percent {
  background: #1c1c1e;
  color: #fff;
  font-size: 22px;
}

/* 波纹效果 */
.btn .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  transform: scale(0);
  animation: ripple 0.4s ease-out;
  pointer-events: none;
}

@keyframes ripple {
  to {
    transform: scale(2.5);
    opacity: 0;
  }
}

/* 版权信息 */
.copyright {
  text-align: center;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.2);
  padding: 0 14px 5px;
  line-height: 1.6;
}

.copyright a {
  color: rgba(255, 255, 255, 0.28);
  text-decoration: none;
}

.copyright a:active {
  color: rgba(255, 255, 255, 0.45);
}

/* 锁定状态小提示 - 极其隐蔽 */
.lock-indicator {
  position: absolute;
  top: 50px;
  right: 24px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: transparent;
  transition: background 0.3s ease;
}

.lock-indicator.locked {
  background: rgba(70, 196, 91, 0.35);
}

/* 全屏模式样式 */
:fullscreen {
  background: #000;
}

:-webkit-full-screen {
  background: #000;
}

:-ms-fullscreen {
  background: #000;
}

:fullscreen .calculator {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
}

:-webkit-full-screen .calculator {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
}

:-ms-fullscreen .calculator {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
}

/* 响应式 */
@media (max-height: 700px) {
  .btn {
    aspect-ratio: 1 / 0.52;
    border-radius: 22px;
    font-size: 24px;
  }
  .btn-zero {
    aspect-ratio: 2.12 / 0.52;
  }
  .result {
    font-size: 52px;
  }
  .buttons {
    gap: 8px;
    padding: 8px 12px 24px;
  }
}

@media (min-height: 800px) {
  .display-area {
    min-height: 280px;
  }
}