:root {
  color-scheme: light;
  --ink: #493958;
  --muted: #9a8ba6;
  --line: #f0dfeb;
  --pink: #f28cb4;
  --purple: #9675d7;
  --surface: rgba(255, 255, 255, .9);
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 87% 8%, rgba(255, 211, 231, .7), transparent 29%),
    radial-gradient(ellipse at 5% 55%, rgba(219, 211, 255, .58), transparent 34%),
    linear-gradient(145deg, #fff9fc, #f8f5ff 58%, #fff7f2);
}
button, input, select { font: inherit; }
button { cursor: pointer; }
.page { width: min(1120px, calc(100% - 72px)); min-height: 100vh; display: flex; flex-direction: column; margin: 0 auto; }
header {
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(231, 210, 230, .75);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-icon {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: linear-gradient(145deg, #ffd8e7, #e6d9ff);
  box-shadow: 0 6px 16px rgba(153, 113, 173, .16);
}
.brand-icon img { width: 27px; height: 27px; object-fit: contain; }
.brand-name { color: #604773; font-size: 22px; font-weight: 800; letter-spacing: .04em; line-height: 1; }
.brand-caption { margin-top: 5px; color: #a58cae; font-size: 10px; letter-spacing: .06em; -webkit-text-stroke: 0; text-shadow: none; }
.header-right {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 14px;
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 999px;
  color: #8d7a99;
  background: rgba(255, 255, 255, .62);
  font-size: 12px;
  white-space: nowrap;
}
.live-dot { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: #e7ad55; box-shadow: 0 0 0 4px rgba(231, 173, 85, .12); }
.live-dot[data-state="ready"] { background: #49b991; box-shadow: 0 0 0 4px rgba(73, 185, 145, .12); }
.live-dot[data-state="error"] { background: #d97785; box-shadow: 0 0 0 4px rgba(217, 119, 133, .12); }
main { flex: 1; padding: 37px 0 42px; }
.welcome {
  position: relative;
  overflow: hidden;
  display: flex;
  min-height: 218px;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 30px clamp(28px, 5vw, 65px);
  border-radius: 30px;
  background:
    radial-gradient(circle at 20% 5%, rgba(255, 255, 255, .85), transparent 26%),
    linear-gradient(115deg, #ffe5ef, #eee5ff 58%, #e6f5ff);
  box-shadow: 0 17px 45px rgba(138, 108, 159, .12);
}
.welcome::after {
  position: absolute;
  top: -170px;
  right: 12%;
  width: 360px;
  height: 360px;
  border: 1px solid rgba(160, 125, 193, .13);
  border-radius: 50%;
  box-shadow: 0 0 0 27px rgba(160, 125, 193, .045), 0 0 0 56px rgba(160, 125, 193, .035);
  content: "";
  pointer-events: none;
}
.welcome-copy, .mascot-wrap, .time-block { position: relative; z-index: 1; }
.welcome-label { color: #a378bd; font-size: 10px; font-weight: 700; letter-spacing: .15em; }
h1 { margin: 13px 0 9px; color: #574267; font-size: clamp(27px, 4vw, 38px); font-weight: 750; letter-spacing: .02em; line-height: 1.4; }
.mobile-break { display: none; }
.welcome-text { margin: 0; color: #8f7e9c; font-size: 14px; }
.mascot-wrap { width: 180px; height: 165px; flex: 0 0 180px; }
.mascot { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 10px 7px rgba(119, 91, 147, .12)); animation: bob 3.2s ease-in-out infinite; }
.mascot-sparkle { position: absolute; z-index: 1; color: #f0a3c4; font-size: 23px; }
.sparkle-one { top: 16px; left: -8px; }
.sparkle-two { top: 40px; right: -10px; color: #ac90df; font-size: 27px; }
.mascot-heart { position: absolute; z-index: 1; right: 15px; bottom: 17px; color: #ef92b7; font-size: 25px; transform: rotate(12deg); }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.time-block { min-width: 160px; text-align: right; }
.clock { color: #705b91; font-size: clamp(30px, 4vw, 42px); font-weight: 350; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.date { margin-top: 5px; color: #9785a2; font-size: 12px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 30px 3px 15px; }
h2 { margin: 0; color: #604873; font-size: 18px; font-weight: 750; letter-spacing: .03em; }
.section-caption { margin: 5px 0 0; color: #a28fa9; font-size: 12px; }
.section-badge { padding: 8px 13px; border: 1px solid #f4dfea; border-radius: 999px; color: #b2799a; background: rgba(255, 255, 255, .7); font-size: 11px; white-space: nowrap; }
.tools { display: grid; grid-template-columns: minmax(0, 1fr); }
.tool {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 27px;
  padding: 27px;
  border: 1px solid rgba(234, 215, 234, .9);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 14px 40px rgba(94, 70, 114, .08);
  backdrop-filter: blur(12px);
}
.converter-panel { min-width: 0; }
.tool-header { display: flex; align-items: center; gap: 12px; margin-bottom: 23px; }
.tool-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid #f6dcea;
  border-radius: 15px;
  color: #d875a2;
  background: #fff0f6;
  font-size: 18px;
  font-weight: 700;
}
.tool-title { color: #624970; font-size: 15px; font-weight: 750; }
.tool-description { margin-top: 4px; color: var(--muted); font-size: 11px; }
.converter { display: grid; gap: 16px; }
.mobile-quick-rate { display: none; }
.field-label { display: block; margin-bottom: 8px; color: #796986; font-size: 12px; font-weight: 650; }
.field-control {
  width: 100%;
  height: 47px;
  padding: 0 13px;
  border: 1px solid #eadfea;
  border-radius: 13px;
  outline: none;
  color: var(--ink);
  background: #fffcfe;
  font-size: 12px;
  transition: border-color .2s, box-shadow .2s;
}
.field-control:focus { border-color: #d8a4cb; box-shadow: 0 0 0 3px rgba(215, 153, 196, .14); }
.rate-note { margin-top: 4px; color: #a493ab; font-size: 11px; line-height: 1.6; }
.currency-pair { display: grid; grid-template-columns: minmax(0, 1fr) 42px minmax(0, 1fr); align-items: end; gap: 10px; }
.currency-pair .field-control { min-width: 0; padding: 0 8px; }
.swap-button { width: 40px; height: 40px; margin-bottom: 3px; border: 1px solid #ebdced; border-radius: 13px; color: #a17bc0; background: #faf3ff; font-size: 19px; transition: transform .2s, background .2s; }
.swap-button:hover { transform: rotate(180deg); background: #f2e7ff; }
.result {
  height: 47px;
  min-height: 47px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 13px;
  border: 1px solid #f1ddec;
  border-radius: 15px;
  background: linear-gradient(105deg, #fff2f7, #f7f0ff);
}
.result-label { color: #947f9e; font-size: 12px; }
.result-value { color: #795caa; font-size: 19px; font-weight: 750; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; text-align: right; }
.result-message { min-height: 14px; color: #8e7b98; font-size: 11px; }
.quick-panel {
  position: relative;
  overflow: hidden;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  padding: 23px 20px 10px;
  border: 1px solid #f0e2f1;
  border-radius: 20px;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 255, 255, .95), transparent 35%),
    linear-gradient(150deg, #fcf6ff, #fff5f8);
}
.quick-panel::after { position: absolute; right: -25px; bottom: 48px; width: 94px; height: 94px; border: 1px dashed rgba(191, 157, 202, .25); border-radius: 50%; content: ""; pointer-events: none; }
.quick-kicker { color: #b083bd; font-size: 10px; font-weight: 700; letter-spacing: .15em; }
h3 { margin: 7px 0 4px; color: #604873; font-size: 17px; }
.quick-description { margin: 0; color: #a08fa8; font-size: 11px; }
.quick-pairs { flex: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 17px; }
.quick-pair {
  position: relative;
  z-index: 1;
  width: 100%;
  display: grid;
  grid-template-columns: 35px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 9px;
  padding: 10px 11px;
  border: 1px solid rgba(237, 220, 237, .9);
  border-radius: 13px;
  color: var(--ink);
  background: rgba(255, 255, 255, .8);
  text-align: left;
  transition: transform .18s, border-color .18s, box-shadow .18s;
}
.quick-pair:hover { transform: translateY(-2px); border-color: #e5bfda; box-shadow: 0 6px 14px rgba(134, 97, 150, .1); }
.pair-emoji { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; background: #fff3f7; }
.pair-flag { width: 27px; height: 19px; display: block; border-radius: 3px; box-shadow: 0 1px 2px rgba(66, 45, 80, .16); }
.quick-pair strong { display: block; color: #6b547e; font-size: 12px; letter-spacing: .03em; }
.quick-pair strong i { color: #d093b7; font-style: normal; }
.quick-pair small { display: block; margin-top: 3px; color: #aa99b0; font-size: 10px; }
.pair-arrow { color: #bf9cc5; font-size: 13px; text-align: right; }
.quick-footnote { position: relative; z-index: 1; margin-top: 12px; padding-top: 10px; border-top: 1px dashed #e8d8e9; color: #9a88a3; font-size: 10px; line-height: 1.6; }
.quick-footnote span { margin-right: 4px; color: #df8eb2; }
footer { display: flex; justify-content: space-between; gap: 12px; padding: 14px 0 18px; border-top: 1px solid rgba(231, 210, 230, .75); color: #a392aa; font-size: 11px; }
footer b { color: #9876a8; font-weight: 650; }

@media (min-width: 821px) {
  main { display: flex; flex-direction: column; justify-content: space-evenly; }
}

@media (min-width: 821px) and (max-height: 850px) {
  header { height: 64px; }
  main { padding: 18px 0 16px; }
  .welcome { min-height: 0; padding: 14px 42px; border-radius: 25px; }
  .mascot-wrap { width: 140px; height: 125px; flex-basis: 140px; }
  h1 { margin: 8px 0 5px; font-size: 34px; }
  .welcome-text { font-size: 13px; }
  .clock { font-size: 34px; }
  .section-heading { margin: 16px 3px 8px; }
  .section-caption { margin-top: 3px; }
  .tool { gap: 18px; padding: 18px; border-radius: 20px; }
  .tool-header { margin-bottom: 12px; }
  .tool-icon { width: 38px; height: 38px; }
  .converter { gap: 10px; }
  .field-label { margin-bottom: 4px; }
  .field-control { height: 42px; }
  .swap-button { height: 36px; margin-bottom: 2px; }
  .rate-note { margin-top: 0; }
  .result { height: 42px; min-height: 42px; padding: 6px 12px; }
  .result-value { font-size: 17px; }
  .quick-panel { padding: 14px 14px 8px; }
  .quick-pairs { gap: 6px; margin-top: 10px; }
  .quick-pair { grid-template-columns: 30px minmax(0, 1fr) 16px; gap: 6px; padding: 6px 8px; }
  .pair-emoji { width: 30px; height: 30px; }
  .pair-flag { width: 25px; height: 18px; }
  .quick-pair strong { font-size: 11px; }
  .quick-pair small { font-size: 9px; }
  .quick-footnote { margin-top: 8px; padding-top: 7px; font-size: 10px; line-height: 1.5; }
  footer { padding: 9px 0 10px; }
}

@media (min-width: 821px) and (max-height: 740px) {
  main { padding-bottom: 12px; }
}

@media (min-width: 821px) and (max-height: 680px) {
  header { height: 48px; }
  .brand-icon { width: 34px; height: 34px; border-radius: 11px; }
  .brand-icon img { width: 22px; height: 22px; }
  .brand-name { font-size: 18px; }
  .brand-caption { margin-top: 2px; font-size: 9px; }
  .header-right { padding: 6px 10px; font-size: 10px; }
  main { padding: 6px 0 4px; }
  .welcome { padding: 5px 28px; border-radius: 18px; }
  .welcome-label { font-size: 9px; }
  h1 { margin: 4px 0 2px; font-size: 27px; line-height: 1.25; }
  .welcome-text { font-size: 12px; }
  .mascot-wrap { width: 100px; height: 86px; flex-basis: 100px; }
  .time-block { min-width: 130px; }
  .clock { font-size: 28px; }
  .date { margin-top: 2px; font-size: 10px; }
  .section-heading { margin: 6px 3px 4px; }
  h2 { font-size: 16px; }
  .section-caption { margin-top: 1px; font-size: 10px; }
  .section-badge { padding: 5px 9px; font-size: 10px; }
  .tool { gap: 12px; padding: 10px 14px; border-radius: 16px; }
  .tool-header { gap: 8px; margin-bottom: 5px; }
  .tool-icon { width: 30px; height: 30px; border-radius: 10px; font-size: 15px; }
  .tool-title { font-size: 13px; }
  .tool-description { margin-top: 1px; font-size: 10px; }
  .converter { gap: 5px; }
  .field-label { margin-bottom: 2px; font-size: 10px; }
  .field-control { height: 34px; padding: 0 8px; border-radius: 9px; font-size: 11px; }
  .swap-button { width: 32px; height: 30px; margin-bottom: 2px; font-size: 16px; }
  .currency-pair { grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr); gap: 5px; }
  .rate-note { font-size: 9px; line-height: 1.3; }
  .result { height: 34px; min-height: 34px; padding: 4px 9px; border-radius: 10px; }
  .result-label { font-size: 10px; }
  .result-value { font-size: 14px; }
  .result-message { min-height: 11px; font-size: 9px; line-height: 1.2; }
  .quick-panel { padding: 8px 10px 5px; border-radius: 15px; }
  .quick-kicker { font-size: 8px; }
  h3 { margin: 3px 0 1px; font-size: 14px; }
  .quick-description { font-size: 9px; }
  .quick-pairs { gap: 4px; margin-top: 5px; }
  .quick-pair { grid-template-columns: 25px minmax(0, 1fr) 12px; gap: 4px; padding: 3px 5px; border-radius: 9px; }
  .pair-emoji { width: 25px; height: 25px; border-radius: 7px; }
  .pair-flag { width: 22px; height: 16px; }
  .quick-pair strong { font-size: 10px; }
  .quick-pair small { margin-top: 1px; font-size: 8px; }
  .pair-arrow { font-size: 11px; }
  .quick-footnote { margin-top: 5px; padding-top: 4px; font-size: 8px; line-height: 1.3; }
  footer { padding: 4px 0; font-size: 9px; }
}

@media (min-width: 821px) and (min-height: 851px) and (max-height: 950px) {
  header { height: 72px; }
  main { padding: 24px 0 22px; }
  .welcome { min-height: 196px; padding: 22px 48px; }
  .mascot-wrap { width: 155px; height: 140px; flex-basis: 155px; }
  .section-heading { margin: 22px 3px 11px; }
  .tool { padding: 22px; gap: 22px; }
  .tool-header { margin-bottom: 17px; }
  .converter { gap: 13px; }
  .quick-panel { padding: 18px 18px 11px; }
  .quick-pairs { gap: 7px; margin-top: 13px; }
  .quick-pair { padding: 8px 9px; }
  .quick-footnote { margin-top: 10px; padding-top: 9px; }
  footer { padding: 10px 0 12px; }
}

@media (max-width: 820px) {
  main { display: block; }
  .page { width: min(100% - 40px, 650px); }
  .tool { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .quick-panel { padding: 20px 20px 12px; }
  .quick-pairs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .page { width: calc(100% - 32px); }
  header { height: 72px; }
  .brand-icon { width: 39px; height: 39px; }
  .brand-icon img { width: 25px; height: 25px; }
  .brand-name { font-size: 20px; }
  .header-right { gap: 7px; padding: 8px 10px; font-size: 9px; }
  main { padding: 24px 0 30px; }
  .welcome { min-height: 0; flex-wrap: wrap; gap: 0; padding: 23px 21px 16px; border-radius: 23px; }
  .welcome::after { top: -80px; right: -95px; width: 230px; height: 230px; }
  .welcome-copy { width: calc(100% - 102px); max-width: none; }
  .welcome-label { font-size: 8px; }
  .mobile-break { display: initial; }
  h1 { margin: 10px 0 7px; font-size: clamp(25px, 7vw, 32px); line-height: 1.45; }
  .welcome-text { max-width: 245px; font-size: 12px; line-height: 1.65; }
  .mascot-wrap { width: 96px; height: 104px; flex: 0 0 96px; margin: -4px 0 0 auto; transform: translateY(-14px); }
  .mascot-heart { right: 2px; bottom: 8px; font-size: 19px; }
  .time-block { width: 100%; min-width: 0; display: flex; align-items: baseline; gap: 10px; margin-top: -1px; text-align: left; }
  .clock { font-size: 25px; }
  .date { margin: 0; font-size: 10px; }
  .section-heading { align-items: flex-start; margin: 25px 2px 13px; }
  h2 { font-size: 16px; }
  .section-caption { font-size: 11px; }
  .section-badge { padding: 7px 9px; font-size: 10px; }
  .tool { gap: 20px; padding: 18px; border-radius: 20px; }
  .tool-header { margin-bottom: 18px; }
  .currency-pair { grid-template-columns: minmax(0, 1fr) 36px minmax(0, 1fr); gap: 6px; }
  .swap-button { width: 35px; height: 38px; }
  .field-control { height: 44px; font-size: 12px; }
  .result { height: 44px; min-height: 44px; padding: 6px 12px; }
  .result-value { font-size: 17px; }
  .mobile-quick-rate { display: block; }
  .quick-panel { display: none; }
  .quick-pairs { gap: 7px; }
  .quick-pair { grid-template-columns: 29px minmax(0, 1fr) 13px; gap: 6px; padding: 9px 7px; }
  .pair-emoji { width: 29px; height: 30px; font-size: 15px; }
  .quick-pair strong { font-size: 11px; }
  .quick-pair small { font-size: 9px; }
  footer { flex-direction: column; font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
