* {
  margin: 0;
  padding: 0;
}

body {
  background-color: #f1f2f3;
}

.container {
  box-sizing: border-box;
  width: 100%;
  max-width: 1640px;
  min-width: 1240px;
  margin: 25px auto;
  color: #333;
}

.container * {
  box-sizing: border-box;
}

header {
  position: relative;
  margin-bottom: 20px;
  text-align: center;
}

header h1 {
  font-size: 32px;
  margin-bottom: 5px;
}

header p {
  font-size: 16px;
  line-height: 1.6;
}

.main-content {
  display: flex;
  gap: 20px;
  margin-bottom: 25px;
}

.editor-section {
  flex: 3;
}

.file-section {
  flex: 1;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.section-title {
  background: #2c3e50;
  color: white;
  padding: 10px 15px;
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.code-editor {
  width: 100%;
  height: 400px;
  padding: 15px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 14px;
  line-height: 1.5;
  border: 1px solid #ddd;
  border-radius: 8px;
  resize: vertical;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin-bottom: 15px;
}

.button-group {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.btn {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.2s;
}

.btn-primary {
  background: #3498db;
  color: white;
}

.btn-primary:hover {
  background: #2980b9;
}

.btn-secondary {
  background: #2ecc71;
  color: white;
}

.btn-secondary:hover {
  background: #27ae60;
}

.btn-warning {
  background: #e74c3c;
  color: white;
}

.btn-warning:hover {
  background: #c0392b;
}

.btn-info {
  background: #9b59b6;
  color: white;
}

.btn-info:hover {
  background: #8e44ad;
}

.output-section {
  background: white;
  padding: 15px;
  min-height: 300px;
  max-height: 500px;
  overflow-y: auto;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  font-family: 'Consolas', 'Monaco', monospace;
  white-space: pre-wrap;
  word-wrap: break-word;
  word-break: break-all;
}

.file-list {
  padding: 10px;
  max-height: 580px;
  overflow-y: auto;
}

.file-item {
  padding: 8px 10px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.file-item:hover {
  background: #f9f9f9;
}

.file-name {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.file-actions {
  display: flex;
  gap: 5px;
}

.file-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
}

.package-install {
  padding: 15px;
  border-top: 1px solid #eee;
}

.package-input {
  width: 100%;
  padding: 12px 8px;
  font-size: 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin-bottom: 10px;
}

.features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 25px;
}

.feature-card {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.feature-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 15px;
  color: #2c3e50;
  display: flex;
  align-items: center;
  gap: 8px;
}

footer {
  text-align: center;
  font-size: 15px;
  color: #7f8c8d;
}

.notice-container {
  position: fixed;
  bottom: 20px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  pointer-events: none;
  z-index: 1000;
}

.notice {
  background: rgba(44, 62, 80, 0.9);
  color: white;
  padding: 12px 20px;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s ease;
  max-width: 600px;
  text-align: center;
}

.notice.show {
  opacity: 1;
  transform: translateY(0);
}

.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, .3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.usage-examples {
  margin-bottom: 25px;
  background: #fff;
  border-radius: 12px;
  padding: 20px;
}

.usage-examples h2 {
  margin-bottom: 15px;
  font-size: 20px;
}

.examples-box {
  display: flex;
  gap: 20px;
}

.example {
  flex: 1;
  background: #f8f9fa;
  border-left: 4px solid #3498db;
  padding: 15px;
  border-radius: 0 4px 4px 0;
}

.example pre {
  line-height: 1.5;
}

.example-title {
  font-weight: bold;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Modal styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1001;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
  background-color: #fefefe;
  margin: 5% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 80%;
  max-width: 800px;
  max-height: 80vh;
  overflow-y: auto;
  border-radius: 8px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.close-modal {
  font-size: 28px;
  padding: 0 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
}

.package-search {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.package-search input {
  flex: 1;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.popular-packages {
  margin-bottom: 20px;
}

.package-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.package-badge {
  background: #e0e0e0;
  padding: 5px 10px;
  border-radius: 15px;
  cursor: pointer;
  font-size: 14px;
}

.package-badge:hover {
  background: #d0d0d0;
}

.package-list {
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 20px;
}

.package-item {
  padding: 10px;
  border-bottom: 1px solid #eee;
}

.package-item label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.package-checkbox {
  transform: scale(1.3);
}

.package-name {
  font-weight: bold;
}

.package-version {
  color: #777;
  font-size: 0.9em;
}

.package-desc {
  color: #555;
  font-size: 0.9em;
}

.install-controls {
  text-align: center;
}

.upload-file {
  display: flex;
  gap: 20px;
  padding: 15px;
}

.upload-file input {
  width: 70%;
  padding: 5px;
}

.upload-file button {
  flex: 1;
  text-align: center;
}

.directory {
  font-weight: bold;
  color: #2c3e50;
}

.directory-content {
  padding-left: 20px;
}

.hidden {
  display: none;
}

/* 加载动画样式 */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  transition: opacity 0.3s ease-out;
}

.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-container {
  text-align: center;
  max-width: 500px;
  padding: 30px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid #4a90e2;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.loading-container h2 {
  color: #333;
  margin-bottom: 10px;
}

.loading-container p {
  color: #666;
  margin-bottom: 20px;
  min-height: 24px;
}

.loading-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.loading-progress-bar {
  flex-grow: 1;
  height: 10px;
  background-color: #e0e0e0;
  border-radius: 5px;
  overflow: hidden;
  margin-right: 15px;
}

.loading-progress-fill {
  height: 100%;
  background-color: #4a90e2;
  width: 0%;
  transition: width 0.3s ease;
}

.loading-progress-text {
  font-weight: bold;
  color: #4a90e2;
  min-width: 40px;
}
