/*! HTML5 Boilerplate v9.0.1 | MIT License | https://html5boilerplate.com/ */

/* main.css 3.0.0 | MIT License | https://github.com/h5bp/main.css#readme */
/*
 * What follows is the result of much research on cross-browser styling.
 * Credit left inline and big thanks to Nicolas Gallagher, Jonathan Neal,
 * Kroc Camen, and the H5BP dev community and team.
 */

/* ==========================================================================
   Base styles: opinionated defaults
   ========================================================================== */

html {
  color: #222;

  background-color: #f8f9fa;
  font-size: 1em;
  line-height: 1.4;
}

body{
  margin-right: 0;
}

/*
 * Remove text-shadow in selection highlight:
 * https://twitter.com/miketaylr/status/12228805301
 *
 * Customize the background color to match your design.
 */

::-moz-selection {
  background: #b3d4fc;
  text-shadow: none;
}

::selection {
  background: #b3d4fc;
  text-shadow: none;
}

/*
 * A better looking default horizontal rule
 */

hr {
  display: block;
  height: 1px;
  border: 0;
  border-top: 1px solid #ccc;
  margin: 1em 0;
  padding: 0;
}

/*
 * Remove the gap between audio, canvas, iframes,
 * images, videos and the bottom of their containers:
 * https://github.com/h5bp/html5-boilerplate/issues/440
 */

audio,
canvas,
iframe,
img,
svg,
video {
  vertical-align: middle;
}

/*
 * Remove default fieldset styles.
 */

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
}

/*
 * Allow only vertical resizing of textareas.
 */

textarea {
  resize: vertical;
}

/* ==========================================================================
   Author's custom styles
   ========================================================================== */

/* 工具栏样式 */
.toolbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background-color: #2c3e50;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  z-index: 50;
}

.toolbar-left {
  display: flex;
  gap: 10px;
}

.toolbar-right {
  display: flex;
  align-items: center;
}

.toolbar-btn {
  background-color: #3498db;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s ease;
}

.toolbar-btn:hover {
  background-color: #2980b9;
}

.toolbar-btn:active {
  background-color: #21618c;
}

/* 声音设计按钮特殊样式 */
#soundDesignBtn {
  background-color: #9b59b6;
}

#soundDesignBtn:hover {
  background-color: #8e44ad;
}

#soundDesignBtn:active {
  background-color: #7d3c98;
}

.username {
  color: white;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 4px;
  transition: background-color 0.3s ease;
  font-size: 14px;
}

.username:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* 生成成功提示气泡样式 */
.success-tooltip {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  z-index: 1000;
  animation: tooltipFadeIn 0.3s ease-out;
}

.tooltip-content {
  position: relative;
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.4;
  box-shadow: 0 4px 20px rgba(40, 167, 69, 0.3);
  min-width: 200px;
  max-width: 280px;
  text-align: center;
}

.tooltip-arrow {
  position: absolute;
  top: -6px;
  right: 20px;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid #28a745;
}

.tooltip-text {
  display: block;
  font-weight: 500;
}

@keyframes tooltipFadeIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes tooltipFadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

.success-tooltip.hiding {
  animation: tooltipFadeOut 0.3s ease-out forwards;
}

/* 悬浮工具栏样式 */
.floating-toolbar {
  position: fixed;
  top: 80px;
  left: 0;
  right: 0;
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 80;
  border: 1px solid #e0e0e0;
  margin: 0 20px;
}

.sliders-container {
  display: flex;
  align-items: center;
  gap: 15px;
  flex: 1;
}

.buttons-container {
  display: flex;
  gap: 8px;
  margin-left: 15px;
}

.control-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  flex: 1;
  max-width: 180px;
}

.control-label {
  font-size: 11px;
  color: #555;
  font-weight: 500;
  white-space: nowrap;
}

.number-input {
  width: 50px;
  height: 20px;
  border: none;
  text-align: center;
  font-size: 11px;
  padding: 1px;
  background: transparent;
  transition: background-color 0.3s ease;
}

.number-input:focus {
  outline: none;
  background-color: rgba(52, 152, 219, 0.1);
}

