.nav {
  width: 100%;
  background: #fff;
  border-bottom: 1px solid #e8ecf0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-toggle-input {
  display: none;
}

.nav-toggle-btn {
  display: none;
}

.nav-inner {
  max-width: 1440px;
  margin: 0 auto;
  height: 70px;
  display: flex;
  align-items: center;
  padding: 0 24px;
}

.nav-logo,
h1.nav-logo {
  font-size: 20px;
  font-weight: 800;
  color: #1a1a2e;
  text-decoration: none;
  margin: 0 40px 0 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
h1.nav-logo a {
  color: inherit;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: inherit;
  font-size: inherit;
}

.nav-logo i {
  color: #667eea;
  font-size: 22px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}

.nav-links a {
  text-decoration: none;
  color: #555;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 6px;
  transition: all 0.2s;
}

.nav-links a:hover {
  color: #1a1a2e;
  background: #f0f2f5;
}

.nav-links a.active {
  color: #667eea;
  background: #eef2ff;
}

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

.nav-right a {
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 20px;
  border-radius: 6px;
  transition: all 0.2s;
}

.nav-right .btn-login {
  color: #667eea;
}

.nav-right .btn-login:hover {
  background: #eef2ff;
}

.nav-right .btn-register {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
}

.nav-right .btn-register:hover {
  opacity: 0.9;
}

.nav-user {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 4px 10px 4px 4px;
  border-radius: 8px;
  transition: background 0.2s;
  user-select: none;
}

.nav-user:hover {
  background: #f0f2f5;
}

.nav-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #eef2ff;
}

.nav-nickname {
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

.nav-arrow {
  font-size: 10px;
  color: #999;
  transition: transform 0.2s;
}

.nav-arrow.up {
  transform: rotate(180deg);
}

.nav-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
  min-width: 160px;
  overflow: hidden;
  z-index: 200;
  border: 1px solid #e8ecf0;
}

.nav-dropdown.show {
  display: block;
}

.nav-dropdown a {
  display: flex !important;
  align-items: center;
  gap: 10px;
  padding: 12px 16px !important;
  color: #555 !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  text-decoration: none;
  border-radius: 0 !important;
  transition: background 0.15s;
}

.nav-dropdown a:hover {
  background: #f6f8fa !important;
  color: #1a1a2e !important;
}

.nav-dropdown a i {
  width: 16px;
  color: #999;
}

.nav-dropdown .dropdown-divider {
  height: 1px;
  background: #e8ecf0;
  margin: 0;
}

.nav-dropdown .dropdown-danger {
  color: #e74c3c !important;
}

.nav-dropdown .dropdown-danger i {
  color: #e74c3c !important;
}

.nav-dropdown .dropdown-danger:hover {
  background: #fef0ef !important;
}

.nav-icon-home { color: #667eea; }
.nav-icon-recommend { color: #10b981; }
.nav-icon-hot { color: #f59e0b; }
.nav-icon-categories { color: #8b5cf6; }
.nav-icon-latest { color: #f97316; }

.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

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

.modal-card {
  background: #fff;
  border-radius: 16px;
  padding: 40px 36px 32px;
  width: 400px;
  max-width: 90vw;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  animation: modalIn 0.3s ease;
}

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

.modal-close {
  position: absolute;
  top: 16px; right: 20px;
  background: none;
  border: none;
  font-size: 28px;
  color: #999;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: #333;
}

.modal-header {
  text-align: center;
  margin-bottom: 28px;
}

.modal-icon {
  font-size: 48px;
  color: #667eea;
  margin-bottom: 12px;
}

.modal-header h2 {
  font-size: 22px;
  color: #1a1a2e;
  margin-bottom: 6px;
}

.modal-header p {
  color: #888;
  font-size: 14px;
}

.form-group {
  margin-bottom: 18px;
}

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

.form-group label i {
  margin-right: 4px;
  color: #667eea;
}

.form-group input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #e0e4e8;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus {
  border-color: #667eea;
}

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

.input-group input {
  flex: 1;
}

.btn-code {
  padding: 0 16px;
  background: #eef2ff;
  color: #667eea;
  border: 1.5px solid #d0d5f0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.btn-code:hover {
  background: #e0e5ff;
}

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

.btn-submit {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
  margin-top: 4px;
}

.btn-submit:hover {
  opacity: 0.9;
}

.btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.modal-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 13px;
  color: #888;
}

.modal-footer a {
  color: #667eea;
  text-decoration: none;
  font-weight: 600;
}

.modal-footer a:hover {
  text-decoration: underline;
}

.error-msg {
  color: #e74c3c;
  font-size: 13px;
  margin-top: 8px;
  display: none;
  text-align: center;
}

.error-msg.show {
  display: block;
}

.avatar-upload {
  display: flex;
  align-items: center;
  gap: 16px;
}

.avatar-preview {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid #eef2ff;
  flex-shrink: 0;
}

.avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-upload-btn button {
  padding: 8px 16px;
  background: #eef2ff;
  color: #667eea;
  border: 1.5px solid #d0d5f0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.avatar-upload-btn button:hover {
  background: #e0e5ff;
}

.avatar-upload-btn button i {
  margin-right: 4px;
}

.avatar-hint {
  display: block;
  font-size: 11px;
  color: #aaa;
  margin-top: 4px;
}

.avatar-limit {
  display: block;
  font-size: 11px;
  color: #e67e22;
  margin-top: 2px;
}

.upload-progress {
  display: none;
  margin-top: 8px;
  font-size: 12px;
  color: #888;
}

.upload-progress.show {
  display: block;
}

.nav-file-input {
  display: none;
}

.external-link-modal {
  max-width: 480px;
  text-align: center;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.external-link-url {
  background: #f5f6fa;
  border-radius: 8px;
  padding: 12px 16px;
  margin: 16px 24px;
  word-break: break-all;
  font-size: 13px;
  color: #333;
  font-weight: 700;
  text-align: left;
  line-height: 1.5;
}

.external-link-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  padding: 0 24px 24px;
}

.external-link-actions .btn {
  padding: 10px 28px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all 0.2s;
}

.external-link-actions .btn-cancel {
  background: #f0f2f5;
  color: #666;
}

.external-link-actions .btn-cancel:hover {
  background: #e4e6eb;
}

.external-link-actions .btn-primary {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
}

.external-link-actions .btn-primary:hover {
  opacity: 0.9;
}
