/**
 * TusongUI - 暖色调前端 UI 框架
 * 版本: 1.0.0
 * 作者: 蚌埠笨笨宠物有限公司
 * 网站: https://www.tusong.cn
 * 
 * 一个基于琥珀色/橙色暖色调设计的前端 UI 框架
 * 适合宠物、生活、温馨类应用
 */

/* ========================================
   1. 全局样式与变量
   ======================================== */

/* CSS 变量定义 */
:root {
  /* 主色调 - 琥珀色系 */
  --ts-primary: #f59e0b;
  --ts-primary-light: #fbbf24;
  --ts-primary-dark: #d97706;
  
  /* 辅助色 */
  --ts-secondary: #f97316;
  --ts-success: #10b981;
  --ts-danger: #ef4444;
  --ts-warning: #f59e0b;
  --ts-info: #3b82f6;
  
  /* 文字颜色 */
  --ts-text-primary: #1f2937;
  --ts-text-secondary: #6b7280;
  --ts-text-muted: #9ca3af;
  --ts-text-dark: #78350f;
  --ts-text-light: #92400e;
  
  /* 背景颜色 */
  --ts-bg-primary: #fffbeb;
  --ts-bg-secondary: #fef3c7;
  --ts-bg-light: #fafaf8;
  --ts-bg-white: #ffffff;
  
  /* 边框颜色 */
  --ts-border-light: rgba(245, 158, 11, 0.1);
  --ts-border-medium: rgba(245, 158, 11, 0.2);
  --ts-border-dark: rgba(245, 158, 11, 0.3);
  
  /* 阴影 */
  --ts-shadow-sm: 0 2px 8px rgba(245, 158, 11, 0.06);
  --ts-shadow-md: 0 4px 20px rgba(245, 158, 11, 0.08);
  --ts-shadow-lg: 0 8px 30px rgba(245, 158, 11, 0.12);
  --ts-shadow-xl: 0 25px 50px rgba(0, 0, 0, 0.25);
  
  /* 圆角 */
  --ts-radius-sm: 8px;
  --ts-radius-md: 12px;
  --ts-radius-lg: 16px;
  --ts-radius-xl: 20px;
  --ts-radius-full: 50px;
  
  /* 过渡 */
  --ts-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --ts-transition-fast: all 0.2s ease;
}

/* 全局重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(180deg, var(--ts-bg-primary) 0%, var(--ts-bg-light) 100%);
  color: var(--ts-text-primary);
  min-height: 100vh;
  line-height: 1.6;
}

/* ========================================
   2. 图标样式
   ======================================== */

.ts-icon {
  width: 24px;
  height: 24px;
  display: inline-block;
  flex-shrink: 0;
}

.ts-icon-sm {
  width: 18px;
  height: 18px;
}

.ts-icon-lg {
  width: 32px;
  height: 32px;
}

/* ========================================
   3. 布局组件
   ======================================== */

/* 应用布局 */
.ts-app-layout {
  display: flex;
  min-height: 100vh;
}

/* 侧边栏 */
.ts-sidebar {
  width: 260px;
  background: linear-gradient(180deg, var(--ts-bg-primary) 0%, var(--ts-bg-white) 100%);
  padding: 28px 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--ts-border-light);
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  box-shadow: 4px 0 20px rgba(245, 158, 11, 0.06);
  z-index: 200;
  overflow-y: auto;
}

.ts-sidebar-header {
  padding: 0 24px 28px;
  border-bottom: 1px solid var(--ts-border-light);
  margin-bottom: 24px;
}

.ts-logo-wrapper {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ts-logo-icon {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, var(--ts-primary) 0%, var(--ts-primary-light) 50%, var(--ts-secondary) 100%);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}

.ts-logo-text {
  display: flex;
  flex-direction: column;
}

.ts-logo-text h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--ts-text-primary);
  letter-spacing: -0.3px;
}

.ts-logo-text span {
  font-size: 12px;
  color: var(--ts-text-light);
  font-weight: 500;
  margin-top: 2px;
}

