/* 基础布局 */
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto;
  margin: 0;
  background: #0f172a;
  color: #e5e7eb;
}

/* 主内容容器 */
.main-container {
  max-width: 1700px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

/* 头部样式 */
header {
  padding: 16px 24px;
  background: #020617;
  border-bottom: 1px solid #1e293b;
  text-align: center;
}

header h1 { 
  font-size: 28px; 
  margin: 0 0 10px 0; 
}

.subtitle {
  font-size: 18px;
  color: #93c5fd;
  margin: 0;
  font-weight: 400;
}

/* 工具面板容器 */
.tool-panel-container {
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 24px 0 48px 0;
}

/* 主工具区域 - 调整为95%宽度 */
main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  width: 95%;
  max-width: 1600px;
  margin: 0 auto;
}

section {
  background: #020617;
  border: 1px solid #1e293b;
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

h2 { 
  font-size: 20px; 
  margin: 0 0 20px 0; 
  color: #93c5fd; 
  display: flex;
  align-items: center;
  gap: 10px;
}

h2 i {
  font-size: 18px;
}

label { 
  font-size: 15px; 
  color: #cbd5f5; 
  display: block; 
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

input, textarea, select, button {
  width: 100%;
  margin-bottom: 18px;
  background: #020617;
  color: #e5e7eb;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 12px 14px;
  font-family: monospace;
  font-size: 15px;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

textarea { 
  min-height: 160px; 
  resize: vertical; 
  font-family: monospace;
  line-height: 1.5;
}

button {
  cursor: pointer;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  border: none;
  font-weight: 600;
  transition: opacity 0.2s, transform 0.1s;
  margin-top: 10px;
  font-family: system-ui, -apple-system, sans-serif;
}

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

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: white;
  font-size: 17px;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 10px;
  font-weight: 600;
}

.btn-secondary {
  width: auto;
  background: #1e293b;
  color: #cbd5e1;
  border: 1px solid #334155;
  padding: 10px 18px;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 8px;
}

.btn-secondary:hover {
  background: #334155;
  border-color: #475569;
}

pre {
  white-space: pre-wrap;
  word-break: break-all;
  background: #020617;
  border: 1px solid #1e293b;
  border-radius: 10px;
  padding: 18px;
  font-size: 15px;
  max-height: 450px;
  overflow: auto;
  margin: 0;
  line-height: 1.5;
}

footer { 
  padding: 28px; 
  text-align: center; 
  font-size: 15px; 
  color: #94a3b8; 
  border-top: 1px solid #1e293b;
  margin-top: 50px;
}

footer a {
  color: #93c5fd;
  text-decoration: none;
}

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

/* 历史记录下拉框相关 */
.url-wrapper {
  position: relative;
}

.history-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  max-height: 280px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  margin-top: -10px;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid #0f172a;
}

.history-item:hover {
  background: #334155;
}

.history-url-text {
  flex: 1;
  font-size: 15px;
  color: #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-right: 12px;
}

.history-delete-btn {
  width: auto;
  margin: 0;
  padding: 0 8px;
  background: transparent;
  color: #94a3b8;
  font-size: 22px;
  border: none;
  border-radius: 6px;
  min-width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.history-delete-btn:hover {
  background: #ef4444;
  color: white;
}

/* 键值对编辑行 */
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr 45px;
  gap: 12px;
  margin-bottom: 12px;
}

.field-row input { 
  margin: 0; 
}

.remove-btn {
  background: #dc2626;
  color: white;
  height: 42px;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border-radius: 8px;
}

.remove-btn:hover {
  background: #b91c1c;
}

.body-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 8px;
}

/* 表单组样式 */
.form-group {
  margin-bottom: 24px;
}

