/* 全局样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
  color: #333;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

/* 头部样式 */
.header {
  text-align: center;
  margin-bottom: 40px;
  color: white;
}

.header h1 {
  font-size: 48px;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
  font-size: 18px;
  opacity: 0.9;
  margin-bottom: 20px;
}

.header-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-header {
  text-align: left;
  margin-bottom: 32px;
}

.hero-content {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.hero-text {
  max-width: 680px;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 14px;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

.hero-text h1 {
  margin-bottom: 16px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 24px;
  font-size: 16px;
  opacity: 0.9;
}

.hero-stats__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
}

.hero-stats__item strong {
  font-size: 20px;
}

.control-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 18px;
  margin-bottom: 30px;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(12px);
  position: relative;
  z-index: 1000;
}

.search-form {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 240px;
  position: relative;
}

.search-wrapper {
  position: relative;
  flex: 1;
  z-index: 10001;
}

.search-field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.15);
}

.search-field input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 15px;
  color: #333;
}

.search-field input::placeholder {
  color: #999;
  font-size: 14px;
}

.search-field input:disabled {
  cursor: not-allowed;
}

.search-field input:focus {
  outline: none;
}

.search-icon {
  font-size: 16px;
  color: #667eea;
}

.search-loading {
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-spinner {
  font-size: 16px;
  color: #667eea;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.search-history {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  z-index: 2147483647; /* 最大z-index值 */
  max-height: 300px;
  overflow: hidden;
  margin-top: 4px;
}

.search-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
  font-size: 14px;
  font-weight: 600;
  color: #666;
}

.clear-history-btn {
  background: none;
  border: none;
  color: #999;
  font-size: 12px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.clear-history-btn:hover {
  background: #f5f5f5;
  color: #666;
}

.search-history-list {
  max-height: 240px;
  overflow-y: auto;
}

.search-history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.2s ease;
  font-size: 14px;
  color: #333;
}

.search-history-item:hover,
.search-history-item.selected {
  background: #f8f9fa;
}

.search-history-item .search-term {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-history-item .remove-item {
  color: #999;
  font-size: 12px;
  margin-left: 8px;
  padding: 2px 6px;
  border-radius: 3px;
  opacity: 0;
  transition: all 0.2s ease;
}

.search-history-item:hover .remove-item {
  opacity: 1;
}

.search-history-item .remove-item:hover {
  background: #eee;
  color: #666;
}

.search-history-empty {
  padding: 16px;
  text-align: center;
  color: #999;
  font-size: 14px;
}

.btn-search,
.btn-clear {
  border: none;
  border-radius: 12px;
  padding: 10px 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
}

.btn-search {
  background: #ffffff;
  color: #667eea;
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.25);
}

.btn-search:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(102, 126, 234, 0.35);
}

.btn-clear {
  background: transparent;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.btn-clear:hover {
  background: rgba(255, 255, 255, 0.2);
}

.view-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
}

.toggle-group {
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  gap: 4px;
}

.toggle-btn {
  border: none;
  padding: 8px 16px;
  border-radius: 999px;
  background: transparent;
  color: white;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.toggle-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.toggle-btn.is-active {
  background: white;
  color: #667eea;
  font-weight: 600;
  box-shadow: 0 6px 14px rgba(102, 126, 234, 0.25);
}

.size-group .toggle-btn {
  min-width: 48px;
  text-align: center;
}

.search-feedback {
  margin-bottom: 20px;
  color: white;
  line-height: 1.6;
}

.search-feedback strong {
  font-size: 18px;
}

.search-feedback__tip {
  font-size: 14px;
  opacity: 0.9;
}

.link-reset {
  color: white;
  font-weight: 600;
  text-decoration: underline;
}

/* 按钮样式 */
.btn-primary, .btn-secondary, .btn-submit {
  display: inline-block;
  padding: 12px 30px;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
  font-size: 16px;
}

.btn-primary {
  background: white;
  color: #667eea;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 2px solid white;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.3);
}

.btn-secondary-dark {
  background: rgba(0, 0, 0, 0.1);
  color: #333;
  border: 2px solid #666;
}

.btn-secondary-dark:hover {
  background: rgba(0, 0, 0, 0.2);
  border-color: #333;
}

.btn-admin {
  display: inline-block;
  padding: 12px 30px;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
  font-size: 16px;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.5);
}

