/* ============================================
   益善网络 V2.0 - 核心样式
   所有 V2 样式使用 v2- 前缀，防止与 style.css 冲突
   ============================================ */

/* ===== 品牌设计系统（与 V1 主站 style.css 统一） ===== */
:root {
  /* 主色：赭石红系 */
  --brand: #8B3A3A;
  --brand-light: #A0522D;
  --brand-lighter: #C4815E;
  --brand-bg: #FDF5F3;
  --brand-dark: #6B2525;
  --brand-darkest: #4A1818;

  /* 强调色：古铜金 */
  --gold: #C8A45C;
  --gold-light: #D4BC8A;
  --gold-bg: #FDF8F0;

  /* 中性暖灰 */
  --bg: #FDF8F5;
  --surface: #FFFFFF;
  --gray-50: #FAF7F4;
  --gray-100: #F5EFE8;
  --gray-200: #E8DED4;
  --gray-300: #D4C8BC;
  --gray-400: #A89888;
  --gray-500: #8B7B6B;
  --gray-600: #6B5D50;
  --gray-700: #4A4036;
  --gray-800: #2D2620;
  --gray-900: #1A1510;

  /* 语义色 */
  --success: #2D7D46;
  --success-bg: #F0F8F2;
  --warning: #B8860B;
  --warning-bg: #FFFDF5;
  --danger: #C0392B;
  --danger-bg: #FEF5F4;
  --info: #4A6FA5;
  --info-bg: #F4F7FB;

  /* 形状与阴影 */
  --radius: 8px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --shadow-sm: 0 1px 3px rgba(74, 24, 24, 0.04), 0 1px 2px rgba(74, 24, 24, 0.03);
  --shadow: 0 2px 8px rgba(74, 24, 24, 0.06), 0 1px 3px rgba(74, 24, 24, 0.04);
  --shadow-md: 0 6px 20px rgba(74, 24, 24, 0.08), 0 2px 6px rgba(74, 24, 24, 0.04);
  --shadow-lg: 0 12px 32px rgba(74, 24, 24, 0.10), 0 4px 12px rgba(74, 24, 24, 0.05);
}

/* ===== 按钮基类（品牌色） ===== */
.v2-btn-primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.v2-btn-primary:hover:not(:disabled) {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}
.v2-btn-secondary {
  background: #fff;
  color: var(--brand);
  border-color: var(--gold);
}
.v2-btn-secondary:hover:not(:disabled) {
  background: var(--gold-bg);
  border-color: var(--gold);
}
.v2-btn-ghost {
  background: transparent;
  color: var(--gray-600);
  border-color: transparent;
}
.v2-btn-ghost:hover:not(:disabled) {
  background: var(--gray-100);
}
.v2-btn-danger {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.v2-btn-danger:hover:not(:disabled) {
  background: #a50e0e;
  border-color: #a50e0e;
}

/* ===== 状态徽章 .v2-badge ===== */
.v2-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.6;
  border-radius: 10px;
  white-space: nowrap;
  user-select: none;
}

.v2-badge-info {
  background: #e8f4fd;
  color: var(--brand);
}

.v2-badge-success {
  background: #e6f4ea;
  color: #137333;
}

.v2-badge-warning {
  background: #fef7e0;
  color: #b06000;
}

.v2-badge-error {
  background: #fce8e6;
  color: #c5221f;
}

.v2-badge-neutral {
  background: var(--gray-100);
  color: var(--gray-600);
}

/* ===== 表单 .v2-form-* ===== */
.v2-form-group {
  margin-bottom: 16px;
}

.v2-form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-700);
}

.v2-form-label .v2-required {
  color: #c5221f;
  margin-left: 2px;
}

.v2-form-input {
  width: 100%;
  padding: 8px 12px;
  font-size: 14px;
  font-family: inherit;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fff;
  color: var(--gray-700);
}

.v2-form-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(139, 58, 58, 0.15);
}

.v2-form-input::placeholder {
  color: var(--gray-400);
}

.v2-form-input:disabled {
  background: var(--gray-50);
  color: var(--gray-500);
  cursor: not-allowed;
}

.v2-form-textarea {
  min-height: 80px;
  resize: vertical;
}

.v2-form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235f6368' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
}

.v2-form-error {
  margin-top: 4px;
  font-size: 12px;
  color: #c5221f;
}

.v2-form-hint {
  margin-top: 4px;
  font-size: 12px;
  color: var(--gray-500);
}

.v2-form-row {
  display: flex;
  gap: 12px;
}

.v2-form-row .v2-form-group {
  flex: 1;
}

/* ===== 按钮 .v2-btn ===== */
.v2-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  line-height: 1.4;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  outline: none;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
  user-select: none;
  white-space: nowrap;
}

.v2-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.v2-btn-sm {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 4px;
}

.v2-btn-lg {
  padding: 12px 24px;
  font-size: 16px;
  border-radius: 8px;
}

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

/* ===== 空状态 .v2-empty ===== */
.v2-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}

.v2-empty-icon {
  font-size: 48px;
  color: var(--gray-200);
  margin-bottom: 12px;
}

.v2-empty-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--gray-600);
  margin: 0 0 8px 0;
}

.v2-empty-desc {
  font-size: 13px;
  color: var(--gray-500);
  margin: 0;
  max-width: 320px;
  line-height: 1.5;
}

/* ===== 错误状态 .v2-error ===== */
.v2-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}

.v2-error-icon {
  font-size: 48px;
  color: #c5221f;
  margin-bottom: 12px;
}

.v2-error-title {
  font-size: 16px;
  font-weight: 500;
  color: #c5221f;
  margin: 0 0 8px 0;
}

.v2-error-desc {
  font-size: 13px;
  color: var(--gray-500);
  margin: 0 0 16px 0;
  max-width: 360px;
  line-height: 1.5;
}

.v2-error-retry {
  margin-top: 8px;
}

/* ===== 加载状态 .v2-loading ===== */
.v2-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
}

.v2-loading-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--gray-300);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: v2-spin 0.8s linear infinite;
  margin-bottom: 12px;
}

.v2-loading-text {
  font-size: 13px;
  color: var(--gray-500);
}

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

/* ===== 骨架屏 ===== */
.v2-skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-300) 50%, var(--gray-100) 75%);
  background-size: 200% 100%;
  animation: v2-skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: 4px;
}

@keyframes v2-skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===== V2 占位页面 ===== */
.v2-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: 40px 20px;
}

.v2-placeholder-card {
  text-align: center;
  padding: 40px 32px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
  max-width: 420px;
  width: 100%;
}

.v2-placeholder-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-light));
  border-radius: 16px;
  margin-bottom: 16px;
}

.v2-placeholder-card h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--gray-800);
  margin: 0 0 8px 0;
}

.v2-placeholder-card p {
  font-size: 14px;
  color: var(--gray-600);
  margin: 0 0 20px 0;
}

.v2-placeholder-path {
  font-size: 12px;
  color: var(--gray-500);
  font-family: 'SF Mono', 'Menlo', 'Monaco', monospace;
  background: var(--gray-50);
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 16px;
  word-break: break-all;
}

.v2-placeholder-meta {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.v2-placeholder .v2-error-icon {
  background: linear-gradient(135deg, #c5221f, #ea4335);
}

.v2-placeholder .v2-btn {
  margin-top: 4px;
}

/* ===== 响应式 ===== */
@media (max-width: 480px) {
  .v2-form-row {
    flex-direction: column;
    gap: 0;
  }

  .v2-placeholder-card {
    padding: 28px 20px;
  }
}
