/**
 * OneTV 配置管理系统 - Vercel 风格设计
 * 简洁、现代、专业的界面设计
 */

/* ==================== 全局样式 ==================== */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  background: #fafafa;
  min-height: 100vh;
  color: #000;
  line-height: 1.6;
  font-size: 14px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==================== 主容器 ==================== */

.container {
  max-width: 1200px;
  margin: 0 auto;
  min-height: 100vh;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05), 0 2px 4px rgba(0, 0, 0, 0.02);
}

/* ==================== 头部区域 ==================== */

.header {
  background: #fff;
  border-bottom: 1px solid #eaeaea;
  padding: 0 24px;
  height: 64px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-left h1 {
  color: #000;
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-left p {
  color: #666;
  font-size: 12px;
  margin: 0;
  font-weight: 400;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.env-select {
  padding: 6px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.2s ease;
  color: #374151;
}

.env-select:focus {
  outline: none;
  border-color: #000;
}

.env-select:hover {
  border-color: #9ca3af;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #666;
  font-size: 13px;
}

#user-info-display {
  color: #333;
  font-weight: 500;
  white-space: nowrap; /* 防止换行 */
}

.logout-btn {
  padding: 6px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  color: #374151;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.logout-btn:hover {
  border-color: #000;
  color: #000;
}

/* ==================== 导航标签栏 ==================== */

.nav-tabs {
  border-bottom: 1px solid #eaeaea;
  background: #fff;
  padding: 0 24px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  position: sticky;
  top: 64px;
  z-index: 90;
}

.nav-tabs::-webkit-scrollbar {
  display: none;
}

.nav-grid {
  display: flex;
  gap: 0;
  margin: 0;
  min-width: max-content;
  height: 48px;
}

.nav-card {
  background: transparent;
  border: none;
  padding: 0 16px;
  border-radius: 0;
  text-decoration: none;
  color: #666;
  transition: color 0.15s ease;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  position: relative;
  border-bottom: 2px solid transparent;
  height: 48px;
  min-width: 0;
}

.nav-card:hover {
  color: #000;
  background: transparent;
  transform: none;
  box-shadow: none;
}

.nav-card.active {
  color: #000;
  background: transparent;
  border-bottom-color: #000;
  box-shadow: none;
}

.nav-card .nav-icon {
  font-size: 14px;
  margin: 0;
  display: inline-block;
  filter: none;
  flex-shrink: 0;
}

.nav-card h3 {
  font-size: 14px;
  margin: 0;
  color: inherit;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-card.active h3 {
  color: inherit;
}

/* ==================== 主内容区域 ==================== */

.main-content {
  position: relative;
  background: #fff;
}

.page-content {
  display: none;
  padding: 32px 24px 24px;
  min-height: calc(100vh - 112px); /* 64px header + 48px nav tabs */
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.page-content.active {
  display: block;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
  gap: 16px;
}

/* ==================== 页面工具栏 ==================== */

.page-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  gap: 16px;
  flex-wrap: wrap;
}

.page-toolbar .search-group {
  display: flex;
  gap: 12px;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.page-toolbar .page-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.page-header h2 {
  font-size: 32px;
  color: #000;
  font-weight: 700;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  line-height: 1.2;
}

.page-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-primary {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  background: #000;
  color: white;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  white-space: nowrap;
}

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

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  padding: 8px 16px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  color: #666;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  white-space: nowrap;
}

.btn-secondary:hover {
  border-color: #000;
  color: #000;
  transform: translateY(-1px);
}

.btn-secondary:active {
  transform: translateY(0);
}

/* ==================== 搜索面板 ==================== */

.search-panel {
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 32px;
  border: 1px solid #eaeaea;
}

.search-group {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

/* 在工具栏中的搜索组 */
.page-toolbar .search-group {
  flex: 1;
  min-width: 400px;
}

/* 独立搜索面板中的搜索组 */
.search-panel .search-group {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 12px;
  align-items: center;
}

/* 高级搜索内联布局 */
.search-group-inline {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
}

.search-input {
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  font-size: 14px;
  transition: all 0.15s ease;
  color: #000;
  height: 40px;
}

.search-input:focus {
  outline: none;
  border-color: #000;
  box-shadow: 0 0 0 1px #000;
}

.search-input:hover {
  border-color: #9ca3af;
}

.search-input::placeholder {
  color: #9ca3af;
}

.filter-select {
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  color: #000;
  height: 40px;
}

.filter-select:focus {
  outline: none;
  border-color: #000;
  box-shadow: 0 0 0 1px #000;
}

.filter-select:hover {
  border-color: #9ca3af;
}

/* ==================== 圆角样式组件 ==================== */

.search-input-rounded {
  padding: 10px 16px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  background: #fff;
  font-size: 14px;
  transition: all 0.15s ease;
  color: #000;
  height: 44px;
  flex: 1;
  min-width: 200px;
}

.search-input-rounded:focus {
  outline: none;
  border-color: #000;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.search-input-rounded:hover {
  border-color: #9ca3af;
}

.search-input-rounded::placeholder {
  color: #9ca3af;
}

.filter-select-rounded {
  padding: 10px 16px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  background: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  color: #000;
  height: 44px;
  min-width: 140px;
}

.filter-select-rounded:focus {
  outline: none;
  border-color: #000;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.filter-select-rounded:hover {
  border-color: #9ca3af;
}

.btn-primary-rounded {
  padding: 10px 20px;
  border: none;
  border-radius: 12px;
  background: #000;
  color: white;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  white-space: nowrap;
}

.btn-primary-rounded:hover {
  background: #333;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-primary-rounded:active {
  transform: translateY(0);
}

.btn-primary-rounded:disabled {
  background: #d1d5db;
  color: #9ca3af;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary-rounded {
  padding: 10px 20px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  background: #fff;
  color: #666;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  white-space: nowrap;
}

.btn-secondary-rounded:hover {
  border-color: #000;
  color: #000;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-secondary-rounded:active {
  transform: translateY(0);
}

.btn-secondary-rounded:disabled {
  background: #f9fafb;
  color: #d1d5db;
  border-color: #e5e7eb;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ==================== 批量操作样式 ==================== */

.batch-operations-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.batch-selection-group {
  display: flex;
  gap: 12px;
  align-items: center;
}

.batch-actions-horizontal {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.btn-success-rounded {
  padding: 10px 20px;
  border: none;
  border-radius: 12px;
  background: #10b981;
  color: white;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  white-space: nowrap;
}

.btn-success-rounded:hover {
  background: #059669;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-success-rounded:disabled {
  background: #d1d5db;
  color: #9ca3af;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-warning-rounded {
  padding: 10px 20px;
  border: none;
  border-radius: 12px;
  background: #f59e0b;
  color: white;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  white-space: nowrap;
}

.btn-warning-rounded:hover {
  background: #d97706;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}

.btn-warning-rounded:disabled {
  background: #d1d5db;
  color: #9ca3af;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-info-rounded {
  padding: 10px 20px;
  border: none;
  border-radius: 12px;
  background: #3b82f6;
  color: white;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  white-space: nowrap;
}

.btn-info-rounded:hover {
  background: #2563eb;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.25);
}

.btn-info-rounded:disabled {
  background: #d1d5db;
  color: #9ca3af;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-danger-rounded {
  padding: 10px 20px;
  border: none;
  border-radius: 12px;
  background: #ef4444;
  color: white;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  white-space: nowrap;
}

.btn-danger-rounded:hover {
  background: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.btn-danger-rounded:disabled {
  background: #d1d5db;
  color: #9ca3af;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ==================== 编辑器增强样式 ==================== */

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

.history-item {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
  background: #f9fafb;
}

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

.history-header .version {
  font-weight: 600;
  color: #1f2937;
}

.history-header .date {
  color: #6b7280;
  font-size: 12px;
}

.history-header .author {
  color: #6b7280;
  font-size: 12px;
}

.history-summary {
  color: #4b5563;
  margin-bottom: 12px;
  font-size: 14px;
}

.history-actions {
  display: flex;
  gap: 8px;
}

.tags-section {
  margin-bottom: 20px;
}

.current-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  min-height: 40px;
  padding: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background: #f9fafb;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  background: #3b82f6;
  color: white;
  border-radius: 4px;
  font-size: 12px;
}

.tag button {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

.tag button:hover {
  background: rgba(255, 255, 255, 0.2);
}

.add-tag-section {
  display: flex;
  gap: 8px;
  align-items: end;
}

.add-tag-section input {
  flex: 1;
}

#json-status {
  margin-right: 12px;
  font-size: 12px;
  font-weight: 500;
}

/* ==================== 搜索标签样式 ==================== */

.search-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 4px;
}

.advanced-search-panel {
  margin-top: 16px;
}

.advanced-search-panel .search-panel {
  margin-bottom: 0;
}

/* ==================== 配置网格 ==================== */

.config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
}

.config-card {
  background: #fff;
  border-radius: 8px;
  border: 1px solid #eaeaea;
  transition: all 0.15s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  padding: 20px;
}

.config-card:hover {
  border-color: #000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
  transform: translateY(-2px);
}

.config-card.active {
  border-color: #000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.config-card h3 {
  font-size: 16px;
  color: #000;
  margin-bottom: 8px;
  font-weight: 600;
}

.config-card p {
  color: #666;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 12px;
}

.config-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
}

.badge {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge.type-index {
  background: #f0f9ff;
  color: #0369a1;
  border: 1px solid #e0f2fe;
}

.badge.type-route {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #dcfce7;
}

.badge.status-active {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #dcfce7;
}

.badge.status-inactive {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.loading-card {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 20px;
  color: #666;
}

.loading-icon {
  font-size: 48px;
  margin-bottom: 16px;
  display: block;
}

/* ==================== 模态框 ==================== */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: #fff;
  border-radius: 8px;
  width: 90%;
  max-width: 1000px;
  max-height: 90%;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
  border: 1px solid #eaeaea;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  padding: 16px 24px;
  border-bottom: 1px solid #eaeaea;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 18px;
  color: #000;
  font-weight: 600;
  margin: 0;
}

.modal-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-close {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #666;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-close:hover {
  background: #f5f5f5;
  color: #000;
}

.modal-toolbar {
  padding: 12px 24px;
  background: #fafafa;
  border-bottom: 1px solid #eaeaea;
  display: flex;
  gap: 8px;
}

.tool-btn {
  padding: 6px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.tool-btn:hover {
  border-color: #000;
  color: #000;
}

.tool-btn.save {
  background: #000;
  color: white;
  border-color: #000;
}

.tool-btn.save:hover {
  background: #333;
}

.modal-body {
  flex: 1;
  padding: 24px;
  overflow: hidden;
}

.code-editor {
  width: 100%;
  height: 400px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 16px;
  font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
  font-size: 14px;
  line-height: 1.6;
  background: #fafafa;
  color: #000;
  resize: none;
  outline: none;
  transition: border-color 0.2s ease;
}

.code-editor:focus {
  border-color: #000;
  background: #fff;
}

.modal-footer {
  padding: 12px 24px;
  background: #fafafa;
  border-top: 1px solid #eaeaea;
}

.editor-status {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #666;
}

/* ==================== 统计网格 ==================== */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(5px);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* ==================== 工具卡片 ==================== */

.tools-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.tool-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(5px);
  border-radius: 12px;
  padding: 25px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  cursor: pointer;
}

.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  background: rgba(255, 255, 255, 1);
}

.tool-card h3 {
  font-size: 1.2em;
  color: #2d3748;
  margin-bottom: 10px;
  font-weight: 600;
}

.tool-card p {
  color: #718096;
  line-height: 1.5;
}

/* ==================== 配置卡片样式 ==================== */

.config-card {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(5px);
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  margin-bottom: 12px;
  transition: all 0.3s ease;
  cursor: pointer;
  overflow: hidden;
}

.config-card:hover {
  background: rgba(255, 255, 255, 0.95);
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
  border-color: rgba(102, 126, 234, 0.3);
}

.config-card.active {
  background: rgba(102, 126, 234, 0.1);
  border-color: #667eea;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.2);
}

.config-card-header {
  padding: 15px 15px 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.config-name {
  font-size: 1.1em;
  font-weight: 600;
  color: #2d3748;
  margin: 0 0 8px 0;
  line-height: 1.3;
}

.config-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.config-badge {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.75em;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.config-badge.type-index {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.config-badge.type-route {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.config-badge.type-other {
  background: rgba(107, 114, 128, 0.1);
  color: #6b7280;
}

.config-badge.status-active {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
}

.config-badge.status-inactive {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.config-card-body {
  padding: 10px 15px;
}

.config-description {
  font-size: 0.9em;
  color: #718096;
  margin: 0 0 10px 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.config-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8em;
  color: #a0aec0;
}

.config-env {
  padding: 2px 6px;
  background: rgba(102, 126, 234, 0.1);
  color: #667eea;
  border-radius: 4px;
  font-weight: 500;
}

.config-card-actions {
  padding: 10px 15px;
  background: rgba(0, 0, 0, 0.02);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.config-card-actions .action-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9em;
}

.config-card-actions .action-btn:hover {
  background: rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.edit-btn:hover {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}

.copy-btn:hover {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.delete-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* ==================== 编辑器区域 ==================== */

.editor-section {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 15px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ==================== 欢迎页面 ==================== */

.welcome-content {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 40px;
}

.welcome-card {
  text-align: center;
  max-width: 500px;
}

.welcome-icon {
  font-size: 4em;
  margin-bottom: 20px;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.welcome-card h2 {
  font-size: 2em;
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 15px;
}

.welcome-card p {
  font-size: 1.1em;
  color: #718096;
  margin-bottom: 30px;
  line-height: 1.6;
}

.feature-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  text-align: left;
}

.feature-item {
  padding: 15px;
  background: rgba(102, 126, 234, 0.1);
  border-radius: 10px;
  color: #4a5568;
  font-size: 0.95em;
  transition: all 0.3s ease;
}

.feature-item:hover {
  background: rgba(102, 126, 234, 0.15);
  transform: translateY(-2px);
}

/* ==================== 编辑器容器 ==================== */

.editor-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.editor-header {
  padding: 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.config-info h3 {
  font-size: 1.3em;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 8px;
}

.config-meta {
  display: flex;
  gap: 10px;
}

.config-badge {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.8em;
  font-weight: 500;
  background: rgba(102, 126, 234, 0.1);
  color: #667eea;
}

.editor-toolbar {
  display: flex;
  gap: 10px;
}

.toolbar-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.05);
  color: #4a5568;
  font-size: 0.9em;
  cursor: pointer;
  transition: all 0.3s ease;
}

.toolbar-btn:hover {
  background: rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.save-btn {
  background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(72, 187, 120, 0.3);
}

.save-btn:hover {
  box-shadow: 0 6px 25px rgba(72, 187, 120, 0.4);
}

/* ==================== 编辑器内容 ==================== */

.editor-content {
  flex: 1;
  padding: 20px;
  overflow: hidden;
}

.json-editor {
  width: 100%;
  height: 100%;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  padding: 20px;
  font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
  font-size: 14px;
  line-height: 1.6;
  background: rgba(248, 250, 252, 0.8);
  color: #2d3748;
  resize: none;
  outline: none;
  transition: all 0.3s ease;
}

.json-editor:focus {
  border-color: #667eea;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* ==================== 状态栏 ==================== */

.status-bar {
  background: #fff;
  border-top: 1px solid #eaeaea;
  padding: 12px 24px;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
}

.status-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #666;
  max-width: 1200px;
  margin: 0 auto;
}

.status-info span:last-child {
  font-family: "Monaco", "Menlo", "Ubuntu Mono", monospace;
  font-size: 11px;
}

/* ==================== 加载遮罩 ==================== */

.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-content {
  text-align: center;
  color: #000;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 2px solid #eaeaea;
  border-top: 2px solid #000;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ==================== 工具类 ==================== */

.hidden {
  display: none !important;
}

/* ==================== 主容器调整 ==================== */

.container {
  padding-bottom: 60px; /* 为状态栏留出空间 */
}

/* ==================== 登录模态框 - Vercel风格 ==================== */

.login-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: modalFadeIn 0.3s ease;
}

.login-modal-container {
  width: 100%;
  max-width: 400px;
  margin: 0 16px;
  animation: modalSlideIn 0.3s ease;
}

.login-modal-content {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  border: 1px solid #eaeaea;
  overflow: hidden;
  position: relative;
}

.login-header {
  padding: 40px 32px 32px;
  text-align: center;
  background: linear-gradient(135deg, #fafafa 0%, #fff 100%);
  border-bottom: 1px solid #eaeaea;
}

.login-logo {
  font-size: 48px;
  margin-bottom: 16px;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.login-title {
  font-size: 24px;
  font-weight: 700;
  color: #000;
  margin: 0 0 8px 0;
  letter-spacing: -0.025em;
}

.login-subtitle {
  font-size: 14px;
  color: #666;
  margin: 0;
  font-weight: 400;
}

.login-form {
  padding: 32px;
}

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

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #000;
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  color: #000;
  transition: all 0.15s ease;
  box-sizing: border-box;
}

.form-input:focus {
  outline: none;
  border-color: #000;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.form-input:hover {
  border-color: #9ca3af;
}

.form-input::placeholder {
  color: #9ca3af;
}

.form-input.shake {
  animation: shake 0.5s ease-in-out;
}

.login-button {
  width: 100%;
  padding: 14px 24px;
  border: none;
  border-radius: 8px;
  background: #000;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
  position: relative;
  overflow: hidden;
}

.login-button:hover {
  background: #333;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.login-button:active {
  transform: translateY(0);
}

.login-button:disabled {
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.login-button.loading {
  background: #666;
  cursor: not-allowed;
}

.login-button.loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top: 2px solid #fff;
  border-radius: 50%;
  right: 16px;
  animation: spin 1s linear infinite;
}

.login-button-text {
  transition: opacity 0.15s ease;
}

.login-button.loading .login-button-text {
  opacity: 0.7;
}

.login-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: errorFadeIn 0.3s ease;
}

.error-icon {
  flex-shrink: 0;
  font-size: 16px;
}

.error-text {
  color: #dc2626;
  font-size: 14px;
  font-weight: 500;
  flex: 1;
}

/* ==================== 动画效果 ==================== */

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

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

@keyframes errorFadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ==================== 登录框响应式设计 ==================== */

@media (max-width: 480px) {
  .login-modal-container {
    margin: 0 8px;
  }

  .login-header {
    padding: 32px 24px 24px;
  }

  .login-form {
    padding: 24px;
  }

  .login-logo {
    font-size: 36px;
    margin-bottom: 12px;
  }

  .login-title {
    font-size: 20px;
  }

  .login-subtitle {
    font-size: 13px;
  }
}

/* ==================== 响应式设计 ==================== */

@media (max-width: 1200px) {
  .config-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

@media (max-width: 768px) {
  .header {
    flex-direction: column;
    gap: 12px;
    height: auto;
    padding: 16px 24px;
  }

  .header-left {
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
  }

  .nav-tabs {
    padding: 0 16px;
  }

  .nav-grid {
    gap: 0;
  }

  .nav-card {
    padding: 12px 12px;
    font-size: 12px;
  }

  .nav-card .nav-icon {
    font-size: 14px;
  }

  .nav-card h3 {
    font-size: 12px;
  }

  .page-content {
    padding: 16px;
    min-height: calc(100vh - 180px);
  }

  .page-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .page-toolbar .search-group {
    min-width: 0;
    flex-direction: column;
    gap: 8px;
  }

  .page-toolbar .page-actions {
    justify-content: stretch;
  }

  /* 高级搜索响应式 */
  .search-group-inline {
    flex-direction: column;
    gap: 8px;
  }

  .search-input-rounded,
  .filter-select-rounded {
    min-width: 100%;
    width: 100%;
  }

  /* 批量操作响应式 */
  .batch-operations-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
  }

  .batch-selection-group,
  .batch-actions-horizontal {
    flex-direction: column;
    gap: 8px;
  }

  .batch-actions-horizontal button {
    width: 100%;
    justify-content: center;
  }

  .search-group {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .search-panel .search-group {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .config-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .modal-content {
    width: 95%;
    margin: 16px;
  }

  .modal-header,
  .modal-toolbar,
  .modal-body,
  .modal-footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .code-editor {
    height: 300px;
  }

  .status-info {
    padding: 0 16px;
  }
}

@media (max-width: 480px) {
  .header-left h1 {
    font-size: 14px;
  }

  .header-left p {
    font-size: 11px;
  }

  .nav-card {
    padding: 8px 8px;
    gap: 4px;
  }

  .nav-card .nav-icon {
    font-size: 12px;
  }

  .nav-card h3 {
    font-size: 10px;
  }

  .page-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .page-header h2 {
    font-size: 20px;
  }

  .page-actions {
    width: 100%;
    justify-content: stretch;
  }

  .btn-primary,
  .btn-secondary {
    flex: 1;
    text-align: center;
    font-size: 12px;
    padding: 6px 12px;
  }
}

/* ==================== 数据分析页面 - Vercel风格 ==================== */

/* 🎨 分析仪表板容器 */
.analytics-dashboard {
  max-width: none;
  width: 100%;
}

/* 🎨 分析头部优化 */
.analytics-header {
  background: #fff;
  border: 1px solid #eaeaea;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  margin-bottom: 24px;
  transition: box-shadow 0.2s ease;
}

.analytics-header:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.06);
}

/* 🎨 概览卡片 - Vercel风格 */
.overview-card {
  background: #fff;
  border: 1px solid #eaeaea;
  border-radius: 8px;
  padding: 20px;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.overview-card:hover {
  border-color: #d1d5db;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}

/* 🎨 图表容器优化 */
.chart-container {
  background: #fff;
  border: 1px solid #eaeaea;
  border-radius: 8px;
  padding: 24px;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  min-height: 500px;
}

.chart-container:hover {
  border-color: #d1d5db;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* 🎨 图表标题 */
.chart-container h3 {
  color: #000;
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 16px 0;
  letter-spacing: -0.025em;
}

/* 🎨 图表区域尺寸修复 */
#usage-trend-chart,
#config-type-chart {
  width: 100%;
  height: 400px !important;
  min-height: 400px !important;
  max-height: none !important;
  display: block;
  border-radius: 6px;
  background: #fafafa;
  margin: 12px 0;
  overflow: visible;
}

/* 🎨 图表SVG样式 */
.chart-container svg {
  max-width: 100%;
  max-height: 100%;
  border-radius: 6px;
  background: #fafafa;
}

/* 🎨 数据表格优化 */
.data-table {
  background: #fff;
  border: 1px solid #eaeaea;
  border-radius: 8px;
  padding: 24px;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.data-table:hover {
  border-color: #d1d5db;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.data-table h3 {
  color: #000;
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 16px 0;
  letter-spacing: -0.025em;
}

/* 🎨 表格样式优化 */
.data-table table {
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #eaeaea;
}

.data-table th {
  background: #fafafa;
  font-weight: 500;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 11px;
  padding: 12px 16px;
  border-bottom: 1px solid #eaeaea;
}

.data-table td {
  padding: 12px 16px;
  color: #000;
  font-size: 14px;
  border-bottom: 1px solid #f5f5f5;
}

.data-table tbody tr:hover {
  background: #fafafa;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* 🎨 性能指标卡片 */
.performance-metric {
  background: #fafafa;
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 12px;
  transition: background 0.2s ease;
}

.performance-metric:hover {
  background: #f0f0f0;
}

.performance-metric span {
  color: #000;
  font-weight: 500;
}

/* 🎨 活动日志优化 */
.activity-log {
  background: #fff;
  border: 1px solid #eaeaea;
  border-radius: 8px;
  padding: 24px;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.activity-log:hover {
  border-color: #d1d5db;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.activity-log h3 {
  color: #000;
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 16px 0;
  letter-spacing: -0.025em;
}

/* 🎨 图表期间按钮优化 */
.chart-period-btn {
  padding: 6px 12px;
  border: 1px solid #eaeaea;
  border-radius: 6px;
  background: #fff;
  color: #666;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chart-period-btn:hover {
  border-color: #000;
  color: #000;
  background: #fafafa;
}

.chart-period-btn.active {
  background: #000;
  color: #fff;
  border-color: #000;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 🎨 统计数字强调 */
.overview-card .text-2xl {
  font-size: 28px;
  font-weight: 700;
  color: #000;
  letter-spacing: -0.05em;
}

/* 🎨 图表占位符样式 */
#usage-trend-chart:empty::before,
#config-type-chart:empty::before {
  content: "图表加载中...";
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-size: 14px;
  height: 100%;
  width: 100%;
}

/* 🎨 响应式优化 */
@media (max-width: 1024px) {
  .analytics-dashboard .lg\\:grid-cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .analytics-dashboard .lg\\:grid-cols-2 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .analytics-dashboard .md\\:grid-cols-2 {
    grid-template-columns: 1fr;
  }

  .overview-card,
  .chart-container,
  .data-table,
  .activity-log {
    padding: 16px;
  }

  #usage-trend-chart,
  #config-type-chart {
    height: 200px;
    min-height: 200px;
  }
}

/* ==================== 服务公告样式 ==================== */

/* 统计卡片网格 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.2s ease;
}

.stat-card:hover {
  border-color: #3b82f6;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.1);
}

.stat-icon {
  font-size: 24px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  border-radius: 8px;
}

.stat-content h3 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  color: #111827;
}

.stat-content p {
  margin: 4px 0 0 0;
  font-size: 14px;
  color: #6b7280;
}

/* 快速操作按钮 */
.quick-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: white;
  color: #374151;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
}

.action-btn:hover {
  border-color: #3b82f6;
  color: #3b82f6;
  background: #f8fafc;
}

.action-btn.immediate {
  border-color: #ef4444;
  color: #ef4444;
}

.action-btn.immediate:hover {
  background: #fef2f2;
}

.action-btn.scheduled {
  border-color: #f59e0b;
  color: #f59e0b;
}

.action-btn.scheduled:hover {
  background: #fffbeb;
}

/* 公告容器 */
.announcements-container {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}

/* ==================== Excel风格样式工具栏 ==================== */

.style-toolbar {
  display: flex;
  flex-wrap: nowrap; /* 不换行，保持单行 */
  gap: 8px; /* 减少间距 */
  padding: 8px 12px; /* 减少内边距 */
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 6px; /* 减少圆角 */
  margin-bottom: 12px; /* 减少下边距 */
  align-items: center;
  overflow-x: auto; /* 如果内容过多，允许水平滚动 */
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 4px; /* 减少间距 */
  padding: 2px 6px; /* 减少内边距 */
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 4px; /* 减少圆角 */
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  white-space: nowrap; /* 防止换行 */
}

.toolbar-select {
  border: none;
  background: transparent;
  padding: 6px 8px;
  font-size: 14px;
  color: #374151;
  cursor: pointer;
  outline: none;
  min-width: 80px;
}

.toolbar-select:focus {
  background: #f3f4f6;
  border-radius: 4px;
}

.toolbar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s ease;
  font-size: 14px;
}

.toolbar-btn:hover {
  background: #f3f4f6;
  color: #374151;
}

.toolbar-btn.active {
  background: #3b82f6;
  color: white;
}

.toolbar-btn.active:hover {
  background: #2563eb;
}

/* 字体样式按钮 */
.font-style-btn {
  position: relative;
}

.font-icon {
  font-family: 'Times New Roman', serif;
  font-size: 14px;
  font-weight: bold;
  display: inline-block;
  width: 16px;
  text-align: center;
}

.bold-icon {
  font-weight: 900;
}

.italic-icon {
  font-style: italic;
  font-weight: bold;
}

.underline-icon {
  text-decoration: underline;
  font-weight: bold;
}

.strikethrough-icon {
  text-decoration: line-through;
  font-weight: bold;
}

/* 颜色选择器容器 */
.color-picker-container {
  position: relative;
}

.color-picker-container input[type="color"] {
  position: absolute;
  top: 100%; /* 显示在按钮下方 */
  left: 0;
  z-index: 1000;
  opacity: 0; /* 隐藏原生颜色选择器 */
  pointer-events: none; /* 禁用直接点击 */
}

.color-picker-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: white;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s ease;
  min-width: 60px;
}

.color-picker-btn:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

.color-icon {
  font-weight: bold;
  font-size: 14px;
}

.color-bar {
  width: 16px;
  height: 3px;
  border-radius: 1px;
  border: 1px solid #d1d5db;
}

.dropdown-arrow {
  font-size: 8px;
  color: #6b7280;
}

/* 背景切换按钮 */
.background-toggle-btn {
  position: relative;
}

.background-icon {
  position: relative;
  display: inline-block;
  width: 20px;
  height: 16px;
}

.bg-rect {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 12px;
  background: #e5e7eb;
  border: 1px solid #9ca3af;
  border-radius: 2px;
}

.bg-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 10px;
  font-weight: bold;
  color: #374151;
  z-index: 1;
}

.background-toggle-btn.active .bg-rect {
  background: #3b82f6;
  border-color: #2563eb;
}

.background-toggle-btn.active .bg-text {
  color: white;
}

/* 发布类型帮助文本 */
.publish-type-help {
  margin-top: 8px;
  padding: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
}

.help-text {
  color: #64748b;
  line-height: 1.4;
}

.help-text strong {
  color: #334155;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .style-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar-group {
    justify-content: center;
    flex-wrap: wrap;
  }
}

.announcements-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
}

.announcements-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #111827;
}

.filter-controls {
  display: flex;
  gap: 12px;
  align-items: center;
}

.filter-select,
.search-input {
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  background: white;
}

.search-input {
  width: 200px;
}

/* 公告列表 */
.announcements-list {
  max-height: 600px;
  overflow-y: auto;
}

.announcement-card {
  padding: 20px;
  border-bottom: 1px solid #e5e7eb;
  transition: background-color 0.2s ease;
}

.announcement-card:hover {
  background: #f9fafb;
}

.announcement-card:last-child {
  border-bottom: none;
}

.announcement-card.inactive {
  opacity: 0.6;
}

.announcement-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.announcement-title h4 {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 600;
  color: #111827;
}

.announcement-badges {
  display: flex;
  gap: 8px;
}

.badge {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.badge.active {
  background: #dcfce7;
  color: #166534;
}

.badge.inactive {
  background: #f3f4f6;
  color: #6b7280;
}

.badge.type-immediate {
  background: #fef2f2;
  color: #dc2626;
}

.badge.type-scheduled {
  background: #fffbeb;
  color: #d97706;
}

.badge.type-normal {
  background: #eff6ff;
  color: #2563eb;
}

.announcement-actions {
  display: flex;
  gap: 8px;
}

.btn-icon {
  width: 32px;
  height: 32px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
}

.btn-icon:hover {
  border-color: #3b82f6;
  background: #f8fafc;
}

.announcement-content p {
  margin: 0;
  color: #6b7280;
  line-height: 1.5;
}

/* 公告预览效果 */
.announcement-preview {
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.marquee-text {
  display: inline-block;
  animation: marquee 10s linear infinite;
}

@keyframes marquee {
  0% {
    transform: translateX(100%);
  }
  100% {
    transform: translateX(-100%);
  }
}

.announcement-meta {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.meta-item {
  display: flex;
  gap: 4px;
  font-size: 12px;
}

.meta-label {
  color: #6b7280;
}

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

/* 模态框样式 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-container {
  background: white;
  border-radius: 8px;
  max-width: 800px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid #e5e7eb;
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #111827;
}

.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  font-size: 20px;
  cursor: pointer;
  color: #6b7280;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: #f3f4f6;
  color: #111827;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
}

/* 表单样式 */
.announcement-form {
  max-width: none;
}

.form-section {
  margin-bottom: 24px;
}

.form-section h4 {
  margin: 0 0 16px 0;
  font-size: 16px;
  font-weight: 600;
  color: #111827;
  padding-bottom: 8px;
  border-bottom: 1px solid #e5e7eb;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s ease;
}

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

.form-group small {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: #6b7280;
}

.preview-container {
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 16px;
  background: #f9fafb;
}

.preview-marquee {
  border-radius: 4px;
  position: relative;
  overflow: hidden;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: #6b7280;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  display: block;
}

.empty-state h3 {
  margin: 0 0 8px 0;
  font-size: 18px;
  font-weight: 600;
  color: #111827;
}

.empty-state p {
  margin: 0 0 24px 0;
  color: #6b7280;
}

/* 历史记录样式 */
.history-container {
  max-height: 500px;
  overflow-y: auto;
}

.history-stats {
  display: flex;
  gap: 24px;
  margin-bottom: 24px;
  padding: 16px;
  background: #f9fafb;
  border-radius: 6px;
}

.stat-item {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 24px;
  font-weight: 600;
  color: #111827;
}

.stat-label {
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
}

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

.history-item {
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 12px;
  background: #f9fafb;
}

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

.history-header h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #111827;
}

.history-date {
  font-size: 12px;
  color: #6b7280;
}

.history-content {
  color: #4b5563;
  margin-bottom: 12px;
  font-size: 14px;
}

.history-meta {
  display: flex;
  gap: 12px;
  align-items: center;
}

.meta-badge {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}

.meta-badge.active {
  background: #dcfce7;
  color: #166534;
}

.meta-badge.inactive {
  background: #f3f4f6;
  color: #6b7280;
}

.meta-info {
  font-size: 11px;
  color: #6b7280;
}

/* 设置样式 */
.settings-container {
  max-width: 600px;
}

.settings-section {
  margin-bottom: 24px;
}

.settings-section h4 {
  margin: 0 0 16px 0;
  font-size: 16px;
  font-weight: 600;
  color: #111827;
  padding-bottom: 8px;
  border-bottom: 1px solid #e5e7eb;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: auto;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .action-btn {
    justify-content: center;
  }

  .announcements-header {
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
  }

  .filter-controls {
    flex-direction: column;
    gap: 8px;
  }

  .search-input {
    width: 100%;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .modal-container {
    width: 95%;
    margin: 16px;
  }

  .history-stats {
    flex-direction: column;
    gap: 12px;
  }
}

/* 活跃设备列表样式 */
.active-devices-content {
  max-height: 400px;
  overflow-y: auto;
}

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

.devices-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.device-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  transition: background-color 0.2s ease;
}

.device-item:hover {
  background: #f1f5f9;
}

.device-info {
  flex: 1;
}

.device-name {
  font-weight: 600;
  color: #1f2937;
  margin-bottom: 4px;
}

.device-details {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: #6b7280;
}

.device-details span {
  background: white;
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid #e5e7eb;
}

.device-status {
  display: flex;
  align-items: center;
}

.status-badge {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.status-badge.online {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}