.slider {
  width: 100%;
  height: 3px;
  border-radius: 2px;
  background: #ddd;
  outline: none;
  -webkit-appearance: none;
  max-width: 120px;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #3498db;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.slider::-webkit-slider-thumb:hover {
  background: #2980b9;
}

.slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #3498db;
  cursor: pointer;
  border: none;
  transition: background-color 0.3s ease;
}

.slider::-moz-range-thumb:hover {
  background: #2980b9;
}

.button-group {
  display: flex;
  gap: 10px;
}

.action-btn {
  background-color: #95a5a6;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: background-color 0.3s ease;
}

.action-btn:hover {
  background-color: #7f8c8d;
}

.action-btn:active {
  background-color: #6c7a7b;
}

.action-btn.primary {
  background-color: #27ae60;
}

.action-btn.primary:hover {
  background-color: #229954;
}

.action-btn.primary:active {
  background-color: #1e8449;
}

.main-content {
  background-color: #f8f9fa;
  margin-top: 150px;
  padding: 20px 0 20px 0;
  height: calc(100vh - 160px);
  box-sizing: border-box;
}

.content-container {
  display: flex;
  height: 100%;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.text-area {
  flex: 5;
  padding: 15px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  height: 100%;
}
.text-area.expanded {
  margin-right: 8px;
}

.text-input {
  flex: 1;
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 12px;
  font-size: 16px;
  line-height: 1.5;
  resize: none;
  outline: none;
  font-family: inherit;
  box-sizing: border-box;
  min-height: 0;
}

.text-input:focus {
  border-color: #3498db;
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

.toggle-btn {
  position: absolute;
  right: 30.1%;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 120px;
  background-color: #3498db;
  color: white;
  border: none;
  border-radius:  0 8px 8px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1.4);
  z-index: 10;
}

.toggle-btn:hover {
  background-color: #2980b9;
}

.toggle-btn.collapsed {
  right: 0;
  border-radius: 8px 0 0 8px;
}

.voice-list {
  flex: 2;
  background-color: #f8f9fa;
  border-left: 1px solid #e0e0e0;
  border-top: 1px solid #e0e0e0;
  border-bottom: 1px solid #e0e0e0;
  padding: 20px;
  overflow-y: auto;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1.4);
  box-sizing: border-box;
  height: 100%;
}

.voice-list.hidden {
  flex: 0;
  padding: 0;
  border-left: none;
  overflow: hidden;
}
.voice-list.hiding {
  flex: 0;
  padding: 0;
  border-left: none;
  overflow: hidden;
}

.voice-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.voice-list-title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #333;
  cursor: pointer;
  padding: 8px 0;
  border-radius: 4px;
  transition: background-color 0.2s ease;
  flex: 1;
}

.voice-list-title:hover {
  background-color: rgba(52, 152, 219, 0.1);
}

.filter-toggle-btn {
  background: none;
  border: none;
  color: #666;
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  min-width: 32px;
  height: 32px;
}

.filter-toggle-btn:hover {
  background-color: rgba(52, 152, 219, 0.1);
  color: #3498db;
}

.filter-toggle-btn:active {
  transform: scale(0.95);
}

#filterToggleIcon {
  font-size: 12px;
  transition: transform 0.3s ease;
  display: inline-block;
}

.filter-toggle-btn.expanded #filterToggleIcon {
  transform: rotate(180deg);
}

