/* 现代化个人日记本样式 */
:root {
  --primary: #4361ee;
  --secondary: #476652;
  --success: #4cc9f0;
  --danger: #f72585;
  --warning: #f8961e;
  --info: #4895ef;
  --light: #f8f9fa;
  --dark: #212529;
  --gray: #6c757d;
  --light-gray: #e9ecef;
  --white: #ffffff;
  --shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 4px 6px rgba(0, 0, 0, 0.1);
  --radius: 8px;
  --transition: all 0.3s ease;
}

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

body {
  font-family: "Microsoft YaHei", "微软雅黑", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--dark);
  background: #f8f9fa;
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* 头部样式 */
header {
  background: white;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.logo {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
}

.logo i {
  margin-right: 10px;
  font-size: 1.8rem;
}

/* 主内容区 */
main {
  padding: 2rem 0;
  min-height: calc(100vh - 140px);
}

/* 卡片样式 */
.card {
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  transition: var(--transition);
  border: 1px solid rgba(0,0,0,0.05);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
  flex-wrap: wrap;
}

.card-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--dark);
  margin: 0;
}

/* 桌面端导航 */
.desktop-nav ul {
  display: flex;
  list-style: none;
}

.desktop-nav ul li {
  margin-left: 1.2rem;
}

.desktop-nav ul li a {
  color: var(--dark);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  display: flex;
  align-items: center;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
}

.desktop-nav ul li a i {
  margin-right: 6px;
}

.desktop-nav ul li a:hover, .desktop-nav ul li a.active {
  background: var(--primary);
  color: white;
}

/* 移动端菜单按钮 */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.3rem;
  color: var(--dark);
  cursor: pointer;
  padding: 0.4rem;
  border-radius: var(--radius);
  transition: var(--transition);
  z-index: 1001;
}

.mobile-menu-btn:hover {
  background: var(--light);
}

/* 移动端导航 */
.mobile-nav {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  z-index: 1000;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: var(--transition);
  opacity: 0;
  transform: translateY(-100%);
}

.mobile-nav.active {
  opacity: 1;
  transform: translateY(0);
}

.mobile-nav-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 1.3rem;
  color: var(--dark);
  cursor: pointer;
  padding: 0.4rem;
  border-radius: var(--radius);
}

.mobile-nav ul {
  list-style: none;
  text-align: center;
}

.mobile-nav ul li {
  margin: 1.2rem 0;
}

.mobile-nav ul li a {
  color: var(--dark);
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius);
  transition: var(--transition);
}

.mobile-nav ul li a i {
  margin-right: 8px;
  font-size: 1.2rem;
}

.mobile-nav ul li a:hover, .mobile-nav ul li a.active {
  background: var(--primary);
  color: white;
}

/* 按钮样式 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.5rem;
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
  box-shadow: var(--shadow);
  font-family: "Microsoft YaHei", "微软雅黑", sans-serif;
}

.btn i {
  margin-right: 6px;
}

.btn:hover {
  background-color: var(--secondary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-primary {
  background-color: var(--primary);
}

.btn-secondary {
  background-color: var(--secondary);
}

.btn-success {
  background-color: var(--success);
}

.btn-danger {
  background-color: var(--danger);
}

.btn-warning {
  background-color: var(--warning);
}

.btn-outline {
  background-color: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-outline:hover {
  background-color: var(--primary);
  color: white;
}

.btn-block {
  display: block;
  width: 100%;
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
}

.btn-responsive {
  padding: 0.6rem 1.2rem;
  font-size: 0.9rem;
  white-space: nowrap;
}

/* 消息提示 */
.alert {
  padding: 0.8rem;
  border-radius: var(--radius);
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  font-size: 0.9rem;
}

.alert i {
  margin-right: 8px;
  font-size: 1.1rem;
}

.alert-success {
  background-color: rgba(76, 201, 240, 0.1);
  color: #0c5460;
  border: 1px solid rgba(76, 201, 240, 0.2);
}

.alert-error {
  background-color: rgba(247, 37, 133, 0.1);
  color: #721c24;
  border: 1px solid rgba(247, 37, 133, 0.2);
}

