/* ==========================================================================
   Minimal Smart Nav - 极简智能导航主样式表
   设计理念：极简、呼吸感、现代毛玻璃微质感、自适应响应式
   ========================================================================== */

:root {
  /* 基础字体与圆角 */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  /* 动效过渡时间 */
  --transition-fast: 0.18s ease;
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

  /* 主题色系 - 浅色模式 (Light) */
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.75);
  --bg-card-hover: rgba(255, 255, 255, 0.95);
  --bg-input: rgba(0, 0, 0, 0.035);
  --bg-input-focus: rgba(0, 0, 0, 0.02);
  --border-color: rgba(0, 0, 0, 0.06);
  --border-focus: rgba(79, 70, 229, 0.5);
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  --accent-primary: #6366f1;
  --accent-hover: #4f46e5;
  --accent-light: rgba(99, 102, 241, 0.08);
  
  --card-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.04), 0 2px 6px -1px rgba(0, 0, 0, 0.02);
  --card-shadow-hover: 0 12px 30px -4px rgba(0, 0, 0, 0.08), 0 4px 12px -2px rgba(0, 0, 0, 0.04);
  
  --backdrop-blur: 20px;
  --overlay-bg: rgba(15, 23, 42, 0.45);
}

/* 深色模式 (Dark) - 现代高质感深空钛金与环境光晕体系 */
body.theme-dark {
  --bg-primary: #0b0f19;
  --bg-secondary: #111726;
  --bg-card: rgba(18, 24, 40, 0.5);
  --bg-card-hover: rgba(26, 36, 58, 0.7);
  --bg-input: rgba(255, 255, 255, 0.045);
  --bg-input-focus: rgba(255, 255, 255, 0.08);
  --border-color: rgba(255, 255, 255, 0.07);
  --border-focus: rgba(99, 102, 241, 0.5);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --accent-primary: #818cf8;
  --accent-hover: #a5b4fc;
  --accent-light: rgba(99, 102, 241, 0.12);
  
  --card-shadow: 0 8px 30px -4px rgba(0, 0, 0, 0.35);
  --card-shadow-hover: 0 16px 40px -4px rgba(0, 0, 0, 0.55);
  
  --overlay-bg: rgba(7, 10, 18, 0.75);
}

/* 深色模式环境氛围光晕 (消除纯黑死板，让毛玻璃卡片拥有真实通透感) */
body.theme-dark:not(.has-custom-bg) {
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(circle at 50% 6%, rgba(99, 102, 241, 0.09) 0%, transparent 45%),
    radial-gradient(circle at 18% 28%, rgba(56, 189, 248, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 82% 55%, rgba(168, 85, 247, 0.04) 0%, transparent 45%),
    linear-gradient(180deg, #0d121f 0%, #070a12 100%);
  background-attachment: fixed;
}

/* 浅色模式环境渐变 */
body.theme-light:not(.has-custom-bg) {
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.05) 0%, transparent 50%),
    linear-gradient(180deg, #f8fafc 0%, #edf2f7 100%);
  background-attachment: fixed;
}

/* 激活自定义背景时应用遮罩与半透明层 */
body.has-custom-bg {
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
}

body.has-custom-bg::before {
  content: "";
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: -1;
  pointer-events: none;
}

/* ==========================================================================
   全局重置与排版
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  overflow-x: hidden;
  position: relative;
}

a {
  color: inherit;
  text-decoration: none;
}

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

input, textarea {
  font-family: inherit;
  color: inherit;
}

/* ==========================================================================
   顶部快捷操作栏
   ========================================================================== */
.top-bar {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  backdrop-filter: blur(var(--backdrop-blur));
  -webkit-backdrop-filter: blur(var(--backdrop-blur));
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  box-shadow: var(--card-shadow);
}

.icon-btn:hover {
  color: var(--accent-primary);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}

.icon-btn.active {
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}

/* ==========================================================================
   主要内容容器
   ========================================================================== */
.main-container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 2.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ==========================================================================
   时钟与问候语组件
   ========================================================================== */
.hero-header {
  text-align: center;
  margin-bottom: 2.25rem;
  user-select: none;
}

.clock-display {
  font-size: clamp(3rem, 7vw, 5.2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--accent-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.6rem;
  transition: all var(--transition-normal);
}

.hero-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.meta-divider {
  opacity: 0.3;
}

.weather-badge {
  color: #10b981;
}

/* ==========================================================================
   极简本地书签搜索组件
   ========================================================================== */
.search-wrapper {
  width: 100%;
  max-width: 680px;
  margin-bottom: 3.25rem;
  position: relative;
  z-index: 50;
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  backdrop-filter: blur(var(--backdrop-blur));
  -webkit-backdrop-filter: blur(var(--backdrop-blur));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  padding: 0.35rem 0.8rem 0.35rem 1rem;
  transition: all var(--transition-normal);
  gap: 0.6rem;
}

.search-box:focus-within {
  border-color: var(--border-focus);
  box-shadow: var(--card-shadow-hover), 0 0 0 3px var(--accent-light);
  transform: translateY(-1px);
}

.search-lead-icon {
  color: var(--accent-primary);
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
}

.search-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.7rem 0.2rem;
  font-size: 1.02rem;
  color: var(--text-primary);
  outline: none;
  min-width: 0;
}

.search-input::placeholder {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.search-clear-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  transition: all var(--transition-fast);
}

.search-clear-btn:hover {
  color: var(--text-primary);
}

.search-kbd-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 5px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-family: var(--font-mono);
  font-weight: 600;
  user-select: none;
}