.voice-search-input {
  margin: 0 0 15px 0;
  font-size: 16px;
  font-weight: 600;
  color: #333;
  background-color: white;
  border: 2px solid #3498db;
  border-radius: 6px;
  padding: 8px 12px;
  width: 100%;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.voice-search-input:focus {
  border-color: #2980b9;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.voice-search-input::placeholder {
  color: #999;
  font-weight: normal;
}

/* 筛选标签样式 */
.voice-filters {
  background-color: #fff;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1.4);
  opacity: 0;
  max-height: 0;
  transform: translateY(-10px);
}

.voice-filters.expanded {
  margin: 15px 0;
  padding: 15px;
  opacity: 1;
  max-height: 500px;
  transform: translateY(0);
}

.filter-group {
  margin-bottom: 12px;
}

.filter-group:last-child {
  margin-bottom: 0;
}

.filter-label {
  font-size: 14px;
  font-weight: 600;
  color: #555;
  margin-bottom: 8px;
  display: block;
}

.filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-tag {
  padding: 4px 12px;
  background-color: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 16px;
  font-size: 12px;
  color: #666;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.filter-tag:hover {
  background-color: #e8e8e8;
  border-color: #bbb;
}

.filter-tag.active {
  background-color: #3498db;
  border-color: #2980b9;
  color: white;
}

.filter-tag.active:hover {
  background-color: #2980b9;
}

.voice-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.voice-item {
  padding: 12px 15px;
  background-color: white;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
  transform: scale(1);
}

.voice-item:hover {
  background-color: #f0f0f0;
  border-color: #3498db;
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.voice-item.active {
  background-color: #3498db;
  color: white;
  border-color: #3498db;
  border-width: 2px;
  font-weight: bold;
  position: relative;
  overflow: visible;
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

/* 确保选中项的子元素也继承加粗效果 */
.voice-item.active .voice-name {
  font-weight: bold;
  color: rgba(255, 0, 0, 0.8);
}

.voice-item.active .voice-id {
  font-weight: bold;
  color: rgba(255, 0, 0, 0.8);
}

/* 音色项类型样式 */
.voice-item.type-0 {
  background-color: #e3f2fd; /* 浅蓝色 */
}

.voice-item.type-1 {
  background-color: #f5f5f5; /* 浅灰色 */
}

.voice-item.type-2 {
  background-color: #e0e0e0; /* 深灰色 */
}

.voice-item.type-3 {
  background-color: #e8f5e8; /* 浅绿色 */
}

.voice-item.type-0:hover {
  background-color: #bbdefb;
}

.voice-item.type-1:hover {
  background-color: #eeeeee;
}

.voice-item.type-2:hover {
  background-color: #bdbdbd;
}

.voice-item.type-3:hover {
  background-color: #c8e6c9;
}

/* 音色项内容布局 */
.voice-item-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.voice-name {
  font-weight: 500;
  color: #333;
  flex: 1;
}

.voice-id {
  color: #999;
  font-size: 12px;
  font-family: monospace;
}

/* 工具提示样式 */
.voice-item {
  position: relative;
}

.voice-item::after {
  content: attr(data-description);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: #333;
  color: white;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  max-width: 300px;
  white-space: normal;
  word-wrap: break-word;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 1000;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.voice-item::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #333;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 999;
  pointer-events: none;
}

.voice-item:hover::after {
  opacity: 1;
  visibility: visible;
  margin-bottom: 6px;
}

.voice-item:hover::before {
  opacity: 1;
  visibility: visible;
  margin-bottom: 6px;
}

/* 登录弹窗样式 */
.modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  animation: fadeIn 0.3s ease;
}

.modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  width: 90%;
  max-width: 400px;
  animation: slideIn 0.3s ease;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 20px 0 20px;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 20px;
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
  color: #333;
}

.close-btn {
  font-size: 24px;
  color: #999;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.close-btn:hover {
  background-color: #f0f0f0;
  color: #333;
}

.modal-body {
  padding: 0 20px 20px 20px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #555;
}

.form-input {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  box-sizing: border-box;
  transition: border-color 0.3s ease;
}

.form-input:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

.checkbox-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-size: 14px;
  color: #555;
}

.checkbox-label input[type="checkbox"] {
  display: none;
}

.checkmark {
  width: 16px;
  height: 16px;
  border: 1px solid #ddd;
  border-radius: 3px;
  margin-right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
  background-color: #3498db;
  border-color: #3498db;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
  content: '✓';
  color: white;
  font-size: 12px;
  font-weight: bold;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 20px;
  border-top: 1px solid #e0e0e0;
}

/* 全文弹窗样式 */
.full-text-content {
  padding: 20px;
  background-color: #f8f9fa;
  border-radius: 8px;
  min-height: 100px;
  max-height: 400px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  line-height: 1.6;
  font-size: 14px;
  color: #333;
}

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-secondary {
  background-color: #95a5a6;
  color: white;
}

.btn-secondary:hover {
  background-color: #7f8c8d;
}

.btn-primary {
  background-color: #3498db;
  color: white;
}

.btn-primary:hover {
  background-color: #2980b9;
}

.btn-danger {
  background-color: #e74c3c;
  color: white;
}