.alert-info {
  background-color: rgba(67, 97, 238, 0.1);
  color: #0c5460;
  border: 1px solid rgba(67, 97, 238, 0.2);
}

/* 表单样式 */
.form-group {
  margin-bottom: 1.2rem;
}

.form-label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 500;
  color: var(--dark);
  font-size: 0.95rem;
}

.form-control {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--light-gray);
  border-radius: var(--radius);
  font-size: 0.95rem;
  transition: var(--transition);
  background: rgba(255, 255, 255, 0.8);
  font-family: "Microsoft YaHei", "微软雅黑", sans-serif;
}

.form-control:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.2);
  background: white;
}

/* 日记网格布局 */
.diary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.diary-card {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
}

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

.diary-media {
  width: 100%;
  height: 200px;
  overflow: hidden;
  border-bottom: 1px solid #eee;
  background: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
}

.diary-media img,
.diary-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 1rem;
  background: #f8f9fa;
  color: #6c757d;
}

.file-icon i {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.file-icon span {
  font-size: 0.9rem;
  text-align: center;
  word-break: break-all;
}

.diary-content {
  padding: 1rem;
}

.diary-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.5rem 0;
  color: #333;
  line-height: 1.3;
}

.diary-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
  color: #666;
}

.diary-date {
  font-weight: 500;
}

.mood-weather-icon {
  font-size: 0.9rem;
}

.diary-excerpt {
  color: #555;
  line-height: 1.4;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-indent: 0;
  white-space: normal;
}

.diary-actions {
  display: flex;
  gap: 0.5rem;
  border-top: 1px solid #f0f0f0;
  padding-top: 0.75rem;
}

.diary-actions .btn {
  flex: 1;
  text-align: center;
  padding: 0.4rem 0.5rem;
  font-size: 0.8rem;
}

/* 心情和天气图标 */
.mood-weather-icons {
  display: flex;
  gap: 0.5rem;
  margin: 0.5rem 0;
}

.mood-icon, .weather-icon {
  font-size: 1.1rem;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--gray);
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  opacity: 0.3;
  color: var(--primary);
}

.empty-state h3 {
  margin-bottom: 1rem;
  color: var(--dark);
  font-size: 1.5rem;
}

.empty-state p {
  margin-bottom: 2rem;
  font-size: 1rem;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.empty-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

/* 页脚样式 */
footer {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  text-align: center;
  padding: 1rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.85rem;
}

/* 悬浮底部导航 */
.floating-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid #e0e0e0;
  box-shadow: 0 -1px 5px rgba(0, 0, 0, 0.1);
  z-index: 999;
  padding: 6px 0;
}

.floating-nav {
  display: flex;
  justify-content: space-around;
  align-items: center;
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.floating-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: #666;
  padding: 4px 6px;
  border-radius: 6px;
  transition: all 0.3s ease;
  flex: 0 0 auto;
  min-width: 50px;
  max-width: 70px;
  font-size: 0.8rem;
}

.floating-nav-item i {
  font-size: 16px;
  margin-bottom: 2px;
}

.floating-nav-item span {
  font-size: 10px;
  font-weight: 500;
  text-align: center;
  line-height: 1.2;
}

.floating-nav-item:hover {
  color: #4361ee;
  background: #f8f9ff;
}

.floating-nav-item.active {
  color: #4361ee;
  background: #eef2ff;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .header-content {
    flex-direction: row;
    text-align: center;
  }
  
  /* 隐藏桌面导航 */
  .desktop-nav {
    display: none !important;
  }
  
  /* 显示移动菜单按钮 */
  .mobile-menu-btn {
    display: block !important;
  }
  
  /* 显示移动导航 */
  .mobile-nav {
    display: flex;
  }
  
  /* 响应式按钮样式 */
  .btn-responsive {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
  }
  
  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
  }
  
  .card-header .btn-responsive {
    align-self: stretch;
    text-align: center;
  }
  
  .diary-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .diary-media {
    height: 160px;
  }
  
  .diary-actions {
    flex-direction: column;
  }
  
  .diary-actions .btn {
    width: 100%;
  }
  
  main {
    padding-bottom: 70px;
  }
}

