/* 基础变量定义 */
:root {
  --bg-color: #0b0c10;
  --card-bg: rgba(22, 24, 37, 0.65);
  --card-border: rgba(255, 255, 255, 0.08);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --primary-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
  --secondary-gradient: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(168, 85, 247, 0.15) 100%);
  --accent-color: #a855f7;
  --toast-bg: rgba(15, 17, 26, 0.9);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Outfit', var(--font-sans);
}

/* 基础重置 */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-color);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-x: hidden;
  position: relative;
  line-height: 1.5;
}

/* 背景光晕动效 */
.bg-glow {
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
  animation: float 20s infinite ease-in-out;
}

.blob-1 {
  background: #6366f1;
  top: -10%;
  left: -10%;
  animation-delay: 0s;
}

.blob-2 {
  background: #ec4899;
  bottom: -10%;
  right: -10%;
  animation-delay: -10s;
}

@keyframes float {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(50px, 30px) scale(1.1);
  }
}

/* 容器布局 */
.container {
  width: 100%;
  max-width: 680px;
  padding: 40px 20px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* 头部样式 */
.header {
  text-align: center;
  margin-bottom: 12px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}

.logo-icon {
  stroke: #a855f7;
  width: 36px;
  height: 36px;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 400;
}

/* 卡片通用样式 (毛玻璃效果) */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 32px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  margin-bottom: 24px;
  letter-spacing: -0.01em;
  position: relative;
  display: inline-block;
}

.card-title::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 24px;
  height: 3px;
  background: var(--primary-gradient);
  border-radius: 2px;
}

/* 表单与输入框 */
.form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 16px;
  color: var(--text-secondary);
  width: 20px;
  height: 20px;
  pointer-events: none;
  transition: color 0.3s;
}

input[type="url"], input[type="text"], input[type="password"] {
  width: 100%;
  background: rgba(15, 17, 26, 0.6);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 14px 16px 14px 48px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.3s, box-shadow 0.3s;
}

input[type="url"]:focus, input[type="text"]:focus, input[type="password"]:focus {
  border-color: #6366f1;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.2);
}

/* 配置选项网格 */
.options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 576px) {
  .options-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.option-card {
  background: rgba(15, 17, 26, 0.3);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* 单选组 */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.radio-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  position: relative;
}

.radio-label input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.radio-custom {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border: 2px solid var(--text-secondary);
  border-radius: 50%;
  margin-top: 2px;
  position: relative;
  transition: border-color 0.3s;
}

.radio-custom::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0);
  width: 8px;
  height: 8px;
  background: var(--primary-gradient);
  border-radius: 50%;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.radio-label input[type="radio"]:checked ~ .radio-custom {
  border-color: #a855f7;
}

.radio-label input[type="radio"]:checked ~ .radio-custom::after {
  transform: translate(-50%, -50%) scale(1);
}

.radio-text {
  display: flex;
  flex-direction: column;
}

.radio-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  transition: color 0.3s;
}

.radio-label input[type="radio"]:checked ~ .radio-text .radio-title {
  color: #a855f7;
}

.radio-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 1px;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 14px 24px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  outline: none;
}

.btn-primary {
  background: var(--primary-gradient);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(168, 85, 247, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(168, 85, 247, 0.4);
}

.btn-primary:active {
  transform: translateY(1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--text-secondary);
}

.btn-icon {
  width: 18px;
  height: 18px;
}

.btn-text {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.3s;
}

.btn-text:hover {
  color: #ef4444;
}

.btn-text-icon {
  width: 16px;
  height: 16px;
}

/* 结果展示卡片 */
.result-card {
  border-color: rgba(99, 102, 241, 0.3);
  animation: scale-up 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.result-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.short-url-container {
  display: flex;
  gap: 8px;
}

.short-url-container input[type="text"] {
  padding-left: 16px;
  font-weight: 500;
  color: #a855f7;
  letter-spacing: 0.02em;
}

.qr-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px;
  background: rgba(15, 17, 26, 0.4);
  border-radius: 12px;
  border: 1px solid var(--card-border);
}

.qr-code-wrapper {
  width: 140px;
  height: 140px;
  background: #ffffff;
  padding: 8px;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.qr-code-wrapper img {
  max-width: 100%;
  height: auto;
}

.qr-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* 历史记录 */
.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.history-card .card-title {
  margin-bottom: 0;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 4px;
}

/* 自定义滚动条 */
.history-list::-webkit-scrollbar {
  width: 6px;
}

.history-list::-webkit-scrollbar-track {
  background: transparent;
}

.history-list::-webkit-scrollbar-thumb {
  background: var(--card-border);
  border-radius: 3px;
}

.history-list::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

.empty-history {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 40px 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.empty-icon {
  width: 32px;
  height: 32px;
  stroke-width: 1.5;
  opacity: 0.6;
}

/* 历史卡片项 */
.history-item {
  background: rgba(15, 17, 26, 0.3);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  transition: all 0.3s;
}

.history-item:hover {
  border-color: rgba(168, 85, 247, 0.3);
  background: rgba(15, 17, 26, 0.5);
}

.history-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.history-short {
  font-size: 0.95rem;
  font-weight: 600;
  color: #a855f7;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-short:hover {
  text-decoration: underline;
}

.history-long {
  font-size: 0.75rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.history-badge {
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  color: var(--text-secondary);
}

.badge-proxy {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.2);
  color: #818cf8;
}

.history-actions {
  display: flex;
  gap: 4px;
}

.btn-icon-only {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
}

.btn-icon-only svg {
  width: 16px;
  height: 16px;
}

/* 页脚 */
.footer {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.8rem;
  margin-top: 16px;
  opacity: 0.7;
}

/* Toast 提示 */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 100;
}

.toast {
  background: var(--toast-bg);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: toast-in 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 动画定义 */
.hidden {
  display: none !important;
}

.animate-fade-in {
  animation: fade-in 0.6s ease-out forwards;
}

.animate-slide-up {
  animation: slide-up 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-slide-up-delay {
  opacity: 0;
  animation: slide-up 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.15s forwards;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   管理员专属样式 (模态框、管理列表、数据表格)
   ========================================================================== */

/* 登录模态框遮罩层 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 11, 16, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

/* 模态框容器 */
.modal-card {
  width: 90%;
  max-width: 400px;
  background: rgba(22, 24, 37, 0.9);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
  text-align: center;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .modal-card {
  transform: scale(1);
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 12px;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.modal-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 24px;
}

/* 管理控制台页面顶部操作区域 */
.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* 检索过滤条 */
.search-bar-wrapper {
  margin-bottom: 20px;
  position: relative;
  display: flex;
  align-items: center;
}

.search-bar-wrapper .input-icon {
  left: 16px;
}

.search-bar-wrapper input {
  padding-left: 48px;
}

/* 桌面端表格容器 */
.table-container {
  width: 100%;
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  background: rgba(15, 17, 26, 0.3);
  margin-bottom: 8px;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.admin-table th {
  background: rgba(15, 17, 26, 0.6);
  padding: 14px 16px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--card-border);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--card-border);
  color: var(--text-primary);
  max-width: 220px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.admin-table-link {
  color: #a855f7;
  text-decoration: none;
  font-weight: 500;
}

.admin-table-link:hover {
  text-decoration: underline;
}

/* 统一移动端适配样式 */
@media (max-width: 768px) {
  .admin-table-desktop {
    display: none;
  }
}

