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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f5f5f5;
  color: #333;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.screen {
  min-height: 100vh;
}

/* 移动端适配 */
@media (max-width: 768px) {
  body {
    font-size: 14px;
  }

  section {
    padding: 20px 15px !important;
  }

  h2 {
    font-size: 18px !important;
  }

  .provider-card {
    padding: 12px !important;
  }

  .button-group {
    flex-direction: column !important;
  }

  .button-group button {
    width: 100% !important;
  }
}

/* Login Screen */
.login-container {
  max-width: 400px;
  margin: 100px auto;
  padding: 40px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

@media (max-width: 768px) {
  .login-container {
    max-width: 90%;
    margin: 50px auto;
    padding: 30px 20px;
  }
}

.login-container h1 {
  text-align: center;
  margin-bottom: 30px;
  color: #2c3e50;
}

#login-form input {
  width: 100%;
  padding: 12px;
  margin-bottom: 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

#login-form button {
  width: 100%;
  padding: 12px;
  background: #3498db;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.3s;
}

#login-form button:hover {
  background: #2980b9;
}

/* Main App */
header {
  background: #2c3e50;
  color: white;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header h1 {
  font-size: 24px;
}

#logout-btn {
  padding: 8px 16px;
  background: #e74c3c;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

#logout-btn:hover {
  background: #c0392b;
}

main {
  max-width: 1200px;
  margin: 30px auto;
  padding: 0 20px;
}

@media (max-width: 768px) {
  main {
    margin: 15px auto;
    padding: 0 10px;
  }
}

section {
  background: white;
  padding: 30px;
  margin-bottom: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

h2 {
  color: #2c3e50;
  margin-bottom: 20px;
  border-bottom: 2px solid #3498db;
  padding-bottom: 10px;
}

h3 {
  color: #34495e;
  margin: 20px 0 10px 0;
}

/* Forms */
label {
  display: block;
  margin-bottom: 15px;
  font-weight: 500;
}

label input[type="checkbox"] {
  width: auto;
  margin-right: 8px;
}

input[type="text"],
input[type="url"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 10px;
  margin-top: 5px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
}

textarea {
  resize: vertical;
  font-family: monospace;
}

button {
  padding: 10px 20px;
  background: #3498db;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.3s;
}

button:hover {
  background: #2980b9;
}

button.secondary {
  background: #95a5a6;
}

button.secondary:hover {
  background: #7f8c8d;
}

.button-group {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

/* Provider List */
.provider-card {
  border: 1px solid #ecf0f1;
  padding: 15px;
  margin-bottom: 15px;
  border-radius: 4px;
  background: #f8f9fa;
}

.provider-card h4 {
  color: #2c3e50;
  margin-bottom: 10px;
}

.provider-card p {
  margin: 5px 0;
  font-size: 14px;
  color: #555;
}

.provider-card code {
  background: #ecf0f1;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 13px;
  font-family: monospace;
}

/* Router Summary */
.router-item {
  padding: 10px;
  margin-bottom: 10px;
  background: #f8f9fa;
  border-left: 4px solid #3498db;
  border-radius: 4px;
}

.router-item strong {
  color: #2c3e50;
  display: inline-block;
  min-width: 180px;
}

/* Messages */
.error {
  color: #e74c3c;
  margin-top: 10px;
  font-size: 14px;
}

.result {
  margin-top: 15px;
  padding: 15px;
  border-radius: 4px;
  font-size: 14px;
}

.result.success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.result.error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.result pre {
  background: white;
  padding: 10px;
  border-radius: 4px;
  overflow-x: auto;
  margin-top: 10px;
  font-size: 12px;
}

#loading {
  text-align: center;
  padding: 20px;
  color: #7f8c8d;
}

/* Warnings */
.warning-box {
  background: #fff3cd;
  border: 1px solid #ffc107;
  color: #856404;
  padding: 15px;
  border-radius: 4px;
  margin: 15px 0;
}

.warning-box strong {
  display: block;
  margin-bottom: 5px;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 8px;
}

.badge-original {
  background: #d4edda;
  color: #155724;
}

.badge-custom {
  background: #fff3cd;
  color: #856404;
}

.badge-error {
  background: #f8d7da;
  color: #721c24;
}

button.danger {
  background: #e74c3c;
}

button.danger:hover {
  background: #c0392b;
}

/* 移动端优化 */
@media (max-width: 768px) {
  .router-item > div {
    flex-direction: column !important;
    align-items: flex-start !important;
  }

  .router-item > div > div:last-child {
    margin-top: 8px;
    text-align: left !important;
  }

  .provider-card > div {
    flex-direction: column !important;
  }

  .provider-card button {
    margin-top: 10px;
    margin-left: 0 !important;
    width: 100%;
  }
}
