/* ========== 全局背景 ========== */
body {
  overflow-x: hidden;
  background:
    linear-gradient(115deg, rgba(254, 218, 117, 0.24), transparent 34%),
    linear-gradient(250deg, rgba(214, 41, 118, 0.13), transparent 38%),
    linear-gradient(135deg, #fff7ed 0%, #fff 42%, #fdf2f8 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.5) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent 78%);
}

/* ========== 页面容器 ========== */
.page-container {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 46px;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ========== Profile 头部 ========== */
.profile-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: 28px 0 16px;
  border-bottom: 1px solid #d6d3d1;
}

.profile-avatar {
  width: 112px;
  aspect-ratio: 1;
  padding: 5px;
  border-radius: 999px;
  background: linear-gradient(145deg, #feda75, #fa7e1e 28%, #d62976 58%, #962fbf 78%, #4f5bd5);
  box-shadow: 0 18px 40px rgba(214, 41, 118, 0.26);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.35s ease,
              padding 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: default;
}

.profile-avatar:hover {
  transform: scale(1.06);
  padding: 2px;
  box-shadow: 0 24px 54px rgba(214, 41, 118, 0.42);
}

.profile-avatar:hover img {
  filter: brightness(1.08) saturate(1.12);
}

.profile-avatar a {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
}

.profile-avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 5px solid #fff;
  border-radius: inherit;
  transition: filter 0.35s ease;
}

.profile-copy {
  min-width: 0;
}

.profile-copy h2 {
  color: #18181b;
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -0.025em;
  font-size: clamp(30px, 6vw, 56px);
}

.eyebrow {
  color: #be185d;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* ========== 统计卡片 ========== */
.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(72px, 1fr));
  gap: 10px;
  min-width: 270px;
}

.profile-stats div {
  padding: 14px 12px;
  border: 1px solid rgba(231, 229, 228, 0.86);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.66);
  text-align: center;
}

.profile-stats strong {
  display: block;
  color: #18181b;
  font-size: 20px;
  line-height: 1;
}

.stat-clickable {
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.stat-clickable:hover {
  transform: translateY(-3px);
  border-color: #db2777;
  box-shadow: 0 8px 24px rgba(219, 39, 119, 0.14);
}

.stat-clickable:active {
  transform: translateY(-1px);
}

.profile-stats span {
  display: block;
  margin-top: 6px;
  color: #78716c;
  font-size: 12px;
  white-space: nowrap;
}

/* ========== 分区标题 ========== */
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-top: 32px;
  padding-top: 0px;
  border-top: 1px solid #d6d3d1;
  margin-bottom: 18px;
}

.profile-hero + .section-heading {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

/* ========== 工具卡片网格 ========== */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.tool-card {
  position: relative;
  overflow: hidden;
  min-height: 220px;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  color: inherit;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 24px 54px rgba(68, 64, 60, 0.1);
  backdrop-filter: blur(18px);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.tool-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.6), transparent 42%);
}

.tool-card.is-live:hover {
  transform: translateY(-6px);
  border-color: rgba(219, 39, 119, 0.28);
  box-shadow: 0 30px 70px rgba(219, 39, 119, 0.18);
}

.tool-card.coming-soon {
  opacity: 0.78;
  pointer-events: none;
}

/* ========== 卡片内容 ========== */
.tool-body {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px;
}

.tool-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

.tool-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.tool-tag.available {
  color: #047857;
  background: #ecfdf5;
}

.tool-tag.soon {
  color: #78716c;
  background: #f5f5f4;
}

.tool-save {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid #f5d0fe;
  border-radius: 999px;
  color: #be185d;
  background: #fff;
  font-size: 19px;
}

.tool-card h3 {
  color: #18181b;
  font-size: 21px;
  line-height: 1.25;
}

.tool-card p {
  margin-top: 10px;
  color: #57534e;
  font-size: 14px;
}

.tool-warning {
  margin-top: auto;
  padding: 8px 12px;
  border-radius: 6px;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  font-size: 12px;
  font-weight: 500;
}

.tool-card .tool-warning {
  margin-top: auto;
}

.tool-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: auto;
  padding-top: 18px;
  color: #db2777;
  font-size: 14px;
  font-weight: 800;
}

.tool-link.muted {
  color: #a8a29e;
}

/* ========== TODO 清单 ========== */
.todo-list {
  position: relative;
  display: grid;
  gap: 10px;
  max-width: 720px;
  overflow: hidden;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.5)),
    linear-gradient(135deg, rgba(254, 218, 117, 0.18), rgba(219, 39, 119, 0.08));
  box-shadow: 0 22px 50px rgba(68, 64, 60, 0.08);
  backdrop-filter: blur(16px);
}

