/* 散列值专用样式 */

/* 顶部输入类型工具栏 */
.hash-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.hash-toolbar label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

/* 输入类型分段开关 */
.input-type {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-soft-border);
  border-radius: 8px;
}

.input-type .seg-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.input-type .seg-btn:hover {
  color: var(--text);
}

.input-type .seg-btn.is-active {
  background: var(--accent);
  color: var(--accent-contrast);
}

/* 输入面板：悬浮复制按钮 */
.field-input {
  position: relative;
}

.field-input .copy-corner {
  position: absolute;
  top: 8px;
  right: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
  box-shadow: var(--shadow-sm);
}

.field-input:focus-within .copy-corner {
  opacity: 1;
  pointer-events: auto;
}

/* 纯图标按钮 */
.btn-icon {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 8px;
}

.btn-icon svg {
  width: 16px;
  height: 16px;
}

.field-input textarea {
  display: block;
  min-height: 140px;
  font-size: 14px;
  line-height: 1.6;
  padding: 12px 48px 12px 14px;
}

.field-textarea {
  margin-bottom: 0;
}

/* 文件拖放区 */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 140px;
  border: 2px dashed var(--border-strong);
  border-radius: 12px;
  background: var(--bg-muted);
  cursor: pointer;
  padding: 20px;
  text-align: center;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.dropzone:hover,
.dropzone.is-dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.dropzone-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.dropzone.has-file .dropzone-empty {
  display: none;
}

.dropzone-empty svg {
  width: 32px;
  height: 32px;
  color: var(--text-faint);
  margin-bottom: 8px;
}

.dropzone-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.dropzone-sub {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--text-muted);
}

.file-info {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.file-info svg {
  width: 22px;
  height: 22px;
  color: var(--accent);
  flex: none;
}

.file-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  flex: 1;
}

.file-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-size {
  font-size: 12.5px;
  color: var(--text-muted);
}

/* 错误提示 */
.error-msg {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--error);
  background: var(--error-soft);
  border: 1px solid var(--error-soft-border);
  border-radius: 8px;
  padding: 8px 12px;
}

/* 环境提示（非错误，中性色） */
.env-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--text-muted);
  background: var(--bg-muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
}

/* 进度条 */
.progress-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.progress-track {
  flex: 1;
  height: 6px;
  background: var(--bg-muted);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.1s linear;
}

.progress-text {
  flex: none;
  min-width: 42px;
  text-align: right;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* 结果面板标题 */
.hash-result-panel h2 {
  margin-bottom: 14px;
}

/* 结果列表 */
.hash-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hash-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hash-name {
  flex: none;
  min-width: 78px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-soft-border);
}

.hash-name.alt {
  background: var(--accent-2-soft);
  color: var(--accent-2);
  border: 1px solid var(--accent-2-soft);
}

.hash-bits {
  flex: none;
  min-width: 52px;
  font-size: 12px;
  color: var(--text-faint);
}

.hash-value {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  line-height: 1.5;
  word-break: break-all;
  color: var(--code-text);
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: 8px;
  padding: 8px 12px;
}

.hash-copy {
  flex: none;
}

/* 底部速查表 */
.rule-panel {
  margin-top: 20px;
}

.rule-panel .rule-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  user-select: none;
}

.rule-panel .rule-toggle::-webkit-details-marker {
  display: none;
}

.rule-panel .rule-toggle::after {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}

.rule-panel[open] .rule-toggle::after {
  transform: rotate(45deg);
}

.rule-panel .table-wrap {
  margin-top: 12px;
}

.rule-table .mono {
  font-family: "SF Mono", SFMono-Regular, ui-monospace, Menlo, Consolas,
    monospace;
  font-size: 12px;
}

/* 窄屏下结果行折行：名称与位长各占一行 */
@media (max-width: 640px) {
  .hash-row {
    flex-wrap: wrap;
  }

  .hash-value {
    flex-basis: 100%;
    order: 3;
  }

  .hash-copy {
    margin-left: auto;
  }
}

/* Large-file confirmation dialog */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-lg);
}

.modal-title {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 700;
}

.modal-body {
  margin: 0 0 20px;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  word-break: break-all;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
