/* 通用输入框：CustomInput */

:root {
  /* 中性色 */
  --input-bg: #ffffff;
  --input-bg-muted: #f5f5f5;
  --input-text: #333333;
  --input-text-muted: #999999;
  --input-border: #d9d9d9;
  --input-border-soft: #f0f0f0;
  --input-primary: var(--color-primary, #ff4d00);
  --input-primary-hover: var(--color-primary-hover, #ff6a2a);
  --input-primary-shadow: rgba(24, 144, 255, 0.2);
}

.custom-input {
  width: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  position: relative;
  color: var(--input-text);
}

/* 尺寸 */
.custom-input.input-size-small .input-element {
  height: 24px;
  font-size: 13px;
}
.custom-input.input-size-default .input-element {
  height: 32px;
  font-size: 14px;
}
.custom-input.input-size-large .input-element {
  height: 40px;
  font-size: 16px;
}

@media (max-width: 768px) {
  /* 16px 避免 iOS 聚焦时页面缩放；44px 便于点按 */
  .custom-input .input-element {
    font-size: 16px !important;
    min-height: 44px;
    height: 44px;
  }
  .custom-input .input-wrapper {
    min-height: 44px;
  }
}

/* 包裹 */
.input-wrapper {
  display: flex;
  align-items: center;
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  padding: 0 11px;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.input-wrapper input{
  width: 100%;
}

.custom-input.input-borderless .input-wrapper {
  border: none;
  box-shadow: none;
  padding-left: 0;
  padding-right: 0;
}

.custom-input.input-borderless.input-focused .input-wrapper {
  box-shadow: none;
}

.input-prefix,
.input-suffix {
  display: inline-flex;
  align-items: center;
  color: var(--input-text-muted);
  white-space: nowrap;
}

.input-prefix {
  margin-right: 8px;
}
.input-suffix {
  margin-left: 8px;
}

.input-element {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--input-text);
  padding: 0;
}

.custom-input.input-focused .input-wrapper {
  border-color: var(--input-primary-hover);
  box-shadow: 0 0 0 2px var(--input-primary-shadow);
}

.custom-input.input-status-error .input-wrapper {
  border-color: #ff4d4f;
}
.custom-input.input-status-error.input-focused .input-wrapper {
  box-shadow: 0 0 0 2px rgba(255, 77, 79, 0.2);
}

.custom-input.input-status-warning .input-wrapper {
  border-color: #faad14;
}
.custom-input.input-status-warning.input-focused .input-wrapper {
  box-shadow: 0 0 0 2px rgba(250, 173, 20, 0.2);
}

.input-clear {
  display: none;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: 8px;
  border-radius: 50%;
  color: var(--input-text-muted);
  cursor: pointer;
  user-select: none;
  transition: background 0.2s, color 0.2s;
  background: var(--input-bg-muted);
  line-height: 1;
}

.input-clear .g-icon {
  width: 12px;
  height: 12px;
}

.custom-input.can-clear .input-clear {
  display: inline-flex;
}

.input-clear:hover {
  background: var(--input-border-soft);
  color: var(--input-text);
}

.custom-input .input-element:disabled {
  background: transparent;
  color: var(--input-text-muted);
  cursor: not-allowed;
}

.custom-input .input-element[readonly] {
  background: transparent;
  color: var(--input-text-muted);
}

/* 字数计数 */
.input-count {
  margin-top: 6px;
  font-size: 12px;
  color: var(--input-text-muted);
}