.todo-list::before {
  content: "";
  position: absolute;
  left: 24px;
  top: 34px;
  bottom: 34px;
  width: 2px;
  border-radius: 999px;
  background: linear-gradient(to bottom, #db2777, rgba(219, 39, 119, 0.08));
}

.todo-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 12px 14px 12px 44px;
  border: 1px solid rgba(231, 229, 228, 0.62);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 24px rgba(68, 64, 60, 0.05);
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.todo-item:hover {
  transform: translateY(-2px);
  border-color: rgba(219, 39, 119, 0.18);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 16px 34px rgba(190, 24, 93, 0.1);
}

.todo-check {
  position: absolute;
  left: 22px;
  top: 50%;
  transform: translate(-50%, -50%);
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 2px solid #f9a8d4;
  background: #fff;
  box-shadow: 0 0 0 5px rgba(249, 168, 212, 0.14);
  transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
}

.todo-item.done .todo-check {
  background-color: #10b981;
  border-color: #10b981;
  box-shadow: 0 0 0 5px rgba(16, 185, 129, 0.14);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
  background-size: 13px 13px;
  background-position: center;
  background-repeat: no-repeat;
}

.todo-text {
  color: #292524;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: 0;
}

.todo-item.done .todo-text {
  color: #78716c;
  text-decoration: line-through;
  text-decoration-color: rgba(120, 113, 108, 0.62);
  text-decoration-thickness: 2px;
}

/* ========== Toast 消息通知 ========== */
.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: min(420px, calc(100% - 32px));
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(16px);
  transform: translateX(-50%) translateY(calc(-100% - 32px));
  opacity: 0;
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.25s ease;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast.success {
  background: rgba(4, 120, 87, 0.92);
}

.toast.error {
  background: rgba(220, 38, 38, 0.92);
}

/* ========== 弹窗 ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 15, 15, 0.45);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay[aria-hidden="false"] {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: min(480px, calc(100% - 40px));
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 32px 72px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(24px);
  padding: 28px;
  transform: translateY(12px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay[aria-hidden="false"] .modal-card {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-header h3 {
  color: #18181b;
  font-size: 20px;
  font-weight: 600;
}

.modal-close {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid #e7e5e4;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: #78716c;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: #f5f5f4;
  color: #18181b;
}

.modal-textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #e7e5e4;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  color: #18181b;
  background: #fafaf9;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.modal-textarea:focus {
  border-color: #db2777;
  box-shadow: 0 0 0 3px rgba(219, 39, 119, 0.1);
}

.modal-textarea::placeholder {
  color: #a8a29e;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 16px;
}

.modal-submit {
  padding: 9px 22px;
  border: none;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #db2777, #c026d3);
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.modal-submit:hover:not(:disabled) {
  transform: translateY(-1px);
}

.modal-submit:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ========== 底部统计 ========== */
.page-footer {
  display: flex;
  justify-content: center;
  margin-top: auto;
  padding-top: 34px;
}

.site-stats {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: 999px;
  color: #78716c;
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 14px 32px rgba(120, 53, 15, 0.08);
  backdrop-filter: blur(16px);
  font-size: 13px;
}

.site-stats .pipe {
  color: #d6d3d1;
}

.site-stats .stats-label {
  color: #78716c;
  font-size: 12px;
}

.site-stats .stats-sep {
  color: #d6d3d1;
  margin: 0 2px;
}

.site-stats .stats-num {
  color: #db2777;
  font-weight: 800;
  font-family: "SF Mono", "Cascadia Code", "Consolas", monospace;
  font-size: 15px;
  text-shadow: 0 0 12px rgba(219, 39, 119, 0.25);
}

/* ========== 响应式 ========== */
@media (max-width: 920px) {
  .profile-hero {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .profile-stats {
    grid-column: 1 / -1;
    min-width: 0;
  }

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

@media (max-width: 680px) {
  .page-container {
    width: min(100% - 24px, 1080px);
    padding: 22px 0 34px;
  }

  .profile-hero {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 18px;
    padding: 22px 0 20px;
  }

  .profile-avatar {
    width: 96px;
  }

  .profile-stats {
    width: 100%;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

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

  .tool-card {
    min-height: 0;
  }

  .site-stats {
    flex-wrap: wrap;
    justify-content: center;
    height: auto;
    min-height: 38px;
    padding: 8px 14px;
  }
}

@media (max-width: 420px) {
  .profile-stats {
    grid-template-columns: 1fr;
  }

  .profile-stats div {
    padding: 12px;
  }
}
