/* 防止 Vue 模板语法闪烁 */
[v-cloak] { display: none !important; }

html {
  font-size: 14px;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: #1e293b;
}

/* 通用按钮 */
.btn-primary {
  display: inline-block;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  color: #fff;
  background: #3b82f6;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary:hover { background: #2563eb; }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-success {
  display: inline-block;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  color: #fff;
  background: #22c55e;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-success:hover { background: #16a34a; }
.btn-success:disabled { opacity: 0.6; cursor: not-allowed; }

.w-100 { width: 100%; }
.text-muted { color: #94a3b8; }
.mb-3 { margin-bottom: 12px; }

/* 首页样式 */
.welcome-card {
  background: #fff;
  border-radius: 12px;
  padding: 40px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.welcome-title {
  font-size: 28px;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 12px;
}

.welcome-desc {
  color: #64748b;
  font-size: 16px;
  margin: 0 0 8px;
}

.welcome-hint {
  color: #94a3b8;
  font-size: 14px;
  margin: 0;
}

.tool-cards {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.tool-section {
  margin-top: 24px;
}

.tool-section-title {
  font-size: 16px;
  font-weight: 600;
  color: #475569;
  margin: 0 0 12px;
  padding-left: 4px;
  border-left: 3px solid #3b82f6;
  padding-left: 10px;
}

.tool-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  transition: transform 0.2s, box-shadow 0.2s;
  flex: 1;
  min-width: 240px;
  max-width: 320px;
}

.tool-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.tool-card-body {
  padding: 24px;
  text-align: center;
}

.tool-icon {
  font-size: 40px;
  margin-bottom: 12px;
}

.tool-card-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 8px;
  color: #1e293b;
}

.tool-card-text {
  color: #64748b;
  font-size: 14px;
  margin: 0 0 16px;
}

/* 加解密页面样式 */
.tool-page {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  height: calc(100vh - 40px);
  display: flex;
  flex-direction: column;
}

.encryption-layout {
  display: flex;
  gap: 12px;
  flex: 1;
  min-height: 0;
}

.encryption-panel {
  flex: 1;
  min-width: 0;
}

.enc-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}

.enc-card-header {
  padding: 10px 14px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  font-size: 14px;
}

.enc-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.enc-card-footer {
  padding: 8px;
  border-top: 1px solid #f1f5f9;
}

.enc-textarea {
  flex: 1;
  border: none;
  resize: none;
  font-family: "Cascadia Code", "Fira Code", "Consolas", monospace;
  font-size: 13px;
  line-height: 1.6;
  padding: 12px;
  outline: none;
  color: #1e293b;
}

.encryption-actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  flex-shrink: 0;
  padding: 0 4px;
}

.action-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: bold;
  padding: 0;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid;
  background: #fff;
}

.action-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.action-btn-primary {
  color: #3b82f6;
  border-color: #3b82f6;
}

.action-btn-primary:hover:not(:disabled) {
  background: #3b82f6;
  color: #fff;
}

.action-btn-success {
  color: #22c55e;
  border-color: #22c55e;
}

.action-btn-success:hover:not(:disabled) {
  background: #22c55e;
  color: #fff;
}

/* 带文字的操作按钮 */
.action-btn-text {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.action-btn-text:disabled { opacity: 0.5; cursor: not-allowed; }

.action-btn-text.action-btn-primary {
  color: #3b82f6;
  border-color: #3b82f6;
}

.action-btn-text.action-btn-primary:hover:not(:disabled) {
  background: #3b82f6;
  color: #fff;
}

.action-btn-text.action-btn-success {
  color: #22c55e;
  border-color: #22c55e;
}

.action-btn-text.action-btn-success:hover:not(:disabled) {
  background: #22c55e;
  color: #fff;
}

/* 加载动画 */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 6px;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 提示消息 */
.toast-msg {
  margin-top: 12px;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  animation: fadeIn 0.3s;
}

.toast-success {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.toast-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

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

/* 参数加解密页面样式 */
.param-crypto-layout {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.env-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.env-label {
  font-weight: 600;
  color: #475569;
  font-size: 14px;
}

.env-radio {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  font-size: 14px;
  color: #64748b;
  transition: all 0.2s;
  user-select: none;
}

.env-radio input[type="radio"] {
  margin: 0;
  accent-color: #3b82f6;
}

.env-radio.active {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1e40af;
  font-weight: 500;
}

.enc-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.copy-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.2s;
}

.copy-btn:hover {
  background: #e2e8f0;
}

.enc-textarea-output {
  background: #1e1e2e;
  color: #00ff88;
}

.param-crypto-footer {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  justify-content: center;
}

.btn-secondary {
  display: inline-block;
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 500;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: #e2e8f0;
  color: #1e293b;
}

/* MobaXterm License 生成器页面样式 */
.license-form {
  background: #f8fafc;
  border-radius: 10px;
  padding: 20px;
  border: 1px solid #e2e8f0;
  margin-top: 16px;
}

.form-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.form-group {
  flex: 1;
  min-width: 0;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 8px 12px;
  font-size: 14px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.2s;
  background: #fff;
  color: #1e293b;
  box-sizing: border-box;
}

.form-control:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

select.form-control {
  appearance: auto;
}

.form-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 8px;
}

.license-help {
  margin-top: 24px;
  padding: 16px 20px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
}

.license-help h6 {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 600;
  color: #92400e;
}

.license-help ol {
  margin: 0;
  padding-left: 20px;
  color: #78350f;
  font-size: 14px;
  line-height: 1.8;
}

.license-help code {
  background: #fef3c7;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 13px;
  color: #92400e;
}

/* 邮件发送选项 */
.email-section {
  padding: 12px 0 4px;
  border-top: 1px solid #e2e8f0;
  margin-top: 4px;
}

.email-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.email-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #3b82f6;
  cursor: pointer;
}

