/* 公共样式 - 所有工具共享 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
}

body {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
  color: #333;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

header {
  text-align: center;
  margin-bottom: 20px;
  color: white;
}

h1 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
  font-size: 13px;
  opacity: 0.9;
  font-weight: 300;
}

.card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  padding: 16px;
  border-radius: 10px;
  box-shadow: 0 3px 15px rgba(0,0,0,0.08);
  border: 1px solid rgba(255,255,255,0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  margin-bottom: 12px;
}

.card:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(0,0,0,0.12);
}

.card-title {
  font-size: 14px;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-title::before {
  content: '';
  width: 3px;
  height: 16px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 2px;
}

/* 按钮样式 */
.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  justify-content: center;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
  background: #f8f9fa;
  color: #495057;
  border: 2px solid #e9ecef;
}

.btn-secondary:hover {
  background: #e9ecef;
  border-color: #dee2e6;
}

.btn-success {
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
}

.btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.btn-danger {
  background: linear-gradient(135deg, #dc3545, #e83e8c);
  color: white;
}

.btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* 表单元素 */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-weight: 600;
  color: #34495e;
  margin-bottom: 6px;
  font-size: 13px;
}

.input-field, .textarea-field, .select-field {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #e1e8ed;
  border-radius: 6px;
  font-size: 13px;
  transition: all 0.2s ease;
  background: white;
}

.input-field:focus, .textarea-field:focus, .select-field:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.textarea-field {
  min-height: 100px;
  resize: vertical;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  line-height: 1.5;
}

/* 工具栏 */
.toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

/* Toast通知系统 - 渐变色优化版本 */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  pointer-events: none;
}

.toast {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  border-radius: 12px;
  padding: 14px 18px;
  margin-bottom: 10px;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.12),
    0 2px 8px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  max-width: 420px;
  transform: translateX(100%) scale(0.85) rotateY(15deg);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: auto;
  font-size: 13px;
  font-weight: 500;
  position: relative;
  overflow: hidden;
}

.toast::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.toast-show {
  transform: translateX(0) scale(1) rotateY(0deg);
  opacity: 1;
}

.toast-hide {
  transform: translateX(100%) scale(0.85) rotateY(-15deg);
  opacity: 0;
}

.toast-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.toast-message {
  flex: 1;
  color: #2c3e50;
  line-height: 1.5;
  font-weight: 500;
}

.toast-close {
  background: rgba(0, 0, 0, 0.05);
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
  transition: all 0.2s ease;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.toast-close:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.1);
  transform: scale(1.1);
}

.toast-close svg {
  width: 12px;
  height: 12px;
  fill: #6c757d;
}

/* Toast类型样式 - 渐变色版本 */
.toast-success {
  background: linear-gradient(135deg, rgba(40, 167, 69, 0.12), rgba(32, 201, 151, 0.12));
  border-left: 4px solid transparent;
  border-image: linear-gradient(135deg, #28a745, #20c997) 1;
  box-shadow: 
    0 8px 32px rgba(40, 167, 69, 0.2),
    0 2px 8px rgba(32, 201, 151, 0.15);
}

.toast-success .toast-icon {
  background: linear-gradient(135deg, #28a745, #20c997);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: pulse-success 2s ease-in-out infinite;
}

@keyframes pulse-success {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.toast-error {
  background: linear-gradient(135deg, rgba(220, 53, 69, 0.12), rgba(232, 62, 140, 0.12));
  border-left: 4px solid transparent;
  border-image: linear-gradient(135deg, #dc3545, #e83e8c) 1;
  box-shadow: 
    0 8px 32px rgba(220, 53, 69, 0.2),
    0 2px 8px rgba(232, 62, 140, 0.15);
}

.toast-error .toast-icon {
  background: linear-gradient(135deg, #dc3545, #e83e8c);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
}

.toast-warning {
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.12), rgba(255, 152, 0, 0.12));
  border-left: 4px solid transparent;
  border-image: linear-gradient(135deg, #ffc107, #ff9800) 1;
  box-shadow: 
    0 8px 32px rgba(255, 193, 7, 0.2),
    0 2px 8px rgba(255, 152, 0, 0.15);
}

.toast-warning .toast-icon {
  background: linear-gradient(135deg, #ffc107, #ff9800);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: bounce-warning 1s ease-in-out infinite;
}

@keyframes bounce-warning {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.toast-info {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.12), rgba(118, 75, 162, 0.12));
  border-left: 4px solid transparent;
  border-image: linear-gradient(135deg, #667eea, #764ba2) 1;
  box-shadow: 
    0 8px 32px rgba(102, 126, 234, 0.2),
    0 2px 8px rgba(118, 75, 162, 0.15);
}

.toast-info .toast-icon {
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: rotate-info 2s linear infinite;
}

@keyframes rotate-info {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* 移动端适配 */
@media (max-width: 768px) {
  .toast-container {
    top: 10px;
    right: 10px;
    left: 10px;
  }
  
  .toast {
    min-width: auto;
    max-width: none;
  }
}

/* 图标 */
.icon {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .container {
    max-width: 100%;
    padding: 0 10px;
  }
  
  body {
    padding: 10px;
  }
  
  .toolbar {
    justify-content: center;
  }
}

/* 加载动画 */
.loading {
  display: none;
  text-align: center;
  padding: 20px;
  color: #667eea;
}

.loading.show {
  display: block;
}

.spinner {
  border: 2px solid #f3f3f3;
  border-top: 2px solid #667eea;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  animation: spin 1s linear infinite;
  margin: 0 auto 10px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 统计信息 */
.stats {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 12px;
  color: #6c757d;
}

/* 隐藏类 */
.hidden {
  display: none !important;
}