.btn-danger:hover {
  background-color: #c0392b;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* 作品弹窗样式 */
.search-section {
  margin-bottom: 20px;
  padding: 15px;
  background-color: #f8f9fa;
  border-radius: 6px;
}

.search-row {
  display: flex;
  gap: 15px;
  align-items: end;
  flex-wrap: wrap;
}

.search-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.search-group label {
  font-size: 14px;
  font-weight: 500;
  color: #333;
}

.search-input, .search-select {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  min-width: 200px;
}

.search-input:focus, .search-select:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* 表格样式 */
.table-section {
  margin-bottom: 20px;
  overflow-x: auto;
}

.works-table {
  width: 100%;
  border-collapse: collapse;
  background-color: white;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.works-table th {
  background-color: #f8f9fa;
  padding: 12px 15px;
  text-align: left;
  font-weight: 600;
  color: #333;
  border-bottom: 2px solid #e0e0e0;
  font-size: 14px;
}

.works-table td {
  padding: 12px 15px;
  border-bottom: 1px solid #e0e0e0;
  font-size: 14px;
  color: #555;
}

.works-table tr:hover {
  background-color: #f8f9fa;
}

.text-cell {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  color: #007bff;
  transition: color 0.2s ease;
}

.text-cell:hover {
  color: #0056b3;
  text-decoration: underline;
}

/* 状态徽章样式 */
.status-badge {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  display: inline-block;
}

.status-completed {
  background-color: #f2e5ff;
  color: mediumpurple;
}

.status-generating {
  background-color: #fff9e5;
  color: #856404;
}

.status-failed {
  background-color: #ffe6e9;
  color: #721c24;
}

.status-success {
  background-color: #d4edda;
  color: #155724;
}

.status-processing {
  background-color: #fff3cd;
  color: #856404;
}

.status-error {
  background-color: #f8d7da;
  color: #721c24;
}

.status-default {
  background-color: #e2e3e5;
  color: #383d41;
}

.status-info {
  background-color: #d1ecf1;
  color: #0c5460;
}

.type-product {
  background-color: #dcebff;
  color: dodgerblue;
}

.type-demo {
  background-color: #e7ffed;
  color: forestgreen;
}

/* 分页样式 */
.pagination-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 0;
  border-top: 1px solid #e0e0e0;
}

.pagination-info {
  font-size: 14px;
  color: #666;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 15px;
}

.page-input-group {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 14px;
  color: #666;
}

.page-input {
  width: 60px;
  padding: 6px 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  text-align: center;
  font-size: 14px;
}

.page-input:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.btn-primary {
  background-color: #3498db;
  color: white;
}

.btn-primary:hover {
  background-color: #2980b9;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 用户下拉菜单样式 */
.user-dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  min-width: 220px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  margin-top: 5px;
}

.dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  padding: 12px 16px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
  color: #333;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dropdown-item-message {
  padding: 12px 16px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
  color: #333;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dropdown-item:first-child {
  border-radius: 8px 8px 0 0;
}

.dropdown-item:last-child {
  border-bottom: none;
  border-radius: 0 0 8px 8px;
}

.dropdown-item:hover {
  background-color: #f8f9fa;
}

.dropdown-item.logout {
  color: #e74c3c;
}

.dropdown-item.logout:hover {
  background-color: #fdf2f2;
}

/* 下拉菜单分割线 */
.dropdown-divider {
  height: 1px;
  background-color: #e9ecef;
  margin: 4px 0;
}

/* 下拉菜单文本布局 */
.dropdown-item-text {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex: 1;
}

/* 使用量数值样式 */
.usage-value {
  background-color: rgba(0, 123, 255, 0.1);
  color: #007bff;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  min-width: 20px;
  text-align: center;
  margin-left: 8px;
}

/* 特定菜单项的悬停效果 */
/*#showUsageCharacter:hover .usage-value {*/
/*  background-color: rgba(180, 180, 180, 0.1);*/
/*  color: forestgreen;*/
/*}*/

/*#showUsageDiy:hover .usage-value {*/
/*  background-color: rgba(180, 180, 180, 0.1);*/
/*  color: forestgreen;*/
/*}*/

.dropdown-item-icon {
  font-size: 16px;
  width: 20px;
  text-align: center;
}