/* 搜索未找到结果时的优雅空状态 */
.search-empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 1rem;
  text-align: center;
  animation: fadeInDown 0.2s ease;
}

/* ==========================================================================
   现代极简网址导航卡片系统 (Raycast / Apple 级轻盈通透美学)
   ========================================================================== */
.categories-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.75rem;
  align-items: start;
}

.category-card {
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
  padding: 1.4rem 1.4rem 1.1rem;
  transition: all var(--transition-normal);
  position: relative;
  display: flex;
  flex-direction: column;
}

body.theme-light .category-card {
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.category-card:hover {
  border-color: rgba(99, 102, 241, 0.35);
  background: rgba(255, 255, 255, 0.035);
  box-shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
}

body.theme-light .category-card:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(79, 70, 229, 0.25);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.06);
}

.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.9rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

body.theme-light .category-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.category-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  min-width: 0;
}

.category-icon {
  font-size: 1.05rem;
  color: var(--accent-primary);
  flex-shrink: 0;
  opacity: 0.9;
}

.category-title-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.category-count-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

body.theme-light .category-count-badge {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.06);
}

.category-admin-actions {
  display: none;
  gap: 0.35rem;
  flex-shrink: 0;
}

body.is-admin .category-admin-actions {
  display: flex;
}

.cat-action-btn {
  padding: 3px 6px;
  font-size: 0.72rem;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
  transition: all var(--transition-fast);
}

.cat-action-btn:hover {
  background: var(--accent-light);
  color: var(--accent-primary);
  border-color: rgba(99, 102, 241, 0.2);
}

.cat-action-btn.btn-delete:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.2);
}

/* 书签列表：去掉了笨重的大黑框，改为轻盈微质感悬浮卡片 */
.links-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.bookmark-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.7rem;
  background: transparent;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
  min-width: 0;
}

.bookmark-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
  transform: translateY(-1px);
}

body.theme-light .bookmark-item:hover {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.06);
}

.bookmark-link-content {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  min-width: 0;
}

.bookmark-icon {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  object-fit: contain;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.06);
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-primary);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: transform var(--transition-fast);
}

body.theme-light .bookmark-icon {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.bookmark-item:hover .bookmark-icon {
  transform: scale(1.08);
}

.bookmark-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.bookmark-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}

.bookmark-item:hover .bookmark-name {
  color: var(--accent-primary);
}

.bookmark-desc {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 1px;
}

/* 展开/收起按钮：更加极简素雅 */
.expand-toggle-btn {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.4rem;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: all var(--transition-fast);
  cursor: pointer;
  opacity: 0.7;
}

.expand-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  opacity: 1;
}

body.theme-light .expand-toggle-btn:hover {
  background: rgba(0, 0, 0, 0.03);
}

/* 网址编辑与删除快捷操作 (仅管理员模式) */
.bookmark-admin-ctrls {
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  align-items: center;
  gap: 2px;
  background: var(--bg-secondary);
  padding: 2px;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  z-index: 10;
}

body.is-admin .bookmark-item:hover .bookmark-admin-ctrls {
  display: flex;
}

.item-action-btn {
  padding: 3px 5px;
  font-size: 0.7rem;
  color: var(--text-secondary);
  border-radius: 4px;
}

.item-action-btn:hover {
  color: var(--accent-primary);
  background: var(--accent-light);
}

.item-action-btn.del:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
}

/* 拖拽效果 */
.draggable-item {
  cursor: grab;
}

.draggable-item:active {
  cursor: grabbing;
}

.dragging {
  opacity: 0.35;
  transform: scale(0.96);
  border: 1px dashed var(--accent-primary) !important;
}

.drag-over {
  border-color: var(--accent-primary) !important;
  background: var(--accent-light) !important;
}

/* 添加书签占位按钮 */
.add-link-btn {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.45rem;
  margin-top: 0.5rem;
  border: 1px dashed rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

body.theme-light .add-link-btn {
  border-color: rgba(0, 0, 0, 0.1);
}

body.is-admin .add-link-btn {
  display: flex;
}

.add-link-btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: var(--accent-light);
}