@media (max-width: 480px) {
  .btn-responsive {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }
  
  .diary-media {
    height: 140px;
  }
  
  .floating-nav-item {
    min-width: 40px;
    padding: 2px 3px;
  }
  
  .floating-nav-item i {
    font-size: 13px;
  }
  
  .floating-nav-item span {
    font-size: 8px;
  }
  
  .floating-footer {
    padding: 4px 0;
  }
  
  main {
    padding-bottom: 60px;
  }
}

@media (min-width: 769px) {
  /* 桌面端显示桌面导航，隐藏移动导航 */
  .desktop-nav {
    display: block;
  }
  
  .mobile-menu-btn {
    display: none;
  }
  
  .mobile-nav {
    display: none;
  }
}

/* 加载动画 */
.loading {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
}

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

/* 认证页面样式 */
.auth-container {
  max-width: 400px;
  margin: 1.5rem auto;
  padding: 1.5rem;
}

.auth-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 2rem;
  text-align: center;
}

.auth-header {
  margin-bottom: 1.5rem;
}

.auth-header h1 {
  color: var(--primary);
  margin-bottom: 0.4rem;
  font-size: 1.6rem;
}

.auth-header p {
  color: var(--gray);
  font-size: 0.9rem;
}

.auth-footer {
  text-align: center;
  margin-top: 1.2rem;
  font-size: 0.9rem;
}

.auth-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.auth-footer a:hover {
  text-decoration: underline;
}

/* 文件上传样式 */
.file-upload {
  position: relative;
  overflow: hidden;
  display: inline-block;
  width: 100%;
}

.file-upload-input {
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.file-upload-label {
  display: block;
  padding: 1.2rem;
  background-color: rgba(248, 249, 250, 0.5);
  border: 2px dashed #dee2e6;
  border-radius: var(--radius);
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.9rem;
}

.file-upload-label:hover {
  background-color: rgba(233, 236, 239, 0.7);
  border-color: var(--primary);
}

.file-preview {
  margin-top: 0.8rem;
  text-align: center;
}

.file-preview img,
.file-preview video {
  max-width: 100%;
  max-height: 250px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* 编辑器样式 */
.editor-container {
  margin-bottom: 0.8rem;
}

#editor {
  height: 350px;
  border: 1px solid #ddd;
  border-radius: 5px;
}

.ql-editor {
  font-family: "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

.ql-toolbar {
  border-top-left-radius: 5px;
  border-top-right-radius: 5px;
  border-bottom: 1px solid #ddd;
}

.ql-container {
  border-bottom-left-radius: 5px;
  border-bottom-right-radius: 5px;
}

/* 日记详情页样式 */
.entry-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.entry-title {
  color: #333;
  margin: 0;
  flex: 1;
  font-size: 1.5rem;
}

.entry-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.diary-date {
  color: #666;
  font-size: 0.85rem;
  margin-bottom: 1.2rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid #eee;
}

.diary-content {
  line-height: 1.6;
  font-size: 0.95rem;
  color: #333;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.diary-content h1,
.diary-content h2,
.diary-content h3,
.diary-content h4,
.diary-content h5,
.diary-content h6 {
  color: #4361ee;
  margin-top: 1.2rem;
  margin-bottom: 0.4rem;
}

.diary-content p {
  margin-bottom: 0.8rem;
}

.diary-content ul,
.diary-content ol {
  margin-bottom: 0.8rem;
  padding-left: 1.5rem;
}

.diary-content blockquote {
  border-left: 3px solid #4361ee;
  padding-left: 0.8rem;
  margin: 0.8rem 0;
  color: #666;
  font-style: italic;
}

.diary-content code {
  background: #f4f4f4;
  padding: 0.15rem 0.3rem;
  border-radius: 3px;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
}

.diary-content pre {
  background: #f8f9fa;
  padding: 0.8rem;
  border-radius: 4px;
  overflow-x: auto;
  margin: 0.8rem 0;
  font-size: 0.85rem;
}

.back-button {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1.2rem;
  border-top: 1px solid #eee;
}

/* 心情和天气选择器样式 */
.mood-weather-container {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.mood-weather-container > div {
  flex: 1;
  min-width: 140px;
}

.mood-weather-select {
  width: 100%;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.9rem;
  background-color: white;
  transition: var(--transition);
  font-family: "Microsoft YaHei", "微软雅黑", sans-serif;
}

.mood-weather-select:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.2);
}

/* 安全区域适配（iPhone X等有刘海的设备） */
@supports (padding: max(0px)) {
  @media (max-width: 768px) {
    main {
      padding-left: max(0px, env(safe-area-inset-left));
      padding-right: max(0px, env(safe-area-inset-right));
      padding-bottom: max(80px, env(safe-area-inset-bottom));
    }
  }
}

/* 高性能动画优化 */
@media (prefers-reduced-motion: no-preference) {
  .diary-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
  }
  
  .diary-media img {
    transition: transform 0.3s ease;
  }
}
/* 现代化日记列表布局 */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    padding: 0 0.5rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dark);
    margin: 0 0 0.25rem 0;
}