/* 防止菜单被遮挡 */
.toolbar {
  z-index: 100;
}

/* 确保用户下拉菜单在最上层 */
.user-dropdown {
  z-index: 2000;
}

.dropdown-menu {
  z-index: 2001;
}

/* 字符数显示样式 */
.char-count {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #666;
  padding: 5px 10px;
  background-color: #f8f9fa;
  border-radius: 4px;
  cursor: help;
  transition: background-color 0.2s ease;
}

.char-count:hover {
  background-color: #e9ecef;
}

.char-count-label {
  font-weight: 500;
}

.char-count-value {
  font-weight: bold;
  color: #3498db;
  min-width: 20px;
  text-align: center;
}

/* 字符数提示框 */
.char-count-tooltip {
  position: absolute;
  bottom: calc(100% - 18px);
  left: 85%;
  transform: translateX(-50%);
  background-color: #333;
  color: white;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 100;
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.char-count-tooltip::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: #333;
}

.char-count:hover .char-count-tooltip {
  opacity: 1;
  visibility: visible;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .floating-toolbar {
    flex-direction: column;
    gap: 15px;
    padding: 15px;
  }

  .sliders-container {
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
  }

  .buttons-container {
    margin-left: 0;
    justify-content: center;
  }

  .control-group {
    max-width: 150px;
  }

  .slider {
    max-width: 120px;
  }

  .content-container {
    flex-direction: column;
    height: 100%;
  }

  .text-area {
    flex: 1;
    min-height: 0;
    height: 50%;
  }

  .toggle-btn {
    right: 50%;
    top: auto;
    bottom: 0;
    transform: translateX(50%);
    width: 60px;
    height: 30px;
    border-radius: 4px 4px 0 0;
  }

  .toggle-btn.collapsed {
    right: 50%;
    transform: translateX(50%);
    border-radius: 4px 4px 0 0;
  }

  .voice-list {
    flex: 1;
    border-left: none;
    border-top: 1px solid #e0e0e0;
    height: 50%;
    max-height: none;
  }

  .voice-list.hidden {
    max-height: 0;
  }
}

@media (max-width: 480px) {
  .floating-toolbar {
    margin: 0 10px;
    gap: 10px;
  }

  .sliders-container {
    gap: 10px;
  }

  .control-group {
    max-width: 100px;
  }

  .slider {
    max-width: 80px;
  }

  .control-label {
    font-size: 11px;
  }

  .number-input {
    width: 50px;
    font-size: 11px;
  }

  .main-content {
    padding: 10px;
    height: calc(100vh - 200px);
  }

  .text-area {
    padding: 10px;
  }

  .text-input {
    font-size: 14px;
    padding: 8px;
    line-height: 1.4;
  }

  .voice-list {
    padding: 15px;
  }

  .voice-item {
    padding: 10px 12px;
    font-size: 13px;
  }
}

/* ==========================================================================
   Helper classes
   ========================================================================== */

/*
 * Hide visually and from screen readers
 */

.hidden,
[hidden] {
  display: none !important;
}

/*
 * Hide only visually, but have it available for screen readers:
 * https://snook.ca/archives/html_and_css/hiding-content-for-accessibility
 *
 * 1. For long content, line feeds are not interpreted as spaces and small width
 *    causes content to wrap 1 word per line:
 *    https://medium.com/@jessebeach/beware-smushed-off-screen-accessible-text-5952a4c2cbfe
 */

