
/* ========== 基础重置与变量定义 ========== */
:root {
  --primary: #6d28d9;
  --primary-light: #8b5cf6;
  --primary-dark: #5b21b6;
  --secondary: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
  --white: #ffffff;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --purple-100: #f3e8ff;
  --purple-200: #e9d5ff;
  --purple-300: #d8b4fe;
  --purple-400: #c084fc;
  --purple-500: #a855f7;
  --purple-600: #9333ea;
  --purple-700: #7e22ce;

  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  --transition-default: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  line-height: 1.5;
  color: var(--gray-800);
  background-color: var(--gray-50);
  min-height: 100vh;
  padding: 1rem;
}

/* ========== 容器布局 ========== */
.container {
  display: grid;
  grid-template-columns: minmax(280px, 320px) 1fr;
  gap: 1.5rem;
  max-width: 1440px;
  margin: 0 auto;
  min-height: calc(100vh - 2rem);
}

@media (max-width: 768px) {
  .container {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* ========== 侧边栏 ========== */
.sidebar {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  box-shadow: var(--shadow-lg);
  height: fit-content;
  position: sticky;
  top: 1rem;
  border: 1px solid var(--gray-200);
}

.sidebar h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--gray-200);
}

/* ====== 高级用户信息面板 ====== */
.user-info {
  /*background: linear-gradient(135deg, rgba(70, 56, 143, 0.08), rgba(109, 40, 217, 0.05));*/
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(109, 40, 217, 0.15);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(8px);
  position: relative;
  overflow: hidden;
}

.user-info::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(190deg, var(--info), var(--purple-600))
}

/* 底部装饰条 */
.user-info::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(190deg, var(--purple-600), var(--info)); /* 反向渐变更好看 */
}

.user-meta {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
  z-index: 1;
}

#userPhoneDisplay {
  font-size: 0.9375rem;
  color: var(--gray-700);
  font-weight: 500;
  display: flex;
  align-items: center;
}

#userPhoneDisplay::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--purple-500);
  margin-right: 8px;
}

/* ========== 权限徽章 ========== */
.role-badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  text-align: center;
  position: relative;
  overflow: hidden;
  width: fit-content;
  transition: all 0.3s ease;
}

.role-badge.normal {
    background: rgb(64 171 229);
    color: #fff;
}

.role-badge.premium {
  background: linear-gradient(135deg, #50abc8, var(--purple-700));
  color: white;
  border: 1px solid var(--purple-500);
}

.role-badge.admin {
  background: linear-gradient(135deg, #ea3389, var(--purple-700));
  color: white;
  border: 1px solid var(--purple-700);
}

.role-badge.premium::after,
.role-badge.admin::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    to bottom right,
    rgba(255,255,255,0) 45%,
    rgba(255,255,255,0.15) 50%,
    rgba(255,255,255,0) 55%
  );
  transform: rotate(30deg);
  animation: shine 3s infinite;
}

/* ========== 退出按钮 ========== */
.logout-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.75rem;
  margin-top: 1rem;
  background: linear-gradient(135deg, #f32167, #9722ce);
    color: #fdfdfd;
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  transition: var(--transition-default);
}

.logout-button:hover {
  background: rgba(239, 68, 68, 0.1);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* ========== 主内容区 ========== */
.main-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-container {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--gray-200);
}

h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--gray-900);
  text-align: center;
  margin-bottom: 2rem;
}

/* ========== 输入框样式 ========== */
.input-wrapper {
  position: relative;
  margin-bottom: 1rem;
}

.input-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  color: var(--gray-500);
  pointer-events: none;
  width: 20px;
  text-align: center;
}

.modern-input {
  width: 100%;
  padding: 0.875rem 1.25rem 0.875rem 48px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  transition: var(--transition-default);
  height: 48px;
  line-height: normal;
}

.modern-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.15);
}

/* ========== 单选卡片组 ========== */
.radio-card-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 15px;
  margin-top: 1rem;
}

.radio-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: var(--transition-default);
  position: relative;
  background: var(--white);
}

