:root {
  --bg: #ffffff;
  --bg-subtle: #f4f7ff;
  --primary: #1a66ff;
  --primary-hover: #1250d6;
  --accent-purple: #6338f0;
  --brand-gradient: linear-gradient(135deg, #1E86FF 0%, #4F46E5 55%, #8B2FE8 100%);
  --btn-blue-gradient: linear-gradient(135deg, #2b7fff 0%, #1055f5 100%);
  --fg: #1849c6;
  --fg-dark: #15368a;
  --fg-muted: #5570b5;
  --border: #c7d7fe;
  --border-light: #e0eaff;
  --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

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

body {
  background-color: var(--bg);
  color: var(--fg);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 24px 64px;
}

/* 頂部導航列：左側品牌 (logo.png + 藍紫漸層品牌字)、右側功能按鈕 */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  border-bottom: 2px solid var(--border-light);
  margin-bottom: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--primary);
}

.brand-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(30, 134, 255, 0.22));
}

.brand-title {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.02em;
  font-family: var(--font-sans);
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: var(--primary);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* 頂部圓形個人頭像（優先顯示 Google Profile 圖示，無圖時顯示 Gmail 首字母縮寫） */
.user-avatar-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.user-avatar-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--brand-gradient);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  font-family: var(--font-sans);
  border: 2px solid #ffffff;
  box-shadow: 0 3px 10px rgba(26, 102, 255, 0.28);
  overflow: hidden;
  cursor: pointer;
  user-select: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.user-avatar-circle:hover,
.user-avatar-circle:focus-visible {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 5px 14px rgba(26, 102, 255, 0.38);
  outline: none;
}

.user-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.user-avatar-initial {
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0;
}

.user-avatar-tooltip {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #15368a;
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(21, 54, 138, 0.24);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
  pointer-events: none;
  z-index: 30;
}

.user-avatar-wrap:hover .user-avatar-tooltip,
.user-avatar-circle:focus-visible + .user-avatar-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.google-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 3px 10px rgba(26, 102, 255, 0.14);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.google-icon-btn:hover {
  transform: translateY(-1px) scale(1.04);
  border-color: var(--primary);
  box-shadow: 0 6px 16px rgba(26, 102, 255, 0.26);
}

/* 縮網址旁的會員等級圖示徽章 (F 綠底 / P 紫金漸層，未登入不顯示) */
.tier-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  user-select: none;
  transition: all 0.15s ease;
}

.tier-badge.tier-free {
  background: linear-gradient(135deg, #22c55e 0%, #10b981 100%);
  color: #ffffff;
  border: none;
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.28);
}

.tier-badge.tier-pro {
  background: linear-gradient(135deg, #f59e0b 0%, #ec4899 50%, #6366f1 100%);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 12px rgba(236, 72, 153, 0.28);
}

.quota-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 4px 12px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--primary);
  font-weight: 700;
}

/* 按鈕統一樣式：搜尋按鈕的藍色系 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 16px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--primary);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn:hover {
  background: var(--btn-blue-gradient);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(26, 102, 255, 0.25);
}

.btn-primary {
  background: var(--btn-blue-gradient);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(26, 102, 255, 0.28);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1b6ef3 0%, #0d45cb 100%);
  color: #ffffff;
  box-shadow: 0 6px 18px rgba(26, 102, 255, 0.36);
}

.btn-sm {
  font-size: 12px;
  padding: 6px 14px;
}

/* 一體成形的開闊主視覺與膠囊搜尋區（涵蓋搜尋框與進階設定） */
.hero-box {
  border: none;
  padding: 0;
  background: transparent;
  margin-bottom: 18px;
}

.hero-visual-wrapper {
  position: relative;
  width: 100%;
  max-width: 872px;
  margin: 0 auto;
}

