:root {
  --blue: #1268f6;
  --blue-deep: #0758e8;
  --ink: #0b1628;
  --muted: #61708a;
  --line: #e1e9f4;
  --soft-blue: #eef5ff;
  --shadow: 0 14px 32px rgba(28, 70, 133, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { min-width: 320px; margin: 0; overflow-x: hidden; color: var(--ink); font-family: Inter, Arial, sans-serif; background: radial-gradient(circle at 76% 16%, rgba(221, 235, 255, 0.58), transparent 25%), #fbfcff; -webkit-font-smoothing: antialiased; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid rgba(18, 104, 246, 0.28); outline-offset: 3px; }
a { color: inherit; text-decoration: none; }
svg { display: block; width: 1em; height: 1em; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.site-shell { width: min(1300px, calc(100% - 64px)); margin: 0 auto; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.tool-header { position: relative; z-index: 10; height: 71px; border-bottom: 1px solid #e7edf6; background: rgba(255, 255, 255, 0.93); backdrop-filter: blur(13px); }
.header-inner { display: flex; align-items: center; height: 100%; }
.brand { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 8px; font-size: 20px; font-weight: 800; letter-spacing: -0.8px; white-space: nowrap; }
.brand > span:last-child span { color: var(--blue); }
.brand-mark { display: grid; place-items: center; width: 29px; height: 29px; color: #fff; border-radius: 50%; background: linear-gradient(135deg, #247bff, #0951d6); box-shadow: 0 6px 14px rgba(18, 104, 246, 0.24); }
.brand-mark svg { width: 18px; height: 18px; }
.tool-nav { display: flex; align-items: center; gap: 34px; margin: 0 auto; font-size: 13px; font-weight: 600; }
.tool-nav a { display: inline-flex; align-items: center; gap: 4px; transition: color 0.2s ease; }
.tool-nav a:hover { color: var(--blue); }
.nav-down { width: 14px; height: 14px; }
.header-tools { display: flex; align-items: center; gap: 18px; }
.header-search { position: relative; display: flex; align-items: center; width: 358px; height: 39px; color: #71809a; border: 1px solid #d9e2ee; border-radius: 8px; background: #fff; }
.header-search input { width: 100%; height: 100%; padding: 0 39px 0 14px; color: var(--ink); font-size: 12px; border: 0; border-radius: inherit; outline: 0; background: transparent; }
.header-search input::placeholder { color: #78869d; }
.header-search svg { position: absolute; right: 13px; width: 18px; height: 18px; pointer-events: none; }
.login-button { min-width: 76px; height: 39px; padding: 0 16px; color: #fff; font-size: 12px; font-weight: 700; border: 0; border-radius: 7px; background: linear-gradient(135deg, #1d75fb, #105de8); box-shadow: 0 6px 13px rgba(18, 104, 246, 0.2); }
.login-button:hover, .convert-button:hover, .explore-bar a:hover { filter: brightness(1.05); }
.mobile-menu { display: none; place-items: center; width: 38px; height: 38px; color: var(--ink); border: 0; border-radius: 7px; background: #f1f5fb; }
.mobile-menu svg { width: 21px; height: 21px; }

.breadcrumb { display: flex; align-items: center; gap: 13px; min-height: 62px; padding-top: 7px; overflow: auto; color: #6c7d97; font-size: 12px; white-space: nowrap; }
.breadcrumb a { display: inline-flex; align-items: center; gap: 8px; }
.breadcrumb a:hover { color: var(--blue); }
.breadcrumb > svg { flex: 0 0 auto; width: 14px; height: 14px; color: #a1aec0; }
.breadcrumb a svg { width: 16px; height: 16px; }
.breadcrumb span[aria-current="page"] { color: #162137; font-weight: 600; }

.tool-hero { max-width: 890px; padding: 30px 20px 28px; text-align: center; }
.tool-badge { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 15px; padding: 6px 11px; color: var(--blue); font-size: 10px; font-weight: 800; letter-spacing: 0.03em; border-radius: 999px; background: #edf4ff; }
.tool-badge span { font-size: 9px; }
.tool-hero h1 { margin: 0; font-size: clamp(36px, 4vw, 51px); line-height: 1.1; letter-spacing: -2.3px; }
.tool-hero h1 strong { color: var(--blue); }
.tool-hero > p:not(.tool-badge) { max-width: 730px; margin: 14px auto 0; color: #5b6c87; font-size: 16px; line-height: 1.62; }

.converter-card { position: relative; padding: 25px; overflow: hidden; border: 1px solid #e2eaf4; border-radius: 15px; background: rgba(255, 255, 255, 0.96); box-shadow: var(--shadow); }
.converter-card::before { position: absolute; top: -100px; right: -80px; width: 300px; height: 300px; border-radius: 50%; background: radial-gradient(circle, rgba(219, 234, 255, 0.85), rgba(239, 246, 255, 0)); content: ""; pointer-events: none; }
.converter-heading { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.converter-heading > div { display: flex; align-items: center; gap: 12px; }
.heading-icon { display: grid; flex: 0 0 auto; place-items: center; width: 42px; height: 42px; color: var(--blue); border-radius: 12px; background: #edf4ff; }
.heading-icon svg { width: 23px; height: 23px; }
.converter-heading h2 { margin: 0; font-size: 17px; letter-spacing: -0.5px; }
.converter-heading p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.utf-pill { padding: 6px 10px; color: #3c75d9; font-size: 10px; font-weight: 800; letter-spacing: 0.05em; border: 1px solid #d6e6ff; border-radius: 999px; background: #f3f8ff; }

.mode-switch { position: relative; z-index: 1; display: inline-flex; gap: 5px; margin-top: 25px; padding: 4px; border: 1px solid #e1eaf6; border-radius: 9px; background: #f7faff; }
.mode-button { display: inline-flex; align-items: center; gap: 7px; min-height: 37px; padding: 0 15px; color: #677790; font-size: 12px; font-weight: 700; border: 0; border-radius: 6px; background: transparent; transition: color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease; }
.mode-button svg { width: 16px; height: 16px; }
.mode-button.is-active { color: var(--blue); background: #fff; box-shadow: 0 2px 7px rgba(32, 77, 140, 0.1); }

.conversion-grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr) 50px minmax(0, 1fr); align-items: center; gap: 17px; margin-top: 19px; }
.conversion-field { min-width: 0; padding: 15px; border: 1px solid #e0e9f4; border-radius: 11px; background: #fcfdff; }
.input-field { background: linear-gradient(135deg, #fdfefe, #f7faff); }
.output-field { background: linear-gradient(135deg, #fbfdff, #f6faff); }
.field-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.field-heading label { color: #17243a; font-size: 12px; font-weight: 700; }
.field-heading span { color: #71829b; font-size: 10px; text-align: right; }
.conversion-field textarea { display: block; width: 100%; min-height: 220px; padding: 12px; color: #293852; font-size: 13px; line-height: 1.64; border: 1px solid #d8e3f1; border-radius: 8px; outline: 0; background: #fff; resize: vertical; transition: border-color 0.2s, box-shadow 0.2s; }
.conversion-field textarea:focus { border-color: #72a8ff; box-shadow: 0 0 0 3px rgba(18, 104, 246, 0.1); }
.conversion-field textarea::placeholder { color: #98a6ba; }
.output-field textarea { color: #1d4fa0; font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 12px; background: #fbfdff; }
.conversion-field small { display: block; min-height: 15px; margin-top: 8px; color: #75849b; font-size: 10px; line-height: 1.4; }
.conversion-action { display: grid; place-items: center; }
.conversion-action > span { display: grid; place-items: center; width: 40px; height: 40px; color: var(--blue); border: 1px solid #cee0fb; border-radius: 50%; background: #eff6ff; box-shadow: 0 5px 12px rgba(39, 100, 197, 0.12); }
.conversion-action svg { width: 21px; height: 21px; }
.output-actions { display: flex; gap: 8px; margin-top: 8px; }
.small-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 30px; padding: 0 10px; color: #416080; font-size: 10px; font-weight: 700; border: 1px solid #d8e4f3; border-radius: 6px; background: #fff; transition: color 0.2s, border-color 0.2s, background 0.2s; }
.small-button svg { width: 14px; height: 14px; }
.copy-button:hover { color: var(--blue); border-color: #bcd5fb; background: #f4f8ff; }
.clear-button:hover { color: #b4475a; border-color: #efd6dc; background: #fff7f8; }

.converter-footer { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 20px; }
.converter-footer p { display: flex; align-items: center; gap: 8px; margin: 0; color: #71809a; font-size: 10px; line-height: 1.45; }
.converter-footer p svg { flex: 0 0 auto; width: 17px; height: 17px; color: var(--blue); }
.converter-footer p b { color: #40516d; }
.convert-button { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; gap: 8px; min-width: 207px; height: 43px; padding: 0 17px; color: #fff; font-size: 12px; font-weight: 700; border: 0; border-radius: 7px; background: linear-gradient(135deg, #2379fb, #0d5be7); box-shadow: 0 8px 18px rgba(18, 104, 246, 0.2); }
.convert-button svg { width: 17px; height: 17px; }
.conversion-status { position: relative; z-index: 1; min-height: 17px; margin: 9px 0 0; color: #5e7798; font-size: 11px; }
.conversion-status.is-error { color: #bf4857; }
.conversion-status.is-success { color: #168253; }

.ad-wrap { margin-top: 23px; }
.ad-slot { display: flex; align-items: center; justify-content: center; min-height: 52px; color: #94a1b5; font-size: 9px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; border: 1px dashed #dce6f2; border-radius: 10px; background: rgba(255, 255, 255, 0.5); }

.benefits { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; padding: 28px 4px 26px; }
.benefits article { display: flex; align-items: flex-start; gap: 11px; min-width: 0; }
.benefits article > span { display: grid; flex: 0 0 auto; place-items: center; width: 41px; height: 41px; color: var(--blue); border-radius: 50%; background: #edf4ff; }
.benefits article > span svg { width: 21px; height: 21px; }
.benefits p { margin: 0; color: #697a94; font-size: 10px; line-height: 1.47; }
.benefits b { display: block; margin: 1px 0 4px; color: #1d2b42; font-size: 12px; }

.info-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 20px; }
.how-card, .about-card { min-height: 235px; padding: 22px; border: 1px solid #e5ecf5; border-radius: 13px; background: #fff; box-shadow: 0 8px 22px rgba(38, 73, 133, 0.04); }
.how-card h2, .about-card h2 { margin: 0; font-size: 16px; letter-spacing: -0.45px; }
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; margin-top: 21px; }
.steps > div { position: relative; min-width: 0; padding-top: 48px; }
.steps > div:not(:last-child)::after { position: absolute; top: 20px; right: -5px; left: 48px; border-top: 1px dashed #bfd5f5; content: ""; }
.steps span { position: absolute; top: 0; left: 0; display: grid; place-items: center; width: 39px; height: 39px; color: var(--blue); font-size: 17px; font-weight: 800; border-radius: 50%; background: #eaf2ff; }
.steps p { margin: 0; color: #6a7a94; font-size: 10px; line-height: 1.48; }
.steps b { display: block; margin-bottom: 5px; color: #26354c; font-size: 11px; }
.about-card > p { margin: 15px 0 0; color: #60718b; font-size: 12px; line-height: 1.65; }
.about-card > p b { color: #266fe9; }
.example-code { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding: 11px; overflow: auto; border: 1px solid #e1eaf5; border-radius: 8px; background: #f8fbff; white-space: nowrap; }
.example-code span { color: #1b2a42; font-size: 12px; font-weight: 800; }
.example-code svg { flex: 0 0 auto; width: 15px; height: 15px; color: var(--blue); }
.example-code code { color: #2c64b8; font-family: "SFMono-Regular", Consolas, monospace; font-size: 10px; }
.about-card small { display: block; margin-top: 10px; color: #8090a6; font-size: 10px; line-height: 1.4; }

.explore-bar { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-top: 18px; margin-bottom: 30px; padding: 18px 70px; border-radius: 12px; background: linear-gradient(100deg, #eff6ff, #f8fbff); }
.explore-bar > div { display: flex; align-items: center; gap: 14px; }
.explore-mark { display: grid; place-items: center; width: 32px; height: 32px; color: #fff; border-radius: 50%; background: linear-gradient(135deg, #2580ff, #0754df); }
.explore-mark svg { width: 19px; height: 19px; }
.explore-bar p { margin: 0; }
.explore-bar b { display: block; color: #1e2c43; font-size: 12px; }
.explore-bar b span { color: var(--blue); }
.explore-bar small { display: block; margin-top: 4px; color: #71809a; font-size: 10px; }
.explore-bar a { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 7px; min-height: 39px; padding: 0 16px; color: #fff; font-size: 11px; font-weight: 700; border-radius: 7px; background: linear-gradient(135deg, #2378fb, #0e5dea); box-shadow: 0 7px 14px rgba(18, 104, 246, 0.17); }
.explore-bar a svg { width: 16px; height: 16px; }

.login-dialog { position: relative; width: min(390px, calc(100% - 32px)); padding: 34px; color: var(--ink); border: 0; border-radius: 16px; box-shadow: 0 30px 80px rgba(0, 16, 43, 0.3); }
.login-dialog::backdrop { background: rgba(2, 11, 25, 0.62); backdrop-filter: blur(3px); }
.login-dialog > button:first-child { position: absolute; top: 13px; right: 13px; display: grid; place-items: center; width: 35px; height: 35px; color: #5c6a80; border: 0; border-radius: 50%; background: #f2f6fb; }
.login-dialog > button:first-child svg { width: 18px; height: 18px; }
.dialog-icon { display: grid; place-items: center; width: 45px; height: 45px; margin-bottom: 18px; color: #fff; border-radius: 13px; background: linear-gradient(145deg, #2582ff, #0753de); }
.dialog-icon svg { width: 28px; height: 28px; }
.login-dialog h2 { margin: 0; font-size: 22px; letter-spacing: -0.8px; }
.login-dialog p { margin: 10px 0 24px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.login-dialog > button:last-child { width: 100%; height: 44px; color: #fff; font-size: 13px; font-weight: 700; border: 0; border-radius: 8px; background: var(--blue); }
.toast { position: fixed; z-index: 50; left: 50%; bottom: 24px; max-width: calc(100% - 32px); padding: 12px 18px; color: #fff; font-size: 13px; border-radius: 9px; background: #102039; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18); opacity: 0; pointer-events: none; transform: translate(-50%, 16px); transition: opacity 0.25s, transform 0.25s; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1180px) {
  .site-shell { width: min(1100px, calc(100% - 40px)); }
  .tool-nav { gap: 21px; }
  .header-search { width: 250px; }
  .info-grid { grid-template-columns: 1fr; }
  .about-card { min-height: 0; }
}

@media (max-width: 980px) {
  .tool-header { height: 62px; }
  .header-inner { position: relative; }
  .tool-nav { position: absolute; top: 62px; right: 0; left: 0; display: grid; gap: 0; max-height: 0; margin: 0; overflow: hidden; visibility: hidden; background: #09192b; box-shadow: 0 13px 25px rgba(0, 9, 20, 0.2); transition: max-height 0.28s ease, visibility 0.28s ease; }
  .tool-header.nav-open .tool-nav { max-height: 340px; visibility: visible; }
  .tool-nav a { padding: 14px 20px; color: #f5f8fd; border-bottom: 1px solid rgba(255, 255, 255, 0.07); }
  .header-tools { margin-left: auto; }
  .header-search { width: min(320px, 38vw); }
  .mobile-menu { display: grid; }
  .benefits { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 20px; }
}

@media (max-width: 760px) {
  .conversion-grid { grid-template-columns: 1fr; gap: 11px; }
  .conversion-action { height: 35px; }
  .conversion-action > span { width: 35px; height: 35px; transform: rotate(90deg); }
  .conversion-field textarea { min-height: 170px; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 24px; }
  .steps > div:nth-child(2)::after { display: none; }
}

@media (max-width: 640px) {
  .site-shell { width: min(100% - 32px, 560px); }
  .brand { font-size: 18px; }
  .brand-mark { width: 27px; height: 27px; }
  .header-tools { gap: 10px; }
  .header-search { display: none; }
  .login-button { min-width: 64px; height: 36px; padding: 0 12px; }
  .breadcrumb { min-height: 51px; gap: 10px; font-size: 11px; }
  .breadcrumb > svg { width: 12px; height: 12px; }
  .tool-hero { padding: 26px 0 23px; text-align: left; }
  .tool-hero h1 { font-size: clamp(34px, 10vw, 43px); letter-spacing: -1.8px; }
  .tool-hero > p:not(.tool-badge) { margin-left: 0; font-size: 14px; }
  .converter-card { padding: 17px; border-radius: 12px; }
  .converter-heading p { font-size: 11px; }
  .heading-icon { width: 38px; height: 38px; }
  .utf-pill { display: none; }
  .mode-switch { display: grid; grid-template-columns: 1fr 1fr; width: 100%; margin-top: 19px; }
  .mode-button { justify-content: center; min-width: 0; padding: 0 8px; font-size: 10px; }
  .conversion-grid { margin-top: 15px; }
  .conversion-field { padding: 12px; }
  .conversion-field textarea { min-height: 145px; font-size: 12px; }
  .converter-footer { align-items: stretch; flex-direction: column-reverse; gap: 13px; margin-top: 16px; }
  .converter-footer p { font-size: 10px; }
  .convert-button { width: 100%; }
  .benefits { gap: 17px 12px; padding: 25px 3px; }
  .benefits b { font-size: 11px; }
  .benefits p { font-size: 9px; }
  .benefits article > span { width: 37px; height: 37px; }
  .how-card, .about-card { min-height: 0; padding: 18px; border-radius: 12px; }
  .steps { grid-template-columns: 1fr; gap: 13px; }
  .steps > div { display: grid; grid-template-columns: 39px 1fr; column-gap: 10px; min-height: 40px; padding: 0; }
  .steps > div:not(:last-child)::after { top: 44px; right: auto; bottom: -12px; left: 19px; width: 0; border-top: 0; border-left: 1px dashed #bfd5f5; }
  .steps p { align-self: center; }
  .example-code { gap: 8px; padding: 10px; }
  .example-code code { font-size: 9px; }
  .explore-bar { align-items: flex-start; flex-direction: column; gap: 16px; padding: 20px; }
  .explore-bar a { width: 100%; justify-content: center; }
}

@media (max-width: 390px) {
  .login-button { display: none; }
  .mode-button { font-size: 9px; }
  .mode-button svg { display: none; }
  .output-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .small-button { padding: 0 6px; }
  .benefits { grid-template-columns: 1fr; }
}