/* 添加新分类卡片按钮 */
.add-category-card {
  display: none;
  min-height: 140px;
  border: 2px dashed rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  background: transparent;
  color: var(--text-muted);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.88rem;
  transition: all var(--transition-normal);
}

body.theme-light .add-category-card {
  border-color: rgba(0, 0, 0, 0.1);
}

body.is-admin .add-category-card {
  display: flex;
}

.add-category-card:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background: var(--accent-light);
}

/* ==========================================================================
   底部版权与后台唤起
   ========================================================================== */
.footer {
  text-align: center;
  padding: 2.5rem 1rem 1.5rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  user-select: none;
}

.footer-inner {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.admin-trigger {
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.admin-trigger:hover {
  color: var(--text-secondary);
  background: var(--bg-input);
}

.admin-status-badge {
  display: none;
  align-items: center;
  gap: 0.3rem;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

body.is-admin .admin-status-badge {
  display: inline-flex;
}

/* ==========================================================================
   设置抽屉面板与模态框
   ========================================================================== */
.drawer-panel {
  position: fixed;
  top: 0;
  right: -360px;
  width: 340px;
  max-width: 90vw;
  height: 100vh;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-color);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.2);
  z-index: 200;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transition: right var(--transition-normal);
  overflow-y: auto;
}

.drawer-panel.open {
  right: 0;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--border-color);
}

.drawer-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.close-btn {
  font-size: 1.25rem;
  color: var(--text-muted);
  padding: 4px;
}

.close-btn:hover {
  color: var(--text-primary);
}

.setting-group {
  margin-bottom: 1.4rem;
}

.setting-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.btn-row {
  display: flex;
  gap: 0.5rem;
}

.option-btn {
  flex: 1;
  padding: 0.6rem 0.5rem;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  text-align: center;
}

.option-btn:hover, .option-btn.active {
  background: var(--accent-light);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  font-weight: 600;
}

.text-input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition-fast);
}

.text-input:focus {
  border-color: var(--accent-primary);
}

.btn-primary {
  width: 100%;
  padding: 0.7rem;
  background: var(--accent-primary);
  color: #ffffff;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  transition: background var(--transition-fast);
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-danger {
  width: 100%;
  padding: 0.7rem;
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.85rem;
  transition: all var(--transition-fast);
}

.btn-danger:hover {
  background: #ef4444;
  color: #ffffff;
}

/* 模态弹窗 */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.modal-overlay.open {
  display: flex;
}

.modal-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-secondary);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.6);
  padding: 1.6rem 1.6rem 1.4rem;
  animation: scaleIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

body.theme-light .modal-card {
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 20px 40px -8px rgba(0, 0, 0, 0.12);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

body.theme-light .modal-header {
  border-bottom-color: rgba(0, 0, 0, 0.06);
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.form-group {
  margin-bottom: 1.1rem;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.45rem;
  color: var(--text-secondary);
}

.text-input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius-md);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 0.92rem;
  outline: none;
  transition: all var(--transition-fast);
}

.text-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-light);
  background: transparent;
}

.modal-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.5rem;
  width: 100%;
}

.modal-actions .btn-cancel,
.modal-actions .option-btn {
  flex: 1;
  height: 42px;
  padding: 0 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  transition: all var(--transition-fast);
  cursor: pointer;
}

body.theme-light .modal-actions .btn-cancel,
body.theme-light .modal-actions .option-btn {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.08);
  color: var(--text-secondary);
}

.modal-actions .btn-cancel:hover,
.modal-actions .option-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
}

body.theme-light .modal-actions .btn-cancel:hover,
body.theme-light .modal-actions .option-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  color: var(--text-primary);
}

.modal-actions .btn-primary {
  flex: 1;
  height: 42px;
  padding: 0 1rem;
  background: var(--accent-primary);
  color: #ffffff;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.modal-actions .btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.5);
  transform: translateY(-1px);
}

/* Toast 提示 */
.toast-container {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 0.65rem 1.2rem;
  border-radius: var(--radius-full);
  font-size: 0.88rem;
  font-weight: 500;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: toastIn 0.25s ease, toastOut 0.25s ease 2.75s forwards;
}

.toast.success { border-color: rgba(16, 185, 129, 0.5); }
.toast.error { border-color: rgba(239, 68, 68, 0.5); }

/* ==========================================================================
   动画与关键帧
   ========================================================================== */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

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

@keyframes toastOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-12px); }
}

/* ==========================================================================
   响应式调整
   ========================================================================== */
@media (max-width: 640px) {
  .main-container {
    padding: 3rem 1rem 1.5rem;
  }
  
  .links-grid {
    grid-template-columns: 1fr;
  }
  
  .search-wrapper {
    margin-bottom: 2rem;
  }
}