.hero-banner-frame {
  position: relative;
  width: 100%;
  border-radius: 26px;
  overflow: hidden;
  padding-bottom: 22px;
  box-shadow: 0 14px 36px rgba(30, 80, 220, 0.13);
  border: 1px solid rgba(199, 215, 254, 0.75);
  background: linear-gradient(180deg, #eef4ff 0%, #eff3ff 75%, #edf2ff 100%);
}

.hero-visual-img {
  width: 100%;
  height: auto;
  display: block;
  user-select: none;
  transition: opacity 0.25s ease;
}

.hero-switch-btn {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 6;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(26, 102, 255, 0.24);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 4px 12px rgba(26, 102, 255, 0.14);
}

.hero-switch-btn:hover {
  background: var(--btn-blue-gradient);
  color: #ffffff;
  border-color: transparent;
}

/* 圖稿膠囊搜尋框與進階設定（整體內嵌於主視覺背景中） */
.hero-search-form {
  position: relative;
  z-index: 5;
  margin: -148px 28px 0;
}

.search-pill-outer {
  padding: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(14px);
  border: 1.5px solid rgba(255, 255, 255, 0.96);
  box-shadow:
    0 12px 32px rgba(24, 73, 198, 0.16),
    0 2px 8px rgba(79, 70, 229, 0.08);
}

.search-pill-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ffffff;
  border-radius: 999px;
  padding: 6px 6px 6px 20px;
  box-shadow: inset 0 1px 3px rgba(24, 73, 198, 0.06);
}

.search-link-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #6b7fa8;
  flex-shrink: 0;
}

.url-input {
  flex: 1;
  font-size: 15px;
  padding: 10px 8px;
  border: none;
  background: transparent;
  color: var(--primary);
  outline: none;
  font-family: var(--font-sans);
  font-weight: 500;
  min-width: 0;
}

.url-input::placeholder {
  color: #7d92be;
  font-weight: 400;
}

.btn-shorten {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 28px;
  border: none;
  border-radius: 999px;
  background: var(--btn-blue-gradient);
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(26, 102, 255, 0.35);
  transition: transform 0.12s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.btn-shorten:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(26, 102, 255, 0.45);
}

.btn-shorten:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-shorten-arrow {
  font-size: 18px;
  line-height: 1;
}

/* 進階設定勾選（與搜尋框間距拉高 10px：原本 12px -> 22px）與圓角灰框輸入欄 */
.advanced-toggle-row {
  display: flex;
  align-items: center;
  margin-top: 22px;
  padding-left: 16px;
}

.advanced-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  user-select: none;
  transition: opacity 0.15s ease;
}

.advanced-checkbox-label:hover {
  color: var(--primary-hover);
}

.advanced-checkbox-label.disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: auto;
}

.advanced-checkbox-label.disabled input[type="checkbox"] {
  cursor: not-allowed;
}

.guest-lock-badge {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  background: rgba(100, 116, 139, 0.12);
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0;
}

.advanced-checkbox-label input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
  cursor: pointer;
}

.options-row {
  display: none;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 16px;
  margin-top: 12px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  border: 1px solid rgba(199, 215, 254, 0.85);
}

.options-row.show {
  display: flex;
}

.option-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex: 1;
  min-width: 260px;
}

.option-label-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  padding-top: 8px;
  white-space: nowrap;
}

.option-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
}

.pro-tag-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 4px;
  background: linear-gradient(135deg, #f59e0b 0%, #ec4899 50%, #6366f1 100%);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(236, 72, 153, 0.3);
}

.option-input-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.option-input {
  width: 100%;
  padding: 8px 12px;
  font-size: 13px;
  border: 1px solid #d4d4d8;
  border-radius: 8px;
  background: var(--bg);
  color: var(--primary);
  font-family: var(--font-mono);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.option-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 102, 255, 0.12);
}

.option-input:disabled {
  background: rgba(241, 245, 249, 0.85);
  color: #94a3b8;
  border-color: #e2e8f0;
  cursor: not-allowed;
}

.custom-code-feedback {
  display: none;
  font-size: 12px;
  font-weight: 600;
  margin-top: 5px;
  line-height: 1.4;
  padding-left: 2px;
  transition: all 0.15s ease;
}

.custom-code-feedback.show {
  display: block;
}

.custom-code-feedback.available {
  color: #16a34a;
}

