/* pages/calculator/calculator.wxss */ /* ========== 全局 ========== */ page { height: 100%; background-color: #EBF4F8; /* Color 03 (Background) */ display: flex; flex-direction: column; } .calculator-container { display: flex; flex-direction: column; height: 100%; padding-bottom: constant(safe-area-inset-bottom); padding-bottom: env(safe-area-inset-bottom); } /* ========== 显示区域 ========== */ .display-area { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-end; padding: 30rpx 40rpx 20rpx; background: transparent; /* No more dark gradient */ position: relative; overflow: hidden; } /* 顶部工具栏 */ .display-top-bar { position: absolute; top: 20rpx; left: 30rpx; right: 30rpx; display: flex; justify-content: space-between; align-items: center; } .top-actions { display: flex; gap: 16rpx; } .action-btn { width: 64rpx; height: 64rpx; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(17, 97, 107, 0.1); /* Color 01 with opacity */ } .action-icon { font-size: 30rpx; color: #11616B; /* Color 01 */ } /* 模式切换 */ .mode-indicator text { color: #7BBDB6; /* Color 02 text */ font-size: 24rpx; padding: 10rpx 24rpx; border-radius: 30rpx; background: rgba(123, 189, 182, 0.2); /* Color 02 bg */ border: none; } .mode-indicator text.active { color: #11616B; /* Color 01 text */ background: rgba(17, 97, 107, 0.15); /* Color 01 bg */ font-weight: 600; } /* 表达式行 */ .history-text { font-size: 32rpx; color: rgba(17, 97, 107, 0.6); /* Color 01 faded */ min-height: 44rpx; margin-bottom: 12rpx; font-family: -apple-system, 'SF Pro Display', 'Helvetica Neue', sans-serif; text-align: right; width: 100%; letter-spacing: 2rpx; } /* 当前值 */ .current-value { font-size: 130rpx; color: #11616B; /* Color 01 (Deep Teal) */ line-height: 1.1; font-weight: 200; word-break: break-all; text-align: right; width: 100%; font-family: -apple-system, 'SF Pro Display', 'Helvetica Neue', sans-serif; } .current-value.shrink { font-size: 90rpx; } .current-value.shrink-more { font-size: 62rpx; } /* ========== 键盘区域 ========== */ .keypad-area { background: #EBF4F8; /* Color 03 */ padding: 16rpx 24rpx 24rpx; display: flex; flex-direction: column; gap: 20rpx; } .keypad-area.scientific-pad { gap: 14rpx; padding-bottom: 20rpx; } /* 行 */ .row { display: flex; justify-content: space-between; gap: 20rpx; } .keypad-area.scientific-pad .row { gap: 14rpx; } .small-row { justify-content: space-around; gap: 8rpx; } /* ========== 按钮通用 ========== */ .btn { width: 152rpx; height: 152rpx; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-size: 56rpx; font-weight: 400; font-family: -apple-system, 'SF Pro Display', 'Helvetica Neue', sans-serif; position: relative; overflow: hidden; box-shadow: 0 4rpx 10rpx rgba(17, 97, 107, 0.05); /* Very subtle shadow */ } /* 数字键 */ .digit { background-color: #ffffff; color: #11616B; /* Color 01 */ } /* 功能键 (AC, +/-, %) */ .func { background-color: #7BBDB6; /* Color 02 (Medium Teal) */ color: #ffffff; font-size: 46rpx; font-weight: 500; } /* 运算符 */ .operator { background-color: #FED9CD; /* Color 04 (Pale Pink/Peach) */ color: #DC8B70; /* Color 05 (Terracotta) for contrast */ font-size: 64rpx; font-weight: 400; } /* 等号键:渐变突出 */ .equal { background: #11616B; /* Color 01 (Deep Teal) */ color: #ffffff; box-shadow: 0 6rpx 20rpx rgba(17, 97, 107, 0.3); } /* 0键 */ .zero { width: 324rpx; border-radius: 76rpx; justify-content: flex-start; padding-left: 62rpx; box-sizing: border-box; } /* 点击反馈 */ .btn-hover { transform: scale(0.92); opacity: 0.9; } /* 科学模式缩放 */ .keypad-area.scientific-pad .btn { width: 130rpx; height: 130rpx; font-size: 48rpx; } .keypad-area.scientific-pad .zero { width: 274rpx; border-radius: 65rpx; } .keypad-area.scientific-pad .func { font-size: 40rpx; } .keypad-area.scientific-pad .operator { font-size: 54rpx; } /* 科学功能键 */ .sci-btn { width: 120rpx !important; height: 120rpx !important; font-size: 32rpx !important; background: rgba(17, 97, 107, 0.05) !important; /* Very light teal bg */ color: #11616B !important; /* Color 01 */ border-radius: 50% !important; font-weight: 500 !important; letter-spacing: 1rpx; } /* ========== 历史记录面板 ========== */ .history-panel { position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 100; pointer-events: none; opacity: 0; } .history-panel.show { pointer-events: auto; opacity: 1; } .history-mask { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(17, 97, 107, 0.4); /* Color 01 dim */ } .history-content { position: relative; z-index: 101; background: #EBF4F8; /* Color 03 */ border-radius: 0 0 36rpx 36rpx; max-height: 70vh; display: flex; flex-direction: column; box-shadow: 0 16rpx 48rpx rgba(17, 97, 107, 0.2); } .history-panel.show .history-content { animation: histSlideDown 0.3s cubic-bezier(0.32, 0.72, 0, 1) forwards; } @keyframes histSlideDown { from { transform: translateY(-100%); } to { transform: translateY(0); } } .history-header { display: flex; justify-content: space-between; align-items: center; padding: 36rpx 40rpx; border-bottom: 2rpx solid rgba(17, 97, 107, 0.1); } .history-title { color: #11616B; /* Color 01 */ font-size: 34rpx; font-weight: 600; letter-spacing: 1rpx; } .history-clear { color: #DC8B70; /* Color 05 */ font-size: 28rpx; padding: 8rpx 24rpx; border-radius: 20rpx; background: rgba(220, 139, 112, 0.15); /* Color 05 faint */ } .history-list { max-height: 58vh; padding: 10rpx 0; } .history-item { padding: 28rpx 40rpx; border-bottom: 1rpx solid rgba(255,255,255,0.05); display: flex; flex-direction: column; align-items: flex-end; } .history-item:active { background: rgba(255,255,255,0.06); } .history-expr { color: rgba(255,255,255,0.45); font-size: 26rpx; margin-bottom: 8rpx; font-family: -apple-system, 'SF Pro Display', monospace; } .history-result { color: #ffffff; font-size: 42rpx; font-weight: 500; font-family: -apple-system, 'SF Pro Display', 'Helvetica Neue', sans-serif; } .history-empty { text-align: center; padding: 100rpx 0; color: rgba(17, 97, 107, 0.4); font-size: 28rpx; } .history-empty-icon { font-size: 64rpx; display: block; margin-bottom: 16rpx; opacity: 0.5; } /* ========== 小屏适配 ========== */ @media (max-width: 360px) { .btn { width: 140rpx; height: 140rpx; font-size: 50rpx; } .zero { width: 300rpx; } .current-value { font-size: 110rpx; } }