/* ============================================
   MyHub - 个人数字中枢
   设计系统：深色玻璃拟态 + 紫蓝渐变
   ============================================ */

:root {
  /* 背景色阶 */
  --bg-base: #0F172A;
  --bg-deep: #0A0F1F;
  --bg-card: #192134;
  --bg-card-hover: #1F2841;

  /* 强调色 */
  --accent-1: #4338CA;
  --accent-2: #7C3AED;
  --accent-grad: linear-gradient(135deg, #4338CA 0%, #7C3AED 100%);

  /* 文字色 */
  --text-primary: #FFFFFF;
  --text-secondary: #9CA3B5;
  --text-muted: #6B7280;
  --text-link: #A78BFA;

  /* 边框 */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-light: rgba(255, 255, 255, 0.12);

  /* 阴影 */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);

  /* 圆角 */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;

  /* 间距 */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;

  /* 字体 */
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  --font-mono: "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
}

/* ============================================
   Reset
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

img {
  max-width: 100%;
  display: block;
}

/* ============================================
   整体布局
   ============================================ */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-base);
}

.container {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 40px;
}

.page-content {
  flex: 1;
  padding: var(--sp-6) 0 var(--sp-8);
}

/* ============================================
   顶部导航栏
   ============================================ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  height: 64px;
}

.navbar-inner {
  display: flex;
  align-items: center;
  height: 100%;
  gap: var(--sp-6);
}

.brand {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  margin-left: var(--sp-6);
}

.nav-link {
  font-size: 14px;
  color: var(--text-secondary);
  font-weight: 500;
  padding: 6px 4px;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
}

.nav-link:hover {
  color: var(--text-primary);
}

.nav-link.active {
  color: var(--text-primary);
  border-bottom-color: var(--accent-2);
}

.nav-search {
  flex: 1;
  max-width: 320px;
  margin-left: auto;
  position: relative;
}

.nav-search input {
  width: 100%;
  height: 36px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  padding: 0 12px 0 36px;
  font-size: 13px;
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.nav-search input::placeholder {
  color: var(--text-muted);
}

.nav-search input:focus {
  border-color: var(--accent-2);
  background: rgba(255, 255, 255, 0.08);
}

.nav-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent-grad);
  color: #fff;
  box-shadow: 0 2px 12px rgba(124, 58, 237, 0.3);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.45);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-light);
}

.btn-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.nav-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(124, 58, 237, 0.12);
  border: 1px solid rgba(124, 58, 237, 0.3);
  border-radius: 999px;
  font-size: 12px;
  color: #C4B5FD;
  font-weight: 500;
}

.nav-status::before {
  content: "";
  width: 6px;
  height: 6px;
  background: #A78BFA;
  border-radius: 50%;
  box-shadow: 0 0 8px #A78BFA;
}

/* 返回按钮 */
.nav-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 36px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  margin-left: auto;
  transition: all 0.2s ease;
}

.nav-back:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* ============================================
   Hero 区
   ============================================ */
.hero {
  position: relative;
  padding: 80px 40px;
  margin-bottom: 0;
  overflow: hidden;
  background: var(--bg-base);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url('../assets/hero-bg.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.85;
  z-index: 0;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(15, 23, 42, 0.5) 80%, var(--bg-base) 100%);
  z-index: 1;
}

.hero-inner {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}

.hero h1 {
  font-size: 42px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: var(--sp-3);
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.hero p {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: var(--sp-5);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.3);
}

.hero-stats {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-4);
  padding: 10px 24px;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-light);
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-primary);
}

.hero-stat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hero-stat strong {
  color: #fff;
  font-weight: 600;
}

.hero-stat-sep {
  color: var(--text-muted);
}

/* ============================================
   区域标题
   ============================================ */
.section {
  margin-top: var(--sp-7);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-5);
}

.section-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

/* 分类标签 */
.tabs {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin-bottom: var(--sp-5);
  flex-wrap: wrap;
}

.tab {
  height: 32px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  transition: all 0.2s ease;
}

.tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

.tab.active {
  color: #fff;
  background: var(--accent-grad);
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}

/* ============================================
   卡片 - 通用
   ============================================ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  transition: all 0.2s ease;
  cursor: pointer;
  overflow: hidden;
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

/* ============================================
   书签/工具小卡片（首页）
   ============================================ */
.mini-card-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}

.mini-card-grid.two-rows {
  grid-template-rows: auto auto;
}

.mini-card {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  height: 48px;
  padding: 0 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
}

.mini-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
  transform: translateY(-1px);
}

.mini-card-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
}

.mini-card-name {
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-card-add {
  background: rgba(124, 58, 237, 0.1);
  border: 1px dashed rgba(124, 58, 237, 0.4);
  color: #A78BFA;
  justify-content: center;
}

.mini-card-add:hover {
  background: rgba(124, 58, 237, 0.15);
  border-color: rgba(124, 58, 237, 0.6);
  color: #C4B5FD;
}

/* ============================================
   卡片编辑/删除按钮
   ============================================ */
.card-actions {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 10;
}

.mini-card:hover .card-actions,
.tool-card:hover .card-actions,
.inspire-card:hover .card-actions {
  opacity: 1;
}

.card-actions.admin-visible {
  opacity: 1;
}

.card-action-btn {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.card-action-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.1);
}