.user-subtitle {
    color: var(--gray);
    margin: 0;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.user-subtitle i {
    color: #12B7F5;
}

.header-actions {
    flex-shrink: 0;
}

/* 日记列表布局 */
.diary-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.diary-item {
    background: white;
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #eaeaea;
    transition: all 0.2s ease;
    display: flex;
    overflow: hidden;
}

.diary-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.diary-image {
    width: 120px;
    min-width: 120px;
    height: 120px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    flex-shrink: 0;
}

.diary-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.diary-item:hover .diary-image img {
    transform: scale(1.05);
}

.no-image {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
    padding: 1rem;
    text-align: center;
    width: 100%;
    height: 100%;
}

.no-image i {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    opacity: 0.7;
}

.no-image span {
    font-size: 0.8rem;
}

.diary-content {
    flex: 1;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    min-width: 0; /* 防止内容溢出 */
}

.diary-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.5rem;
    gap: 1rem;
}

.diary-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark);
    margin: 0;
    line-height: 1.3;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.diary-date {
    color: var(--gray);
    font-size: 0.85rem;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mood-icon, .weather-icon {
    font-size: 1rem;
}

.diary-excerpt {
    color: var(--gray);
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    flex: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.diary-actions {
    display: flex;
    gap: 0.5rem;
}

.diary-actions .btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.empty-icon {
    font-size: 3rem;
    color: var(--primary);
    opacity: 0.3;
    margin-bottom: 1rem;
}

.empty-state h3 {
    margin-bottom: 0.5rem;
    color: var(--dark);
    font-size: 1.3rem;
}

.empty-state p {
    margin-bottom: 1.5rem;
    color: var(--gray);
    font-size: 0.95rem;
}

.empty-actions .btn {
    padding: 0.6rem 1.2rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        padding: 0;
    }
    
    .header-actions {
        align-self: stretch;
    }
    
    .header-actions .btn {
        width: 100%;
        justify-content: center;
    }
    
    .diary-item {
        flex-direction: column;
    }
    
    .diary-image {
        width: 100%;
        height: 160px;
        min-width: auto;
    }
    
    .diary-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .diary-date {
        justify-content: space-between;
    }
    
    .diary-actions {
        justify-content: space-between;
    }
    
    .diary-actions .btn {
        flex: 1;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .diary-image {
        height: 140px;
    }
    
    .diary-content {
        padding: 0.75rem;
    }
    
    .diary-title {
        font-size: 1rem;
    }
    
    .diary-excerpt {
        font-size: 0.85rem;
    }
    
    .diary-actions .btn {
        padding: 0.35rem 0.6rem;
        font-size: 0.75rem;
    }
    
    .empty-state {
        padding: 2rem 1rem;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .diary-item:hover {
        transform: none;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }
    
    .diary-item:active {
        transform: scale(0.98);
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    }
    
    .diary-actions .btn {
        min-height: 44px;
    }
}/* 单列布局样式 */
.single-column-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.single-column-item {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #eaeaea;
    transition: all 0.2s ease;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.single-column-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

/* 左侧图片区域 - 单行 */
.diary-media-single {
    width: 60px;
    height: 60px;
    min-width: 60px;
    border-radius: 6px;
    overflow: hidden;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.diary-media-single img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #adb5bd;
}

.media-fallback i {
    font-size: 1.25rem;
    opacity: 0.7;
}

/* 右侧内容区域 */
.diary-content-single {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
}

.content-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.first-row {
    align-items: flex-start;
}

.second-row {
    align-items: flex-end;
}

.diary-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark);
    margin: 0;
    line-height: 1.3;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.diary-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--gray);
    white-space: nowrap;
    flex-shrink: 0;
}

.diary-date {
    font-weight: 500;
}

.mood-icon, .weather-icon {
    font-size: 0.9rem;
}

.diary-excerpt {
    color: var(--gray);
    font-size: 0.9rem;
    line-height: 1.4;
    flex: 1;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    margin: 0;
}

.diary-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.diary-actions .btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    white-space: nowrap;
}

