:root {
  --primary: #3498db;
  --primary-hover: #2980b9;
  --light-bg: #f7f9fc;
  --card-bg: #ffffff;
  --border: #bdc3c7;
  --text: #333;
  --label: #34495e;
  --error: #e74c3c;
  --success: #27ae60;
  --radius: 8px;
  --shadow: 0 4px 12px rgba(0,0,0,0.1);
  --transition: all 0.2s ease;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--light-bg);
  color: var(--text);
  margin: 30px auto;
  max-width: 900px;
  padding: 20px;
  line-height: 1.6;
}

h1, h3 {
  color: #2c3e50;
  text-align: center;
}

p {
  text-align: center;
  color: #555;
  margin-bottom: 25px;
}

fieldset {
  border: 1px solid var(--border);
  padding: 20px;
  border-radius: var(--radius);
  margin-bottom: 25px;
  background-color: var(--card-bg);
  box-shadow: var(--shadow);
}

legend {
  font-weight: bold;
  color: var(--label);
  font-size: 1.1em;
  padding: 0 10px;
  background-color: var(--card-bg);
}

.form-group {
  margin-bottom: 15px;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--label);
}

input[type="text"],
input[type="number"],
textarea,
select,
input[type="file"] {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-sizing: border-box;
  font-size: 16px;
  transition: var(--transition);
}

input[type="text"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

input[type="radio"] {
  transform: scale(1.1);
  margin-right: 8px;
  cursor: pointer;
}


.custom-btn-style {
  background-color: var(--primary); /* 使用你定义的颜色变量 */
  color: white;
  padding: 8px 16px; /* 调整padding以适应.sm大小 */
  font-size: 0.875rem; /* 确保字体大小匹配其他按钮 */
  border-radius: 6px;
  transition: var(--transition);
}
button:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

button:disabled {
  background-color: #95a5a6;
  cursor: not-allowed;
  transform: none;
}

.mode-option {
  margin-bottom: 12px;
  padding: 10px;
  border-radius: 6px;
  transition: var(--transition);
}

.mode-option:hover {
  background-color: #ecf4fd;
}

.mode-fields {
  background-color: #f0f7ff;
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-top: 10px;
  display: none;
}

.active {
  display: block !important;
}

.window-row {
  display: flex;
  gap: 15px;
  align-items: end;
}

.window-row .form-group {
  flex: 1;
  margin-bottom: 0;
}

@media (max-width: 768px) {
  .window-row {
    flex-direction: column;
  }
}

.pair-inputs {
  display: flex;
  gap: 15px;
  margin-top: 8px;
}

.pair-inputs > div {
  flex: 1;
}

.pair-inputs label {
  font-size: 0.85em;
  color: #555;
  margin-bottom: 4px;
}

.error {
  color: var(--error);
  font-size: 0.9em;
  margin-top: 4px;
}

textarea {
  resize: vertical;
  min-height: 100px;
}

[type="file"] {
  padding: 8px;
}

.loading {
  text-align: center;
  color: #555;
  font-style: italic;
  margin: 15px 0;
  display: none;
}

.alert {
  padding: 12px;
  margin: 15px 0;
  border-radius: 6px;
  font-size: 0.95em;
}

.alert-error {
  background-color: #fadbd8;
  color: var(--error);
  border: 1px solid #e74c3c;
}

.alert-success {
  background-color: #d4edda;
  color: var(--success);
  border: 1px solid #27ae60;
}

#otherOrganismContainer {
  margin-top: 8px;
}

#other_organism {
  background-color: #eef7ff;
  border: 2px solid #3498db;
}

.hidden {
  display: none !important;
}





.dred-navbar {
  background: linear-gradient(to bottom, #003366, #002244);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  padding: 0;
  margin-bottom: 30px;
  border-radius: 8px 8px 0 0;
  position: sticky; 
  top: 0;
  z-index: 1000; 
}

.nav-container {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 15px;
}

.nav-logo a {
  display: flex;
  align-items: center;
  color: white;
  text-decoration: none;
  font-weight: bold;
  font-size: 1.4em;
}

.nav-logo img {
  margin-right: 10px;
  border-radius: 6px;
}

.nav-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 10px;
}

.nav-menu li {
  position: relative;
}

.nav-menu a {
  color: white;
  text-decoration: none;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 6px;
  transition: background 0.3s;
  font-size: 14px;
}

.nav-menu a:hover {
  background: rgba(255,255,255,0.2);
}

.dropdown {
  position: relative;
}

.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  min-width: 180px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  border-radius: 6px;
  z-index: 1000;
  overflow: hidden;
}

.dropdown-content a {
  color: #333;
  padding: 10px 16px;
  display: block;
  text-align: left;
}

.dropdown-content a:hover {
  background: #ecf4fd;
  color: #003366;
}

.dropdown:hover .dropdown-content {
  display: block;
}

