:root {
  --header-height: 50px;
  --sidebar-width: 340px;
  --header-bg: #ffffff;
  --sidebar-bg: #ffffff;
  --content-bg: #f9f9f9;
  --hover-bg: #efefef;
  --header-border: #e4e7ed;
  --text-primary: #303133;
  --text-secondary: #606266;
  --text-muted: #909399;
  --shadow-color: rgba(0, 0, 0, 0.08);
  --shadow-hover: rgba(59, 130, 246, 0.2);
  --panel-shadow: rgba(0, 0, 0, 0.12);
  --badge-bg: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
  --badge-text: #ffffff;
  --card-bg: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  --card-border: #e2e8f0;
  --stats-card-bg: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  --stats-card-border: #bfdbfe;
  --btn-gradient: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
  --btn-shadow: rgba(59, 130, 246, 0.39);
  --info-row-hover: #f1f5f9;
  --footer-bg: #ffffff;
  --tooltip-bg: #ffffff;
  --tooltip-border: #e2e8f0;
  --scrollbar-thumb: #c1c1c1;
  --scrollbar-track: #f1f1f1;
  --map-bg: #f8fafc;
  --map-border-color: #94a3b8;
  --map-area-color: #c8d3df;
  --map-area-hover: #2563eb;
  --map-text-color: #64748b;
}

