/* ===========================================
   骰子盒组件样式
   =========================================== */

.dice-box {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.dice-box__section {
  padding-bottom: var(--spacing-md);
  border-bottom: 1px solid var(--border-color);
}

.dice-box__section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.dice-box__section-title {
  font-family: var(--font-title);
  font-size: var(--font-size-md);
  color: var(--ink-light);
  margin: 0 0 var(--spacing-sm);
}

/* 骰子类型选择 */
.dice-box__dice-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-xs);
}

.dice-box__dice-btn {
  min-width: 60px;
  padding: var(--spacing-sm) var(--spacing-md);
  font-family: var(--font-mono);
  font-size: var(--font-size-md);
  font-weight: bold;
  border: var(--border-width) solid var(--border-color);
  border-radius: var(--border-radius-sm);
  background: var(--parchment-light);
  color: var(--ink-color);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.dice-box__dice-btn:hover {
  background: var(--parchment-dark);
}

.dice-box__dice-btn--active {
  background: var(--accent-gold);
  border-color: var(--accent-gold-light);
  box-shadow: var(--shadow-soft);
}

/* 数量控制 */
.dice-box__count-row {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.dice-box__count-btn {
  width: 40px;
  height: 40px;
  font-size: var(--font-size-lg);
  font-weight: bold;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dice-box__count-input {
  width: 80px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: var(--font-size-lg);
  font-weight: bold;
}

.dice-box__hint {
  font-size: var(--font-size-sm);
  color: var(--ink-faded);
  margin: var(--spacing-sm) 0 0;
}

/* 投掷按钮 */
.dice-box__roll-btn {
  width: 100%;
  padding: var(--spacing-md);
  font-size: var(--font-size-lg);
  font-weight: bold;
}

/* 结果显示 */
.dice-box__result-section {
  text-align: center;
}

.dice-box__result {
  padding: var(--spacing-md);
  background: var(--parchment-bg);
  border-radius: var(--border-radius-md);
}

.dice-box__result-total {
  font-family: var(--font-mono);
  font-size: 48px;
  font-weight: bold;
  color: var(--accent-red);
  line-height: 1.2;
}

.dice-box__result-total--animate {
  animation: diceResult 0.3s ease-out;
}

@keyframes diceResult {
  0% {
    transform: scale(1.3);
    opacity: 0.5;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.dice-box__result-detail {
  font-family: var(--font-mono);
  font-size: var(--font-size-md);
  color: var(--ink-light);
  margin-top: var(--spacing-sm);
  word-break: break-all;
}

.dice-box__die {
  display: inline-block;
  padding: 2px 6px;
  margin: 2px;
  background: var(--parchment-light);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
}

.dice-box__die--max {
  background: var(--accent-gold);
  border-color: var(--accent-gold-light);
  color: var(--ink-color);
}

.dice-box__die--min {
  background: var(--accent-red);
  border-color: var(--accent-red-light);
  color: var(--parchment-light);
}

/* 历史记录 */
.dice-box__history-section {
  max-height: 200px;
  overflow: hidden;
}

.dice-box__history {
  max-height: 150px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.dice-box__empty {
  color: var(--ink-faded);
  text-align: center;
  padding: var(--spacing-sm);
}

.dice-box__history-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-xs) var(--spacing-sm);
  background: var(--parchment-bg);
  border-radius: var(--border-radius-sm);
  font-size: var(--font-size-sm);
}

.dice-box__history-time {
  color: var(--ink-faded);
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
}

.dice-box__history-roll {
  font-family: var(--font-mono);
  font-weight: bold;
  color: var(--ink-color);
}

.dice-box__history-total {
  font-family: var(--font-mono);
  font-weight: bold;
  color: var(--accent-red);
}

.dice-box__history-detail {
  color: var(--ink-faded);
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