.email-toggle-text {
  font-size: 14px;
  font-weight: 500;
  color: #475569;
}

.email-input-wrap {
  margin-top: 10px;
}

/* License 表单 - 窄字段 */
.form-group-narrow {
  flex: 0 0 auto;
  min-width: 0;
}

/* 版本号输入组 */
.version-input-group {
  display: flex;
  align-items: center;
  gap: 0;
}

.version-input-group .form-control {
  width: 72px;
  text-align: center;
  padding: 8px 6px;
  border-radius: 6px 0 0 6px;
}

.version-input-group .form-control + .form-control {
  border-radius: 0 6px 6px 0;
  border-left: none;
}

.version-dot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 38px;
  background: #fff;
  border-top: 1px solid #d1d5db;
  border-bottom: 1px solid #d1d5db;
  font-size: 16px;
  font-weight: 700;
  color: #94a3b8;
  flex-shrink: 0;
}

.form-group-narrow input[type="number"] {
  width: 100px;
}

.form-group-narrow select.form-control {
  width: 150px;
}

/* License 结果展示 */
.license-result {
  margin-top: 20px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
}

.license-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
  font-size: 14px;
}

.license-result-body {
  padding: 0;
}

.license-textarea {
  width: 100%;
  height: 100px;
  border: none;
  resize: none;
  font-family: "Cascadia Code", "Fira Code", "Consolas", monospace;
  font-size: 13px;
  line-height: 1.6;
  padding: 12px;
  outline: none;
  color: #1e293b;
  background: #1e1e2e;
  color: #00ff88;
  box-sizing: border-box;
}

/* 下载站管理 */
.dl-section {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  margin-top: 16px;
}

.dl-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.dl-section-header h5 {
  margin: 0;
  font-size: 16px;
  color: #1e293b;
}

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

.dl-search-bar {
  display: flex;
  gap: 8px;
  align-items: center;
}

.dl-search-info {
  font-size: 13px;
  color: #94a3b8;
  white-space: nowrap;
}

.btn-sm {
  padding: 4px 12px;
  font-size: 13px;
}

.form-control-sm {
  padding: 4px 8px;
  font-size: 13px;
}

.dl-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.dl-table th, .dl-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #f1f5f9;
  text-align: left;
  vertical-align: middle;
}

.dl-table th {
  background: #f8fafc;
  font-weight: 600;
  color: #475569;
  white-space: nowrap;
}

.dl-table-inner th { background: #f8fafc; }

.dl-table tr:hover { background: #f8fafc; }

.td-title {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-link {
  background: none;
  border: none;
  cursor: pointer;
  color: #3b82f6;
  font-size: 13px;
  padding: 2px 6px;
}

.btn-link:hover { text-decoration: underline; }
.btn-link.text-danger { color: #ef4444; }
.btn-link.text-success { color: #22c55e; }
.btn-link.text-primary { color: #3b82f6; }

/* 弹窗 */
.dl-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.dl-modal {
  background: #fff;
  border-radius: 12px;
  width: 90%;
  max-width: 800px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.dl-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e2e8f0;
}

.dl-modal-header h5 { margin: 0; font-size: 16px; }

.dl-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #94a3b8;
  line-height: 1;
}

.dl-modal-close:hover { color: #1e293b; }

.dl-modal-body { padding: 20px; }

.dl-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 20px;
  border-top: 1px solid #e2e8f0;
}

/* ===== 移动端响应式 ===== */
@media (max-width: 768px) {
  /* 工具页面高度自适应 */
  .tool-page {
    height: auto;
    min-height: calc(100vh - 76px);
    padding: 16px;
  }

  /* 表单行改为纵向排列 */
  .form-row {
    flex-direction: column;
    gap: 12px;
  }

  .form-group-narrow {
    width: 100%;
  }

  /* 确保所有表单控件不超出容器 */
  .form-control {
    max-width: 100%;
    box-sizing: border-box;
  }

  .form-group-narrow input[type="number"] {
    width: 100%;
    max-width: 100%;
  }

  .form-group-narrow select.form-control {
    width: 100%;
    max-width: 100%;
  }

  /* 版本号输入组 */
  .version-input-group .form-control {
    flex: 1;
    width: auto;
  }

  /* 加解密布局改为纵向 */
  .encryption-layout {
    flex-direction: column;
    gap: 12px;
  }

  .encryption-actions {
    flex-direction: row;
    justify-content: center;
    padding: 4px 0;
  }

  /* 首页工具卡片占满宽度 */
  .tool-card {
    max-width: none;
    min-width: 0;
  }

  .tool-cards {
    gap: 12px;
  }

  /* License 帮助文本 */
  .license-help {
    padding: 12px 16px;
  }

  /* License 表单防止溢出 */
  .license-form {
    overflow: hidden;
    box-sizing: border-box;
  }

  /* License 结果区域 */
  .license-result-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  /* 下载站表格滚动 */
  .dl-table {
    font-size: 12px;
  }

  .dl-table th, .dl-table td {
    padding: 6px 8px;
  }

  /* 弹窗占满屏幕 */
  .dl-modal {
    width: 95%;
    max-width: none;
  }

  /* 搜索栏改为纵向 */
  .dl-section-header {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .dl-search-bar {
    flex-wrap: wrap;
  }
}