.btn-admin:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: white;
}

.btn-submit {
  width: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-size: 18px;
  padding: 15px;
  margin-top: 20px;
}

.btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* 应用网格 */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
  transition: all 0.25s ease;
}

.apps-grid[data-size="large"] {
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
}

.apps-grid[data-size="medium"] {
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.apps-grid[data-size="small"] {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.apps-grid[data-view="list"] {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* 应用卡片 */
.app-card {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.app-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.app-preview {
  position: relative;
  height: 200px;
  overflow: hidden;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.apps-grid[data-size="large"] .app-preview {
  height: 260px;
}

.apps-grid[data-size="small"] .app-preview {
  height: 150px;
}

.app-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.app-card:hover .app-overlay {
  opacity: 1;
}

.btn-view {
  background: white;
  color: #667eea;
  padding: 10px 25px;
  border-radius: 20px;
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.2s ease;
}

.btn-view:hover {
  transform: scale(1.1);
}

.app-info {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.app-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.app-name {
  font-size: 20px;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-author {
  font-size: 14px;
  color: #667eea;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(102, 126, 234, 0.12);
  flex-shrink: 0;
}

.app-author.is-placeholder {
  color: #999;
  background: rgba(0, 0, 0, 0.05);
}

.app-description {
  font-size: 14px;
  color: #666;
  line-height: 1.6;
  margin-bottom: 12px;
  max-height: 110px;
  overflow: hidden;
  position: relative;
  transition: all 0.3s ease;
  padding-bottom: 8px;
}

.app-description:hover {
  background: rgba(102, 126, 234, 0.05);
  border-radius: 12px;
}

.app-description-hint {
  position: absolute;
  bottom: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-size: 12px;
  font-weight: 600;
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
  opacity: 0;
  transform: translateY(5px);
  transition: all 0.3s ease;
  pointer-events: none;
  white-space: nowrap;
  z-index: 1;
}

.app-description:hover .app-description-hint {
  opacity: 1;
  transform: translateY(0);
}

.hint-icon {
  font-size: 14px;
  line-height: 1;
}

.hint-text {
  letter-spacing: 0.3px;
}

.app-description::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 30px;
  background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.95));
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.app-description:hover::after {
  opacity: 0;
}

.app-description p,
.app-description ul,
.app-description ol {
  margin: 0 0 8px 0;
}

.app-description ul,
.app-description ol {
  padding-left: 18px;
}

.app-description li {
  margin-bottom: 4px;
}

.app-description p:last-child,
.app-description ul:last-child,
.app-description ol:last-child {
  margin-bottom: 0;
}

.app-meta {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: #666;
  margin-bottom: 15px;
}

.app-views {
  font-size: 13px;
  color: #888;
}

.apps-grid[data-view="list"] .app-meta {
  justify-content: flex-start;
  gap: 24px;
}

.app-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
}

.btn-copy {
  flex: 1;
  padding: 8px 16px;
  background: #f0f0f0;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s ease;
}

.btn-copy:hover {
  background: #e0e0e0;
}

.btn-view-app {
  flex: 1;
  padding: 8px 16px;
  background: #007bff;
  color: white;
  text-decoration: none;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  text-align: center;
  transition: background 0.2s ease;
}

.btn-view-app:hover {
  background: #0056b3;
}

.btn-delete {
  flex: 1;
  padding: 8px 16px;
  background: #fee;
  border: 1px solid #fcc;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: #c33;
  transition: all 0.2s ease;
}

.btn-delete:hover {
  background: #fdd;
  border-color: #f99;
}

.btn-regenerate {
  flex: 1;
  padding: 8px 16px;
  background: #e3f2fd;
  border: 1px solid #90caf9;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: #1976d2;
  transition: all 0.2s ease;
}

.btn-regenerate:hover {
  background: #bbdefb;
  border-color: #42a5f5;
}

.btn-regenerate:disabled {
  background: #f5f5f5;
  border-color: #e0e0e0;
  color: #999;
  cursor: not-allowed;
}

.btn-manage {
  display: inline-block;
  padding: 6px 12px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.2s ease;
  border: none;
  cursor: pointer;
}

.btn-manage:hover {
  background: linear-gradient(135deg, #5a6fd8, #6a4190);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.apps-grid[data-view="list"] .app-card {
  flex-direction: row;
}

.apps-grid[data-view="list"] .app-preview {
  width: 320px;
  height: auto;
  min-height: 180px;
  flex-shrink: 0;
}

.apps-grid[data-view="list"] .app-preview img {
  height: 100%;
}

.apps-grid[data-view="list"] .app-info {
  padding: 24px;
}

.apps-grid[data-view="list"] .app-description {
  max-height: 150px;
}

.apps-grid[data-view="list"] .app-description:hover {
  padding-bottom: 40px;
}

.apps-grid[data-view="list"] .app-actions {
  justify-content: flex-start;
  max-width: 360px;
}

/* 空状态 */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  background: white;
  border-radius: 16px;
  color: #666;
}

.empty-icon {
  font-size: 80px;
  margin-bottom: 20px;
}

.empty-state h2 {
  font-size: 32px;
  margin-bottom: 10px;
  color: #333;
}

.empty-state p {
  font-size: 18px;
  margin-bottom: 30px;
}

/* 上传页面 */
.upload-section {
  display: flex;
  justify-content: center;
}

.upload-card {
  background: white;
  border-radius: 16px;
  padding: 40px;
  max-width: 600px;
  width: 100%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 表单样式 */
.upload-form {
  margin-top: 30px;
}

.form-group {
  margin-bottom: 25px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  color: #333;
}

.form-group input[type="text"] {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.3s ease;
}

.form-group input[type="text"]:focus {
  outline: none;
  border-color: #667eea;
}

.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.3s ease;
}

.form-group textarea:focus {
  outline: none;
  border-color: #667eea;
}

.form-group small {
  display: block;
  margin-top: 5px;
  color: #999;
  font-size: 14px;
}

.form-group-rich-text .rich-editor {
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  overflow: hidden;
  background: white;
  box-shadow: inset 0 1px 0 rgba(102, 126, 234, 0.05);
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 12px;
  background: #f9f9ff;
  border-bottom: 1px solid #ececff;
}

.editor-btn {
  border: none;
  background: white;
  color: #555;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(102, 126, 234, 0.15);
}

.editor-btn:hover {
  background: #eef0ff;
  color: #5563c1;
}

.editor-btn:active {
  transform: scale(0.96);
}

.editor-btn__text {
  font-weight: 700;
}

.editor-btn__text--italic {
  font-style: italic;
}

.editor-btn__text--underline {
  text-decoration: underline;
}

.editor-content {
  min-height: 180px;
  padding: 16px;
  font-size: 15px;
  line-height: 1.6;
  color: #333;
  outline: none;
  overflow-y: auto;
}

.editor-content:focus {
  background: #fafaff;
}

.editor-content:empty:before {
  content: attr(data-placeholder);
  color: #b0b0b0;
  font-style: italic;
  pointer-events: none;
}

.editor-content p {
  margin-bottom: 10px;
}

.editor-content ul,
.editor-content ol {
  padding-left: 20px;
  margin: 10px 0;
}

.editor-content li {
  margin-bottom: 6px;
}

/* 文件上传样式 */
.file-input-wrapper {
  position: relative;
}

/* 复选框样式 */
.checkbox-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  padding: 12px 0;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-right: 10px;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.checkbox-label .checkbox-text {
  font-size: 15px;
  color: #333;
}

.checkbox-label input[type="checkbox"]:disabled + .checkbox-text {
  color: #999;
  text-decoration: line-through;
}

.checkbox-hint {
  display: block;
  margin-top: 5px;
  color: #f39c12;
  font-size: 13px;
}

/* 单选框样式 */
.radio-group {
  margin-bottom: 15px;
}

.radio-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  padding: 12px 0;
}

.radio-label input[type="radio"] {
  width: 18px;
  height: 18px;
  margin-right: 10px;
  cursor: pointer;
}

.radio-label .radio-text {
  font-size: 15px;
  color: #333;
}

.radio-hint {
  display: block;
  margin-top: 5px;
  margin-left: 28px;
  color: #f39c12;
  font-size: 13px;
}

/* 隐藏字段样式 */
.hidden-field {
  display: none;
  margin-top: 15px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

/* 图片预览样式 */
.image-preview {
  margin-top: 15px;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e9ecef;
  max-width: 400px;
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #dee2e6;
}

.preview-title {
  font-size: 14px;
  font-weight: 600;
  color: #495057;
}

.preview-close {
  background: none;
  border: none;
  font-size: 18px;
  color: #6c757d;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.preview-close:hover {
  background-color: #e9ecef;
  color: #495057;
}

.preview-content {
  display: flex;
  justify-content: center;
}

.preview-content img {
  max-width: 100%;
  max-height: 200px;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  object-fit: contain;
}

.file-input-wrapper input[type="file"] {
  position: absolute;
  left: -9999px;
}

.file-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 2px dashed #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #f9f9f9;
}

.file-label:hover {
  border-color: #667eea;
  background: #f0f0ff;
}

.file-icon {
  font-size: 24px;
}

#fileName {
  flex: 1;
  color: #666;
}

/* 提示信息 */
.form-info {
  background: #f0f8ff;
  border-left: 4px solid #667eea;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.form-info h4 {
  margin-bottom: 10px;
  color: #667eea;
}

.form-info ul {
  margin-left: 20px;
}

.form-info li {
  margin-bottom: 5px;
  color: #666;
  font-size: 14px;
}

/* 提示框 */
.alert {
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 25px;
}

.alert-error {
  background: #fee;
  border-left: 4px solid #f44;
  color: #c33;
}

.alert-success {
  background: #efe;
  border-left: 4px solid #4c4;
  color: #363;
}

.alert-success h3 {
  margin-bottom: 10px;
}

.alert-success p {
  margin-bottom: 8px;
}

.alert-warning {
  background: #fff3cd;
  border-left: 4px solid #ffc107;
  color: #856404;
  padding: 12px;
  margin: 12px 0;
  border-radius: 4px;
  font-size: 14px;
}

.url-box {
  display: flex;
  gap: 10px;
  margin: 15px 0;
}

.url-box input {
  flex: 1;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
}

.btn-copy-inline {
  padding: 10px 20px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}

.btn-copy-inline:hover {
  background: #5568d3;
}

.success-actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.success-actions a {
  flex: 1;
  text-align: center;
}

/* 登录页面 */
.login-section {
  display: flex;
  justify-content: center;
}

.login-card {
  background: white;
  border-radius: 16px;
  padding: 40px;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.login-form {
  margin-top: 20px;
}

.login-info {
  margin-top: 20px;
  text-align: center;
  color: #999;
  font-size: 14px;
}

/* 页脚 */
.footer {
  text-align: center;
  color: white;
  padding: 20px;
  font-size: 16px;
}

.footer strong {
  font-size: 24px;
}


/* 应用详情浮窗 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-content {
  background: white;
  border-radius: 20px;
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  position: relative;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateY(30px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  border: none;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 50%;
  font-size: 28px;
  line-height: 1;
  color: #666;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: rgba(0, 0, 0, 0.2);
  color: #333;
  transform: rotate(90deg);
}

.modal-app-preview {
  width: 100%;
  height: 300px;
  overflow: hidden;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  border-radius: 20px 20px 0 0;
}

.modal-app-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.modal-app-info {
  padding: 32px;
}

.modal-app-name {
  font-size: 28px;
  color: #333;
  margin-bottom: 12px;
  line-height: 1.3;
}

.modal-app-author {
  margin-bottom: 20px;
}

.modal-app-description {
  font-size: 16px;
  color: #666;
  line-height: 1.8;
  margin-bottom: 24px;
  padding: 20px;
  background: #f9f9f9;
  border-radius: 12px;
  border-left: 4px solid #667eea;
}

.modal-app-description p,
.modal-app-description ul,
.modal-app-description ol {
  margin: 0 0 12px 0;
}

.modal-app-description ul,
.modal-app-description ol {
  padding-left: 24px;
}

.modal-app-description li {
  margin-bottom: 6px;
}

.modal-app-description p:last-child,
.modal-app-description ul:last-child,
.modal-app-description ol:last-child {
  margin-bottom: 0;
}

.modal-app-meta {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: #999;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid #eee;
}

.modal-app-actions {
  display: flex;
  gap: 12px;
}

.modal-app-actions .btn-primary,
.modal-app-actions .btn-secondary {
  flex: 1;
  text-align: center;
  text-decoration: none;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .header h1 {
    font-size: 36px;
  }

  .hero-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-actions {
    justify-content: flex-start;
  }

  .control-panel {
    flex-direction: column;
    align-items: stretch;
  }

  .search-form {
    width: 100%;
  }

  .view-controls {
    width: 100%;
    justify-content: space-between;
  }

  .apps-grid[data-view="list"] .app-card {
    flex-direction: column;
  }

  .apps-grid[data-view="list"] .app-preview {
    width: 100%;
  }

  .apps-grid[data-view="list"] .app-actions {
    width: 100%;
  }

  .apps-grid {
    grid-template-columns: 1fr;
  }

  .upload-card {
    padding: 20px;
  }

  .success-actions {
    flex-direction: column;
  }

  .app-description-hint {
    font-size: 11px;
    padding: 5px 10px;
    gap: 4px;
  }

  .hint-icon {
    font-size: 12px;
  }

  .app-description:hover {
    padding-bottom: 36px;
  }

  .modal-content {
    max-height: 95vh;
    border-radius: 16px 16px 0 0;
    margin-top: auto;
  }

  .modal-app-preview {
    height: 200px;
  }

  .modal-app-info {
    padding: 24px 20px;
  }

  .modal-app-name {
    font-size: 24px;
  }

  .modal-app-description {
    font-size: 14px;
    padding: 16px;
  }

  .modal-app-actions {
    flex-direction: column;
  }

  .modal-app-actions .btn-primary,
  .modal-app-actions .btn-secondary {
    width: 100%;
  }
}

/* 用户认证样式 */
.user-auth-section {
  display: flex;
  align-items: center;
}

.user-status {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  color: white;
  font-size: 14px;
  font-weight: 500;
}

#userName {
  font-weight: 600;
  color: #ffd700;
}

.btn-login, .btn-logout {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 20px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-login:hover, .btn-logout:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-1px);
}

.btn-logout {
  background: rgba(255, 255, 255, 0.15);
  font-size: 12px;
  padding: 4px 12px;
}

.btn-my-apps {
  background: rgba(255, 255, 255, 0.25);
  color: white;
  text-decoration: none;
  margin-left: 12px;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 18px;
}

.btn-my-apps:hover {
  background: rgba(255, 255, 255, 0.35);
  transform: translateY(-1px);
}

.login-loading {
  color: white;
  font-size: 14px;
  opacity: 0.8;
}

/* 我的应用页面样式 */
.btn-edit, .btn-view, .btn-copy, .btn-delete {
  display: inline-block;
  padding: 4px 8px;
  border: none;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  margin-right: 4px;
  min-width: auto;
}

.btn-view {
  background: #28a745;
  color: white;
}

.btn-view:hover {
  background: #218838;
  transform: translateY(-1px);
}

.btn-edit {
  background: #ffc107;
  color: #212529;
}

.btn-edit:hover {
  background: #e0a800;
  transform: translateY(-1px);
}

.btn-copy {
  background: #17a2b8;
  color: white;
}

.btn-copy:hover {
  background: #138496;
  transform: translateY(-1px);
}

.btn-delete {
  background: #dc3545;
  color: white;
}

.btn-delete:hover {
  background: #c82333;
  transform: translateY(-1px);
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  margin: 40px 0;
}

.empty-icon {
  font-size: 64px;
  margin-bottom: 20px;
  opacity: 0.7;
}

.empty-state h3 {
  font-size: 24px;
  margin-bottom: 10px;
  color: #666;
}

.empty-state p {
  color: #999;
  margin-bottom: 20px;
}

/* 编辑弹窗样式 */
.modal-edit {
  max-width: 600px;
  width: 90%;
}

.edit-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding-top: 20px;
  border-top: 1px solid #eee;
}



