/* ========== 用户中心模块样式 ========== */

/* 本地变量代理到全局主题变量（见 theme.css） */
.uc-container {
    --uc-primary: var(--theme-primary);
    --uc-primary-dark: var(--theme-primary-dark);
    --uc-primary-light: var(--theme-primary-light);

  /* 文本颜色 */
  --uc-text-primary: #333333;
  --uc-text-secondary: #666666;
  --uc-text-muted: #999999;

  /* 背景与边框 */
  --uc-bg-white: #FFFFFF;
  --uc-bg-light: #F5F5F5;
    --uc-border: var(--theme-border);
    --uc-border-light: var(--theme-border-light);
    --uc-hover-bg: var(--theme-primary-06);

  /* 间距系统 */
  --uc-space-xs: 4px;
  --uc-space-sm: 8px;
  --uc-space-md: 16px;
  --uc-space-lg: 24px;
  --uc-space-xl: 32px;
  --uc-space-2xl: 48px;

  /* 圆角系统 */
  --uc-radius-sm: 8px;
  --uc-radius-md: 12px;
  --uc-radius-lg: 16px;

  /* 阴影 */
  --uc-shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.06);
  --uc-shadow-md: 0 2px 8px rgba(196, 113, 74, 0.1);
  --uc-shadow-lg: 0 12px 32px rgba(196, 113, 74, 0.12);
}

/* ========== 容器和布局 ========== */
.uc-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--uc-space-lg);
}

.uc-header {
  text-align: center;
  margin-bottom: var(--uc-space-2xl);
}

.uc-title {
  font-size: 2.5rem;
  font-weight: 400;
  color: var(--uc-text-primary);
  margin-bottom: var(--uc-space-sm);
  letter-spacing: -0.02em;
}

.uc-subtitle {
  font-size: 1.125rem;
  color: var(--uc-text-secondary);
  font-weight: 400;
}

/* 主体布局 - 侧边栏 + 内容 */
.uc-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: var(--uc-space-xl);
}

/* ========== 左侧导航栏 ========== */
.uc-sidebar {
  height: fit-content;
  position: sticky;
  top: 100px;
}

.uc-nav {
  display: flex;
  flex-direction: column;
  gap: var(--uc-space-md);
  background: var(--uc-bg-white);
  border: 1px solid var(--uc-border);
  border-radius: var(--uc-radius-lg);
  padding: var(--uc-space-lg);
  backdrop-filter: blur(12px);
}

.uc-nav-item {
  display: flex;
  align-items: center;
  gap: var(--uc-space-md);
  padding: var(--uc-space-md) var(--uc-space-lg);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--uc-radius-md);
  color: var(--uc-text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.uc-nav-item:hover {
  background: var(--uc-hover-bg);
  border-color: var(--uc-border-light);
}

.uc-nav-item.active {
  background: var(--uc-primary);
  color: var(--uc-bg-white);
  border-color: var(--uc-primary);
  font-weight: 600;
}

.uc-nav-icon {
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.uc-nav-label {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ========== 右侧主体内容 ========== */
.uc-main {
  display: flex;
  flex-direction: column;
  gap: var(--uc-space-xl);
  min-width: 0; /* 允许网格列收缩，使长标题触发省略号而非溢出右侧 */
}

/* ========== 积分余额卡片 ========== */
.uc-balance-card {
  display: flex;
  align-items: center;
  gap: var(--uc-space-lg);
  padding: var(--uc-space-xl);
    background: linear-gradient(135deg, var(--uc-bg-white) 0%, var(--theme-primary-03) 100%);
  border: 1px solid var(--uc-border);
  border-radius: var(--uc-radius-lg);
  box-shadow: var(--uc-shadow-md);
  transition: all 0.3s ease;
}

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

.uc-balance-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(196, 113, 74, 0.12);
  border-radius: var(--uc-radius-md);
  font-size: 32px;
  flex-shrink: 0;
}

.uc-balance-info {
  flex: 1;
}

.uc-balance-label {
  font-size: 0.9rem;
  color: var(--uc-text-secondary);
  font-weight: 500;
  margin-bottom: var(--uc-space-xs);
}

.uc-balance-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--uc-primary-dark);
  line-height: 1;
}

