/* 个人中心 - 扁平简约风格 */

.profile-main {
  padding: 2rem 0 4rem;
  background: var(--bg);
  min-height: calc(100vh - 64px - 150px);
}

/* 用户概览 */
.profile-overview {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 2rem;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  color: #fff;
}

.avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
}

.overview-info h1 {
  margin: 0 0 0.25rem;
  font-size: 1.35rem;
  font-weight: 600;
}

.overview-info p {
  margin: 0;
  opacity: 0.75;
  font-size: 0.9rem;
}

/* 内容区 */
.profile-content {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* 区块 */
.profile-section {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.section-title h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.btn-text {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
}

.btn-text:hover {
  color: var(--accent-dark);
}

/* 信息网格 */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.info-item {
  padding: 0.75rem 1rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

.info-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.info-value {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
}

/* 编辑表单 */
.edit-form {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.edit-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.edit-row label {
  width: 50px;
  flex-shrink: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.edit-row .form-input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
}

.edit-actions {
  display: flex;
  gap: 0.5rem;
  margin-left: calc(50px + 0.75rem);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}

.btn-ghost:hover {
  background: var(--bg);
  color: var(--text);
}

/* 订单列表 */
.order-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.order-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  transition: transform 0.2s;
}

.order-item:hover {
  transform: translateX(4px);
}

.order-info {
  flex: 1;
}

.order-title {
  font-weight: 500;
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
}

.order-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

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

.order-price {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
}

.order-status {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
}

.order-status--completed {
  background: #d1fae5;
  color: #059669;
}

.order-status--pending {
  background: #fef3c7;
  color: #d97706;
}

/* ==================== 我的激活码 — 均衡布局 ==================== */

.profile-section--licenses {
  padding: 1.25rem;
}

.section-title--licenses {
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-title--licenses h2 {
  font-size: 1rem;
  margin: 0;
}

.section-title--licenses .section-hint {
  margin-left: auto;
  font-size: 0.85rem;
  color: #728aa5;
}

/* 激活码网格 */
.license-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

/* ====== 激活码卡片 ====== */
.license-card {
  background: #fff;
  border-radius: 12px;
  padding: 12px 16px;
  border: 1px solid #eef2f7;
  transition: all 0.15s ease;
}

.license-card:hover {
  border-color: #d0ddee;
}

/* 行布局 */
.license-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.license-row + .license-row {
  margin-top: 8px;
}

/* 左侧：产品 + 版本 + 激活码 + 复制按钮 */
.license-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.product-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: #1a2a3a;
}

.product-version {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}

.code-text {
  font-family: 'JetBrains Mono', 'SF Mono', monospace;
  font-weight: 600;
  font-size: 1.2rem;
  color: #6366f1;
}

/* 复制按钮 */
.copy-btn {
  background: #f0f4ff;
  border: 1px solid #c7d2fe;
  color: #6366f1;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.copy-btn:hover {
  background: #e0e7ff;
  border-color: #a5b4fc;
}

.copy-btn:disabled {
  background: #e8f5e9;
  border-color: #a5d6a7;
  color: #2e7d32;
}

/* 状态标签 */
.license-status {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 10px;
}

.license-status--active { background: #e8f5e9; color: #2e7d32; }
.license-status--unused { background: #fff8e1; color: #f57c00; }
.license-status--used { background: #f5f5f5; color: #757575; }
.license-status--expired { background: #ffebee; color: #c62828; }
.license-status--disabled { background: #fce4ec; color: #ad1457; }

/* 信息行 - 均匀分布 */
.license-info {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  justify-content: flex-start;
}

.license-info > span {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
}

.license-info label {
  color: #8896a6;
  font-size: 0.75rem;
}

.license-info span:not(label) {
  color: #1a2a3a;
  font-weight: 500;
}

/* 设备绑定 */
.license-row > label {
  color: #8896a6;
  font-size: 0.75rem;
  margin-right: 6px;
}

.devices-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  flex: 1;
}

.device-id {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  background: #f5f7fa;
  padding: 2px 6px;
  border-radius: 4px;
  color: #4a5568;
  border: 1px solid #e2e8f0;
}

/* 空状态 */
.empty-state--licenses {
  text-align: center;
  padding: 36px 20px;
  background: #fafcff;
  border-radius: 12px;
  border: 1px dashed #d9e2ef;
}

.empty-state--licenses p {
  color: #5b7393;
  margin-bottom: 16px;
}

/* ====== 响应式 ====== */
@media (max-width: 640px) {
  .license-left {
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .license-info {
    gap: 8px 16px;
  }
  
  .license-info > span {
    min-width: calc(50% - 8px);
  }
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
}

.empty-state p {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
}

/* 响应式 */
@media (max-width: 768px) {
  .profile-overview {
    padding: 1.5rem;
  }

  .avatar {
    width: 52px;
    height: 52px;
    font-size: 1.25rem;
  }

  .overview-info h1 {
    font-size: 1.15rem;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

  .order-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

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

  .edit-actions {
    margin-left: 0;
  }
}

/* 更换手机号弹窗 */
.phone-change-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.phone-change-modal .modal-content {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 1.5rem;
  width: 90%;
  max-width: 400px;
}

.phone-change-modal h3 {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  color: var(--text);
}

.phone-change-modal .edit-row {
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}

.phone-change-modal .edit-row label {
  width: 70px;
  flex-shrink: 0;
}

.phone-change-modal .input-with-btn {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 8px;
}

.phone-change-modal .input-with-btn .form-input {
  flex: 1;
  min-width: 0;
}

.phone-change-modal .btn-code {
  white-space: nowrap;
  font-size: 0.8rem;
  padding: 0.5rem 0.75rem;
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #fff;
  flex-shrink: 0;
}

.phone-change-modal .btn-code:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.phone-change-modal .btn-code:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: var(--bg);
  border-color: var(--border);
  color: var(--text-muted);
}

.phone-change-modal .edit-actions {
  margin-left: 0;
  margin-top: 1rem;
  justify-content: flex-end;
}