.custom-code-feedback.unavailable {
  color: #dc2626;
}

.custom-code-feedback.warning {
  color: #d97706;
}

.custom-code-feedback.checking {
  color: #64748b;
}

/* 即時網站畫面預覽列（於輸入網址時自動載入並顯示） */
.preview-card {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  padding: 12px 16px;
  border: 1.5px solid rgba(199, 215, 254, 0.92);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  box-shadow: 0 6px 20px rgba(24, 73, 198, 0.08);
}

.preview-card.active {
  display: flex;
}

.preview-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1;
}

.preview-thumb-box {
  width: 150px;
  height: 100px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--bg-subtle);
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}

.preview-thumb-box.loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #e8f0fe 0%, #f5f8ff 50%, #e8f0fe 100%);
  background-size: 200% 100%;
  animation: thumbShimmer 1.2s infinite linear;
}

@keyframes thumbShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.preview-thumb {
  width: 150px;
  height: 100px;
  max-width: 150px;
  max-height: 100px;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.preview-thumb[src*="noscreenshot.png"],
.url-thumb[src*="noscreenshot.png"],
.preview-thumb[src*="/static/logo.png"],
.url-thumb[src*="/static/logo.png"] {
  object-fit: contain;
  object-position: center;
}

.preview-meta {
  min-width: 0;
  flex: 1;
}

.preview-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--fg-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-safety {
  font-size: 12px;
  color: var(--fg-muted);
  font-family: var(--font-mono);
  margin-top: 2px;
}

/* 狀態提示訊息：圓角無邊框 */
.notice-banner {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border: none;
  border-radius: 12px;
  margin-bottom: 24px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  background: #edf3ff;
}

.notice-banner .btn {
  border: none;
  border-radius: 8px;
  background: var(--btn-blue-gradient);
  color: #ffffff;
}

.notice-banner .btn:hover {
  filter: brightness(1.08);
  color: #ffffff;
}

.notice-banner.show {
  display: flex;
}

/* 列表標題列：縮網址 + F/P 圖示 + 使用 X / 20 組 + [ i ] 懸停說明圖示；右側為齒輪設定 + 重新整理 */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 12px 14px;
  border-bottom: 2px solid var(--border-light);
  margin-bottom: 16px;
}

.section-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.section-actions-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-icon-gear {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--bg-subtle);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.15s ease;
}

.btn-icon-gear:hover {
  background: var(--btn-blue-gradient);
  border-color: transparent;
  color: #ffffff;
  transform: rotate(30deg);
  box-shadow: 0 4px 12px rgba(26, 102, 255, 0.25);
}

.section-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--primary);
}

.rule-info-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  outline: none;
}

.rule-info-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid #94a3b8;
  background: #f8fafc;
  color: #64748b;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all 0.15s ease;
  user-select: none;
}

.rule-info-wrap:hover .rule-info-icon,
.rule-info-wrap:focus-visible .rule-info-icon {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(26, 102, 255, 0.28);
}

.rule-tooltip {
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
  background: #1e293b;
  color: #f8fafc;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font-sans);
  padding: 7px 12px;
  border-radius: 8px;
  white-space: nowrap;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.22);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease;
  z-index: 25;
}

.rule-tooltip::before {
  content: "";
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: transparent #1e293b transparent transparent;
}

.rule-info-wrap:hover .rule-tooltip,
.rule-info-wrap:focus-visible .rule-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
}

/* 短網址項目列表：左側 150x100 (3:2) 縮圖，右側三層排版 */
.url-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.url-item {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 20px;
  padding: 14px 18px;
  border: 1.5px solid var(--border-light);
  border-radius: 16px;
  background: var(--bg);
  box-shadow: 0 2px 10px rgba(26, 102, 255, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.url-item:hover {
  border-color: var(--border);
  box-shadow: 0 6px 18px rgba(26, 102, 255, 0.08);
}

.url-item-left {
  display: flex;
  align-items: center;
  gap: 20px;
  min-width: 0;
  flex: 1;
}

.url-thumb {
  width: 150px;
  height: 100px;
  max-width: 150px;
  max-height: 100px;
  object-fit: cover;
  object-position: top center;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--bg-subtle);
  flex-shrink: 0;
  display: block;
}

.url-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.url-tags-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.url-link-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
}

