/* Layout and supplementary styles for ipbe-info.
   Component styling comes from the self-hosted Codex CSS in assets/vendor/;
   overrides below adapt it to the local visual style. */

@font-face {
  font-family: 'HarmonyOS Sans SC';
  src: url('fonts/HarmonyOS_Sans_SC.woff2') format('woff2');
  font-display: swap;
}

* {
  box-sizing: border-box;
}

/* Codex sets display on .cdx-message etc., which overrides the UA [hidden] rule */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background-color: #fff;
  color: #1a2333;
  font-family: 'HarmonyOS Sans SC', -apple-system, 'PingFang SC', 'Noto Sans CJK SC',
    'Microsoft YaHei', sans-serif;
  line-height: 1.7;
}

h1,
h2 {
  font-weight: 700;
}

/* Wide container, left-aligned content (like a Bootstrap .container) */
.page {
  max-width: 1140px;
  margin: 0 auto;
  padding: 40px 24px 64px;
}

.page__header h1 {
  font-size: 1.75rem;
  line-height: 1.3;
  margin: 0 0 12px;
}

.page__header p {
  margin: 0;
  color: #4a5568;
}

/* Channel selection buttons */
.mode-select {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 32px;
}

.mode-select__button {
  min-width: 240px;
  padding: 14px 28px;
  font-size: 1rem;
}

/* Form section */
#form-section h2,
#output-section h2 {
  font-size: 1.25rem;
  margin: 24px 0 16px;
}

/* Small hint under the output heading (Unblock-zh.org channel) */
.output-hint {
  margin: -8px 0 12px;
  color: #4a5568;
  font-size: 0.875rem;
}

.form-section__back {
  margin: 32px 0 12px;
}

.form-section__submit {
  margin: 32px 0 0;
}

.form-section__submit .cdx-button {
  min-width: 200px;
  padding: 12px 28px;
}

/* Space out Codex fields (Codex only styles the components themselves) */
.cdx-field {
  margin-bottom: 28px;
}

.cdx-field__help-text {
  margin-top: 6px;
  color: #4a5568;
  font-size: 0.875rem;
}

.cdx-message--error {
  margin-top: 6px;
}

/* Rounder corners than the Codex 2px defaults */
.cdx-button {
  border-radius: 6px;
}

.cdx-text-input__input,
.cdx-text-area__textarea {
  border-radius: 6px;
}

/* Generated output: wiki code block look */
.output-block {
  position: relative;
}

.output-text {
  margin: 0;
  padding: 20px 52px 20px 20px;
  background-color: #f8f9fa;
  border: 1px solid #d8dde6;
  border-radius: 8px;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.875rem;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  user-select: text;
}

/* Copy icon button pinned to the block's top-right corner */
.copy-button {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  background-color: #fff;
  border: 1px solid #d8dde6;
  border-radius: 6px;
  color: #4a5568;
  cursor: pointer;
}

.copy-button:hover {
  background-color: #f0f3f7;
  color: #1a2333;
}

.copy-button--done {
  color: #14866d;
}

.copy-button__svg {
  display: block;
  fill: currentColor;
}

/* Call-to-action link styled like the primary buttons */
.output-section__link {
  margin: 20px 0;
}

.action-link {
  display: inline-block;
  padding: 10px 22px;
  background-color: #36c;
  border: 1px solid #36c;
  border-radius: 6px;
  color: #fff;
  font-weight: bold;
  text-decoration: none;
}

.action-link:hover {
  background-color: #447ff5;
  border-color: #447ff5;
  color: #fff;
}

.action-link:active {
  background-color: #2a4b8d;
  border-color: #2a4b8d;
}

/* Email notice: mbox-style warning box */
.email-notice {
  margin: 20px 0;
  padding: 14px 18px;
  background-color: #ffc;
  border: 1px solid #fb3;
  border-left: 10px solid #fb3;
  border-radius: 4px;
  font-size: 0.9375rem;
}

.email-notice p {
  margin: 0 0 6px;
  font-weight: bold;
}

.email-notice ul {
  margin: 0;
  padding-left: 22px;
}

/* Footer: small print */
.page-footer {
  max-width: 1140px;
  margin: 0 auto;
  padding: 20px 24px;
  border-top: 1px solid #d8dde6;
  color: #4a5568;
  font-size: 0.75rem;
}

.page-footer p {
  margin: 4px 0;
}

/* Small screens: keep comfortable touch targets and full-width buttons */
@media (max-width: 480px) {
  .page {
    padding: 28px 14px 48px;
  }

  .page__header h1 {
    font-size: 1.5rem;
  }

  .mode-select__button,
  .form-section__submit .cdx-button {
    width: 100%;
  }
}
