:root{
  --bg-start:#1E3C73;
  --bg-end:#295095;
  --text-primary:#FFC94C;
  --button-bg:#FFB940;
  --border:#2C3E50;
}

*{box-sizing:border-box}

body {
  font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin:20px;
  background:linear-gradient(135deg, var(--bg-start), var(--bg-end));
  color:var(--text-primary);
}

h2 {
  text-align:center;
  color:var(--text-primary);
  text-shadow:2px 2px 5px rgba(0,0,0,0.3);
  display:flex;
  justify-content:center;
  align-items:center;
  font-size:2em;
}

h2 svg {
  width:1.1em;
  height:1.1em;
  margin-right:0.4em;
  fill:var(--text-primary);
}

.table-wrapper { overflow-x:auto; }

table {
  border-collapse:collapse;
  width:100%;
  margin-top:20px;
  background:transparent;
  border-radius:8px;
  overflow:hidden;
  box-shadow:0 4px 10px rgba(0,0,0,0.1);
  color:var(--text-primary);
}

th, td {
  border:1px solid var(--border);
  padding:10px 8px;
  text-align:center;
  color:var(--text-primary);
}

th {
  background-color:var(--bg-end);
  color:var(--text-primary);
  font-weight:600;
}

tr.highlight {
  background-color:var(--bg-end);
  font-weight:700;
}

tr.highlight td input { color:var(--text-primary); }

.slider-container {
  position:relative;
  width:100%;
  margin-top:20px;
}

input[type=range] {
  -webkit-appearance:none;
  appearance:none;
  width:100%;
  min-height:32px;
  background:transparent;
  cursor:grab;
}

input[type=range]:active {
  cursor:grabbing;
}

input[type=range]::-webkit-slider-runnable-track{
  height:8px;
  border-radius:4px;
  background:linear-gradient(to right, var(--text-primary) var(--fill, 0%), rgba(255,255,255,0.2) var(--fill, 0%));
}

input[type=range]::-moz-range-track{
  height:8px;
  border-radius:4px;
  background:linear-gradient(to right, var(--text-primary) var(--fill, 0%), rgba(255,255,255,0.2) var(--fill, 0%));
}

/* V5：3.6 秒周期，缩放范围 0.8 → 1.1 */
@keyframes slider-thumb-breathe {
  0%, 100% {
    transform:scale(0.8);
    box-shadow:0 0 5px rgba(255,201,76,0.32);
  }
  50% {
    transform:scale(1.1);
    box-shadow:
      0 0 12px rgba(255,201,76,0.78),
      0 0 22px rgba(255,201,76,0.32);
  }
}

input[type=range]::-webkit-slider-thumb{
  -webkit-appearance:none;
  appearance:none;
  height:18px;
  width:18px;
  border:none;
  border-radius:50%;
  background:var(--text-primary);
  cursor:grab;
  margin-top:-5px;
  position:relative;
  z-index:2;
  transform-origin:center;
  animation:slider-thumb-breathe 3.6s ease-in-out infinite;
  will-change:transform, box-shadow;
}

input[type=range]:active::-webkit-slider-thumb {
  cursor:grabbing;
}

input[type=range]::-moz-range-thumb{
  height:18px;
  width:18px;
  border:none;
  border-radius:50%;
  background:var(--text-primary);
  cursor:grab;
  position:relative;
  z-index:2;
  transform-origin:center;
  animation:slider-thumb-breathe 3.6s ease-in-out infinite;
  will-change:transform, box-shadow;
}

input[type=range]:active::-moz-range-thumb {
  cursor:grabbing;
}

.ticks{
  display:flex;
  justify-content:space-between;
  position:absolute;
  top:22px;
  left:0;
  right:0;
  font-size:16px;
  font-weight:600;
  color:var(--text-primary);
  text-shadow:1px 1px 2px rgba(0,0,0,0.4);
}