.uc-recharge-btn {
  display: flex;
  align-items: center;
  gap: var(--uc-space-sm);
  padding: var(--uc-space-md) var(--uc-space-lg);
  background: var(--uc-primary);
  border: none;
  border-radius: var(--uc-radius-md);
  color: var(--uc-bg-white);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.uc-recharge-btn:hover {
  background: var(--uc-primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--uc-shadow-md);
}

.uc-recharge-btn svg {
  width: 20px;
  height: 20px;
}

/* ========== 内容区域（透明容器，卡片下移到 .uc-section） ========== */
.uc-content {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  box-shadow: none;
}

/* 每个区块独立成卡（credits tab 含 Breakdown + History 两块 = 两张卡） */
.uc-section {
  background: var(--uc-bg-white);
  border: 1px solid var(--uc-border);
  border-radius: var(--uc-radius-lg);
  padding: var(--uc-space-xl);
  box-shadow: var(--uc-shadow-md);
}

.uc-tab-pane {
  display: none;
}

.uc-tab-pane.active {
  display: flex;
  flex-direction: column;
  gap: var(--uc-space-xl);
  animation: ucFadeIn 0.3s ease;
}

@keyframes ucFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========== 区域标题 ========== */
.uc-section-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--uc-text-primary);
  margin-bottom: var(--uc-space-lg);
  position: relative;
  padding-bottom: var(--uc-space-md);
}

.uc-section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 48px;
  height: 3px;
  background: var(--uc-primary);
  border-radius: 2px;
}

/* ========== 表格样式 ========== */
.uc-table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: var(--uc-space-lg) 0;
}

.uc-table-scroll::-webkit-scrollbar {
  height: 6px;
}

.uc-table-scroll::-webkit-scrollbar-thumb {
  background: rgba(196, 113, 74, 0.2);
  border-radius: 8px;
}

.uc-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.95rem;
}

.uc-table thead th {
  text-align: left;
  font-weight: 600;
  color: var(--uc-text-primary);
  background: rgba(196, 113, 74, 0.06);
  padding: var(--uc-space-md) var(--uc-space-lg);
  border-bottom: 1px solid var(--uc-border);
  white-space: nowrap;
}

.uc-table tbody td {
  color: var(--uc-text-secondary);
  padding: var(--uc-space-md) var(--uc-space-lg);
  border-bottom: 1px solid var(--uc-border-light);
  background: transparent;
}

.uc-table tbody tr:hover {
  background: var(--uc-hover-bg);
}

.uc-amount-positive {
  color: var(--uc-primary);
  font-weight: 700;
}

.uc-amount-negative {
  color: #d32f2f;
  font-weight: 700;
}

.uc-status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(196, 113, 74, 0.1);
  color: var(--uc-primary-dark);
  border: 1px solid rgba(196, 113, 74, 0.2);
}

/* ========== Credits Breakdown ========== */
/* 与 .uc-history-list 保持一致的布局上下文，避免表格上方间距不一致 */
.uc-breakdown-list {
  display: grid;
  gap: var(--uc-space-md);
}

.uc-bk-source {
  font-weight: 400;
  color: var(--uc-text-primary);
}

.uc-bk-balance {
  font-weight: 400;
  color: var(--uc-text-primary);
}

.uc-bk-of {
  font-size: 0.8rem;
  color: var(--uc-text-muted);
}

.uc-date {
  color: var(--uc-text-secondary);
  white-space: nowrap;
}

.uc-date-sep {
  margin: 0 6px;
  color: var(--uc-text-muted);
}

.uc-never-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  font-weight: 500;
  color: #3F9D6B;
  background: #EAF5EF;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.uc-breakdown-empty {
  color: var(--uc-text-muted);
  padding: 8px 0;
}

/* ========== 历史记录列表 ========== */
.uc-history-list {
  display: grid;
  gap: var(--uc-space-md);
}

.uc-history-item {
  display: flex;
  align-items: center;
  gap: var(--uc-space-md);
  padding: var(--uc-space-lg);
  background: var(--uc-bg-light);
  border: 1px solid var(--uc-border-light);
  border-radius: var(--uc-radius-md);
  transition: all 0.3s ease;
}

.uc-history-item:hover {
  background: var(--uc-hover-bg);
  border-color: var(--uc-border);
}

.uc-history-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(196, 113, 74, 0.1);
  border-radius: var(--uc-radius-md);
  flex-shrink: 0;
  font-size: 18px;
}

.uc-history-content {
  flex: 1;
}