.short-link {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--primary);
  background: transparent;
  border: none;
  padding: 0;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.short-link:hover {
  color: var(--accent-purple);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 12px;
  height: 28px;
  padding: 0 12px;
  line-height: 1;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--primary);
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.tag-solid {
  background: var(--brand-gradient);
  border-color: transparent;
  color: #ffffff;
}

.url-actions-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.url-info .btn-sm {
  height: 30px;
  padding: 0 14px;
  line-height: 1;
}

/* 刪除按鈕：紅字，hover 時白字紅底 */
.btn.btn-danger {
  color: #dc2626;
  border-color: #fca5a5;
  background: #fff5f5;
}

.btn.btn-danger:hover {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.28);
}

.empty-state {
  padding: 40px 20px;
  text-align: center;
  border: 1.5px dashed var(--border);
  border-radius: 16px;
  color: var(--fg-muted);
  background: var(--bg-subtle);
  font-size: 14px;
}

/* 彈窗 Modal */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 35, 95, 0.35);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}

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

.modal {
  width: 100%;
  max-width: 520px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(24, 73, 198, 0.2);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1.5px solid var(--border-light);
  margin-bottom: 16px;
}

.modal-title {
  font-size: 16px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--primary);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.stat-cell {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-subtle);
  padding: 10px;
}

.stat-label {
  font-size: 11px;
  color: var(--fg-muted);
}

.stat-value {
  font-size: 16px;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--primary);
  margin-top: 2px;
}

.logs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  font-family: var(--font-mono);
}

.logs-table th,
.logs-table td {
  border: 1px solid var(--border-light);
  padding: 6px 8px;
  text-align: left;
  color: var(--fg);
}

.logs-table th {
  background: var(--bg-subtle);
  color: var(--primary);
}