@media (max-width: 768px) {
  .nav-container {
    flex-direction: column;
    gap: 10px;
  }
  .nav-menu {
    width: 100%;
    justify-content: space-around;
  }
  .nav-menu a {
    padding: 10px;
    font-size: 13px;
  }

main {
  margin-bottom: 50px;
}

    h1 {
      text-align: center;
      color: #2c3e50;
      font-weight: 600;
      margin: 30px 0 10px;
    }
    p {
      color: #555;
      margin-bottom: 16px;
      text-align: left
    }

    .section {
      background-color: var(--card-bg);
      padding: 25px;
      border-radius: var(--radius);
      margin-bottom: 30px;
      box-shadow: var(--shadow);
      border: 1px solid var(--border);
    }

    .step {
      margin-bottom: 20px;
      padding-left: 15px;
      border-left: 4px solid var(--primary);
    }

    .step h3 {
      margin-top: 0;
      color: var(--primary);
    }


    .highlight {
      background-color: #f0f7ff;
      padding: 12px;
      border-left: 3px solid #3498db;
      font-family: monospace;
      overflow-x: auto;
      margin: 10px 0;
    }

    .example {
      font-style: italic;
      color: #666;
      font-size: 0.95em;
    }

    ul, ol {
      margin-bottom: 16px;
    }

.run-example {
  display: inline-block;
  background-color: #0056b3;
  color: white;
  padding: 8px 16px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
  font-size: 14px;
  transition: background-color 0.2s ease;
}

.run-example:hover {
  background-color: #00264C;
  text-decoration: underline;
}


    /* 导航栏容器 - 白底，文字改为白色 */
    .dred-navbar {
      background-color: white;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
      position: sticky;
      top: 0;
      z-index: 1000;
    }

    .nav-container {
      max-width: 1200px;
      margin: 0 auto;
      padding: 0 20px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      height: 60px;
    }

    .nav-logo a {
      display: flex;
      align-items: center;
      gap: 8px;
      text-decoration: none;
      color: white; /* LOGO 文字颜色 */
      font-weight: bold;
      font-size: 18px;
    }

    .nav-logo img {
      height: 40px;
    }

    .nav-menu {
      display: flex;
      list-style: none;
      margin: 0;
      padding: 0;
      gap: 20px;
    }

    .nav-menu a {
      text-decoration: none;
      color: white; /* 导航链接文字颜色 */
      font-size: 14px;
      font-weight: 500;
      display: flex;
      align-items: center;
      gap: 6px;
    }

    .nav-menu a.active {
      color: #00cfff; /* 高亮时用浅蓝 */
    }

    .nav-menu a:hover {
      color: #ffffffcc; /* 浅白悬停效果 */
    }

    /* 汉堡按钮 - 改为深色线条以在白底上可见 */
    .nav-toggle {
      display: none;
      flex-direction: column;
      cursor: pointer;
    }

    .bar {
      width: 25px;
      height: 3px;
      background-color: #333; /* 深色汉堡线 */
      margin: 3px 0;
      transition: 0.3s;
    }

    /* 下拉菜单 */
    .dropdown {
      position: relative;
    }

    .dropdown-content {
      display: none;
      position: absolute;
      top: 100%;
      left: 0;
      background-color: #002B55; /* 深蓝背景 */
      min-width: 200px;
      box-shadow: 0 4px 8px rgba(0,0,0,0.1);
      z-index: 1;
      border-radius: 6px;
      overflow: hidden;
    }

    .dropdown-content a {
      display: block;
      padding: 10px 16px;
      color: white; /* 下拉项文字为白色 */
      text-decoration: none;
    }

    .dropdown-content a:hover {
      background-color: #001f3f;
    }

    .dropdown:hover .dropdown-content {
      display: block;
    }

    /* 小屏幕响应式 */
    @media (max-width: 768px) {
      .nav-menu {
        display: none;
        flex-direction: column;
        width: 100%;
        background-color: white;
        position: absolute;
        top: 60px;
        left: 0;
        padding: 10px 0;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        border-top: 1px solid #eee;
      }

      .nav-menu.active {
        display: flex;
      }

      .nav-menu li {
        margin: 0;
      }

      .nav-menu a {
        padding: 10px 20px;
        color: #333; 
      }

      .nav-menu a.active,
      .nav-menu a:hover {
        color: #007BFF;
      }

      .nav-toggle {
        display: flex;
      }

      .search-container-left {
        max-width: 80%;
      }

      .search-input {
        min-width: 100px;
      }

      .results-controls {
        flex-direction: column;
        align-items: flex-end;
        width: 100%;
        margin-top: 8px;
      }

      .action-btn {
        width: 100%;
        justify-content: center;
        margin-bottom: 4px;
      }
    }

    /* 更小屏幕优化 */
    @media (max-width: 480px) {
      .search-container-left {
        max-width: 90%;
        flex-direction: column;
        align-items: stretch;
      }

      .search-input {
        height: 40px;
        padding: 0 12px;
      }

      .search-btn {
        width: 100%;
        height: 40px;
        margin-top: 8px;
      }

      .search-instructions-center,
      .results-frame {
        padding: 10px;
      }
    }