/* HMAC-SHA 消息认证工具特定样式 */

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.pill-input {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* HMAC 结果展示样式 */
#shaResults {
  display: none;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
  width: 100%;
}

.sha-result-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(15, 23, 42, 0.3);
  padding: 16px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.sha-result-item:hover {
  background: rgba(15, 23, 42, 0.5);
  border-color: rgba(16, 185, 129, 0.2);
  transform: translateY(-1px);
}

.sha-result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.sha-result-label {
  font-size: 11px;
  font-weight: 700;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sha-result-label::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
}

.sha-result-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 11px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: #64748b;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sha-result-copy svg {
  width: 12px;
  height: 12px;
  stroke-width: 2.5;
}

.sha-result-copy:hover {
  border-color: #10b981;
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
}

.sha-result-value {
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(148, 163, 184, 0.05);
  border-radius: 8px;
  padding: 12px 14px;
  font-family: "JetBrains Mono", "Fira Code", "Source Code Pro", monospace;
  font-size: 13px;
  color: #10b981;
  word-break: break-all;
  min-height: 48px;
  display: flex;
  align-items: center;
  line-height: 1.5;
  letter-spacing: 0.01em;
}

/* 复制按钮成功状态 */
.sha-result-copy.success {
  border-color: #10b981 !important;
  background: #10b981 !important;
  color: #ffffff !important;
}

/* 亮色模式优化 */
.light-theme .sha-result-item {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.light-theme .sha-result-item:hover {
  border-color: #10b981;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.light-theme .sha-result-label {
  color: #64748b;
}

.light-theme .sha-result-value {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #059669;
}

.light-theme .sha-result-copy {
  border-color: #cbd5e1;
  background: #f1f5f9;
  color: #475569;
}

.light-theme .sha-result-copy:hover {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.05);
}

/* 响应式布局：认证结果框占满横向位置 */
@media (min-width: 900px) {
  .editor-area {
    grid-template-areas: 
      "key input"
      "result result";
    grid-template-rows: 1fr 1fr;
  }

  #keyPanel { grid-area: key; }
  #inputPanel { grid-area: input; }
  #outputPanel { grid-area: result; }

  /* 结果展示区域内部排列 */
  #shaResults {
    display: none; /* 初始隐藏，由 JS 控制 */
    flex-direction: row;
    flex-wrap: wrap;
    gap: 16px;
  }

  .sha-result-item {
    flex: 1;
    min-width: 300px;
  }
}