@media (max-width: 680px) {
  .hero-banner-frame {
    padding-bottom: 18px;
  }
  .hero-search-form {
    margin: -64px 14px 0;
  }
  .search-pill-inner {
    flex-direction: column;
    border-radius: 20px;
    padding: 12px;
    align-items: stretch;
  }
  .search-link-icon {
    display: none;
  }
  .btn-shorten {
    width: 100%;
  }
  .rule-tooltip {
    left: auto;
    right: 0;
    top: calc(100% + 8px);
    transform: translateY(-4px);
    white-space: normal;
    width: 240px;
  }
  .rule-tooltip::before {
    display: none;
  }
  .rule-info-wrap:hover .rule-tooltip,
  .rule-info-wrap:focus-visible .rule-tooltip {
    transform: translateY(0);
  }
  .url-item-left {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ==========================================================================
   帳戶設定與 Pro 授權啟用彈窗 (Settings Modal)
   ========================================================================== */
.settings-modal {
  max-width: 680px;
  width: 95%;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.settings-col {
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.settings-subtitle {
  font-size: 13px;
  font-weight: 700;
  color: var(--fg-dark);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.account-profile-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-light);
}

.account-avatar-wrap {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4361ee 0%, #7209b7 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(67, 97, 238, 0.25);
}

.account-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.account-avatar-initial {
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  font-family: var(--font-sans);
}

.account-info-meta {
  min-width: 0;
  flex: 1;
}

.account-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--fg-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-email {
  font-size: 12px;
  color: var(--fg-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-stat-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.account-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
}

.account-stat-label {
  color: var(--fg-muted);
}

.account-stat-val {
  font-weight: 700;
  color: var(--fg-dark);
}

.highlight-days {
  color: #4361ee;
  font-family: var(--font-mono);
  font-size: 14px;
}

.tier-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.tier-pill-free {
  background: #e6f4ea;
  color: #137333;
}

.tier-pill-pro {
  background: #fce8e6;
  color: #c5221f;
  border: 1px solid #fad2cf;
}

.lic-alert-box {
  margin-bottom: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

.lic-alert-error {
  background: #fde8e8;
  color: #c5221f;
  border: 1px solid #f8b4b4;
}

.lic-alert-success {
  background: #def7ec;
  color: #03543f;
  border: 1px solid #bcf0da;
}

/* 下方 API 金鑰區塊 */
.settings-bottom-keys {
  background: #f8faff;
  border: 1.5px dashed #c2d7ff;
  border-radius: 12px;
  padding: 14px 16px;
}

.keys-header {
  margin-bottom: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
}

.keys-title {
  font-size: 13px;
  font-weight: 700;
  color: #1a73e8;
}

.keys-desc {
  font-size: 12px;
  color: var(--fg-muted);
}

.keys-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.key-card {
  background: #ffffff;
  border: 1px solid #d2e3fc;
  border-radius: 8px;
  padding: 8px 12px;
}

.key-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--fg-muted);
  display: block;
  margin-bottom: 4px;
}

.key-val-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.key-text {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: #1e3a8a;
  letter-spacing: 0.5px;
}

.btn-copy-key {
  padding: 3px 10px;
  font-size: 11px;
  height: 26px;
  border-radius: 6px;
  flex-shrink: 0;
}

@media (max-width: 680px) {
  .settings-grid,
  .keys-grid {
    grid-template-columns: 1fr;
  }
}

/* 頁尾隱私權政策與使用者條款連結 */
.site-footer {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1.5px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.8125rem;
  color: var(--fg-muted);
}

.site-footer-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.footer-sep {
  opacity: 0.5;
}

.site-footer-links {
  display: flex;
  align-items: center;
  gap: 1.125rem;
}

.footer-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s ease;
}

.footer-link:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* 複製成功視覺回饋 (勾勾與綠色高亮) */
.btn-copied {
  border-color: #10b981 !important;
  color: #059669 !important;
  background-color: #ecfdf5 !important;
  font-weight: 700 !important;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2) !important;
  transition: all 0.2s ease !important;
}

/* 短網址列表行：密碼保護開啟密碼提示標籤 */
.pwd-link-hint {
  font-size: 12px;
  color: #4338ca;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 2px;
}

.pwd-code {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  color: #3730a3;
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* 點擊計數後方「分享社群」按鈕 */
.btn-share-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  color: #2563eb;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-left: 4px;
  line-height: 1.2;
}

.btn-share-action:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1d4ed8;
  transform: translateY(-1px);
}

/* 設定彈窗：Discord Webhook 設定區 (Pro 會員專用) */
.settings-discord-section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border-light);
}

.discord-webhook-box {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.discord-webhook-hint {
  font-size: 12px;
  margin-top: 6px;
  line-height: 1.4;
}

/* 社群分享 Modal (忠實還原設計) */
.share-modal {
  max-width: 440px;
  width: 92%;
  border-radius: 18px;
  padding: 20px 22px;
  background: #ffffff;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.18);
  border: 1px solid #e2e8f0;
}

.share-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 16px;
}

.share-modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 700;
  color: #1e293b;
}

.share-modal-close {
  background: transparent;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: #64748b;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  transition: all 0.15s;
}

.share-modal-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.share-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.share-card-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 4px 12px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  color: #334155;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  min-height: 80px;
}

.share-card-btn:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
}

.share-card-icon {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0f172a;
}

.share-card-icon svg {
  width: 24px;
  height: 24px;
}

.share-pro-badge {
  position: absolute;
  top: 5px;
  right: 5px;
  font-size: 9px;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 4px;
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  color: #ffffff;
  line-height: 1.2;
}

.share-footer-links {
  border-top: 1px solid #f1f5f9;
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.share-footer-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #334155;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}

.share-footer-btn:hover {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #0f172a;
}

.share-footer-btn svg {
  width: 18px;
  height: 18px;
  color: #64748b;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .share-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .share-card-btn {
    min-height: 72px;
    padding: 10px 4px;
    font-size: 11px;
  }
  .share-card-icon svg {
    width: 22px;
    height: 22px;
  }
}