.visually-hidden {
  border: 0;
  clip: rect(0, 0, 0, 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
  /* 1 */
}

/*
 * Extends the .visually-hidden class to allow the element
 * to be focusable when navigated to via the keyboard:
 * https://www.drupal.org/node/897638
 */

.visually-hidden.focusable:active,
.visually-hidden.focusable:focus {
  clip: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  position: static;
  white-space: inherit;
  width: auto;
}

/*
 * Hide visually and from screen readers, but maintain layout
 */

.invisible {
  visibility: hidden;
}

/*
 * Clearfix: contain floats
 *
 * The use of `table` rather than `block` is only necessary if using
 * `::before` to contain the top-margins of child elements.
 */

.clearfix::before,
.clearfix::after {
  content: "";
  display: table;
}

.clearfix::after {
  clear: both;
}

/* ==========================================================================
   EXAMPLE Media Queries for Responsive Design.
   These examples override the primary ('mobile first') styles.
   Modify as content requires.
   ========================================================================== */

@media only screen and (min-width: 35em) {
  /* Style adjustments for viewports that meet the condition */
}

@media print,
  (-webkit-min-device-pixel-ratio: 1.25),
  (min-resolution: 1.25dppx),
  (min-resolution: 120dpi) {
  /* Style adjustments for high resolution devices */
}

/* ==========================================================================
   Print styles.
   Inlined to avoid the additional HTTP request:
   https://www.phpied.com/delay-loading-your-print-css/
   ========================================================================== */

@media print {
  *,
  *::before,
  *::after {
    background: #fff !important;
    color: #000 !important;
    /* Black prints faster */
    box-shadow: none !important;
    text-shadow: none !important;
  }

  a,
  a:visited {
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
  }

  abbr[title]::after {
    content: " (" attr(title) ")";
  }

  /*
   * Don't show links that are fragment identifiers,
   * or use the `javascript:` pseudo protocol
   */
  a[href^="#"]::after,
  a[href^="javascript:"]::after {
    content: "";
  }

  pre {
    white-space: pre-wrap !important;
  }

  pre,
  blockquote {
    border: 1px solid #999;
    page-break-inside: avoid;
  }

  tr,
  img {
    page-break-inside: avoid;
  }

  p,
  h2,
  h3 {
    orphans: 3;
    widows: 3;
  }

  h2,
  h3 {
    page-break-after: avoid;
  }
}

/* 声音设计弹窗样式 */
.voice-design-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
}

.voice-design-content {
  background: white;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.voice-design-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #e0e0e0;
}

.voice-design-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.voice-design-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.voice-design-close:hover {
  background-color: #f5f5f5;
}

.voice-design-body {
  padding: 20px 24px;
  max-height: calc(80vh - 140px);
  overflow-y: auto;
}

.form-group {
  margin-bottom: 20px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: #333;
  font-size: 14px;
}

.form-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.form-input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.form-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  box-sizing: border-box;
}

.form-textarea:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.input-with-button {
  display: flex;
  gap: 8px;
  align-items: center;
}

.input-with-button .form-input {
  flex: 1;
  min-width: 100px;
}

.id-prefix-label {
  font-weight: 500;
  color: #333;
  font-size: 14px;
  white-space: nowrap;
  padding: 10px 0;
  display: flex;
  align-items: center;
}

.random-btn {
  padding: 10px 16px;
  background-color: #f8f9fa;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}

.random-btn:hover {
  background-color: #e9ecef;
  border-color: #adb5bd;
}

.voice-design-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px 20px;
  border-top: 1px solid #e0e0e0;
  background-color: #fafafa;
}

.submit-btn, .cancel-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.submit-btn {
  background-color: #007bff;
  color: white;
}

.submit-btn:hover {
  background-color: #0056b3;
}

.cancel-btn {
  background-color: #6c757d;
  color: white;
}

.cancel-btn:hover {
  background-color: #545b62;
}

/* PWA相关样式 */

/* 在线状态指示器 */
#online-status {
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  margin-right: 8px;
  transition: all 0.3s ease;
}

#online-status.online {
  background-color: rgba(40, 167, 69, 0.1);
  color: #28a745;
  border: 1px solid rgba(40, 167, 69, 0.2);
}

#online-status.offline {
  background-color: rgba(220, 53, 69, 0.1);
  color: #dc3545;
  border: 1px solid rgba(220, 53, 69, 0.2);
}

/* PWA安装按钮 */
.pwa-install-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 12px 20px;
  background: linear-gradient(135deg, #007bff, #0056b3);
  color: white;
  border: none;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
  z-index: 1000;
  transition: all 0.3s ease;
  animation: slideInUp 0.5s ease;
}

.pwa-install-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
  background: linear-gradient(135deg, #0056b3, #004085);
}

.pwa-install-btn:active {
  transform: translateY(0);
}

/* PWA更新通知 */
.pwa-update-notification {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
  z-index: 10000;
  animation: slideInDown 0.5s ease;
}

.update-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.update-content span {
  flex: 1;
  font-weight: 500;
}