html.dark {
  --header-bg: #1e1e2e;
  --sidebar-bg: #1e1e2e;
  --content-bg: #181825;
  --hover-bg: #2a2a3e;
  --header-border: #3a3d5c;
  --text-primary: #e5e7eb;
  --text-secondary: #b0b0b0;
  --text-muted: #888888;
  --shadow-color: rgba(0, 0, 0, 0.3);
  --shadow-hover: rgba(96, 165, 250, 0.3);
  --panel-shadow: rgba(0, 0, 0, 0.4);
  --badge-bg: linear-gradient(135deg, #60a5fa 0%, #22d3ee 100%);
  --card-bg: linear-gradient(180deg, #1e1e2e 0%, #181825 100%);
  --card-border: #3a3d5c;
  --stats-card-bg: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
  --stats-card-border: #3b82f6;
  --btn-gradient: linear-gradient(135deg, #60a5fa 0%, #22d3ee 100%);
  --btn-shadow: rgba(96, 165, 250, 0.3);
  --info-row-hover: #2a2a3e;
  --footer-bg: #1e1e2e;
  --tooltip-bg: #1e1e2e;
  --tooltip-border: #3a3d5c;
  --scrollbar-thumb: #4a4a6a;
  --scrollbar-track: #1e1e2e;
  --map-bg: #0c1222;
  --map-border-color: #2d4a6f;
  --map-area-color: #1e3a5f;
  --map-area-hover: #60a5fa;
  --map-text-color: #94a3b8;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: ui-sans-serif, -apple-system, system-ui, Segoe UI, Helvetica, Arial, sans-serif;
  background-color: var(--content-bg);
  color: var(--text-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
}

.header {
  height: var(--header-height);
  background-color: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: relative;
  z-index: 100;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  font-size: 22px;
}

.logo-text {
  font-size: 18px;
  font-weight: 600;
  background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

html.dark .logo-text {
  background: linear-gradient(135deg, #60a5fa 0%, #22d3ee 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--badge-bg);
  color: var(--badge-text);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.header-center {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  max-width: 600px;
  margin: 0 20px;
}

.search-container {
  position: relative;
  flex: 1;
  max-width: 400px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--hover-bg);
  border: 1.5px solid transparent;
  border-radius: 10px;
  transition: all 0.2s ease;
  overflow: hidden;
}

.search-box:focus-within {
  border-color: #3b82f6;
  background: var(--sidebar-bg);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

html.dark .search-box:focus-within {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.15);
}

.search-icon {
  padding-left: 12px;
  font-size: 16px;
  pointer-events: none;
  user-select: none;
}

.search-input {
  flex: 1;
  height: 36px;
  padding: 0 8px;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  color: var(--text-primary);
  font-family: inherit;
  min-width: 0;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-clear {
  width: 22px;
  height: 22px;
  margin-right: 6px;
  border: none;
  border-radius: 50%;
  background: var(--text-muted);
  color: white;
  font-size: 12px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  opacity: 0;
}

.search-clear.visible {
  display: flex;
  opacity: 1;
}

.search-clear:hover {
  background: #ef4444;
  transform: scale(1.1);
}

.search-loading {
  position: absolute;
  right: 40px;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  align-items: center;
  justify-content: center;
}

.search-loading.active {
  display: flex;
}

.loading-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--text-muted);
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--sidebar-bg);
  border: 1px solid var(--header-border);
  border-radius: 12px;
  box-shadow: 0 10px 30px var(--shadow-color), 0 2px 8px rgba(0,0,0,0.08);
  max-height: 420px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  animation: dropdownFadeIn 0.15s ease-out;
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.search-dropdown.active {
  display: block;
}

.search-history {
  border-bottom: 1px solid var(--header-border);
  padding: 12px;
}

.search-history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.history-clear-btn {
  background: none;
  border: none;
  color: #3b82f6;
  cursor: pointer;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.history-clear-btn:hover {
  background: rgba(59, 130, 246, 0.1);
}

html.dark .history-clear-btn {
  color: #60a5fa;
}

.search-history-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.history-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--hover-bg);
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.history-item:hover {
  background: var(--btn-gradient);
  color: white;
  transform: translateY(-1px);
}

.search-results {
  max-height: 350px;
  overflow-y: auto;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  transition: all 0.12s ease;
  border-bottom: 1px solid rgba(228, 231, 237, 0.3);
}

html.dark .search-result-item {
  border-bottom-color: rgba(58, 61, 92, 0.3);
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-item:hover,
.search-result-item.selected {
  background: var(--info-row-hover);
}

.search-result-item.selected {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(6, 182, 212, 0.08) 100%);
}

html.dark .search-result-item.selected {
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.12) 0%, rgba(34, 211, 238, 0.12) 100%);
}

.result-flag {
  font-size: 24px;
  line-height: 1;
  flex-shrink: 0;
  user-select: none;
}

.result-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.result-name-en {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-name-zh {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.highlight {
  color: #3b82f6;
  font-weight: 700;
  background: rgba(59, 130, 246, 0.1);
  padding: 0 2px;
  border-radius: 2px;
}

html.dark .highlight {
  color: #60a5fa;
  background: rgba(96, 165, 250, 0.15);
}

.search-no-results {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 28px 20px;
  color: var(--text-muted);
  font-size: 13px;
}

.search-no-results.visible {
  display: flex;
}

.no-results-icon {
  font-size: 32px;
}

.local-clock {
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.local-date {
  font-size: 13px;
  color: var(--text-muted);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.theme-toggle {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: var(--hover-bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  font-size: 18px;
}

.theme-toggle:hover {
  background: var(--btn-gradient);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px 0 var(--btn-shadow);
}

.theme-toggle:hover .theme-icon {
  filter: brightness(10);
}

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: none;
  border-radius: 8px;
  background: var(--hover-bg);
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 13px;
  font-weight: 500;
}

.axis-toggle {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: var(--hover-bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  font-size: 16px;
}

.axis-toggle:hover {
  background: var(--btn-gradient);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px 0 var(--btn-shadow);
}

.axis-toggle:hover .axis-icon {
  filter: brightness(10);
}

.axis-icon {
  font-size: 16px;
}

.lang-toggle:hover {
  background: var(--btn-gradient);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px 0 var(--btn-shadow);
}

.lang-toggle:hover .lang-icon,
.lang-toggle:hover .lang-text {
  filter: brightness(10);
  color: #ffffff;
}

.lang-icon {
  font-size: 16px;
}

.lang-text {
  color: var(--text-primary);
  font-weight: 600;
}

.main {
  display: flex;
  height: calc(100vh - var(--header-height) - 36px);
  position: relative;
}

.map-wrapper {
  flex: 1;
  position: relative;
  overflow: hidden;
  background-color: var(--map-bg);
  transition: background-color 0.3s ease;
}

.map-container {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
}

.info-panel {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  border-left: 1px solid var(--header-border);
  display: flex;
  flex-direction: column;
  height: 100%;
  transform: translateX(0);
  transition: transform 0.2s ease, background-color 0.3s ease, border-color 0.3s ease;
  z-index: 60;
  overflow: hidden;
}

.info-panel.hidden {
  transform: translateX(100%);
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
}

.info-panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--header-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: border-color 0.3s ease;
}

.info-panel-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  transition: color 0.3s ease;
}

.info-panel-close {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: var(--hover-bg);
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.info-panel-close:hover {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
}

.info-panel-body {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.info-panel-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--header-border);
  background: var(--sidebar-bg);
  flex-shrink: 0;
  transition: border-color 0.3s ease, background-color 0.3s ease;
}

.info-card {
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all 0.2s ease;
  border: 1px solid var(--card-border);
}

.info-card-main {
  background: var(--stats-card-bg);
  border-color: var(--stats-card-border);
}

.info-card-date {
  background: var(--card-bg);
}

.info-card-ip {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: transparent;
  color: white;
  height: 76px;
  box-sizing: border-box;
}

.info-card-ip .info-card-label,
.info-card-ip .info-card-sub {
  color: rgba(255, 255, 255, 0.85);
}

.info-card-ip .info-card-value {
  color: white;
  font-size: 22px;
  line-height: 1.2;
}

.info-card-ip .info-card-icon {
  font-size: 24px;
}

.info-card-sub {
  font-size: 11px;
  margin-top: 2px;
  display: none;
}

.info-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--shadow-color);
}

.info-card-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.info-card-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.info-card-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.info-card-value {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.info-card-date .info-card-value {
  font-size: 16px;
}

.info-details {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  overflow: hidden;
  background: var(--card-bg);
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  transition: background-color 0.15s ease;
}

.info-row:not(:last-child) {
  border-bottom: 1px solid var(--header-border);
}

.info-row:hover {
  background-color: var(--info-row-hover);
}

.info-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.info-value {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
  text-align: right;
}

.info-badge-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.info-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.info-badge-primary {
  background: var(--badge-bg);
  color: var(--badge-text);
}

.info-badge-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
}

html.dark .info-badge-success {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
}

.info-badge-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
}

html.dark .info-badge-warning {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
}

.info-badge-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
}

html.dark .info-badge-danger {
  background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
}

.info-badge-info {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #ffffff;
}

html.dark .info-badge-info {
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
}

.footer {
  height: 36px;
  background: var(--footer-bg);
  border-top: 1px solid var(--header-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.footer-text {
  font-size: 12px;
  color: var(--text-muted);
}

.footer-timezone {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.info-panel::-webkit-scrollbar {
  width: 6px;
}

.info-panel::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

.info-panel::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 3px;
}

@media (max-width: 768px) {
  .header-center {
    display: none;
  }

  .mobile-search-container {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .search-container.mobile {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    padding: 60px 16px 16px;
    max-width: none;
  }

  .search-container.mobile .search-box {
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  }

  .search-container.mobile .search-input {
    height: 44px;
    font-size: 16px;
  }

  .search-container.mobile .search-dropdown {
    position: static;
    max-height: calc(100vh - 140px);
    margin-top: 8px;
    border-radius: 12px;
  }

  .main {
    flex-direction: column;
  }

  .info-panel {
    width: 100%;
    height: 45vh;
    border-left: none;
    border-top: 1px solid var(--header-border);
    order: 2;
  }

  .info-details {
    border-radius: 8px;
  }

  .info-row {
    padding: 14px 16px;
    min-height: 48px;
  }

  .info-label,
  .info-value {
    line-height: 1.4;
  }

  .info-panel.hidden {
    transform: translateY(100%);
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
  }

  .info-panel-footer {
    padding: 10px 16px;
  }

  .info-panel-footer .info-card {
    padding: 12px;
  }

  .info-panel-footer .info-card-icon {
    font-size: 20px;
  }

  .info-panel-footer .info-card-value {
    font-size: 18px;
  }

  .map-wrapper {
    order: 1;
  }

  .logo-text {
    font-size: 15px;
  }

  .footer {
    height: auto;
    min-height: 36px;
    padding: 8px 12px;
    flex-direction: column;
    gap: 4px;
    justify-content: center;
  }

  .footer-text {
    font-size: 11px;
    text-align: center;
    line-height: 1.4;
  }

  .footer-timezone {
    font-size: 10px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .header {
    padding: 0 12px;
  }

  .footer {
    padding: 6px 10px;
    gap: 2px;
  }

  .footer-text {
    font-size: 10px;
    line-height: 1.3;
  }

  .footer-timezone {
    font-size: 9px;
  }

  .logo-badge {
    display: none;
  }

  .info-panel {
    height: 50vh;
  }

  .info-row {
    padding: 12px 14px;
    min-height: 44px;
  }

  .info-label {
    font-size: 12px;
  }

  .info-value {
    font-size: 13px;
  }

  .info-panel-footer {
    padding: 8px 12px;
  }

  .info-panel-footer .info-card {
    padding: 10px;
    gap: 10px;
  }

  .info-panel-footer .info-card-icon {
    font-size: 18px;
  }

  .info-panel-footer .info-card-value {
    font-size: 16px;
  }

  .info-panel-footer .info-card-label {
    font-size: 11px;
  }

  .info-card-value {
    font-size: 18px;
  }
}

.mobile-search-btn {
  display: none;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: var(--hover-bg);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: all 0.15s ease;
}

.mobile-search-btn:hover {
  background: var(--btn-gradient);
}

.mobile-search-btn:hover span {
  filter: brightness(10);
}

@media (max-width: 768px) {
  .mobile-search-btn {
    display: flex;
  }
}

.search-results::-webkit-scrollbar,
.search-dropdown::-webkit-scrollbar {
  width: 6px;
}

.search-results::-webkit-scrollbar-track,
.search-dropdown::-webkit-scrollbar-track {
  background: transparent;
}

.search-results::-webkit-scrollbar-thumb,
.search-dropdown::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 3px;
}

.echarts-visualMap-piecewise {
  transition: opacity 0.5s ease;
}

.echarts-visualMap-piecewise.orient-horizontal .echarts-visualMap-piecewise-item {
  flex: 1 !important;
  min-width: 0 !important;
  border-radius: 0 !important;
}

.echarts-visualMap-piecewise.orient-horizontal {
  width: calc(100% - 40px) !important;
  left: 20px !important;
  display: flex !important;
}

.echarts-visualMap-piecewise.orient-vertical .echarts-visualMap-piecewise-item {
  width: 100% !important;
  border-radius: 0 !important;
}

.echarts-visualMap-piecewise.orient-vertical {
  height: calc(100% - 60px) !important;
  top: 30px !important;
}

.echarts-visualMap-piecewise,
.echarts-visualMap-continuous {
  display: none !important;
}

.tz-ruler {
  position: absolute;
  z-index: 80;
  pointer-events: auto;
  transition: opacity 0.4s ease;
}

.tz-ruler.hidden {
  opacity: 0;
  pointer-events: none;
}

.tz-ruler.horizontal {
  left: 20px;
  right: 20px;
  bottom: 12px;
  height: 36px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tz-ruler.vertical {
  left: 8px;
  top: 30px;
  bottom: 30px;
  width: 36px;
  display: flex;
  flex-direction: row;
  gap: 1px;
}

.tz-ruler-track {
  flex: 1;
  display: flex;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.tz-ruler.horizontal .tz-ruler-track {
  width: 100%;
  height: 18px;
  flex-direction: row;
}

.tz-ruler.vertical .tz-ruler-track {
  width: 14px;
  height: 100%;
  flex-direction: column;
}

.tz-ruler-segment {
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, filter 0.15s ease;
  border-right: 1px solid rgba(255,255,255,0.25);
}

.tz-ruler-segment-label {
  font-size: 9px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  color: rgba(0,0,0,0.35);
  user-select: none;
  white-space: nowrap;
  pointer-events: none;
}

html.dark .tz-ruler-segment-label {
  color: rgba(255,255,255,0.4);
}

.tz-ruler.vertical .tz-ruler-segment {
  border-right: none;
  border-bottom: 1px solid rgba(255,255,255,0.25);
}

.tz-ruler-segment:last-child {
  border-right: none;
  border-bottom: none;
}

.tz-ruler-segment:hover {
  filter: brightness(1.25);
  z-index: 2;
}

.tz-ruler-segment.active {
  filter: brightness(1.35);
  box-shadow:
    inset 0 0 0 2px rgba(255,255,255,0.9),
    0 0 12px rgba(59,130,246,0.6),
    0 0 24px rgba(59,130,246,0.3);
  border: 2px solid #3b82f6;
  z-index: 10;
  position: relative;
  animation: tzPulse 2s ease-in-out infinite;
}

@keyframes tzPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow:
      inset 0 0 0 2px rgba(255,255,255,0.9),
      0 0 12px rgba(59,130,246,0.6),
      0 0 24px rgba(59,130,246,0.3);
  }
  50% {
    transform: scale(1.02);
    box-shadow:
      inset 0 0 0 2px rgba(255,255,255,1),
      0 0 16px rgba(59,130,246,0.8),
      0 0 32px rgba(59,130,246,0.5);
  }
}

.tz-ruler-labels {
  display: flex;
  font-size: 9px;
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  user-select: none;
}

.tz-ruler.horizontal .tz-ruler-labels {
  justify-content: space-between;
  padding-top: 1px;
}

.tz-ruler.vertical .tz-ruler-labels {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  font-size: 9px;
  line-height: 1;
}

.tz-countries-panel {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 280px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--header-border);
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.25s ease, background-color 0.3s ease, border-color 0.3s ease;
  overflow-y: auto;
  z-index: 70;
  box-shadow: 4px 0 16px var(--shadow-color);
}

.tz-countries-panel.active {
  transform: translateX(0);
}

.tz-countries-panel.with-vertical-ruler {
  left: 48px;
  width: calc(280px - 48px);
}

.tz-countries-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--header-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: border-color 0.3s ease;
}

.tz-countries-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  transition: color 0.3s ease;
}

.tz-countries-close {
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 6px;
  background: var(--hover-bg);
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.tz-countries-close:hover {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: #ffffff;
}

.tz-countries-body {
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tz-countries-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 30px 16px;
  line-height: 1.6;
}

.tz-country-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.tz-country-item:hover {
  background: var(--hover-bg);
  border-color: var(--card-border);
  transform: translateX(2px);
}

.tz-country-flag {
  font-size: 18px;
  flex-shrink: 0;
  min-width: 24px;
  text-align: center;
}

.tz-country-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tz-country-time {
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.tz-header-time {
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  padding: 16px 0 12px;
  letter-spacing: 1px;
}

.tz-header-diff {
  display: flex;
  justify-content: center;
  gap: 20px;
  padding: 8px 0 16px;
  font-size: 12px;
  color: var(--text-muted);
}

.tz-diff-beijing,
.tz-diff-local {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--bg-secondary, rgba(128, 128, 128, 0.1));
  border-radius: 12px;
  font-weight: 500;
}

.tz-diff-beijing {
  color: #f59e0b;
}

.tz-diff-local {
  color: #3b82f6;
}

.tz-country-names {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 0;
  align-items: flex-start;
  line-height: 1.3;
}

.tz-country-zh {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tz-country-en {
  font-size: 11px;
  color: #3b82f6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

html.dark .tz-country-en {
  color: #60a5fa;
}
