/* ACG嗷呜喵 - 自定义样式 */
/* 统一样式管理，减少内联样式，提升可维护性 */

/* ========== 模态框样式 ========== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  min-width: 320px;
  max-width: 420px;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.modal .close {
  position: absolute;
  right: 10px;
  top: 10px;
  cursor: pointer;
  font-size: 20px;
  color: #9ca3af;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.modal .close:hover {
  background: #f3f4f6;
  color: #374151;
}

/* ========== 表单样式 ========== */
.form-input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin: 8px 0;
  font-size: 14px;
  transition: border-color 0.2s ease;
}

.form-input:focus {
  outline: none;
  border-color: #6d28d9;
  box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.1);
}

.form-input::placeholder {
  color: #9ca3af;
}

/* ========== 按钮样式 ========== */
.btn-full {
  width: 100%;
}

.btn-rounded {
  border-radius: 8px;
}

.btn-primary {
  background: #111827;
  border: none;
  color: #fff;
  padding: 10px 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  background: #374151;
  transform: translateY(-1px);
}

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

/* ========== 消息提示样式 ========== */
.msg {
  margin-top: 8px;
  min-height: 18px;
  font-size: 13px;
  transition: all 0.3s ease;
}

.msg-error {
  color: #b91c1c;
}

.msg-success {
  color: #27ae60;
}

.msg-info {
  color: #6b7280;
}

/* ========== 浮动按钮样式 ========== */
.float-btn {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #111827;
  transition: all 0.15s ease;
  cursor: pointer;
  outline: none;
}

.float-btn:hover {
  background: #111827;
  color: #fff;
  border-color: #111827;
}

.float-btn:active {
  transform: scale(0.96);
}

.float-btn:focus {
  box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.15);
}

/* ========== 链接样式 ========== */
.link-primary {
  color: #6d28d9;
  text-decoration: none;
  transition: color 0.2s ease;
}

.link-primary:hover {
  color: #5b21b6;
  text-decoration: underline;
}

.link-muted {
  color: #6b7280;
  text-decoration: none;
  transition: color 0.2s ease;
}

.link-muted:hover {
  color: #374151;
}

/* ========== 导航 hover 下拉（桌面端优化） ========== */
@media (min-width: 992px) {
  .navbar-nav .dropdown:hover > .dropdown-menu {
    display: block;
    margin-top: 0; /* 与 Bootstrap 对齐，避免跳动 */
  }
}

/* ========== 顶部搜索框样式 ========== */
.nav-search-input {
  height: 38px;
  border: 1px solid #e5e7eb;
  border-radius: 8px 0 0 8px;
  padding: 0 10px;
  outline: none;
}
.search-form .search-btn {
  border-radius: 0 8px 8px 0;
  border-left: 0;
}
.mobile-search-form {
  display: flex;
  align-items: center;
}
.mobile-search-input {
  height: 34px;
  border: 1px solid #e5e7eb;
  border-radius: 6px 0 0 6px;
  padding: 0 10px;
}
.mobile-search-btn {
  height: 34px;
  border: 1px solid #e5e7eb;
  border-left: 0;
  border-radius: 0 6px 6px 0;
  background: #fff;
}

/* ========== 文本样式 ========== */
.text-muted {
  color: #6b7280;
}

.text-center {
  text-align: center;
}

.text-small {
  font-size: 12px;
}

/* ========== 间距工具类 ========== */
.mt-8 {
  margin-top: 8px;
}

.mt-10 {
  margin-top: 10px;
}

.mb-8 {
  margin-bottom: 8px;
}

.mx-8 {
  margin-left: 8px;
  margin-right: 8px;
}

/* ========== 验证码发送按钮 ========== */
.btn-send-code {
  height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-send-code:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

/* ========== Toast 通知样式 ========== */
.toast {
  transition: transform 0.3s ease-out !important;
  transform: translateX(100%);
}

.toast.fade.show {
  transform: translateX(0);
}

/* ========== 响应式优化 ========== */
@media (max-width: 768px) {
  .modal-content {
    min-width: 90vw;
    max-width: 90vw;
    padding: 15px;
  }
  
  .form-input {
    font-size: 16px; /* 防止移动端输入框自动缩放 */
  }
}

/* ========== 浮动按钮层级，避免被搜索框遮挡 ========== */
.floating-action-menu { z-index: 1040; }

/* ========== 分类徽章（Category Badge） ========== */
.category-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.4;
  background: var(--cbg, #6b7280);
  color: #fff;
  text-decoration: none;
  vertical-align: middle;
}

.category-badge:hover {
  filter: brightness(0.95);
  text-decoration: none;
}

.post-list-meta .category-badge { margin-right: 8px; }