.update-content button {
  margin-left: 10px;
  padding: 6px 12px;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

#update-app-btn {
  background-color: white;
  color: #28a745;
  font-weight: 500;
}

#update-app-btn:hover {
  background-color: #f8f9fa;
  transform: translateY(-1px);
}

#dismiss-update-btn {
  background-color: rgba(255, 255, 255, 0.2);
  color: white;
}

#dismiss-update-btn:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

/* PWA通用通知 */
.pwa-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 20px;
  border-radius: 8px;
  color: white;
  font-weight: 500;
  z-index: 9999;
  animation: slideInRight 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.pwa-notification-success {
  background: linear-gradient(135deg, #28a745, #20c997);
}

.pwa-notification-warning {
  background: linear-gradient(135deg, #ffc107, #fd7e14);
}

.pwa-notification-error {
  background: linear-gradient(135deg, #dc3545, #c82333);
}

.pwa-notification-info {
  background: linear-gradient(135deg, #17a2b8, #138496);
}

/* 动画效果 */
@keyframes slideInUp {
  from {
    transform: translateY(100px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideInDown {
  from {
    transform: translateY(-100px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideInRight {
  from {
    transform: translateX(100px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

/* PWA安装按钮脉冲动画 */
.pwa-install-btn {
  animation: slideInUp 0.5s ease, pulse 2s infinite 3s;
}

/* 响应式设计 - PWA样式 */
@media (max-width: 768px) {
  .pwa-install-btn {
    bottom: 15px;
    right: 15px;
    padding: 10px 16px;
    font-size: 13px;
  }

  .pwa-notification {
    top: 15px;
    right: 15px;
    left: 15px;
    font-size: 13px;
  }

  .update-content {
    padding: 10px 15px;
    flex-direction: column;
    text-align: center;
  }

  .update-content span {
    margin-bottom: 8px;
  }

  .update-content button {
    margin: 0 5px;
  }

  #online-status {
    font-size: 10px;
    padding: 3px 6px;
  }
}

@media (max-width: 480px) {
  .pwa-install-btn {
    bottom: 10px;
    right: 10px;
    padding: 8px 14px;
    font-size: 12px;
  }

  .pwa-notification {
    top: 10px;
    right: 10px;
    left: 10px;
    font-size: 12px;
  }
}

/* 音频播放器样式 */
.audio-player {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border: 1px solid #dee2e6;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  font-size: 12px;
  transition: all 0.3s ease;
  min-width: 180px;
}

.audio-player:hover {
  border-color: #007bff;
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
  transform: translateY(-1px);
}

.audio-play-btn {
  background: linear-gradient(135deg, #007bff, #0056b3);
  color: white;
  border: none;
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.audio-play-btn:hover {
  background: linear-gradient(135deg, #0056b3, #004085);
  transform: scale(1.05);
}

.audio-play-btn:active {
  transform: scale(0.95);
}

.audio-progress-container {
  width: 60px;
  height: 4px;
  background: #e9ecef;
  border-radius: 2px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.audio-progress-container:hover {
  background: #dee2e6;
}

.audio-progress {
  height: 100%;
  background: linear-gradient(90deg, #007bff, #28a745);
  border-radius: 2px;
  transition: width 0.1s ease;
  position: relative;
}

.audio-progress::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 6px;
  height: 6px;
  background: #007bff;
  border-radius: 50%;
  box-shadow: 0 0 4px rgba(0, 123, 255, 0.5);
}

.audio-time {
  font-size: 11px;
  color: #6c757d;
  min-width: 70px;
  font-weight: 500;
  font-family: 'Monaco', 'Menlo', monospace;
}

/* 响应式音频播放器 */
@media (max-width: 768px) {
  .audio-player {
    min-width: 160px;
    padding: 5px 8px;
    gap: 6px;
  }
  
  .audio-progress-container {
    width: 50px;
  }
  
  .audio-time {
    font-size: 10px;
    min-width: 65px;
  }
}

@media (max-width: 480px) {
  .audio-player {
    min-width: 140px;
    padding: 4px 6px;
    gap: 4px;
  }
  
  .audio-progress-container {
    width: 40px;
  }
  
  .audio-time {
    font-size: 9px;
    min-width: 60px;
  }
}

