:root {
  --primary: #5068e7;
  --primary-dark: #3d52c8;
  --primary-soft: #edf0ff;
  --text: #202842;
  --muted: #68718a;
  --line: #e7eaf2;
  --surface: #ffffff;
  --background: #f7f8fc;
  --shadow: 0 18px 55px rgba(38, 49, 94, 0.09);
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 11px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 10%, rgba(117, 135, 255, 0.12), transparent 27rem),
    radial-gradient(circle at 92% 33%, rgba(133, 222, 207, 0.12), transparent 24rem),
    var(--background);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

.page-shell {
  min-height: 100vh;
}

.site-header,
main,
.site-footer {
  width: min(1160px, calc(100% - 40px));
  margin-inline: auto;
}

.site-header {
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 14px;
  color: white;
  background: linear-gradient(145deg, #7184f3, #435bd7);
  box-shadow: 0 9px 24px rgba(80, 104, 231, 0.28);
}

.brand-mark svg {
  width: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 17px;
  letter-spacing: 0.01em;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 34px;
}

.site-nav a {
  position: relative;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: color 180ms ease;
}

.site-nav a:hover {
  color: var(--primary);
}

.hero {
  min-height: 425px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 72px;
  padding: 58px 64px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.79);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.eyebrow {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.hero h1 {
  margin: 0;
  font-size: clamp(40px, 5vw, 62px);
  line-height: 1.13;
  letter-spacing: -0.055em;
}

.hero h1 span {
  color: var(--primary);
}

.hero-copy > p {
  max-width: 510px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.85;
}

.hero-actions {
  display: flex;
  gap: 12px;
  margin-top: 30px;
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 21px;
  border: 0;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  color: white;
  background: linear-gradient(145deg, #6479ed, var(--primary));
  box-shadow: 0 10px 22px rgba(80, 104, 231, 0.22);
}

.button-primary:hover {
  background: linear-gradient(145deg, #5c71e8, var(--primary-dark));
  box-shadow: 0 12px 28px rgba(80, 104, 231, 0.3);
}

.button-ghost,
.button-soft {
  color: #52607a;
  background: #f0f2f8;
}

.button-ghost:hover,
.button-soft:hover {
  background: #e8ebf4;
}

.button-small {
  min-height: 39px;
  padding-inline: 16px;
  border-radius: 10px;
  font-size: 13px;
}

.button-full {
  width: 100%;
  margin-top: 18px;
}

.text-button {
  padding: 7px 5px;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
}

.text-button:hover {
  color: var(--primary);
}

.clock-panel {
  position: relative;
  min-height: 272px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 28px;
  color: white;
  background: linear-gradient(145deg, #5e73e8 0%, #485fd7 62%, #3c52c5 100%);
  box-shadow: 0 24px 45px rgba(66, 85, 196, 0.26);
}

.clock-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.24;
  background-image: radial-gradient(rgba(255, 255, 255, 0.7) 0.7px, transparent 0.7px);
  background-size: 18px 18px;
}

.clock-panel > *:not(.clock-decoration) {
  position: relative;
  z-index: 1;
}

.clock-decoration {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
}

.clock-decoration-one {
  width: 170px;
  height: 170px;
  top: -82px;
  right: -46px;
}

.clock-decoration-two {
  width: 95px;
  height: 95px;
  right: 60px;
  bottom: -50px;
}

.clock-label {
  opacity: 0.72;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

#live-time {
  margin-top: 12px;
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.035em;
}

.clock-stamps {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.clock-stamps span {
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 9px;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.09);
  font-size: 11px;
}

.clock-stamps strong {
  margin-left: 4px;
  color: white;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  padding: 74px 4px 26px;
}

.section-heading .eyebrow {
  margin-bottom: 8px;
}

.section-heading h2 {
  margin: 0;
  font-size: 30px;
  letter-spacing: -0.04em;
}

.section-heading p {
  max-width: 430px;
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
  text-align: right;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.tool-card {
  padding: 28px;
  border: 1px solid rgba(226, 230, 240, 0.9);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 10px 36px rgba(41, 51, 86, 0.055);
  scroll-margin-top: 24px;
}

.tool-card-wide {
  grid-column: 1 / -1;
}

.tool-title {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.tool-title h3,
.info-card h2 {
  margin: 0;
  font-size: 19px;
  letter-spacing: -0.02em;
}

.tool-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.tool-icon {
  flex: 0 0 45px;
  height: 45px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  font-size: 13px;
  font-weight: 900;
}

.icon-blue { color: #4963d9; background: #edf0ff; }
.icon-green { color: #238f74; background: #e6f7f1; }
.icon-purple { color: #8050c6; background: #f3eaff; }
.icon-orange { color: #c77b20; background: #fff2df; }
.icon-cyan { color: #257f9d; background: #e6f6fb; }
.icon-pink { color: #c0507d; background: #fceaf1; }

.timestamp-layout {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 28px;
}

.tool-divider {
  width: 1px;
  background: var(--line);
}

.tool-group,
.tool-card {
  min-width: 0;
}

label {
  display: block;
  margin-bottom: 8px;
  color: #4d5872;
  font-size: 13px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #dfe3ed;
  border-radius: var(--radius-sm);
  outline: none;
  color: var(--text);
  background: #fbfcfe;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input,
select {
  height: 44px;
  padding: 0 13px;
}

textarea {
  display: block;
  min-height: 106px;
  padding: 12px 13px;
  resize: vertical;
  line-height: 1.65;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #8c9cf0;
  background: white;
  box-shadow: 0 0 0 3px rgba(80, 104, 231, 0.11);
}

.input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 10px;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 13px;
}

.result-box {
  min-height: 49px;
  margin-top: 14px;
  padding: 13px 14px;
  overflow: auto;
  border: 1px dashed #d9deea;
  border-radius: 11px;
  color: #667089;
  background: #f8f9fc;
  font-size: 13px;
  line-height: 1.65;
}

.result-box strong {
  color: var(--text);
}

.result-lines {
  display: grid;
  gap: 4px;
}

.result-output {
  color: var(--primary-dark);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  word-spacing: 8px;
}

.result-monospace {
  color: #46506c;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.result-pre {
  min-height: 80px;
  margin-bottom: 0;
  white-space: pre-wrap;
  word-break: break-all;
}

.result-break {
  min-height: 80px;
  word-break: break-all;
}

.result-error {
  border-color: #f2c6cb;
  color: #bb3e4c;
  background: #fff6f7;
}

.two-column-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.compact-fields {
  margin-top: 12px;
}

.checkbox-label {
  min-height: 68px;
  display: flex;
  align-items: end;
  gap: 9px;
  padding: 0 2px 13px;
  margin: 0;
  cursor: pointer;
}

.checkbox-label input {
  width: 17px;
  height: 17px;
  padding: 0;
  accent-color: var(--primary);
}

.info-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

.info-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 28px;
  border-radius: 20px;
  background: #eef1ff;
}

.info-card:last-child {
  background: #eaf7f4;
}

.info-card p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}

.info-icon {
  flex: 0 0 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: white;
  background: var(--primary);
  font-weight: 900;
}

.info-icon-alt {
  background: #2e9a80;
}

.site-footer {
  min-height: 130px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 34px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.site-footer strong,
.site-footer span {
  display: block;
}

.site-footer strong {
  margin-bottom: 5px;
  color: var(--text);
  font-size: 15px;
}

.site-footer p {
  margin: 0;
  text-align: right;
}

.site-footer a {
  color: #59647d;
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  max-width: min(340px, calc(100vw - 48px));
  padding: 12px 17px;
  border-radius: 11px;
  opacity: 0;
  color: white;
  background: #27304a;
  box-shadow: 0 12px 32px rgba(24, 31, 54, 0.25);
  font-size: 13px;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 48px;
  }

  .clock-panel {
    min-height: 240px;
  }

  .timestamp-layout {
    grid-template-columns: 1fr;
  }

  .tool-divider {
    width: auto;
    height: 1px;
  }
}

@media (max-width: 680px) {
  .site-header,
  main,
  .site-footer {
    width: min(100% - 28px, 1160px);
  }

  .site-header {
    height: 72px;
  }

  .site-nav {
    display: none;
  }

  .hero {
    min-height: auto;
    padding: 34px 24px 24px;
    border-radius: 24px;
  }

  .hero h1 {
    font-size: 40px;
  }

  .hero-copy > p {
    font-size: 14px;
  }

  .hero-actions {
    align-items: stretch;
  }

  .hero-actions .button {
    flex: 1;
    padding-inline: 12px;
  }

  .clock-panel {
    min-height: 220px;
    padding: 28px 24px;
    border-radius: 21px;
  }

  .clock-stamps {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-heading {
    display: block;
    padding-top: 54px;
  }

  .section-heading p {
    margin-top: 10px;
    text-align: left;
  }

  .tool-grid,
  .info-section {
    grid-template-columns: 1fr;
  }

  .tool-card {
    padding: 22px;
    border-radius: 20px;
  }

  .input-row {
    grid-template-columns: 1fr;
  }

  .two-column-fields {
    gap: 9px;
  }

  .site-footer {
    min-height: 150px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
  }

  .site-footer p {
    text-align: left;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
