:root {
  --ask-accent: #f97316;
  --ask-text: #111827;
  --ask-muted: #9ca3af;
  --ask-label: #6b7280;
  --ask-line: #e5e7eb;
  --ask-hint-bg: #fef3e2;
  --ask-bg: #ffffff;
}

* {
  box-sizing: border-box;
}

body.home-ask {
  margin: 0;
  background: var(--ask-bg);
  color: var(--ask-text);
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", "Microsoft YaHei", sans-serif;
}

html[lang^="en"] body.home-ask {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
}

.ask-page {
  max-width:100%;
  min-height: 100vh;
  margin: 0 auto;
  background: #ffffff;
  padding-bottom: 82px;
}

.ask-statusbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 44px;
  padding: 0 28px;
  font-size: 13px;
  font-weight: 700;
}

.ask-statusbar__time { justify-self: start; }

.ask-statusbar__notch {
  width: 120px;
  height: 28px;
  border-radius: 20px;
  background: #1a1a1a;
}

.ask-statusbar__signal {
  justify-self: end;
  width: 16px;
  height: 12px;
  display: block;
}

.ask-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px 13px;
  position: sticky;
  top: 0;
  z-index: 5;
  border-bottom: 1px solid var(--ask-line);
}

.ask-header__back {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 22px;
}

.ask-header__back img {
  width: 22px;
  height: 22px;
  display: block;
}

.ask-header h1 {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
  font-weight: 700;
}

.ask-main {
  padding: 16px 16px 18px;
}

.ask-message {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff1f2;
  color: #b42318;
  font-size: 12px;
  line-height: 1.45;
}

.ask-message.hidden {
  display: none;
}

.ask-hint {
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--ask-hint-bg);
}

.ask-hint p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  font-weight: 400;
  color: var(--ask-accent);
}

.ask-guest-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #fed7aa;
  border-radius: 12px;
  background: #fffaf5;
}

.ask-guest-notice p {
  margin: 0;
  color: #9a3412;
  font-size: 13px;
  line-height: 1.5;
}

.ask-guest-notice a {
  flex: 0 0 auto;
  color: var(--ask-accent);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.ask-form {
  display: grid;
  gap: 20px;
  padding-top: 14px;
}

.ask-field-group {
  display: grid;
  gap: 5px;
}

.ask-field-group--compact {
  gap: 5px;
}

.ask-label {
  font-size: 12px;
  line-height: 1.2;
  font-weight: 700;
  color: var(--ask-label);
}

.ask-field {
  width: 100%;
  padding: 13px 15px;
  border: 1px solid var(--ask-line);
  border-radius: 10px;
  background: #ffffff;
  font-size: 14px;
  line-height: 1.4;
  color: var(--ask-text);
  outline: 0;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.ask-field::placeholder {
  color: var(--ask-muted);
}

.ask-field:focus {
  border-color: #fdba74;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.12);
}

.ask-field--textarea {
  min-height: 110px;
  resize: none;
}

.ask-field-group--images {
  position: relative;
  gap: 9px;
}

.ask-image-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ask-image-upload {
  width: 33.333%;
  max-width: 150px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 10px;
  border: 1px solid rgba(249, 115, 22, .34);
  border-radius: 999px;
  background: #ffffff;
  color: #c2410c;
  box-shadow: 0 2px 8px rgba(249, 115, 22, .08);
  font-size: 12px;
  line-height: 1;
  font-weight: 600;
  user-select: none;
  cursor: pointer;
  transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
}

.ask-image-upload:hover {
  border-color: rgba(249, 115, 22, .58);
  background: #fffaf5;
  box-shadow: 0 3px 10px rgba(249, 115, 22, .13);
}

.ask-image-upload:active {
  background: #fff3e8;
  box-shadow: 0 1px 4px rgba(249, 115, 22, .1);
}

.ask-image-upload.is-disabled {
  opacity: .55;
  cursor: not-allowed;
}

.ask-image-upload img {
  width: 15px;
  height: 15px;
  display: block;
}

.ask-image-hint {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin: 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--ask-muted);
}

#askImageCount {
  font-variant-numeric: tabular-nums;
}

.ask-image-preview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 2px;
}

.ask-image-preview:empty {
  display: none;
}

.ask-image-preview__item {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--ask-line);
  border-radius: 10px;
  background: #f9fafb;
}

.ask-image-preview__item img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.ask-image-preview__remove {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(17, 24, 39, .82);
  color: #ffffff;
  font-size: 15px;
  line-height: 22px;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
}

/* Tag widget styles */
.ask-tags-widget {
  margin-top: 6px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 10px;
  border: 1px solid var(--ask-line);
  border-radius: 10px;
  background: #fff;
}
.ask-tags-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.ask-tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: #fff7ed;
  border: 1px solid rgba(249,115,22,0.14);
  color: #92400e;
  border-radius: 999px;
  font-size: 13px;
}
.ask-tag-remove {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font-weight: 700;
  padding: 0 4px;
  cursor: pointer;
}
.ask-tags-type {
  flex: 1 1 160px;
  min-width: 80px;
  padding: 8px 6px;
  border: 0;
  background: transparent;
  font-size: 14px;
  color: var(--ask-text);
  outline: none;
}
.ask-tags-widget:focus-within {
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.08);
  border-color: #fdba74;
}
.ask-tags-widget {
  position: relative;
}

.ask-tags-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  margin-top: 0;
  max-height: 60vh;
  overflow: auto;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
  background: #fff;
  z-index: 9999;
}
.ask-tags-suggestions.hidden { display: none; }
.ask-tags-suggestion {
  padding: 10px 12px;
  background: #ffffff;
  border-bottom: 1px solid var(--ask-line);
  cursor: pointer;
  font-size: 14px;
}
.ask-tags-suggestion:hover {
  background: #fffbf5;
}

/* Improve spacing under tags area */
.ask-field-group--compact .ask-tags-widget { margin-top: 4px; }

.ask-tag-hint {
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
  color: var(--ask-muted);
}

.ask-submit {
  width: 100%;
  padding: 13px 20px;
  border: 0;
  border-radius: 10px;
  background: var(--ask-accent);
  color: #ffffff;
  font-size: 15px;
  line-height: 1.2;
  font-weight: 700;
  margin-top: 2px;
}

.ask-bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-width:100%;
  height: 70px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: center;
  padding: 0 4px;
  background: #ffffff;
  border-top: 1px solid var(--ask-line);
}

.ask-bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: var(--ask-muted);
  font-size: 10px;
  font-weight: 500;
}

.ask-bottom-nav a img {
  width: 22px;
  height: 22px;
  display: block;
}

.ask-bottom-nav__plus span {
  width: 46px;
  height: 46px;
  border-radius: 23px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ask-accent);
  box-shadow: 0 4px 14px rgba(249, 115, 22, 0.45);
}

@media (min-width: 768px) {
  body.home-ask {
    padding: 0;
    background: #ffffff;
  }

  .ask-page {
    width: 100%;
    max-width: none;
    border-radius: 0;
    overflow: visible;
    box-shadow: none;
  }

  .ask-bottom-nav {
    left: 50%;
    right: auto;
    width: calc(100vw - 32px);
    max-width: 960px;
    max-width: none;
    transform: translateX(-50%);
  }
}
