/* MVP工具集合 - 公共样式 */
/* 极简黑白灰配色方案 */

:root {
  --color-primary: #000000;
  --color-secondary: #666666;
  --color-border: #e5e5e5;
  --color-bg: #fafafa;
  --color-bg-white: #ffffff;
  --color-text: #333333;
  --color-text-light: #999999;
  --color-success: #22c55e;
  --color-error: #ef4444;
  --color-warning: #f59e0b;
  --color-info: #3b82f6;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  color: var(--color-text);
  background-color: var(--color-bg);
  line-height: 1.6;
  margin: 0;
  padding: 0;
}

/* 按钮样式 */
.btn-primary {
  background-color: var(--color-primary);
  color: white;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 0.375rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary:hover {
  background-color: #333333;
  transform: translateY(-1px);
}

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

.btn-primary:disabled {
  background-color: #cccccc;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background-color: white;
  color: var(--color-primary);
  border: 1px solid var(--color-border);
  padding: 0.75rem 1.5rem;
  border-radius: 0.375rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

/* 输入框样式 */
.input-field {
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
  padding: 0.75rem;
  width: 100%;
  font-size: 1rem;
  transition: border-color 0.2s ease;
  background-color: white;
}

.input-field:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.input-field::placeholder {
  color: var(--color-text-light);
}

/* Textarea样式 */
textarea.input-field {
  resize: vertical;
  min-height: 120px;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

/* 卡片样式 */
.card {
  background-color: var(--color-bg-white);
  border-radius: 0.5rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* 工具卡片 */
.tool-card {
  background-color: var(--color-bg-white);
  border: 1px solid var(--color-border);
  border-radius: 0.5rem;
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  color: inherit;
  display: block;
}

.tool-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.tool-card-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--color-primary);
}

.tool-card-description {
  font-size: 0.875rem;
  color: var(--color-secondary);
  line-height: 1.5;
}

.tool-card-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 0.25rem;
  margin-top: 0.5rem;
}

.badge-frontend {
  background-color: #e0f2fe;
  color: #0369a1;
}

.badge-backend {
  background-color: #fef3c7;
  color: #92400e;
}

.badge-ai {
  background-color: #f3e8ff;
  color: #6b21a8;
}

/* 通知消息 */
.notification {
  position: fixed;
  top: 1rem;
  right: 1rem;
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  animation: slideIn 0.3s ease;
  max-width: 400px;
}

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

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

.notification-error {
  background-color: var(--color-error);
  color: white;
}

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

.notification-info {
  background-color: var(--color-info);
  color: white;
}

/* 加载动画 */
.loading-spinner {
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  animation: spin 0.8s linear infinite;
}

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

/* 代码块样式 */
.code-block {
  background-color: #f5f5f5;
  border: 1px solid var(--color-border);
  border-radius: 0.375rem;
  padding: 1rem;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.875rem;
  overflow-x: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* 响应式工具类 */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.container-narrow {
  max-width: 800px;
}

/* 网格布局 */
.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-cols-1 {
  grid-template-columns: repeat(1, 1fr);
}

.grid-cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-cols-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* 响应式断点 */
@media (max-width: 768px) {
  .grid-cols-2,
  .grid-cols-3,
  .grid-cols-4 {
    grid-template-columns: repeat(1, 1fr);
  }
  
  .btn-primary,
  .btn-secondary {
    width: 100%;
  }
  
  .notification {
    left: 1rem;
    right: 1rem;
    max-width: none;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .grid-cols-3,
  .grid-cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* 工具类 */
.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.hidden {
  display: none;
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }

/* Xiaohongshu card generators */
.xhs-card-shell {
  width: min(100%, 390px);
  margin: 0 auto;
}

.xhs-card-preview {
  width: 100%;
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  letter-spacing: 0;
}

.xhs-card-preview * {
  box-sizing: border-box;
}

.xhs-card-kicker {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.xhs-card-title {
  font-size: 30px;
  line-height: 1.18;
  font-weight: 900;
  margin: 18px 0 10px;
}

.xhs-card-subtitle {
  font-size: 15px;
  line-height: 1.65;
}

.xhs-card-section {
  border-radius: 14px;
  padding: 13px 14px;
  margin-top: 12px;
  background: rgba(255, 255, 255, 0.54);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.xhs-card-section-title {
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 5px;
}

.xhs-card-section-body {
  font-size: 14px;
  line-height: 1.58;
}

.xhs-card-cta {
  border-radius: 16px;
  padding: 14px;
  margin-top: 16px;
  font-size: 15px;
  line-height: 1.55;
  font-weight: 800;
  background: rgba(0, 0, 0, 0.08);
}

.xhs-card-footer {
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  opacity: 0.72;
}
