:root {
  --key-unit: 40px;
  --key-gap: 3px;
  --bg-primary: #2b2b2b;
  --bg-secondary: #3d3d3d;
  --bg-tertiary: #1e1e1e;
  --text-primary: #ffffff;
  --text-secondary: #cccccc;
  --text-tertiary: #aaaaaa;
  --accent-cyan: #00d4ff;
  --accent-green: #7ed321;
  --accent-orange: #ff6b35;
  --accent-red: #d0021b;
  --accent-yellow: #f5a623;
  --accent-blue: #4a90e2;
  --accent-white: #ffffff;
  --key-bg-default: linear-gradient(145deg, #666666, #555555);
  --key-bg-white: linear-gradient(145deg, #ffffff, #f0f0f0);
  --key-bg-special: linear-gradient(145deg, #4a4a4a, #3a3a3a);
  --key-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  --key-shadow-hover: 0 4px 12px rgba(0, 212, 255, 0.4);
  --key-shadow-active: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
a {
  text-decoration: none;
  color: inherit;
}
a:hover {
  color: var(--text-primary);
  text-decoration: underline;
}
body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: "Marcellus", "Noto Serif SC", serif;
  line-height: 1.4;
  overflow-x: auto;
  font-size: 17px;
  user-select: none;
}

.container {
  width: 1200px;
  margin: 0 auto;
  padding: 25px;
  background-color: var(--bg-primary);
  line-height: 1.6;
}

.header {
  display: flex;
  align-items: flex-end;
  margin-bottom: 25px;
}

.logo {
  font-size: 84px;
  font-weight: 900;
  letter-spacing: -2px;
  margin-right: 25px;
  color: var(--text-primary);
  /* font-family: "Inter", sans-serif; */
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.logo-number {
  font-size: 36px;
  font-weight: 300;
  vertical-align: text-top;
  letter-spacing: 0;
}

.subtitle-container {
  margin-bottom: 8px;
}

.subtitle {
  font-size: 17px;
  color: var(--text-secondary);
  font-weight: 400;
  line-height: 1.3;
  margin-bottom: 2px;
}

.info-icon {
  display: inline-block;
  width: 16px;
  height: 16px;
  background: linear-gradient(145deg, #666, #555);
  border-radius: 50%;
  text-align: center;
  line-height: 16px;
  font-size: 10px;
  color: #fff;
  margin-left: 5px;
  cursor: help;
  transition: all 0.3s ease;
}

.info-icon:hover {
  background: linear-gradient(145deg, #777, #666);
  transform: scale(1.1);
}

.top-section {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 18px;
  margin-bottom: 25px;
}

.section {
  background: linear-gradient(145deg, var(--bg-secondary), #353535);
  padding: 22px;
  border-radius: 8px;
  border: 1px solid #4a4a4a;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.section:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.section-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
  line-height: 1.4;
}

.section-number {
  font-size: 18px;
  font-weight: 600;
}

.toggle-container {
  margin: 6px 0;
}

.toggle-switch {
  display: flex;
  align-items: center;
  margin: 10px 0;
  font-size: 15px;
  color: var(--text-secondary);
  transition: color 0.3s ease;
  line-height: 1.5;
}

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

.switch {
  width: 38px;
  height: 20px;
  background: linear-gradient(145deg, #888, #777);
  border-radius: 10px;
  margin-right: 10px;
  position: relative;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.switch.on {
  background: linear-gradient(145deg, #4caf50, #45a049);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2), 0 0 10px rgba(76, 175, 80, 0.3);
}

.switch::after {
  content: "|";
  width: 16px;
  height: 16px;
  text-align: center;
  line-height: 16px;
  color: #333;
  font-size: 10px;
  font-weight: 900;
  background: linear-gradient(145deg, #ffffff, #f0f0f0);
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.switch.on::after {
  transform: translateX(18px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.switch:hover {
  transform: scale(1.05);
}

.switch:active {
  transform: scale(0.95);
}

.section-note {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-top: 10px;
  line-height: 1.6;
  padding: 8px 8px 8px 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  /* border-left: 3px solid var(--accent-cyan); */
}

.keyboard-section {
  margin: 25px 0;
  text-align: center;
}

.keyboard-legends {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
  font-size: 14px;
  color: var(--text-secondary);
  padding: 0 20px;
  line-height: 1.5;
}

.legend-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent-cyan);
  letter-spacing: -0.5px;
  line-height: 1.3;
}

.legend-left .legend-title {
  border-bottom-color: var(--accent-cyan);
}

.legend-right .legend-title {
  border-bottom-color: var(--accent-orange);
}

.legend-left,
.legend-right {
  flex: 1;
}

.legend-item {
  display: flex;
  align-items: center;
  margin: 8px 0;
  font-size: 14px;
  transition: all 0.3s ease;
  padding: 2px 0;
}

.legend-item:hover {
  color: var(--text-primary);
  transform: translateX(5px);
}

.legend-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 8px;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.legend-item:hover .legend-color {
  transform: scale(1.2);
  box-shadow: 0 0 10px currentColor;
}

/* 精确的键盘尺寸和对齐 */
.keyboard {
  background: linear-gradient(145deg, #8a8a8a, #7a7a7a);
  border: none;
  border-radius: 20px;
  padding: 25px;
  margin: 20px 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), inset 0 2px 4px rgba(255, 255, 255, 0.1), inset 0 -2px 4px
    rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: visible;
  width: 722px; /* 672px + 50px padding */
  margin-left: auto;
  margin-right: auto;
}

.keyboard::before {
  content: "";
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  bottom: 8px;
  background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
  border-radius: 15px;
  z-index: 0;
}

.keyboard-row {
  display: flex;
  justify-content: flex-start;
  margin: 4px 0;
  gap: 4px;
  position: relative;
  z-index: 1;
  width: 672px; /* 精确计算的总宽度 */
}

/* 放大到1000px的键盘尺寸 */
.keyboard {
  background: linear-gradient(145deg, #8a8a8a, #7a7a7a);
  border: none;
  border-radius: 30px; /* 按比例放大 */
  padding: 37px; /* 按比例放大 */
  margin: 30px 0;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.3), inset 0 3px 6px rgba(255, 255, 255, 0.1), inset 0 -3px 6px
    rgba(0, 0, 0, 0.2);
  position: relative;
  overflow: visible;
  width: 1074px; /* 1000px + 74px padding */
  margin-left: auto;
  margin-right: auto;
}

.keyboard::before {
  content: "";
  position: absolute;
  top: 12px; /* 按比例放大 */
  left: 12px;
  right: 12px;
  bottom: 12px;
  background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
  border-radius: 22px; /* 按比例放大 */
  z-index: 0;
}

.keyboard-row {
  display: flex;
  justify-content: flex-start;
  margin: 6px 0; /* 按比例放大 */
  gap: 6px; /* 按比例放大 */
  position: relative;
  z-index: 1;
  width: 1000px; /* 目标宽度 */
}

/* 按比例放大的按键尺寸 */
.key {
  height: 60px; /* 按比例放大 */
  background: linear-gradient(145deg, #4a4a4a, #3a3a3a);
  border: 1px solid #2a2a2a;
  border-radius: 9px; /* 按比例放大 */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: "Inter", sans-serif;
  user-select: none;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

/* 按比例放大的按键宽度 - 基于62.5px单位 (42px * 1.488) */
.key-1u {
  width: 62.5px;
}
.key-1-25u {
  width: 78px;
}
.key-1-5u {
  width: 94px;
}
.key-1-75u {
  width: 109px;
}
.key-2u {
  width: 131px;
}
.key-2-25u {
  width: 140px;
}
.key-2-75u {
  width: 172px;
}
.key-6u {
  width: 375px; /* 按比例放大的空格键 */
}

/* 双字符按键的字体排版 - 按比例放大 */
.key-dual {
  padding: 4px 0; /* 按比例放大 */
}

.key-top {
  font-size: 14px; /* 按比例放大 */
  font-weight: 500;
  line-height: 1;
  margin-bottom: 2px; /* 按比例放大 */
  color: #cccccc;
}

.key-bottom {
  font-size: 18px; /* 按比例放大 */
  font-weight: 700;
  line-height: 1;
  color: #ffffff;
}

/* 字母键 - 按比例放大 */
.key-letter {
  font-size: 18px; /* 按比例放大 */
  font-weight: 700;
  color: #ffffff;
}

/* 功能键 - 按比例放大 */
.key-function {
  font-size: 14px; /* 按比例放大 */
  font-weight: 600;
  color: #cccccc;
}

/* 修饰键 - 按比例放大 */
.key-modifier {
  font-size: 14px; /* 按比例放大 */
  font-weight: 600;
  color: #cccccc;
}

/* 方向键 - 按比例放大 */
.key-arrow {
  font-size: 24px; /* 按比例放大 */
  font-weight: 700;
  color: #ffffff;
}

/* 特殊彩色按键 - 按比例放大 */
.key-esc {
  background: linear-gradient(145deg, #4dd0e1, #26c6da);
  color: #000000;
  font-weight: 700;
  font-size: 16px; /* 按比例放大 */
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.key-enter {
  background: linear-gradient(145deg, #ff6b35, #e55722);
  color: #ffffff;
  font-weight: 700;
  font-size: 16px; /* 按比例放大 */
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.key-spacebar {
  background: linear-gradient(145deg, #ffd54f, #ffb300);
  color: #000000;
  font-weight: 700;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* 确保每行左右对齐 */
.keyboard-row:nth-child(1) {
  /* Function row */
  width: 1000px;
}

.keyboard-row:nth-child(2) {
  /* Number row */
  width: 1000px;
}

.keyboard-row:nth-child(3) {
  /* QWERTY row */
  width: 1000px;
}

.keyboard-row:nth-child(4) {
  /* ASDF row */
  width: 1000px;
}

.keyboard-row:nth-child(5) {
  /* ZXCV row */
  width: 1000px;
}

.keyboard-row:nth-child(6) {
  /* Bottom row */
  width: 1000px;
}

.key-main {
  font-size: 16px; /* 按比例放大 */
  font-weight: 600;
  line-height: 1;
  margin-bottom: 1px;
}

.key-sub {
  font-size: 19px; /* 按比例放大 */
  font-weight: 700;
  line-height: 1;
}

/* Key hover and active states - 按比例放大 */
.key:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.key:active {
  transform: translateY(1px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4), inset 0 3px 6px rgba(0, 0, 0, 0.3);
}

.key.pressed {
  animation: keyPress 0.3s ease;
}

@keyframes keyPress {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(0.95);
    box-shadow: 0 0 22px rgba(0, 212, 255, 0.6), inset 0 3px 6px rgba(0, 0, 0, 0.3);
  }
  100% {
    transform: scale(1);
  }
}

/* Special key hover effects - 按比例放大 */
.key-esc:hover {
  background: linear-gradient(145deg, #5dd5ea, #36d0e6);
  box-shadow: 0 6px 18px rgba(77, 208, 225, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.key-enter:hover {
  background: linear-gradient(145deg, #ff7b45, #f55732);
  box-shadow: 0 6px 18px rgba(255, 107, 53, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.key-spacebar:hover {
  background: linear-gradient(145deg, #ffdd5f, #ffc000);
  box-shadow: 0 6px 18px rgba(255, 213, 79, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.bottom-sections {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 18px;
  margin: 25px 0;
}

.key-combo-container {
  margin: 12px 0;
}

.key-combo-row {
  display: flex;
  align-items: center;
  margin: 10px 0;
  gap: 6px;
  flex-wrap: wrap;
}

.combo-key {
  background: linear-gradient(145deg, #555555, #444444);
  color: var(--text-primary);
  padding: 12px 0 0 0;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 700;
  font-family: "JetBrains Mono", monospace;
  border: 1px solid #666666;
  min-width: 48px;
  min-height: 48px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
.combo-key.white {
  background: var(--key-bg-white);
  color: #000000;
  border-color: #cccccc;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
.combo-key.white:hover {
  background: linear-gradient(145deg, #ffffff, #f0f0f0);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}
.combo-key:hover {
  background: linear-gradient(145deg, #666666, #555555);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.combo-key:active {
  transform: translateY(0);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.combo-plus {
  color: #888888;
  font-size: 12px;
  font-weight: bold;
  margin: 0 2px;
}

.pairing-grid {
  display: flex;
  gap: 8px;
  margin: 12px 0;
  justify-content: flex-start;
}

.pairing-key {
  background: linear-gradient(145deg, #555555, #444444);
  color: var(--text-primary);
  padding: 8px 12px;
  text-align: center;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 600;
  border: 1px solid #666666;
  min-width: 32px;
  font-family: "JetBrains Mono", monospace;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.pairing-key:hover {
  background: linear-gradient(145deg, #666666, #555555);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.pairing-key.active {
  background: linear-gradient(145deg, var(--accent-cyan), #00b8e6);
  color: #000;
  box-shadow: 0 0 15px rgba(0, 212, 255, 0.5);
}

.via-section {
  grid-column: 1 / -1;
  background: linear-gradient(145deg, var(--bg-tertiary), #1a1a1a);
  border: 1px solid #333333;
  padding: 25px;
  border-radius: 8px;
  margin-top: 20px;
  position: relative;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.via-title {
  font-size: 19px;
  font-weight: 600;
  margin-bottom: 15px;
  color: var(--text-primary);
}

.via-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-secondary);
}

.via-logo {
  position: absolute;
  bottom: 20px;
  right: 25px;
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: "Inter", sans-serif;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.mode-indicators {
  position: absolute;
  bottom: 20px;
  left: 25px;
  display: flex;
  gap: 15px;
}

.mode-indicator {
  background: linear-gradient(145deg, #333333, #2a2a2a);
  padding: 8px 15px;
  border-radius: 20px;
  font-size: 15px;
  border: 1px solid #444444;
  color: var(--text-secondary);
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.mode-indicator:hover {
  background: linear-gradient(145deg, #444444, #333333);
  color: var(--text-primary);
  transform: translateY(-1px);
}

/* Color definitions */
.color-orange {
  background-color: var(--accent-orange);
}
.color-blue {
  background-color: var(--accent-blue);
}
.color-green {
  background-color: var(--accent-green);
}
.color-red {
  background-color: var(--accent-red);
}
.color-cyan {
  background-color: var(--accent-cyan);
}
.color-yellow {
  background-color: var(--accent-yellow);
}
.color-purple {
  background-color: #9013fe;
}
.color-white {
  background-color: var(--accent-white);
}
/* RGB Lighting Effects */
.rgb-effect {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 12px;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.rgb-effect.active {
  opacity: 1;
  animation: rgbCycle 3s infinite;
}

@keyframes rgbCycle {
  0% {
    box-shadow: inset 0 0 20px rgba(255, 0, 0, 0.3);
  }
  33% {
    box-shadow: inset 0 0 20px rgba(0, 255, 0, 0.3);
  }
  66% {
    box-shadow: inset 0 0 20px rgba(0, 0, 255, 0.3);
  }
  100% {
    box-shadow: inset 0 0 20px rgba(255, 0, 0, 0.3);
  }
}

/* 重要提示背景 */
.important-note {
  background: linear-gradient(135deg, rgba(255, 107, 53, 0.1), rgba(255, 107, 53, 0.05));
  border-left: 4px solid var(--accent-orange);
  padding: 12px 15px;
  border-radius: 6px;
  margin: 10px 0;
  font-weight: 500;
}

/* 警告信息背景 */
.warning-note {
  background: linear-gradient(135deg, rgba(245, 166, 35, 0.1), rgba(245, 166, 35, 0.05));
  border-left: 4px solid var(--accent-yellow);
  padding: 12px 15px;
  border-radius: 6px;
  margin: 10px 0;
  font-weight: 500;
}

/* 成功/连接状态背景 */
.success-note {
  background: linear-gradient(135deg, rgba(126, 211, 33, 0.1), rgba(126, 211, 33, 0.05));
  border-left: 4px solid var(--accent-green);
  padding: 12px 15px;
  border-radius: 6px;
  margin: 10px 0;
  font-weight: 500;
}

/* 信息提示背景 */
.info-note {
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(0, 212, 255, 0.05));
  border-left: 4px solid var(--accent-cyan);
  padding: 12px 15px;
  border-radius: 6px;
  margin: 10px 0;
  font-weight: 500;
}

/* 快捷键组合突出显示 */
.key-combo-highlight {
  background: linear-gradient(135deg, rgba(74, 144, 226, 0.15), rgba(74, 144, 226, 0.08));
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(74, 144, 226, 0.2);
  margin: 8px 0;
}

/* 设备连接状态 */
.device-status {
  background: linear-gradient(135deg, rgba(144, 19, 254, 0.1), rgba(144, 19, 254, 0.05));
  border-left: 4px solid #9013fe;
  padding: 10px 12px;
  border-radius: 6px;
  margin: 8px 0;
  font-weight: 500;
  font-size: 14px;
}

/* Responsive Design */
@media (max-width: 1250px) {
  .container {
    width: 100%;
    padding: 15px;
  }

  .top-section,
  .bottom-sections {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .keyboard {
    overflow-x: auto;
    padding: 15px;
  }

  .logo {
    font-size: 64px;
  }

  :root {
    --key-unit: 35px;
    --key-gap: 2px;
  }
}

/* Animation classes */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.8s ease forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Loading animation */
.loading {
  position: relative;
  overflow: hidden;
}

.loading::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  animation: loading 2s infinite;
}

@keyframes loading {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}
/* Scrollbar styles */
.two-char {
  padding: 6px 0 0 12px;
  line-height: 18px;
  font-size: 13px;
  vertical-align: middle;
  text-align: left;
}