/* 双栏布局 */
.dual-pane-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.config-pane {
  flex: 1;
  min-width: 0;
}

.result-pane {
  flex: 1;
  min-width: 0;
  position: sticky;
  top: 24px;
}

.password-display-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px;
  border: none;
  box-shadow: none;
  background: transparent;
}

.password-output-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(15, 23, 42, 0.4);
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 12px;
  padding: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.password-output-wrapper:hover {
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(16, 185, 129, 0.3);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.1);
  transform: translateY(-2px);
}

.password-output {
  width: 100%;
  font-family: "JetBrains Mono", "Fira Code", "Source Code Pro", var(--font-mono);
  font-size: 28px;
  font-weight: 700;
  color: #10b981;
  text-align: center;
  padding: 24px 60px 24px 20px;
  background: transparent;
  border: none;
  outline: none;
  transition: all 0.3s ease;
  letter-spacing: 2px;
}

.password-output:focus {
  color: #34d399;
}

.icon-btn {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.2);
  color: #64748b;
  cursor: pointer;
  padding: 10px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.icon-btn:hover {
  color: #10b981;
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  transform: translateY(-50%) scale(1.05);
}

.icon-btn:active {
  transform: translateY(-50%) scale(0.95);
}

.strength-meter-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px 20px;
  background: rgba(15, 23, 42, 0.3);
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.1);
  transition: all 0.3s ease;
}

.strength-meter-container:hover {
  border-color: rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.4);
}

/* 亮色模式适配 */
.light-theme .password-output-wrapper {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.light-theme .password-output-wrapper:hover {
  background: #ffffff;
  border-color: #10b981;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.light-theme .password-output {
  color: #059669;
}

.light-theme .password-output:focus {
  color: #10b981;
}

.light-theme .icon-btn {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}

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

.light-theme .strength-meter-container {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.light-theme .strength-meter-container:hover {
  background: #ffffff;
  border-color: #cbd5e1;
}

.strength-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.strength-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.strength-meter {
  width: 100%;
  height: 8px;
  background-color: var(--border-color);
  border-radius: 4px;
  overflow: hidden;
}

.strength-bar {
  height: 100%;
  width: 0%;
  background-color: #ef4444; /* default red */
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.4s ease;
}

.strength-text {
  font-size: 14px;
  font-weight: 700;
}

/* Config Panel Styles */
.password-config-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 16px;
}

.config-row {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px dashed var(--border-color);
}

.config-row:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.length-row {
  gap: 16px;
}

.length-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.config-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-color);
}

.length-value {
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--primary-color);
  background: var(--hover-bg-color);
  padding: 4px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.length-slider {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background-color: rgba(16, 185, 129, 0.2); /* 默认深色模式背景 */
  border-radius: 3px;
  outline: none;
  cursor: pointer;
  margin: 0;
  /* 初始背景填充，由 JS 动态计算 */
  background-image: linear-gradient(#10b981, #10b981);
  background-size: 20% 100%;
  background-repeat: no-repeat;
}

.light-theme .length-slider {
  background-color: rgba(16, 185, 129, 0.15);
}

.length-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px; /* 增大滑块 */
  height: 18px;
  background: #fff;
  border-radius: 50%;
  border: 3px solid #10b981; /* 加粗滑块边框 */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  cursor: grab;
  transition: transform 0.2s ease;
}

.length-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.length-slider::-webkit-slider-thumb:active {
  cursor: grabbing;
}

.checkbox-group {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.checkbox-group.vertical {
  flex-direction: column;
  gap: 12px;
}

/* 交互式配置项样式 (参考 cronGenerator) */
.interactive-item {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-color);
  user-select: none;
  padding: 12px 16px;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.interactive-item:hover {
  background: var(--hover-bg-color);
  border-color: rgba(16, 185, 129, 0.4);
  transform: translateX(4px);
}

.interactive-item input[type="checkbox"] {
  cursor: pointer;
  width: 18px;
  height: 18px;
  accent-color: var(--primary-color);
}

@media (max-width: 899px) {
  .dual-pane-layout {
    flex-direction: column;
  }
  
  .result-pane {
    position: static;
    order: -1; /* 在移动端将结果区域放到上方 */
  }
}

@media (max-width: 600px) {
  .password-output {
    font-size: 24px;
    padding: 20px 50px;
  }
  
  .icon-btn {
    padding: 8px;
  }
  
  .copy-btn {
    right: 8px;
  }
  
  .refresh-btn {
    left: 8px;
  }
  
  .interactive-item {
    padding: 10px 12px;
  }
  
  .interactive-item:hover {
    transform: none; /* 移动端取消位移效果 */
  }
}