/* 应用详情页面样式 */
.app-detail-main {
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  margin-bottom: 40px;
}

.app-detail-content {
  padding: 40px;
}

.app-detail-header {
  display: flex;
  gap: 40px;
  margin-bottom: 40px;
  align-items: flex-start;
}

.app-detail-preview {
  flex-shrink: 0;
  width: 500px;
  height: 350px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.app-detail-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-detail-info {
  flex: 1;
}

.app-detail-title {
  font-size: 32px;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 20px;
  line-height: 1.2;
}

.app-detail-meta {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 30px;
}

.app-detail-meta > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.meta-label {
  font-weight: 600;
  color: #666;
  min-width: 80px;
}

.meta-value {
  color: #333;
  font-weight: 500;
}

.meta-value.is-placeholder {
  color: #999;
  font-style: italic;
}

.app-views-icon {
  width: 20px;
  height: 20px;
  vertical-align: middle;
  margin-right: 4px;
}

.app-detail-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}


.like-button .like-count {
  background: rgba(102, 126, 234, 0.12);
  color: #5a67d8;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 14px;
  font-weight: 600;
  margin-left: 4px;
}

.like-button.is-liked {
  background: #667eea;
  color: #fff;
  border-color: #667eea;
}

.like-button.is-liked:hover {
  background: #5568d3;
  border-color: #5568d3;
}