/* 侧边栏导航 */
.ts-sidebar-nav {
  flex: 1;
  padding: 0 16px;
  overflow-y: auto;
}

.ts-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 6px;
  background: transparent;
  border: none;
  color: var(--ts-text-secondary);
  text-align: left;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 14px;
  transition: var(--ts-transition);
}

.ts-nav-item:hover {
  background: linear-gradient(135deg, var(--ts-bg-primary) 0%, var(--ts-bg-secondary) 100%);
  color: var(--ts-text-light);
  transform: translateX(2px);
}

.ts-nav-item.active {
  background: linear-gradient(135deg, var(--ts-bg-secondary) 0%, #fde68a 100%);
  color: var(--ts-text-light);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.15);
}

.ts-nav-item .ts-icon {
  transition: var(--ts-transition-fast);
}

.ts-nav-item.active .ts-icon,
.ts-nav-item:hover .ts-icon {
  fill: var(--ts-primary);
  stroke: var(--ts-primary);
}

/* 侧边栏底部 */
.ts-sidebar-footer {
  padding: 0 24px;
  border-top: 1px solid var(--ts-border-light);
  padding-top: 24px;
}

/* 主内容区 */
.ts-main-content {
  flex: 1;
  padding: 32px 36px;
  padding-bottom: 100px;
  overflow-y: auto;
  margin-left: 260px;
  position: relative;
}

/* 页头 */
.ts-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  gap: 12px;
}

.ts-page-title-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ts-page-title-wrapper::before {
  content: '';
  width: 8px;
  height: 28px;
  background: linear-gradient(180deg, var(--ts-primary) 0%, var(--ts-secondary) 50%, var(--ts-primary-light) 100%);
  border-radius: 10px;
  display: inline-block;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.ts-header h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--ts-text-primary);
  letter-spacing: -0.5px;
}

/* 页脚 */
.ts-footer {
  position: fixed;
  bottom: 0;
  left: 260px;
  right: 0;
  padding: 20px 36px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 251, 235, 0.98) 100%);
  border-top: 1px solid var(--ts-border-light);
  text-align: left;
  backdrop-filter: blur(10px);
  z-index: 100;
}

.ts-footer-text {
  color: var(--ts-text-light);
  font-size: 13px;
  font-weight: 500;
}