/* 特性介绍区域 - 也调整为95%宽度 */
.instructions-section {
  width: 95%;
  max-width: 1600px;
  margin: 0 auto 70px;
  background: #020617;
  border: 1px solid #1e293b;
  border-radius: 14px;
  padding: 35px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.instructions-content h2 {
  font-size: 26px;
  margin-bottom: 28px;
  color: #e5e7eb;
  display: flex;
  align-items: center;
  gap: 12px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-bottom: 45px;
}

.feature-item {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 10px;
  padding: 24px;
  transition: border-color 0.2s, transform 0.2s;
}

.feature-item:hover {
  border-color: #334155;
  transform: translateY(-2px);
}

.feature-item h3 {
  font-size: 20px;
  margin: 0 0 14px 0;
  color: #93c5fd;
  display: flex;
  align-items: center;
  gap: 10px;
}

.feature-item p {
  font-size: 15px;
  color: #cbd5e1;
  line-height: 1.6;
  margin: 0;
}

/* FAQ区域 */
.faq-section {
  margin-top: 45px;
}

.faq-section h2 {
  font-size: 26px;
  margin-bottom: 28px;
  color: #e5e7eb;
}

.faq-item {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 10px;
  padding: 24px;
  margin-bottom: 24px;
}

.faq-item h3 {
  font-size: 20px;
  margin: 0 0 14px 0;
  color: #93c5fd;
}

.faq-item p {
  font-size: 16px;
  color: #cbd5e1;
  line-height: 1.6;
  margin: 0 0 14px 0;
}

.faq-item:last-child {
  margin-bottom: 0;
}

/* 使用技巧区域 */
.usage-tips {
  margin-top: 45px;
  padding-top: 35px;
  border-top: 1px solid #1e293b;
}

.usage-tips h2 {
  font-size: 26px;
  margin-bottom: 24px;
  color: #e5e7eb;
}

.usage-tips ul {
  margin: 0;
  padding-left: 24px;
}

.usage-tips li {
  font-size: 16px;
  color: #cbd5e1;
  line-height: 1.7;
  margin-bottom: 10px;
  padding-left: 8px;
}

.usage-tips li:last-child {
  margin-bottom: 0;
}

/* 响应式设计 */
@media (max-width: 1600px) {
  main {
    width: 90%;
    max-width: 1400px;
  }
  
  .instructions-section {
    width: 98%;
    max-width: 1400px;
  }
  
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }
}

@media (max-width: 1200px) {
  main {
    width: 100%;
    max-width: 1000px;
  }
  
  .instructions-section {
    width: 100%;
    max-width: 1000px;
  }
}

@media (max-width: 1000px) {
  main, .body-container { 
    grid-template-columns: 1fr; 
  }
  
  main {
    width: 100%;
    max-width: 800px;
  }
  
  .instructions-section {
    width: 100%;
    max-width: 800px;
    padding: 28px;
  }
  
  .feature-grid {
    grid-template-columns: 1fr;
  }
  
  header h1 {
    font-size: 24px;
  }
  
  .subtitle {
    font-size: 16px;
  }
  
  .tool-panel-container {
    margin: 20px 0 40px 0;
  }
  
  h2 {
    font-size: 20px;
  }
  
  .instructions-content h2,
  .faq-section h2,
  .usage-tips h2 {
    font-size: 24px;
  }
}

@media (max-width: 600px) {
  .main-container {
    padding: 0 16px;
  }
  
  header {
    padding: 14px 20px;
  }
  
  header h1 {
    font-size: 22px;
  }
  
  .subtitle {
    font-size: 15px;
  }
  
  section {
    padding: 20px;
  }
  
  .instructions-section {
    padding: 24px;
  }
  
  .feature-item,
  .faq-item {
    padding: 20px;
  }
  
  h2 {
    font-size: 18px;
    margin-bottom: 16px;
  }
  
  .instructions-content h2,
  .faq-section h2,
  .usage-tips h2 {
    font-size: 22px;
  }
  
  .feature-item h3,
  .faq-item h3 {
    font-size: 18px;
  }
  
  input, textarea, select, button {
    padding: 10px 12px;
    font-size: 14px;
  }
  
  .btn-primary {
    font-size: 16px;
    padding: 12px;
  }
  
  .field-row {
    grid-template-columns: 1fr 1fr 40px;
    gap: 10px;
  }
  
  footer {
    padding: 24px;
    font-size: 14px;
  }
}