/* 现代小说阅读器样式 */
:root {
  --reading-font-size: 18px;
  --reading-line-height: 2;
  --transition-duration: 0.3s;
}

/* 全局样式 */
body {
  font-family: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  transition: background-color var(--transition-duration);
}

/* 导航栏毛玻璃效果 */
.navbar {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all var(--transition-duration);
}

/* 阅读内容样式优化 */
.reading-content {
  font-size: var(--reading-font-size);
  line-height: var(--reading-line-height);
  font-family: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', serif;
}

.reading-content p {
  margin-bottom: 1.5em;
  text-indent: 2em;
  transition: all 0.2s ease;
}

/* 标题样式优化 */
.card-title {
  font-weight: 700;
  letter-spacing: 0.025em;
}

#chapter-title {
  font-weight: 800;
  letter-spacing: 0.05em;
  color: hsl(var(--p));
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#novel-title {
  font-weight: 800;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, hsl(var(--p)) 0%, hsl(var(--s)) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 现代按钮样式 */
.btn {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 12px;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

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

.btn-lg {
  border-radius: 16px;
  padding: 1rem 2rem;
  font-weight: 600;
}

/* 卡片样式优化 */
.card {
  border-radius: 16px;
  transition: all 0.3s ease;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

/* 特性卡片悬停效果 */
.feature-card {
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.feature-card:hover::before {
  left: 100%;
}

/* 文件上传区域样式 */
.file-upload-area {
  border: 2px dashed hsl(var(--p) / 0.3);
  border-radius: 20px;
  transition: all 0.3s ease;
  background: hsl(var(--b1) / 0.5);
}

.file-upload-area:hover {
  border-color: hsl(var(--p));
  background: hsl(var(--b1) / 0.8);
  transform: scale(1.02);
}

/* 导航菜单项样式 */
.nav-item {
  position: relative;
  padding: 0.75rem 1.5rem;
  border-radius: 12px;
  transition: all 0.3s ease;
}

.nav-item::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, hsl(var(--p)) 0%, hsl(var(--s)) 100%);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.nav-item.active::after {
  width: 80%;
}

.nav-item:hover::after {
  width: 60%;
}

/* 阅读进度条美化 */
.progress-primary {
  border-radius: 10px;
  height: 8px;
  overflow: hidden;
}

.progress-primary::-webkit-progress-bar {
  background: hsl(var(--b3));
  border-radius: 10px;
}

.progress-primary::-webkit-progress-value {
  background: linear-gradient(90deg, hsl(var(--p)) 0%, hsl(var(--s)) 100%);
  border-radius: 10px;
  transition: width 0.3s ease;
}

.progress-primary::-moz-progress-bar {
  background: linear-gradient(90deg, hsl(var(--p)) 0%, hsl(var(--s)) 100%);
  border-radius: 10px;
}

/* 章节列表样式优化 */
.chapter-item {
  padding: 1rem 1.5rem;
  border-radius: 12px;
  transition: all 0.3s ease;
  margin: 0.25rem 0;
  border-left: 4px solid transparent;
}

.chapter-item:hover {
  background: hsl(var(--b2));
  transform: translateX(8px);
  border-left-color: hsl(var(--p));
}

.chapter-item.active {
  background: linear-gradient(135deg, hsl(var(--p) / 0.1) 0%, hsl(var(--s) / 0.1) 100%);
  border-left-color: hsl(var(--p));
  color: hsl(var(--p));
  font-weight: 600;
}

/* 小说列表项样式 */
.novel-list-item {
  transition: all 0.3s ease;
  border-radius: 16px;
  padding: 1.5rem;
  background: hsl(var(--b1));
  border: 1px solid hsl(var(--b3));
}

.novel-list-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
  border-color: hsl(var(--p));
  background: hsl(var(--b2));
}

/* 空状态样式 */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: linear-gradient(135deg, hsl(var(--b2)) 0%, hsl(var(--b3)) 100%);
  border-radius: 20px;
  border: 2px dashed hsl(var(--bc) / 0.2);
}

.empty-state .empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.7;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

/* 加载动画 */
.loading-spinner {
  animation: spin 1s linear infinite;
}

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