.ts-footer a {
  color: var(--ts-primary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.ts-footer a:hover {
  color: var(--ts-primary-dark);
  text-decoration: underline;
}

/* 移动端菜单按钮 */
.ts-menu-toggle {
  display: none;
  position: relative;
  background: linear-gradient(135deg, var(--ts-bg-primary) 0%, var(--ts-bg-secondary) 100%);
  color: var(--ts-text-light);
  border: 2px solid var(--ts-border-medium);
  padding: 12px;
  border-radius: 14px;
  cursor: pointer;
  font-size: 20px;
  box-shadow: var(--ts-shadow-sm);
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  transition: var(--ts-transition);
  flex-shrink: 0;
}

.ts-menu-toggle:hover {
  transform: translateY(-2px);
  box-shadow: var(--ts-shadow-md);
  background: linear-gradient(135deg, var(--ts-bg-secondary) 0%, #fde68a 100%);
  border-color: var(--ts-border-dark);
}

/* 移动端遮罩层 */
.ts-sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 199;
  backdrop-filter: blur(4px);
}

/* ========================================
   4. 按钮
   ======================================== */

.ts-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 14px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: var(--ts-transition);
  letter-spacing: 0.2px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* 主要按钮 */
.ts-btn-primary {
  background: linear-gradient(135deg, var(--ts-bg-secondary) 0%, #FFD700 100%);
  color: var(--ts-text-light);
  border: 1px solid var(--ts-border-dark);
  box-shadow: var(--ts-shadow-sm);
}

.ts-btn-primary:hover {
  background: linear-gradient(135deg, var(--ts-bg-secondary) 0%, #FFC107 100%);
  transform: translateY(-2px);
  box-shadow: var(--ts-shadow-md);
}

/* 次要按钮 */
.ts-btn-secondary {
  background: linear-gradient(135deg, var(--ts-bg-primary) 0%, var(--ts-bg-secondary) 100%);
  color: var(--ts-text-light);
  border: 1px solid var(--ts-border-medium);
}

.ts-btn-secondary:hover {
  background: linear-gradient(135deg, var(--ts-bg-secondary) 0%, #fde68a 100%);
  transform: translateY(-2px);
}

/* 成功按钮 */
.ts-btn-success {
  background: linear-gradient(135deg, #3ed784 0%, var(--ts-primary-light) 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.ts-btn-success:hover {
  background: linear-gradient(135deg, #19e476 0%, var(--ts-primary-light) 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.35);
}

/* 危险按钮 */
.ts-btn-danger {
  background: linear-gradient(135deg, #f13e3b 0%, #fa997c 100%);
  color: white;
  border: 1px solid rgb(248 93 44 / 30%);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.ts-btn-danger:hover {
  background: linear-gradient(135deg, #ff664d 0%, #f68271 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.35);
}

/* 警告按钮 */
.ts-btn-warning {
  background: linear-gradient(135deg, #fdb63d 0%, #fde68a 100%);
  color: white;
}

.ts-btn-warning:hover {
  background: linear-gradient(135deg, #ffb02a 0%, #fdaf44 100%);
  transform: translateY(-2px);
}

/* 信息按钮 */
.ts-btn-info {
  background: linear-gradient(135deg, var(--ts-bg-secondary) 0%, #fde68a 100%);
  color: var(--ts-text-light);
  border: 1px solid var(--ts-border-dark);
  box-shadow: var(--ts-shadow-sm);
}

.ts-btn-info:hover {
  background: linear-gradient(135deg, #fde68a 0%, var(--ts-primary-light) 100%);
  transform: translateY(-2px);
  box-shadow: var(--ts-shadow-md);
}

/* 按钮尺寸 */
.ts-btn-small {
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 10px;
}

.ts-btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 8px;
  font-weight: 600;
}

/* 上传按钮 */
.ts-btn-upload {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ts-text-secondary);
  background: white;
  border: 2px dashed #d1d5db;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--ts-transition-fast);
}

.ts-btn-upload:hover {
  border-color: var(--ts-primary);
  color: var(--ts-primary);
  background: var(--ts-bg-primary);
}

/* 按钮加载状态 */
.ts-btn-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.85;
}

.ts-btn-loading span {
  visibility: hidden;
}

.ts-btn-loading::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(245, 158, 11, 0.2);
  border-top-color: var(--ts-primary);
  border-radius: 50%;
  animation: ts-spin 0.6s linear infinite;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

@keyframes ts-spin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ========================================
   5. 卡片
   ======================================== */

.ts-card {
  background: linear-gradient(180deg, var(--ts-bg-primary) 0%, var(--ts-bg-white) 100%);
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--ts-shadow-md);
  border: 1px solid var(--ts-border-light);
  transition: var(--ts-transition);
}

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

/* ========================================
   6. 表格
   ======================================== */

.ts-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
}

.ts-table th,
.ts-table td {
  padding: 16px;
  text-align: left;
  border-bottom: 1px solid #f3f4f6;
}

.ts-table th {
  background: linear-gradient(180deg, var(--ts-bg-primary) 0%, var(--ts-bg-light) 100%);
  font-weight: 600;
  color: var(--ts-text-dark);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ts-table tr {
  transition: var(--ts-transition-fast);
}

.ts-table tr:hover {
  background: linear-gradient(180deg, var(--ts-bg-primary) 0%, var(--ts-bg-white) 100%);
}

.ts-table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 16px;
}

.ts-table-wrapper {
  border-radius: 16px;
  overflow: hidden;
}

/* ========================================
   7. 徽章
   ======================================== */

.ts-badge {
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 12px;
  font-weight: 600;
  display: inline-block;
  letter-spacing: 0.3px;
}

.ts-badge-success {
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
  color: #166534;
}

.ts-badge-warning {
  background: linear-gradient(135deg, var(--ts-bg-secondary) 0%, #fde68a 100%);
  color: var(--ts-text-light);
}

.ts-badge-secondary {
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  color: #4b5563;
}

.ts-badge-primary {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  color: #1e40af;
}

.ts-badge-danger {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #991b1b;
}

.ts-badge-info {
  background: linear-gradient(135deg, #cffafe 0%, #a5f3fc 100%);
  color: #0e7490;
}

/* ========================================
   8. 开关
   ======================================== */

.ts-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
  cursor: pointer;
}

.ts-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.ts-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 28px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ts-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

input:checked + .ts-slider {
  background: linear-gradient(135deg, var(--ts-primary) 0%, var(--ts-secondary) 100%);
}

input:checked + .ts-slider:before {
  transform: translateX(24px);
  box-shadow: 0 2px 12px rgba(245, 158, 11, 0.4);
}

/* ========================================
   9. 模态框
   ======================================== */

.ts-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(6px);
  animation: ts-fadeIn 0.3s ease;
}

.ts-modal.active {
  display: flex;
}

.ts-modal-content {
  background: linear-gradient(180deg, var(--ts-bg-primary) 0%, var(--ts-bg-white) 100%);
  border-radius: 24px;
  padding: 32px;
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--ts-shadow-xl);
  animation: ts-slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.ts-modal-header h2 {
  font-size: 22px;
  color: var(--ts-text-primary);
  font-weight: 700;
  letter-spacing: -0.3px;
}

.ts-modal-body {
  /* 模态框主体内容 */
}

.ts-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 32px;
}

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

@keyframes ts-slideUp {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ========================================
   10. 表单
   ======================================== */

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

.ts-form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--ts-text-dark);
  font-size: 14px;
}

.ts-form-control {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--ts-border-medium);
  border-radius: 12px;
  font-size: 15px;
  transition: var(--ts-transition);
  background: var(--ts-bg-primary);
}

.ts-form-control:focus {
  outline: none;
  border-color: var(--ts-primary);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.15);
  background: white;
}

/* 文件上传输入框 */
.ts-form-control[type="file"] {
  cursor: pointer;
  padding: 0;
  position: relative;
  overflow: hidden;
  background: transparent;
}

.ts-form-control[type="file"]::file-selector-button {
  background: linear-gradient(135deg, var(--ts-primary) 0%, var(--ts-secondary) 100%);
  color: white;
  border: none;
  padding: 14px 20px;
  cursor: pointer;
  font-weight: 600;
  transition: var(--ts-transition);
  margin-right: 12px;
}

.ts-form-control[type="file"]::file-selector-button:hover {
  background: linear-gradient(135deg, var(--ts-primary-dark) 0%, var(--ts-primary) 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

/* ========================================
   11. Toast 提示
   ======================================== */

.ts-toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ts-toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  animation: ts-slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 280px;
  max-width: 400px;
}

.ts-toast-success {
  background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.ts-toast-error {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.ts-toast-warning {
  background: linear-gradient(135deg, var(--ts-bg-secondary) 0%, #fde68a 100%);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.ts-toast-info {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.ts-toast-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.ts-toast-success .ts-toast-icon { background: rgba(16, 185, 129, 0.15); }
.ts-toast-error .ts-toast-icon { background: rgba(239, 68, 68, 0.15); }
.ts-toast-warning .ts-toast-icon { background: rgba(245, 158, 11, 0.15); }
.ts-toast-info .ts-toast-icon { background: rgba(59, 130, 246, 0.15); }

.ts-toast-icon svg {
  width: 16px;
  height: 16px;
}

.ts-toast-success .ts-toast-icon svg { color: #16a34a; }
.ts-toast-error .ts-toast-icon svg { color: #dc2626; }
.ts-toast-warning .ts-toast-icon svg { color: #d97706; }
.ts-toast-info .ts-toast-icon svg { color: #2563eb; }

.ts-toast-message {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
}

.ts-toast-success .ts-toast-message { color: #166534; }
.ts-toast-error .ts-toast-message { color: #991b1b; }
.ts-toast-warning .ts-toast-message { color: var(--ts-text-light); }
.ts-toast-info .ts-toast-message { color: #1e40af; }

.ts-toast-close {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.08);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--ts-transition-fast);
}

.ts-toast-close:hover {
  background: rgba(0, 0, 0, 0.15);
}

.ts-toast-close svg {
  width: 14px;
  height: 14px;
  color: var(--ts-text-secondary);
}

.ts-toast.fade-out {
  animation: ts-fadeOutRight 0.3s ease forwards;
}

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

@keyframes ts-fadeOutRight {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100px);
  }
}

/* ========================================
   12. 确认对话框
   ======================================== */

.ts-confirm-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  align-items: center;
  justify-content: center;
  z-index: 9998;
  backdrop-filter: blur(6px);
  animation: ts-fadeIn 0.2s ease;
}

.ts-confirm-overlay.active {
  display: flex;
}

.ts-confirm-dialog {
  background: linear-gradient(180deg, var(--ts-bg-primary) 0%, var(--ts-bg-white) 100%);
  border-radius: 24px;
  padding: 32px;
  width: 90%;
  max-width: 420px;
  box-shadow: var(--ts-shadow-xl);
  animation: ts-slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ts-confirm-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ts-confirm-icon.warning {
  background: linear-gradient(135deg, var(--ts-bg-secondary) 0%, #fde68a 100%);
}

.ts-confirm-icon.warning svg {
  width: 32px;
  height: 32px;
  color: #d97706;
}

.ts-confirm-icon.danger {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
}

.ts-confirm-icon.danger svg {
  width: 32px;
  height: 32px;
  color: #dc2626;
}

.ts-confirm-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--ts-text-primary);
  text-align: center;
  margin-bottom: 12px;
}

.ts-confirm-message {
  font-size: 15px;
  color: var(--ts-text-secondary);
  text-align: center;
  line-height: 1.6;
  margin-bottom: 24px;
}

.ts-confirm-actions {
  display: flex;
  gap: 12px;
}

.ts-confirm-actions .ts-btn {
  flex: 1;
  justify-content: center;
}

/* ========================================
   13. 数据卡片（移动端）
   ======================================== */

.ts-data-grid {
  display: none;
  gap: 16px;
  margin-top: 0;
}

.ts-data-card {
  background: white;
  border-radius: 16px;
  padding: 16px;
  border: 1px solid rgba(245, 158, 11, 0.08);
  box-shadow: 0 2px 12px rgba(245, 158, 11, 0.06);
  transition: var(--ts-transition);
}

.ts-data-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.12);
}

.ts-data-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.ts-data-card-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, #fde68a 0%, var(--ts-primary-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ts-data-card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ts-data-card-photo {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
  background: linear-gradient(135deg, #fde68a 0%, var(--ts-primary-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ts-data-card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ts-data-card-info {
  flex: 1;
  min-width: 0;
}

.ts-data-card-title {
  flex: 1;
  min-width: 0;
}

.ts-data-card-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--ts-text-primary);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ts-data-card-subtitle {
  font-size: 13px;
  color: var(--ts-text-light);
  font-weight: 500;
}

.ts-data-card-number {
  font-size: 13px;
  color: var(--ts-text-light);
  font-weight: 500;
  margin-bottom: 4px;
}

.ts-data-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
}

.ts-data-card-tag {
  font-size: 12px;
  color: var(--ts-text-dark);
  background: var(--ts-bg-primary);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid rgba(245, 158, 11, 0.15);
}

.ts-data-card-body {
  margin-bottom: 12px;
}

.ts-data-card-field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid rgba(245, 158, 11, 0.08);
}

.ts-data-card-field:last-child {
  border-bottom: none;
}

.ts-data-card-label {
  font-size: 13px;
  color: var(--ts-text-dark);
  font-weight: 500;
}

.ts-data-card-value {
  font-size: 13px;
  color: var(--ts-text-primary);
  font-weight: 600;
}

.ts-data-card-footer {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid rgba(245, 158, 11, 0.08);
}

.ts-data-card-footer .ts-btn {
  flex: 1;
  min-width: 0;
  justify-content: center;
  padding: 10px 12px;
  font-size: 13px;
}

.ts-data-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ts-data-card-actions .ts-btn {
  flex: 1;
  min-width: 0;
  justify-content: center;
  padding: 10px 12px;
  font-size: 13px;
}

/* ========================================
   14. 视图切换
   ======================================== */

.ts-view-toggle {
  display: flex;
  background: var(--ts-bg-primary);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
}

.ts-view-toggle-btn {
  flex: 1;
  padding: 8px 16px;
  border: none;
  background: transparent;
  color: var(--ts-text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 8px;
  transition: var(--ts-transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.ts-view-toggle-btn:hover {
  background: rgba(245, 158, 11, 0.1);
}

.ts-view-toggle-btn.active {
  background: white;
  color: var(--ts-text-light);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.15);
}

/* ========================================
   15. 照片网格
   ======================================== */

.ts-photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  margin-top: 8px;
}

.ts-photo-item {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid rgba(245, 158, 11, 0.15);
  transition: var(--ts-transition);
}

.ts-photo-item:hover {
  border-color: var(--ts-primary);
  transform: scale(1.02);
}

.ts-photo-item.is-cover {
  border-color: var(--ts-primary);
  border-width: 3px;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.ts-photo-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ts-photo-delete {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--ts-transition);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

.ts-photo-delete:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.5);
}

/* ========================================
   16. 头像
   ======================================== */

.ts-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
}

/* ========================================
   17. 隐藏类
   ======================================== */

.ts-hidden {
  display: none !important;
}

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

@media (max-width: 768px) {
  .ts-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .ts-sidebar-overlay.active {
    display: block;
  }

  .ts-sidebar {
    transform: translateX(-100%);
    z-index: 200;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .ts-sidebar.active {
    transform: translateX(0);
  }

  .ts-main-content {
    margin-left: 0;
    padding: 20px 20px 100px 20px;
  }

  .ts-footer {
    left: 0;
  }

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

  .ts-page-title-wrapper {
    flex: 1;
    min-width: 0;
  }

  .ts-card {
    padding: 20px;
    border-radius: 16px;
  }

  .ts-table {
    font-size: 13px;
  }

  .ts-table th,
  .ts-table td {
    padding: 12px;
  }

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

  .ts-modal-actions .ts-btn {
    width: 100%;
  }

  /* 移动端显示卡片视图 */
  .ts-table-container {
    display: none;
  }
  
  .ts-data-grid {
    display: grid;
    grid-template-columns: 1fr;
  }
  
  .ts-table-wrapper {
    padding: 0;
    background: transparent;
    box-shadow: none;
    border: none;
  }

  /* Toast 移动端适配 */
  .ts-toast-container {
    top: 12px;
    left: 12px;
    right: 12px;
  }
  
  .ts-toast {
    min-width: auto;
    max-width: 100%;
    padding: 14px 16px;
  }

  /* 触摸目标更大 */
  .ts-btn {
    min-height: 44px;
  }
}

@media (min-width: 769px) {
  /* 桌面端显示表格 */
  .ts-data-grid {
    display: none;
  }
  
  .ts-table-container {
    display: block;
  }
}

@media (min-width: 576px) and (max-width: 768px) {
  .ts-data-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .ts-btn {
    padding: 10px 18px;
    font-size: 13px;
  }

  .ts-sidebar-header h1 {
    font-size: 18px;
  }

  .ts-nav-item {
    padding: 12px 14px;
    font-size: 14px;
  }

  .ts-modal-content {
    margin: 20px;
    padding: 24px;
    border-radius: 20px;
  }

  .ts-data-card-avatar {
    width: 56px;
    height: 56px;
  }

  .ts-data-card-actions .ts-btn {
    padding: 8px 12px;
  }
}