* { 
  margin: 0; 
  padding: 0; 
  box-sizing: border-box; 
  font-family: 'Microsoft Yahei', sans-serif; 
}
body { 
  background: #f5f7fa; 
  padding: 20px; 
  line-height: 1.6; 
}
.container { 
  max-width: 1200px; 
  margin: 0 auto; 
  gap: 25px; 
  display: flex; 
  flex-direction: column; 
}
h1 { 
  text-align: center; 
  color: #2c3e50; 
  margin-bottom: 10px; 
  font-weight: 600; 
}
.subtitle { 
  text-align: center; 
  color: #666; 
  margin-bottom: 20px; 
  font-size: 14px; 
}
.card { 
  background: white; 
  border-radius: 10px; 
  padding: 20px; 
	box-shadow: 0 2px 12px rgba(0,0,0,0.08); 
}
h2 { 
  color: #3498db; 
  margin-bottom: 18px; 
  padding-bottom: 8px; 
  border-bottom: 2px solid #eef5fb; 
}
.input-area { 
  display: flex; 
  flex-direction: column; 
  gap: 12px; 
}
input[type="file"] { 
  padding: 8px; 
  border: 1px solid #ddd; 
  border-radius: 6px; 
  cursor: pointer; 
}
textarea { 
  width: 100%; 
  min-height: 120px; 
  padding: 12px; 
  border: 1px solid #ddd; 
  border-radius: 6px; 
  resize: vertical; 
  font-size: 14px; 
}
.btn-group { 
  display: flex; 
  gap: 10px; 
  flex-wrap: wrap; 
  margin: 10px 0;
}
button { 
  padding: 10px 20px; 
  border: none; 
  border-radius: 6px; 
  cursor: pointer; 
  font-size: 14px; 
  transition: all 0.2s; 
}
button.primary { background: #3498db; color: white; }
button.primary:hover { background: #2980b9; }
button.success { background: #2ecc71; color: white; }
button.success:hover { background: #27ae60; }
button.warning { background: #f1c40f; color: #2c3e50; }
button.warning:hover { background: #f39c12; }
button.danger { background: #e74c3c; color: white; }
button.danger:hover { background: #c0392b; }
button:disabled { background: #bdc3c7; cursor: not-allowed; }

.num-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.num-view-area label {
  color: #2c3e50;
  font-weight: 500;
  font-size: 14px;
  min-width: 100px;
}

.num-value {
  font-size: 14px;
  background: transparent;
  color: #e74c3c;
  font-weight: bold;
  flex: 1;
  padding: 4px 8px;
}

.result-display-container {
  display: flex;
  gap: 15px;
  align-items: stretch;
  background: #fff;
  margin: 15px 0;
}

.num-view-area {
  width: 50%;
  height: 145px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  background: #f0f7ff;
  border-radius: 6px;
  border: 1px solid #d0e8ff;
  box-sizing: border-box;
  overflow-y: auto;
}

.result-area {
  width: 50%;
  height: 145px;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #f9f9f9;
  white-space: pre-wrap; 
  overflow-x: auto;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.4;
  box-sizing: border-box;
  display: block;
  align-items: center;
}

.coded-result-area {
  width: 100%;
  height: 63px;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #f9f9f9;
  white-space: pre-wrap; 
  overflow-x: auto;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.4;
  box-sizing: border-box;
  display: block;
  align-items: center;
}

@media (max-width: 768px) {
  .result-display-container {
    flex-direction: row;
    gap: 10px;
  }
  
  .num-view-area {
    width: 100%;
    min-height: 120px;
    font-size: 13px;
  }
  
  .result-area {
    width: 100%;
    min-height: 120px;
    font-size: 12px;
    padding: 8px;
  }
  
  .num-item {
    flex-direction: row;
    gap: 5px;
  }
  
  .num-view-area label {
    min-width: 80px;
    font-size: 12px;
  }
}

@media (max-width: 480px) {
  .result-display-container {
    gap: 8px;
  }
  
  .num-view-area {
    width: 100%;
    min-height: 100px;
    font-size: 12px;
    padding: 8px;
  }
  
  .result-area {
    width: 100%;
    min-height: 100px;
    font-size: 11px;
    padding: 6px;
  }
  
  .num-item {
    gap: 3px;
  }
  
  .num-view-area label {
    min-width: 70px;
    font-size: 11px;
  }
}

.tips { color: #666; font-size: 13px; margin-top: 10px; padding-left: 5px; }
.success-tip { color: #27ae60; }
.error-tip { color: #e74c3c; }
.loading { color: #3498db; }
.hide { display: none; }

.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 12px 24px;
  border-radius: 25px;
  font-size: 14px;
  z-index: 1000;
  animation: toastSlideDown 0.3s ease-out, toastSlideUp 0.3s ease-in 2.7s forwards;
}

@keyframes toastSlideDown {
  from { top: -50px; opacity: 0; }
  to { top: 20px; opacity: 1; }
}

@keyframes toastSlideUp {
  from { top: 20px; opacity: 1; }
  to { top: -50px; opacity: 0; }
}

.file-sync-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 12px;
}

.file-sync-row input[type="file"] {
  flex: 1;
  min-width: 200px;
}

.file-sync-row button {
  white-space: nowrap;
  padding: 10px 15px;
}

@media (max-width: 768px) {
  .file-sync-row {
    flex-direction: column;
    gap: 8px;
  }
  
  .file-sync-row input[type="file"] {
    min-width: 100%;
  }
  
  .file-sync-row button {
    width: 100%;
  }
}

.num-edit-area {
  width: 50%;
  height: 210px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  background: #f0f7ff;
  border-radius: 6px;
  border: 1px solid #d0e8ff;
  box-sizing: border-box;
  overflow-y: auto;
}

.json-input-container {
  width: 39%;
  height: 210px;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #f9f9f9;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.json-input-container .input-area {
  flex: 1;
  display: flex;
}

.json-input-container textarea {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  resize: none;
  font-size: 14px;
  line-height: 1.4;
  font-family: inherit;
}

@media (max-width: 768px) {
  .num-edit-area {
    width: 100%;
    min-height: 120px;
    font-size: 13px;
  }
  
  .json-input-container {
    width: 100%;
    min-height: 120px;
    font-size: 12px;
    padding: 8px;
  }
}

@media (max-width: 480px) {
  .num-edit-area {
    width: 100%;
    min-height: 100px;
    font-size: 12px;
    padding: 8px;
  }
  
  .json-input-container {
    width: 100%;
    min-height: 100px;
    font-size: 11px;
    padding: 6px;
  }
}

.stat-row {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  gap: 10px;
  flex-wrap: wrap;
}

.stat-label {
  width: 148px;
  font-weight: bold;
  color: #333;
}

.num-input {
  flex: 1;
  min-width: 80px;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.hide {
  display: none !important;
}

@media (max-width: 768px) {
  .result-display-container {
    flex-direction: column;
  }
  
  .num-edit-area {
    width: 100%;
  }
  
  .json-input-container {
    width: 100%;
  }
  
  .stat-row {
    flex-direction: column;
    align-items: stretch;
  }
  
  .stat-label {
    width: auto;
    margin-bottom: 5px;
  }
  
  .num-input {
    width: 100%;
    margin-bottom: 5px;
  }
}

.input-with-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  position: relative;
}

.input-with-buttons .num-input {
  flex: 1;
  min-width: 80px;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.input-with-buttons .edit-buttons {
  display: flex;
  gap: 5px;
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.9);
  padding: 2px;
  border-radius: 3px;
}

@media (max-width: 768px) {
  .input-with-buttons {
    flex-direction: column;
    align-items: stretch;
  }
  
  .input-with-buttons .edit-buttons {
    position: static;
    transform: none;
    justify-content: flex-end;
    margin-top: 5px;
    background: transparent;
  }
}

.cancel-btn:hover {
  background: #c0392b;
}

/* JSON输入区 */
.json-input-container {
  flex: 1;
  min-width: 300px;
}

/* 隐藏类 */
.hide {
  display: none !important;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .result-display-container {
    flex-direction: column;
  }
  
  .num-edit-area {
    width: 100%;
  }
  
  .json-input-container {
    width: 100%;
  }
  
  .stat-row {
    flex-direction: column;
    align-items: stretch;
  }
  
  .stat-label {
    width: auto;
    margin-bottom: 5px;
  }
  
  .num-input {
    width: 100%;
    margin-bottom: 5px;
  }
  
  .edit-buttons {
    justify-content: flex-end;
  }
}

/* 新增：输入框带按钮的容器样式 */
.input-with-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  position: relative;
}

/* 调整输入框样式，为按钮留出空间 */
.input-with-buttons .num-input {
  flex: 1;
  min-width: 80px;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

/* 调整编辑按钮样式，显示在输入框内 */
.input-with-buttons .edit-buttons {
  display: flex;
  gap: 5px;
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.9);
  padding: 2px;
  border-radius: 3px;
}

/* 窄屏适配：屏幕宽度小于768px时 */
@media (max-width: 768px) {
  .input-with-buttons {
    flex-direction: column;
    align-items: stretch;
  }
  
  .input-with-buttons .edit-buttons {
    position: static;
    transform: none;
    justify-content: flex-end;
    margin-top: 5px;
    background: transparent;
  }
}

/* 隐藏数字输入框的步长调整控件 */
.num-input[type="number"] {
  -webkit-appearance: textfield;
  -moz-appearance: textfield;
  appearance: textfield;
}

.num-input[type="number"]::-webkit-outer-spin-button,
.num-input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.num-input[type="number"] {
  -moz-appearance: textfield;
}

/* 新增：页脚样式 */
.footer {
  margin-top: 30px;
  padding: 20px 0;
  text-align: center;
  border-top: 1px solid #e0e0e0;
  background: #f8f9fa;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  color: #666;
  font-size: 14px;
}

.footer a {
  color: #3498db;
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  .footer {
    padding: 15px 0;
    font-size: 13px;
  }
}

.header-image {
  display: block;
  margin: 0 auto 15px auto;
  max-width: 120px;
  height: auto;
  border-radius: 8px;
}

@media (max-width: 768px) {
  .header-image {
    max-width: 80px;
    margin-bottom: 10px;
  }
}

/* 新增：使用说明样式 */
.usage-guide {
  /* background: #f8f9fa; */
  /* border: 1px solid #e9ecef; */
  /* border-radius: 8px; */
  padding: 20px;
  /* margin: 20px 0; */
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.usage-guide h3 {
  color: #2c3e50;
  margin-bottom: 15px;
  text-align: center;
  font-size: 18px;
}

.usage-guide ol {
  padding-left: 20px;
  margin-bottom: 15px;
}

.usage-guide li {
  margin-bottom: 8px;
  line-height: 1.5;
}

.usage-guide strong {
  color: #3498db;
}


@media (max-width: 768px) {
  .usage-guide {
    padding: 15px;
    margin: 15px 0;
  }
  
  .usage-guide h3 {
    font-size: 16px;
  }
  
  .usage-guide li {
    font-size: 14px;
  }
}

/* 新增：语言切换器样式 */
.language-switcher {
  position: fixed;
  top: 20px;
  right: 6px;
  display: flex;
  gap: 5px;
  z-index: 1000;
}

.lang-btn {
  padding: 8px 7px;
  border: 1px solid #3498db;
  background: white;
  color: #3498db;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.3s;
}

.lang-btn.active {
  background: #3498db;
  color: white;
}

.lang-btn:hover {
  background: #2980b9;
  color: white;
}

@media (max-width: 768px) {
  .language-switcher {
    top: 10px;
    right: 10px;
  }
  
  .lang-btn {
    padding: 6px 12px;
    font-size: 12px;
  }
}