.like-button.is-liked .like-count {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.like-button.is-liked .btn-icon img {
  filter: brightness(0) invert(1);
}

.like-button.is-loading {
  opacity: 0.7;
  cursor: wait;
  pointer-events: none;
}

.app-like-panel {
  margin-top: 8px;
}

.like-meta {
  font-size: 12px;
  color: #8a94b1;
}

/* 统一的操作按钮样式 */
.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #e0e0e0;
  background: #fff;
  color: #344767;
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  font-weight: 500;
  flex: 0 0 auto;
}

.btn-action .btn-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn-action .btn-icon img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.btn-action .btn-text {
  font-size: 15px;
}

.btn-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.25);
}

/* 打开应用按钮 */
.btn-action.btn-open:hover {
  background: #f5f5f5;
  border-color: #d0d0d0;
}

/* 复制按钮 */
.btn-action.btn-copy:hover {
  background: #f5f5f5;
  border-color: #d0d0d0;
}


.app-detail-description,
.app-detail-author-info {
  margin-bottom: 40px;
  padding-top: 40px;
  border-top: 1px solid #eee;
}

.app-detail-description h2,
.app-detail-author-info h2 {
  font-size: 24px;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 20px;
}

.description-content,
.author-details {
  color: #555;
  line-height: 1.6;
}

.description-content p {
  margin-bottom: 16px;
}

.description-content p:last-child {
  margin-bottom: 0;
}

.description-placeholder {
  color: #999;
  font-style: italic;
  text-align: center;
  padding: 40px 20px;
}

.author-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.author-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.author-label {
  font-weight: 600;
  color: #666;
  min-width: 60px;
}

.author-value {
  color: #333;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-back:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateX(-2px);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .app-detail-content {
    padding: 20px;
  }

  .app-detail-header {
    flex-direction: column;
    gap: 24px;
  }

  .app-detail-preview {
    width: 100%;
    height: 180px;
  }

  .app-detail-title {
    font-size: 24px;
  }

  .app-detail-meta {
    gap: 8px;
  }

  .meta-label {
    min-width: 70px;
    font-size: 14px;
  }

  .app-detail-actions {
    flex-direction: column;
  }

  .app-detail-actions .btn-action {
    width: 100%;
    justify-content: center;
  }

  .header-content {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }
}