/* 模态框样式优化 */
.modal-box {
  border-radius: 20px;
  border: 1px solid hsl(var(--b3));
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

/* Toast 通知美化 */
.toast-notification {
  border-radius: 12px;
  border: 1px solid hsl(var(--b3));
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  animation: slideInRight 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* 头像样式 */
.avatar {
  transition: all 0.3s ease;
}

.avatar:hover {
  transform: scale(1.1);
  box-shadow: 0 0 0 3px hsl(var(--p) / 0.3);
}

/* 图标动画 */
.fas {
  transition: transform 0.3s ease;
}

.btn:hover .fas {
  transform: scale(1.2);
}

/* 渐变文字效果 */
.gradient-text {
  background: linear-gradient(135deg, hsl(var(--p)) 0%, hsl(var(--s)) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 响应式设计优化 */
@media (max-width: 768px) {
  :root {
    --reading-font-size: 16px;
    --reading-line-height: 1.8;
  }
  
  .hero-content h1 {
    font-size: 2.5rem !important;
  }
  
  .hero-content p {
    font-size: 1.1rem !important;
  }
  
  .card {
    border-radius: 12px;
  }
  
  .btn-lg {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
  }
  
  .nav-item {
    padding: 0.5rem 1rem;
    border-radius: 8px;
  }
}

@media (max-width: 640px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .hero {
    padding: 2rem 1rem !important;
    border-radius: 16px !important;
  }
  
  .grid-cols-1 {
    grid-template-columns: 1fr;
  }
  
  .flex-col {
    flex-direction: column;
  }
}

/* 暗黑模式优化 */
[data-theme="dark"] {
  --reading-font-size: 17px;
}

[data-theme="dark"] .card {
  background: hsl(var(--b2));
  border-color: hsl(var(--b3));
}

[data-theme="dark"] .novel-list-item {
  background: hsl(var(--b2));
  border-color: hsl(var(--b3));
}

[data-theme="dark"] .file-upload-area {
  background: hsl(var(--b2) / 0.5);
  border-color: hsl(var(--p) / 0.3);
}

[data-theme="dark"] .file-upload-area:hover {
  background: hsl(var(--b2) / 0.8);
  border-color: hsl(var(--p));
}

[data-theme="dark"] .empty-state {
  background: linear-gradient(135deg, hsl(var(--b3)) 0%, hsl(var(--b4)) 100%);
  border-color: hsl(var(--bc) / 0.1);
}

/* 滚动条美化 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: hsl(var(--b2));
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: hsl(var(--b3));
  border-radius: 4px;
  transition: background 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
  background: hsl(var(--bc) / 0.4);
}

/* 选择文本样式 */
::selection {
  background: hsl(var(--p) / 0.3);
  color: hsl(var(--pc));
}

::-moz-selection {
  background: hsl(var(--p) / 0.3);
  color: hsl(var(--pc));
}

/* 聚焦状态 */
button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 2px solid hsl(var(--p));
  outline-offset: 2px;
  border-radius: 4px;
}

/* 动画工具类 */
.fade-in {
  animation: fadeIn 0.6s ease-out;
}

.slide-up {
  animation: slideUp 0.6s ease-out;
}

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

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

/* 页面切换动画 */
.page-content {
  animation: fadeIn 0.4s ease-out;
}

/* 阅读体验优化 */
.reading-content h1,
.reading-content h2,
.reading-content h3,
.reading-content h4,
.reading-content h5,
.reading-content h6 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: hsl(var(--p));
  font-weight: 700;
}

.reading-content blockquote {
  border-left: 4px solid hsl(var(--p));
  padding-left: 1.5rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: hsl(var(--bc) / 0.8);
  background: hsl(var(--b2));
  padding: 1rem 1.5rem;
  border-radius: 0 8px 8px 0;
}

/* 编辑器全屏模式样式 */
#editor-page.fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1000;
  background: hsl(var(--b1));
  margin: 0;
  padding: 1rem;
  overflow: hidden;
}

#editor-page.fullscreen .card {
  height: 100%;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
}

#editor-page.fullscreen .card-body {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 1rem;
}

#editor-page.fullscreen .editor-toolbar {
  margin-bottom: 1rem;
  padding: 0.5rem;
  background: hsl(var(--b2));
  border-radius: 8px;
}

#editor-page.fullscreen .grid {
  flex: 1;
  display: flex;
  gap: 1rem;
  height: calc(100% - 120px);
}

#editor-page.fullscreen .lg\\:col-span-1 {
  height: 100%;
  display: flex;
  flex-direction: column;
}

#editor-page.fullscreen #markdown-editor {
  flex: 1;
  height: 100%;
  resize: none;
  font-size: 16px;
  line-height: 1.6;
}

#editor-page.fullscreen #markdown-preview {
  flex: 1;
  height: 100%;
  overflow-y: auto;
}

#editor-page.fullscreen .flex.justify-end {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid hsl(var(--b3));
}

/* 全屏模式下的响应式调整 */
@media (max-width: 1024px) {
  #editor-page.fullscreen .grid {
    flex-direction: column;
  }
  
  #editor-page.fullscreen .lg\\:col-span-1 {
    height: 50%;
  }
}

/* 全屏模式下的滚动条优化 */
#editor-page.fullscreen ::-webkit-scrollbar {
  width: 6px;
}

#editor-page.fullscreen ::-webkit-scrollbar-thumb {
  background: hsl(var(--b3));
}

#editor-page.fullscreen ::-webkit-scrollbar-thumb:hover {
  background: hsl(var(--bc) / 0.4);
}
