/* Floating consultation widget — right side */
:root {
  --ts-consult-purple: #237bb5;
  --ts-consult-purple-dark: #1c6391;
  --ts-consult-border: #d8d8de;
  --ts-consult-text: #333;
  --ts-consult-muted: #555;
  --ts-consult-width: 300px;
}

.ts-consult {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  pointer-events: none;
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ts-consult-text);
}

.ts-consult-tab,
.ts-consult-panel {
  pointer-events: auto;
}

.ts-consult-tab {
  display: none;
  width: 40px;
  padding: 18px 0;
  border: none;
  border-radius: 8px 0 0 8px;
  background: var(--ts-consult-purple);
  color: #fff;
  cursor: pointer;
  box-shadow: -2px 2px 10px rgba(0, 0, 0, 0.15);
  writing-mode: vertical-rl;
  text-orientation: mixed;
  letter-spacing: 0.2em;
  font-size: 14px;
  line-height: 40px;
}

.ts-consult-tab:hover {
  background: var(--ts-consult-purple-dark);
}

.ts-consult-tab-text {
  display: inline-block;
}

.ts-consult:not(.is-open) .ts-consult-tab {
  display: block;
}

.ts-consult:not(.is-open) .ts-consult-panel {
  display: none;
}

.ts-consult.is-open .ts-consult-tab {
  display: none;
}

.ts-consult-panel {
  width: var(--ts-consult-width);
  background: #fff;
  border: 1px solid #e5e5ea;
  border-right: none;
  border-radius: 4px 0 0 4px;
  box-shadow: -4px 4px 18px rgba(0, 0, 0, 0.12);
  overflow: hidden;
}

.ts-consult-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--ts-consult-purple);
  color: #fff;
}

.ts-consult-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.ts-consult-minimize {
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ts-consult-minimize-icon {
  display: block;
  width: 14px;
  height: 2px;
  background: #fff;
  border-radius: 1px;
}

.ts-consult-body {
  padding: 14px 14px 16px;
}

.ts-consult-intro {
  margin: 0 0 12px;
  color: var(--ts-consult-muted);
  font-size: 12px;
  line-height: 1.65;
}

.ts-consult-field {
  margin-bottom: 10px;
  position: relative;
}

.ts-consult-field textarea,
.ts-consult-field input[type="text"],
.ts-consult-field input[type="tel"] {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--ts-consult-border);
  border-radius: 4px;
  background: #fff;
  color: var(--ts-consult-text);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.4;
  outline: none;
  box-shadow: none;
  text-shadow: none;
  -webkit-text-fill-color: var(--ts-consult-text);
  -webkit-appearance: none;
  appearance: none;
}

.ts-consult-field textarea::placeholder,
.ts-consult-field input::placeholder {
  color: #999;
  opacity: 1;
  font-weight: 400;
  text-shadow: none;
  -webkit-text-fill-color: #999;
}

.ts-consult-field textarea::-webkit-input-placeholder {
  color: #999;
  opacity: 1;
  font-weight: 400;
  text-shadow: none;
  -webkit-text-fill-color: #999;
}

.ts-consult-field textarea::-moz-placeholder,
.ts-consult-field input::-moz-placeholder {
  color: #999;
  opacity: 1;
  font-weight: 400;
  text-shadow: none;
}

.ts-consult-field textarea {
  min-height: 88px;
  resize: vertical;
}

.ts-consult-field textarea:focus,
.ts-consult-field input:focus {
  border-color: var(--ts-consult-purple);
}

.ts-consult-field-icon input {
  padding-left: 34px;
}

.ts-consult-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  opacity: 0.55;
  pointer-events: none;
}

.ts-consult-icon-phone {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23666'%3E%3Cpath d='M6.6 10.8c1.4 2.8 3.8 5.1 6.6 6.6l2.2-2.2c.3-.3.7-.4 1-.2 1.1.4 2.3.6 3.6.6.5 0 1 .4 1 1V20c0 .6-.4 1-1 1C10.6 21 3 13.4 3 4c0-.6.4-1 1-1h3.5c.6 0 1 .4 1 1 0 1.2.2 2.4.6 3.6.1.3 0 .7-.2 1L6.6 10.8z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.ts-consult-icon-grid {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23666'%3E%3Cpath d='M3 3h8v8H3V3zm10 0h8v8h-8V3zM3 13h8v8H3v-8zm10 0h8v8h-8v-8z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.ts-consult-captcha-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ts-consult-captcha-row input {
  flex: 1;
  min-width: 0;
}

.ts-consult-captcha-btn {
  flex: 0 0 auto;
  padding: 0;
  border: 1px solid var(--ts-consult-border);
  border-radius: 4px;
  background: #f5f5f8;
  cursor: pointer;
  overflow: hidden;
  line-height: 0;
}

.ts-consult-captcha-btn img {
  display: block;
  width: 100px;
  height: 36px;
}

.ts-consult-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
  min-height: 34px;
}

.ts-consult-msg {
  flex: 1;
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
  text-align: left;
}

.ts-consult-msg.is-error {
  color: #c0392b;
}

.ts-consult-msg.is-success {
  color: #1e7e34;
}

.ts-consult-submit {
  display: inline-block;
  min-width: 72px;
  padding: 7px 18px;
  border: none;
  border-radius: 4px;
  background: var(--ts-consult-purple);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}

.ts-consult-submit:hover {
  background: var(--ts-consult-purple-dark);
}

.ts-consult-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

@media screen and (max-width: 767px) {
  .ts-consult-panel {
    width: 280px;
  }

  .ts-consult:not(.is-open) .ts-consult-tab {
    width: 34px;
    line-height: 34px;
    padding: 14px 0;
    font-size: 13px;
  }
}