.uc-history-title {
  font-weight: 600;
  color: var(--uc-text-primary);
  margin-bottom: var(--uc-space-xs);
}

.uc-history-desc {
  font-size: 0.85rem;
  color: var(--uc-text-secondary);
  opacity: 0.8;
}

.uc-history-meta {
  display: flex;
  gap: var(--uc-space-md);
  font-size: 0.8rem;
  color: var(--uc-text-muted);
  margin-top: var(--uc-space-sm);
}

.uc-history-amount {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--uc-text-primary);
  flex-shrink: 0;
}

/* ========== 订单卡片网格 ========== */
.uc-orders-grid {
  display: grid;
  gap: var(--uc-space-lg);
}

.uc-order-card {
  padding: var(--uc-space-lg);
  background: var(--uc-bg-light);
  border: 1px solid var(--uc-border-light);
  border-radius: var(--uc-radius-md);
  transition: all 0.3s ease;
}

.uc-order-card:hover {
  transform: translateY(-4px);
  border-color: var(--uc-border);
  box-shadow: var(--uc-shadow-md);
}

/* ========== 作品卡片网格 ========== */
.uc-works-grid {
    display: flex;
    flex-direction: column;
    gap: var(--uc-space-sm);
}

.uc-work-card {
    background: var(--uc-bg-white);
    border: 1px solid var(--uc-border-light);
    border-radius: var(--uc-radius-lg);
    padding: var(--uc-space-md) var(--uc-space-lg);
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--uc-space-md);
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.uc-work-card:hover {
    border-color: var(--uc-primary);
    background: var(--uc-hover-bg);
}

.uc-work-header {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
}

.uc-work-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--uc-text-primary);
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s ease;
}

.uc-work-card:hover .uc-work-title {
    color: var(--uc-primary);
}

.uc-work-actions {
    display: flex;
    align-items: center;
    gap: var(--uc-space-sm);
    position: relative;
    flex-shrink: 0;
}

.uc-work-edit-btn {
    display: flex;
    align-items: center;
  gap: 5px;
  padding: 6px 14px;
  background: var(--uc-primary);
  color: #fff;
    border: none;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
  flex-shrink: 0;
}

.uc-work-edit-btn:hover {
  background: #A85D39;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(196, 113, 74, 0.35);
}

.uc-work-edit-btn svg {
  width: 13px;
  height: 13px;
}

.uc-work-footer {
    display: flex;
    align-items: center;
    gap: var(--uc-space-md);
    flex-shrink: 0;
}

.uc-work-date {
    font-size: 0.85rem;
    color: var(--uc-text-muted);
}

/* ========== 移动端积分/订单卡片列表 ========== */
.uc-mobile-list {
    display: flex;
    flex-direction: column;
    gap: var(--uc-space-sm);
}

.uc-m-card {
    background: var(--uc-bg-white);
    border: 1px solid var(--uc-border-light);
    border-radius: var(--uc-radius-md);
    padding: var(--uc-space-md) var(--uc-space-lg);
}

.uc-m-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--uc-space-sm);
}

.uc-m-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--uc-text-primary);
}

.uc-m-amount {
    font-size: 0.95rem;
    font-weight: 700;
    flex-shrink: 0;
}

.uc-m-sub {
    margin-top: 3px;
    font-size: 0.82rem;
    color: var(--uc-text-secondary);
}

.uc-m-meta {
    margin-top: 4px;
}

.uc-m-time {
    font-size: 0.78rem;
    color: var(--uc-text-muted);
}

/* ========== 订单部分 ========== */
.uc-order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--uc-space-md);
  padding-bottom: var(--uc-space-md);
  border-bottom: 1px solid var(--uc-border-light);
}

.uc-order-id {
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--uc-text-secondary);
}

.uc-order-status {
  padding: 4px 12px;
  background: rgba(196, 113, 74, 0.1);
  color: var(--uc-primary-dark);
  border: 1px solid rgba(196, 113, 74, 0.2);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.uc-order-body {
  margin-bottom: var(--uc-space-lg);
}

.uc-order-product {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--uc-text-primary);
  margin-bottom: var(--uc-space-sm);
}

.uc-order-amount {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--uc-primary);
}

.uc-order-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--uc-space-md);
}

.uc-order-date {
  font-size: 0.85rem;
  color: var(--uc-text-secondary);
  opacity: 0.7;
}