.control-row {
  display:flex;
  justify-content:center;
  align-items:flex-end;
  gap:14px;
  flex-wrap:wrap;
  margin:40px auto 20px;
}

.timezone-control {
  display:flex;
  flex-direction:column;
  gap:6px;
  font-size:14px;
  font-weight:600;
  color:var(--text-primary);
  text-align:center;
}

#timezoneSelect,
#toggleFreeze {
  min-height:48px;
  padding:12px 18px;
  font-size:17px;
  background-color:var(--button-bg);
  color:#0D1B2A;
  border:none;
  border-radius:8px;
  cursor:pointer;
  transition:background 0.3s, transform 0.2s, box-shadow 0.3s;
  box-shadow:0 4px 12px rgba(0,0,0,0.2);
}

#timezoneSelect {
  width:220px;
  text-align:center;
  text-align-last:center;
}

#toggleFreeze {
  margin:0;
  white-space:nowrap;
}

#timezoneSelect:hover,
#toggleFreeze:hover {
  background-color:var(--text-primary);
  transform:translateY(-1px);
  box-shadow:0 6px 16px rgba(0,0,0,0.3);
}

#timezoneSelect:focus,
#toggleFreeze:focus {
  outline:2px solid rgba(255,255,255,0.85);
  outline-offset:2px;
}

#selectedTime,
#currentMode {
  text-align:center;
  margin-top:10px;
  font-size:18px;
  color:var(--text-primary);
  text-shadow:1px 1px 3px rgba(0,0,0,0.3);
}

td.time-cell input{
  width:100%;
  border:none;
  background:transparent;
  text-align:center;
  font-size:20px;
  color:var(--text-primary);
  white-space:nowrap;
}

td.time-cell input::placeholder{ color:rgba(255,201,76,0.75); }

td.time-cell input:focus{
  outline:2px solid var(--text-primary);
  background-color:rgba(255,255,255,0.05);
}

td.utc-cell{
  font-size:20px;
  white-space:nowrap;
}

.city-short { display:none; }

/* 平板端：保留完整布局，扩大滑块可触控区域 */
@media (min-width:641px) and (max-width:1024px) {
  input[type=range] {
    min-height:36px;
  }

  .ticks {
    font-size:15px;
  }
}

/* 移动端：扩大触控区域，并维持同一呼吸节奏 */
@media (max-width:640px) {
  body { margin:12px; }

  input[type=range] {
    min-height:40px;
  }

  input[type=range]::-webkit-slider-thumb {
    height:20px;
    width:20px;
    margin-top:-6px;
  }

  input[type=range]::-moz-range-thumb {
    height:20px;
    width:20px;
  }

  .control-row {
    flex-direction:column;
    align-items:center;
    gap:10px;
  }

  .timezone-control {
    width:200px;
    align-items:center;
  }

  #timezoneSelect,
  #toggleFreeze {
    width:200px;
  }

  #toggleFreeze {
    min-width:0;
    padding-left:20px;
    padding-right:20px;
  }

  .table-wrapper {
    overflow-x:hidden;
  }

  table {
    table-layout:fixed;
    width:100%;
  }

  th,
  td {
    padding:10px 4px;
  }

  th:nth-child(1),
  td:nth-child(1) {
    width:22%;
  }

  th:nth-child(2),
  td:nth-child(2) {
    width:28%;
  }

  th:nth-child(3),
  td:nth-child(3) {
    width:50%;
  }

  td.utc-cell {
    font-size:16px;
    white-space:nowrap;
  }

  .city-full { display:none; }
  .city-short { display:inline; }

  .city-cell {
    font-size:15px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }

  td.time-cell input {
    font-size:16px;
    white-space:nowrap;
    overflow:visible;
  }
}

@media (prefers-reduced-motion:reduce) {
  input[type=range]::-webkit-slider-thumb,
  input[type=range]::-moz-range-thumb {
    animation:none;
    transform:scale(1);
    box-shadow:0 0 6px rgba(255,201,76,0.6);
  }
}