.card-action-btn.delete:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
}

.card-action-btn svg {
  width: 13px;
  height: 13px;
}

/* 分类提示标签（添加/编辑弹窗中） */
.category-hints {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.category-hint {
  display: inline-block;
  padding: 3px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.category-hint:hover {
  background: rgba(124, 58, 237, 0.12);
  color: #C4B5FD;
  border-color: rgba(124, 58, 237, 0.3);
}

/* ============================================
   工具卡片（首页 + 工具页）
   ============================================ */
.tool-card-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}

.tool-card {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  height: 56px;
  padding: 0 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  transition: all 0.2s ease;
  cursor: pointer;
  position: relative;
}

.tool-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
  transform: translateY(-1px);
}

.tool-card-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.tool-card-body {
  flex: 1;
  min-width: 0;
}

.tool-card-name {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tool-card-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================
   灵感卡片
   ============================================ */
.inspire-card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-4);
}

.inspire-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  padding: var(--sp-5);
  transition: all 0.2s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  min-height: 140px;
  position: relative;
}

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

.inspire-card-title {
  font-size: 15px;
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: var(--sp-2);
  line-height: 1.4;
}

.inspire-card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.inspire-card-tag {
  display: inline-block;
  margin-top: var(--sp-3);
  font-size: 12px;
  color: var(--accent-2);
  font-weight: 500;
}

/* ============================================
   工作计划
   ============================================ */
.planner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-4);
}

.planner-month {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  font-size: 13px;
  color: var(--text-primary);
}

.progress-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}

.progress-label {
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: var(--accent-grad);
  border-radius: 999px;
  transition: width 0.4s ease;
  box-shadow: 0 0 12px rgba(124, 58, 237, 0.5);
}

.progress-count {
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.task-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  transition: all 0.2s ease;
  cursor: pointer;
}

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

.task-check {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--text-muted);
  border-radius: 5px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.task-item.done .task-check {
  background: var(--accent-grad);
  border-color: transparent;
  border-color: rgba(124, 58, 237, 0.5);
}

.task-check svg {
  width: 12px;
  height: 12px;
  opacity: 0;
  color: #fff;
  transition: opacity 0.2s ease;
}

.task-item.done .task-check svg {
  opacity: 1;
}

.task-text {
  font-size: 14px;
  color: var(--text-primary);
  flex: 1;
  transition: all 0.2s ease;
}

.task-item.done .task-text {
  color: var(--text-muted);
  text-decoration: line-through;
}

.task-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 48px;
  background: transparent;
  border: 1px dashed var(--border-light);
  border-radius: var(--r-md);
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: var(--sp-2);
  transition: all 0.2s ease;
}

.task-add:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  border-color: rgba(124, 58, 237, 0.5);
}

/* ============================================
   子页面：网格展示
   ============================================ */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: var(--sp-7) 0 var(--sp-5);
}

.page-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.grid-nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-3);
}

.grid-tool {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-3);
}

.grid-inspire {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-4);
}

/* ============================================
   登录弹窗
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 31, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  width: 360px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform 0.25s ease;
}

.modal-overlay.show .modal {
  transform: translateY(0);
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: var(--sp-2);
  text-align: center;
}

.modal-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: var(--sp-5);
  text-align: center;
}

.form-field {
  margin-bottom: var(--sp-4);
}

.form-label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}

.form-input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  font-size: 14px;
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.form-input:focus {
  border-color: var(--accent-2);
  background: rgba(255, 255, 255, 0.06);
}

.modal-actions {
  display: flex;
  gap: var(--sp-3);
  margin-top: var(--sp-5);
}

.modal-actions .btn {
  flex: 1;
  height: 40px;
}

.modal-hint {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: var(--sp-3);
}

/* ============================================
   Toast 提示
   ============================================ */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--r-md);
  padding: 12px 20px;
  font-size: 13px;
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
}

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

.toast.success {
  border-color: rgba(124, 58, 237, 0.5);
  color: #C4B5FD;
}

/* ============================================
   添加表单弹窗
   ============================================ */
.form-modal {
  width: 420px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
}

/* ============================================
   页脚
   ============================================ */
.footer {
  border-top: 1px solid var(--border-subtle);
  padding: var(--sp-5) 0;
  margin-top: var(--sp-8);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

/* ============================================
   响应式
   ============================================ */
@media (max-width: 1024px) {
  .container { padding: 0 24px; }
  .mini-card-grid { grid-template-columns: repeat(4, 1fr); }
  .tool-card-grid { grid-template-columns: repeat(3, 1fr); }
  .grid-nav { grid-template-columns: repeat(3, 1fr); }
  .grid-tool { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .container { padding: 0 16px; }
  .nav-menu { gap: 16px; margin-left: 16px; }
  .nav-search { display: none; }
  .hero { padding: 60px 24px; }
  .hero h1 { font-size: 32px; }
  .mini-card-grid { grid-template-columns: repeat(2, 1fr); }
  .tool-card-grid { grid-template-columns: repeat(2, 1fr); }
  .inspire-card-grid,
  .grid-inspire { grid-template-columns: 1fr; }
  .grid-nav { grid-template-columns: repeat(2, 1fr); }
  .grid-tool { grid-template-columns: repeat(2, 1fr); }
  .section-header { flex-direction: column; align-items: flex-start; gap: 12px; }
}