.uc-order-actions {
  display: flex;
  gap: var(--uc-space-sm);
}

.uc-btn {
  padding: 8px 16px;
  border: none;
  border-radius: var(--uc-radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

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

.uc-btn-primary:hover {
  background: var(--uc-primary-dark);
  transform: translateY(-1px);
}

.uc-btn-secondary {
  background: rgba(196, 113, 74, 0.1);
  color: var(--uc-primary);
  border: 1px solid rgba(196, 113, 74, 0.2);
}

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

.uc-btn-danger {
  background: rgba(244, 67, 54, 0.1);
  color: #c62828;
  border: 1px solid rgba(244, 67, 54, 0.2);
}

.uc-btn-danger:hover {
  background: #ef5350;
  color: var(--uc-bg-white);
}

/* ========== Load More 按钮 ========== */
.uc-load-more-container {
  display: flex;
  justify-content: center;
  padding: var(--uc-space-xl) 0;
}

.uc-load-more-btn {
  padding: 10px 28px;
  background: rgba(196, 113, 74, 0.1);
  border: 1px solid rgba(196, 113, 74, 0.3);
  border-radius: var(--uc-radius-md);
  color: var(--uc-primary);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.uc-load-more-btn:hover {
  background: var(--uc-primary);
  color: var(--uc-bg-white);
}

/* ========== 移动端适配 ========== */
@media (max-width: 768px) {
  .uc-container {
    padding: var(--uc-space-md);
  }

  .uc-title {
    font-size: 2rem;
  }

  .uc-subtitle {
    font-size: 1rem;
  }

  /* 移动端改为单列 */
  .uc-layout {
    grid-template-columns: 1fr;
    gap: var(--uc-space-lg);
  }

  /* 导航变为横向按钮 */
  .uc-sidebar {
    position: static;
  }

  .uc-nav {
    flex-direction: row;
    gap: var(--uc-space-sm);
    padding: var(--uc-space-md);
  }

  .uc-nav-item {
    flex: 1;
    justify-content: center;
    padding: var(--uc-space-sm) var(--uc-space-md);
  }

  .uc-nav-label {
    display: none;
  }

  .uc-nav-item.active .uc-nav-label {
    display: inline;
    white-space: nowrap;
    font-size: 0.78rem;
  }

  /* 积分卡片改为上下布局 */
  .uc-balance-card {
    flex-direction: column;
    text-align: center;
    gap: var(--uc-space-md);
  }

  .uc-balance-icon {
    margin: 0 auto;
  }

  .uc-recharge-btn {
    width: 100%;
    justify-content: center;
  }

  /* 内容区缩小padding */
  .uc-section {
    padding: var(--uc-space-lg);
  }

  .uc-table {
    font-size: 0.85rem;
  }

  .uc-table thead th,
  .uc-table tbody td {
    padding: var(--uc-space-sm) var(--uc-space-md);
  }

  .uc-order-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .uc-order-actions {
    width: 100%;
  }

  .uc-btn {
    flex: 1;
  }

    /* 移动端作品列表恢复多列网格 + 竖向卡片 */
    .uc-works-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: var(--uc-space-lg);
    }

    .uc-work-card {
        flex-direction: column;
        align-items: stretch;
        padding: var(--uc-space-lg);
    }

    .uc-work-header {
        flex: unset;
        margin-bottom: var(--uc-space-md);
    }

    .uc-work-title {
        font-size: 0.88rem;
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .uc-work-footer {
        flex-shrink: unset;
        justify-content: space-between;
        padding-top: var(--uc-space-sm);
        margin-top: auto;
    }

    .uc-work-edit-btn {
        display: flex;
    }
}

@media (max-width: 480px) {
  .uc-container {
    padding: var(--uc-space-sm);
  }

  .uc-title {
    font-size: 1.5rem;
  }

  .uc-subtitle {
    font-size: 0.9rem;
  }

  .uc-balance-value {
    font-size: 2rem;
  }

  .uc-balance-icon {
    width: 48px;
    height: 48px;
    font-size: 24px;
  }

  .uc-section {
    padding: var(--uc-space-md);
  }

  .uc-section-title {
    font-size: 1.1rem;
  }

  .uc-history-item,
  .uc-order-card {
    padding: var(--uc-space-md);
  }

  .uc-table {
    font-size: 0.8rem;
  }
}