.radio-card:hover {
  border-color: var(--primary-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.radio-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  height: 0;
  width: 0;
}

.radio-checkmark {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: 2px solid var(--gray-300);
  border-radius: 50%;
  margin-top: 2px;
  transition: var(--transition-default);
}

.radio-card input:checked ~ .radio-checkmark {
  background-color: var(--primary);
  border-color: var(--primary);
}

.radio-checkmark:after {
  content: "";
  display: none;
  position: absolute;
  top: 4px;
  left: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: white;
}

.radio-card input:checked ~ .radio-checkmark:after {
  display: block;
}

.card-content {
  flex: 1;
}

.card-title {
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 4px;
}

.card-description {
  font-size: 0.75rem;
  color: var(--gray-600);
  line-height: 1.4;
   position: relative;  /* 为绝对定位的points-cost提供参考 */
    padding-right: 70px; /* 为点数提示留出空间 */
}





/* ========== 主按钮样式 - 添加流光特效 ========== */
.primary-button {
  width: 100%;
  position: relative;
  overflow: hidden;
  /*display: inline-flex;*/
  align-items: center;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, #6812ef, #6585e9);
  border-radius: var(--radius-xl);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  box-shadow: none;
}


.primary-button:disabled {
  background: #ccc;
  color: #666;
  cursor: not-allowed;
}

/* 流光效果 */
.primary-button::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    to bottom right,
    rgba(255,255,255,0) 45%,
    rgba(255,255,255,0.15) 50%,
    rgba(255,255,255,0) 55%
  );
  transform: rotate(30deg);
  animation: shine 2s infinite;
  pointer-events: none;
}

.primary-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px rgba(109, 40, 217, 0.3);
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
}

.primary-button:active {
  transform: translateY(0);
  box-shadow: 0 4px 6px rgba(109, 40, 217, 0.2);
}

/* 按钮内光效流动 */
.primary-button::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  animation: shine 2s infinite;
  pointer-events: none;
  will-change: transform, left;
}

.primary-button:hover::after {
  left: 100%;
}

.button-icon {
  margin-left: 0.75rem;
  font-size: 1.25rem;
  transition: transform 0.3s ease;
}

.primary-button:hover .button-icon {
  transform: translateX(3px);
  animation: rocketPulse 0.5s infinite alternate;
}

/* 火箭图标动画 */
@keyframes rocketPulse {
  from {
    transform: translateX(3px) scale(1);
  }
  to {
    transform: translateX(3px) scale(1.2);
  }
}






/* ========== 状态显示 ========== */
#systemStatus {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
  padding: 0.875rem 1.25rem;
  background: var(--gray-50);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--info);
}

.task-status-container {
  margin: 1.5rem 0;
  min-height: 120px;
}

.status-card {
  display: none;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  margin: 0.5rem 0;
  border-left: 4px solid;
  animation: fadeIn 0.4s ease-out;
}

.status-queue {
  background-color: rgba(255, 193, 7, 0.1);
  border-left-color: #FFC107;
}

.status-loading {
  background-color: rgba(33, 150, 243, 0.1);
  border-left-color: #2196F3;
  text-align: center;
  padding: 1.5rem;
}

.status-response {
  background-color: rgba(233, 236, 239, 0.5);
  border-left-color: #6c757d;
}

.status-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.status-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

/* ========== 历史记录 ========== */
.history-item {
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius-md);
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  font-size: 0.875rem;
  transition: var(--transition-default);
  margin: 20px auto;
}

#noHistory,
#noMobileHistory {
  color: var(--gray-500);
  font-size: 0.875rem;
  text-align: center;
  padding: 1rem;
}

.mobile-history {
  display: none;
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  margin-top: 1.5rem;
  border: 1px solid var(--gray-200);
}

@media (max-width: 768px) {
  .mobile-history {
    display: block;
  }
}

/* ========== 动画 ========== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

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

@keyframes shine {
  0% { left: -100%; }
  50% { left: 100%; }
  100% { left: 100%; }
}




/* ========== 选择框容器 ========== */
.select-wrapper {
  position: relative;
  margin-bottom: 1rem;
}

/* ========== 自定义选择框样式 ========== */
.modern-select {
  width: 100%;
  padding: 0.875rem 2.5rem 0.875rem 1.25rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  color: var(--gray-700);
  background-color: var(--white);
  appearance: none; /* 移除原生下拉箭头 */
  transition: var(--transition-default);
  cursor: pointer;
  height: 48px; /* 固定高度保持统一 */
}