/* 搜索样式 */
.search-section {
    margin-bottom: 1.5rem;
}

.search-form {
    width: 100%;
}

.search-box {
    display: flex;
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(67, 97, 238, 0.2);
}

.search-input {
    flex: 1;
    border: none;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    background: transparent;
    outline: none;
    color: var(--dark);
}

.search-btn {
    background: var(--primary);
    border: none;
    padding: 0 1rem;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 50px;
    transition: background-color 0.3s ease;
}

.search-btn:hover {
    background: var(--secondary);
}

.search-status {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-top: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    border-left: 4px solid var(--primary);
}

.search-info {
    color: var(--gray);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-keyword {
    color: var(--primary);
    font-weight: 600;
    background: rgba(67, 97, 238, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

/* 分页控件 */
.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    flex-wrap: wrap;
    gap: 1rem;
}

.pagination-info {
    color: var(--gray);
    font-size: 0.9rem;
}

.pagination-settings {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.per-page-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.per-page-form label {
    color: var(--gray);
    font-size: 0.9rem;
}

.per-page-form select {
    padding: 0.4rem 0.8rem;
    border: 1px solid #e1e5e9;
    border-radius: 4px;
    background: white;
    font-size: 0.9rem;
}

/* 分页导航 */
.pagination-nav {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.75rem;
    background: white;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    color: var(--dark);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    min-width: 2.5rem;
}

.page-link:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.page-link.current {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.page-link.prev,
.page-link.next {
    padding: 0.5rem 1rem;
    font-weight: 500;
}

.page-dots {
    padding: 0.5rem 0.25rem;
    color: var(--gray);
}

/* 搜索高亮 */
.search-highlight {
    background: #fff3cd;
    padding: 0.1em 0.2em;
    border-radius: 3px;
    font-weight: bold;
    color: #856404;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .single-column-item {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .diary-media-single {
        width: 100%;
        height: 120px;
        min-width: auto;
    }
    
    .content-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .diary-title {
        white-space: normal;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        display: -webkit-box;
        overflow: hidden;
    }
    
    .diary-meta {
        justify-content: space-between;
    }
    
    .diary-actions {
        justify-content: space-between;
    }
    
    .diary-actions .btn {
        flex: 1;
        justify-content: center;
    }
    
    .pagination-controls {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: 0.75rem;
    }
    
    .search-status {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .single-column-item {
        padding: 0.75rem;
    }
    
    .diary-media-single {
        height: 100px;
    }
    
    .diary-actions .btn {
        padding: 0.35rem 0.6rem;
        font-size: 0.75rem;
    }
    
    .pagination {
        gap: 0.25rem;
    }
    
    .page-link {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
        min-width: 2rem;
    }
    
    .page-link.prev,
    .page-link.next {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
    }
}
// 初始化 Quill 编辑器
document.addEventListener('DOMContentLoaded', function() {
    var quill = new Quill('#editor-container', {
        modules: {
            toolbar: [
                [{ 'header': [1, 2, 3, false] }],
                ['bold', 'italic', 'underline', 'strike'],
                [{ 'color': [] }, { 'background': [] }],
                [{ 'list': 'ordered'}, { 'list': 'bullet' }],
                [{ 'align': [] }],
                ['link', 'image'],
                ['clean']
            ]
        },
        placeholder: '写下您的日记内容...',
        theme: 'snow'
    });

    // 自定义图片处理 - 使用文件上传字段
    var toolbar = quill.getModule('toolbar');
    toolbar.addHandler('image', function() {
        // 触发文件上传输入框
        document.getElementById('media').click();
        
        // 监听文件选择
        document.getElementById('media').addEventListener('change', function(e) {
            var file = e.target.files[0];
            if (file && file.type.startsWith('image/')) {
                var reader = new FileReader();
                reader.onload = function(e) {
                    // 在光标位置插入图片
                    var range = quill.getSelection();
                    quill.insertEmbed(range.index, 'image', e.target.result);
                    
                    // 重新初始化图片查看器
                    initImagePreview();
                };
                reader.readAsDataURL(file);
                
                // 重置文件输入，允许选择同一文件
                this.value = '';
            }
        }, { once: true });
    });

    // 初始化图片预览功能
    function initImagePreview() {
        // 为编辑器中的图片添加查看器
        const editorImages = document.querySelectorAll('.ql-editor img');
        if (editorImages.length > 0) {
            const viewer = new Viewer(document.querySelector('.ql-editor'), {
                toolbar: {
                    zoomIn: 1,
                    zoomOut: 1,
                    oneToOne: 1,
                    reset: 1,
                    prev: 1,
                    play: 0,
                    next: 1,
                    rotateLeft: 1,
                    rotateRight: 1,
                    flipHorizontal: 1,
                    flipVertical: 1,
                },
                title: false,
                keyboard: true,
                movable: true,
                zoomable: true,
                rotatable: true,
                scalable: true,
                transition: true,
                fullscreen: true,
                loop: true
            });
        }
    }
    /* 图片查看器优化样式 */
.diary-image-view {
    cursor: zoom-in;
    transition: transform 0.3s ease;
    max-width: 100%;
    height: auto;
}

.diary-image-view:hover {
    transform: scale(1.02);
}

/* 触摸设备优化 */
.touch-device .diary-image-view {
    cursor: pointer;
}

/* 图片查看器工具栏样式优化 */
.viewer-container .viewer-toolbar {
    background: rgba(0, 0, 0, 0.8) !important;
    border-radius: 20px !important;
    padding: 8px 16px !important;
    backdrop-filter: blur(10px) !important;
}

.viewer-container .viewer-toolbar > ul > li {
    margin: 0 4px !important;
}

.viewer-container .viewer-toolbar > ul > li > button {
    background: transparent !important;
    border: none !important;
    color: white !important;
    font-size: 16px !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background-color 0.3s ease !important;
}

.viewer-container .viewer-toolbar > ul > li > button:hover {
    background: rgba(255, 255, 255, 0.2) !important;
}

.viewer-container .viewer-title {
    color: white !important;
    font-size: 14px !important;
    text-align: center !important;
}

/* 移动端响应式调整 */
@media (max-width: 768px) {
    .viewer-container .viewer-toolbar {
        bottom: 20px !important;
        transform: none !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: auto !important;
    }
    
    .viewer-container .viewer-toolbar > ul > li {
        margin: 0 2px !important;
    }
    
    .viewer-container .viewer-toolbar > ul > li > button {
        width: 32px !important;
        height: 32px !important;
        font-size: 14px !important;
    }
    
    .viewer-container .viewer-title {
        font-size: 12px !important;
        max-width: 80vw !important;
    }
}

/* 安全区域适配（iPhone X等有刘海的设备） */
@supports (padding: max(0px)) {
    .viewer-container .viewer-toolbar {
        padding-bottom: max(8px, env(safe-area-inset-bottom)) !important;
    }
}

/* 高性能动画优化 */
@media (prefers-reduced-motion: no-preference) {
    .diary-image-view {
        transition: transform 0.2s ease;
    }
}

/* 暗色模式支持 */
@media (prefers-color-scheme: dark) {
    .viewer-container .viewer-toolbar {
        background: rgba(0, 0, 0, 0.9) !important;
    }
}
@media (max-width: 480px) {
    .diary-actions {
        display: flex !important;
        width: 100% !important;
        gap: 0 !important; /* 去掉gap，用margin */
    }
    
    .diary-actions .btn {
        width: 33.33% !important;
        margin: 0 3px !important; /* 左右各3px，第一个和最后一个可以特殊处理，或者用容器负margin */
        padding: 8px 4px !important;
        font-size: 0.75rem !important;
        justify-content: center !important;
        text-align: center !important;
        min-height: 44px !important;
        display: flex !important;
        align-items: center !important;
        box-sizing: border-box !important;
    }
    
    /* 第一个按钮左边距为0，最后一个按钮右边距为0 */
    .diary-actions .btn:first-child {
        margin-left: 0 !important;
    }
    
    .diary-actions .btn:last-child {
        margin-right: 0 !important;
    }
}
/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* 容器样式 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* 认证页面样式 */
.auth-container {
    max-width: 400px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 2rem;
}

.auth-header p {
    color: #7f8c8d;
    font-size: 1.1rem;
}

.card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    margin-bottom: 1.5rem;
}

/* 表单样式 */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #495057;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #4361ee;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 0.5rem;
}

.btn-block {
    width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #4361ee, #3a56d4);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(67, 97, 238, 0.3);
}

.btn-outline {
    background: white;
    color: #495057;
    border: 2px solid #e9ecef;
}

.btn-outline:hover {
    border-color: #4361ee;
    color: #4361ee;
}

/* 警告框 */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-left-color: #dc3545;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    animation: modalSlideIn 0.3s ease;
    max-width: 500px;
    width: 95%;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.8rem 2rem 0;
}

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #f8f9fa;
    color: #495057;
    transform: rotate(90deg);
}

.modal-body {
    padding: 1.5rem 2rem;
}

.modal-footer {
    padding: 0 2rem 2rem;
    text-align: center;
}

/* 扫码登录特定样式 */
.wide-modal {
    max-width: 500px;
}

.scan-container {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.qrcode-section {
    flex: 1;
    text-align: center;
}

.qrcode-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 1.5rem;
    border: 2px solid #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

#qrcodeCanvas {
    border-radius: 8px;
    width: 220px !important;
    height: 220px !important;
}

.scan-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.scan-overlay.active {
    display: flex;
}

.success-icon {
    font-size: 3rem;
    color: #28a745;
    margin-bottom: 0.5rem;
}

.overlay-content p {
    color: #28a745;
    font-weight: 600;
    margin: 0;
    font-size: 1.2rem;
}

.scan-instructions {
    text-align: left;
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid #4361ee;
}

.scan-instructions h4 {
    margin: 0 0 1rem 0;
    color: #2c3e50;
    font-size: 1.2rem;
}

.scan-instructions ol {
    margin: 0;
    padding-left: 1.2rem;
    color: #495057;
    font-size: 1rem;
}

.scan-instructions li {
    margin-bottom: 0.8rem;
    line-height: 1.5;
}

.scan-instructions strong {
    color: #4361ee;
}

.scan-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    padding: 1.2rem;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    margin-top: 1.5rem;
}

.status-info {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-weight: 500;
    font-size: 1rem;
}

.status-info i {
    color: #4361ee;
    font-size: 1.2rem;
}

.status-info.success {
    color: #28a745;
}

.status-info.success i {
    color: #28a745;
}

.status-info.error {
    color: #dc3545;
}

.status-info.error i {
    color: #dc3545;
}

.timer {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: #6c757d;
    font-size: 1rem;
}

.timer strong {
    color: #4361ee;
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
}

/* 三种登录方式样式 */
.alternative-login {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e9ecef;
}

.divider {
    text-align: center;
    margin: 1rem 0 1.5rem 0;
    position: relative;
}

.divider span {
    background: white;
    padding: 0 1rem;
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 500;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e9ecef;
    z-index: -1;
}

.login-methods {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.login-method {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.2rem 0.5rem;
    border: 2px solid #f8f9fa;
    border-radius: 12px;
    background: white;
    text-decoration: none;
    color: #495057;
    transition: all 0.3s ease;
    cursor: pointer;
}

.login-method:hover {
    transform: translateY(-2px);
    border-color: #e9ecef;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    color: #495057;
}

.method-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
    transition: all 0.3s ease;
    color: white;
}

.method-text {
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
}

.qq-login .method-icon {
    background: linear-gradient(135deg, #12B7F5, #0A95D4);
}

.qq-login:hover .method-icon {
    background: linear-gradient(135deg, #0A95D4, #0879B3);
    transform: scale(1.1);
}

.scan-login .method-icon {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.scan-login:hover .method-icon {
    background: linear-gradient(135deg, #5a6fd8, #6a4190);
    transform: scale(1.1);
}

.digital-login .method-icon {
    background: linear-gradient(135deg, #6f42c1, #5a36a6);
}

.digital-login:hover .method-icon {
    background: linear-gradient(135deg, #5a36a6, #4a2b8a);
    transform: scale(1.1);
}

.auth-footer {
    text-align: center;
    margin-top: 2rem;
    color: #6c757d;
}

.auth-footer a {
    color: #4361ee;
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* 确认页面样式 */
.confirm-container {
    max-width: 500px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.confirm-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    padding: 2.5rem;
    text-align: center;
    border: 1px solid #e1e5e9;
}

.confirm-header {
    margin-bottom: 2rem;
}

.confirm-header h1 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.confirm-header p {
    color: #7f8c8d;
    font-size: 1.1rem;
}

.user-info {
    background: #f8f9fa;
    padding: 1.8rem;
    border-radius: 15px;
    margin: 2rem 0;
    text-align: left;
    border-left: 4px solid #4361ee;
}

.user-info h3 {
    margin: 0 0 1.2rem 0;
    color: #2c3e50;
    font-size: 1.3rem;
}

.user-details {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1rem 1.5rem;
    align-items: center;
}

.user-details .label {
    font-weight: 600;
    color: #495057;
    font-size: 1rem;
}

.user-details .value {
    color: #6c757d;
    font-size: 1rem;
}

.confirm-actions {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 2.5rem;
    flex-wrap: wrap;
}

.btn-confirm {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 1.2rem 2.5rem;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-confirm:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.3);
}

.btn-confirm:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-cancel {
    background: white;
    color: #495057;
    border: 2px solid #e9ecef;
    padding: 1.2rem 2.5rem;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-cancel:hover {
    border-color: #dc3545;
    color: #dc3545;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.1);
}

.status-info {
    margin: 1.5rem 0;
    padding: 1.2rem;
    border-radius: 10px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    font-size: 1.1rem;
    font-weight: 500;
}

.status-info.active {
    display: flex;
}

.status-info.success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.status-info.error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.session-info {
    background: #e8f4fd;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    font-family: monospace;
    font-size: 0.9rem;
    word-break: break-all;
    color: #495057;
}

.debug-info {
    background: #fff3cd;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    font-size: 0.9rem;
    color: #856404;
    border-left: 4px solid #ffc107;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .modal-content.wide-modal {
        margin: 10% auto;
        width: 95%;
    }
    
    .scan-container {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .qrcode-wrapper {
        padding: 1rem;
    }
    
    #qrcodeCanvas {
        width: 200px !important;
        height: 200px !important;
    }
    
    .modal-header {
        padding: 1.5rem 1.5rem 0;
    }
    
    .modal-body {
        padding: 1.5rem;
    }
    
    .scan-status {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .confirm-container {
        max-width: 450px;
    }
    
    .confirm-card {
        padding: 2rem;
    }
    
    .confirm-actions {
        flex-direction: column;
        gap: 1rem;
    }
    
    .btn-confirm, .btn-cancel {
        width: 100%;
        min-width: auto;
    }
    
    .user-details {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }
    
    .login-methods {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .modal-content.wide-modal {
        margin: 5% auto;
        width: 98%;
    }
    
    #qrcodeCanvas {
        width: 180px !important;
        height: 180px !important;
    }
    
    .login-method {
        padding: 1rem 0.3rem;
    }
    
    .method-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    
    .method-text {
        font-size: 0.8rem;
    }
    
    .confirm-card {
        padding: 1.5rem;
    }
    
    .confirm-header h1 {
        font-size: 1.6rem;
    }
    
    .user-info {
        padding: 1.2rem;
    }
    
    .btn-confirm, .btn-cancel {
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
    }
}