.modern-select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.15);
}

/* ========== 自定义下拉箭头 ========== */
.select-arrow {
  position: absolute;
  top: 50%;
  right: 1rem;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  pointer-events: none; /* 不阻挡点击事件 */
}

.select-arrow::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--gray-400);
  transition: var(--transition-default);
}

.modern-select:hover ~ .select-arrow::after {
  border-top-color: var(--gray-600);
}

.modern-select:focus ~ .select-arrow::after {
  border-top-color: var(--primary);
  transform: translate(-50%, -50%) rotate(180deg);
}

/* ========== 选项样式 ========== */
.modern-select option {
  padding: 0.5rem 1rem;
  color: var(--gray-800);
}

/* 分组标题样式 */
.modern-select optgroup {
  font-weight: 500;
  color: var(--gray-600);
  padding-top: 0.5rem;
}

/* ========== 错误状态 ========== */
.modern-select.invalid {
  border-color: var(--danger) !important;
}

#category-error {
  color: var(--danger);
  font-size: 0.8125rem;
  margin-top: 0.5rem;
  min-height: 18px;
}

/* ========== 响应式调整 ========== */
@media (max-width: 768px) {
  .modern-select {
    font-size: 0.875rem;
    padding: 0.75rem 2rem 0.75rem 1rem;
  }
}


.section-title{
    margin: 20px auto;
}



/* 移动端样式 - 隐藏历史记录区域 */
@media (max-width: 768px) {
  .sidebar {
    /* 确保sidebar是相对定位 */
    position: relative;
    top: auto;
  }
  
  /* 隐藏历史记录标题和列表 */
  .sidebar > h3,
  #historyList {
    display: none !important;
  }
  
  /* 确保用户信息区域保持显示 */
  .user-info {
    display: block !important;
  }
}


.radio-card-label {
    position: absolute;
    top: 0;
    right: 0;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 600;
    color: white;
    border-radius: 0 var(--radius-lg) 0 var(--radius-lg);
    z-index: 2;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* 使用现有配色变量 */
.label-free {
    background: linear-gradient(135deg, var(--warning), var(--danger));
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.label-vip {
    background: linear-gradient(135deg, var(--purple-400), var(--purple-600));
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
/* 复用已有动画 */
.label-free::after,
.label-vip::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        rgba(255,255,255,0) 0%,
        rgba(255,255,255,0.3) 50%,
        rgba(255,255,255,0) 100%
    );
    animation: shine 2s infinite;
}



.points-cost {
    position: absolute;
    right: 0;
    bottom: 0;
    font-size: 12px;
    color: #1a5276; /* 暗蓝色 */
    font-weight: 500;
}


/* 添加在CSS部分 */
.history-item {
    padding: 25px;
    margin-bottom: 10px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.result-link {
    margin: 8px 0;
    font-size: 14px;
}

.result-link a {
    color: #1890ff;
    text-decoration: none;
    transition: color 0.3s;
}

.result-link a:hover {
    color: #40a9ff;
    text-decoration: underline;
}



/* 咨询客服按钮 */
.consult-button {
  position: fixed;
  right: 2rem;
  bottom: 45%;
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  cursor: pointer;
  transition: transform 0.2s ease-in-out;
  background-color: transparent; /* 去掉调试色后恢复 */
}

@media (max-width: 768px) {
  .consult-button {
      right: 0.5rem;
    width: 54px;
    height: 54px;
  }
}

/* 图标大小 */
.consult-button .icon {
  width: 80px;
  height: 80px;
  pointer-events: none;
  transition: transform 0.2s ease;
}

.consult-button:hover .icon {
  transform: scale(1.1);
}

/* 弹窗样式 */
.modal {
  position: fixed;
  right: 0.5rem;
  bottom: 45%;
  background-color: white;
  padding: 1rem;
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 10000;
  animation: fadeIn 0.3s ease-in-out;
}

.modal.hidden {
  display: none;
}

.modal.show {
  animation: fadeIn 0.3s ease-in-out;
}

.modal img {
  width: 150px;
  height: auto;
}
