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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f0f2f5;
  color: #333;
  min-height: 100vh;
}

nav {
  background: #fff;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-size: 20px;
  font-weight: 700;
  color: #4f46e5;
  text-decoration: none;
}

#nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

#nav-right .user-info {
  color: #666;
  font-size: 14px;
}

main {
  max-width: 800px;
  margin: 32px auto;
  padding: 0 16px;
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.btn-primary { background: #4f46e5; color: #fff; }
.btn-primary:hover { background: #4338ca; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-outline { background: #fff; color: #4f46e5; border: 1px solid #4f46e5; }
.btn-outline:hover { background: #eef2ff; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-ghost { background: transparent; color: #666; }
.btn-ghost:hover { background: #f3f4f6; }

/* 卡片 */
.card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  font-size: 18px;
  font-weight: 600;
}

/* 表单 */
.form-group {
  margin-bottom: 16px;
}

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

.form-group input, .form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.15s;
}

.form-group input:focus, .form-group textarea:focus {
  outline: none;
  border-color: #4f46e5;
  box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}

/* 认证页面 */
.auth-page {
  display: flex;
  justify-content: center;
  padding-top: 80px;
}

.auth-box {
  width: 380px;
}

.auth-box h2 {
  text-align: center;
  margin-bottom: 24px;
  font-size: 24px;
}

.auth-box .switch-link {
  text-align: center;
  margin-top: 16px;
  font-size: 14px;
  color: #666;
}

.auth-box .switch-link a {
  color: #4f46e5;
  cursor: pointer;
  text-decoration: none;
}

.auth-box .switch-link a:hover {
  text-decoration: underline;
}

.error-msg {
  background: #fef2f2;
  color: #dc2626;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
  display: none;
}

/* 收藏夹列表 */
.collection-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: #fff;
  border-radius: 12px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  cursor: pointer;
  transition: box-shadow 0.15s;
}

.collection-item:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.collection-info h3 {
  font-size: 16px;
  margin-bottom: 4px;
}

.collection-info p {
  font-size: 13px;
  color: #888;
}

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

.badge {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 500;
}

.badge-public { background: #dcfce7; color: #16a34a; }
.badge-private { background: #f3f4f6; color: #6b7280; }

/* 书签项 */
.bookmark-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 14px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  margin-bottom: 10px;
  transition: border-color 0.15s;
}

.bookmark-item:hover {
  border-color: #4f46e5;
}

.bookmark-content {
  flex: 1;
  min-width: 0;
}

.bookmark-content h4 {
  font-size: 15px;
  margin-bottom: 4px;
}

.bookmark-content h4 a {
  color: #4f46e5;
  text-decoration: none;
}

.bookmark-content h4 a:hover {
  text-decoration: underline;
}

.bookmark-content .url {
  font-size: 12px;
  color: #999;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bookmark-content .desc {
  font-size: 13px;
  color: #666;
  margin-top: 4px;
}

/* 空状态 */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: #999;
}

.empty-state p {
  font-size: 16px;
  margin-bottom: 16px;
}

/* 分享链接 */
.share-link {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f9fafb;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: #4f46e5;
  word-break: break-all;
}

/* 添加表单 */
.add-form {
  background: #f9fafb;
  padding: 16px;
  border-radius: 10px;
  margin-bottom: 20px;
  display: none;
}

.add-form.show {
  display: block;
}

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

.add-form .form-row .form-group {
  flex: 1;
  margin-bottom: 0;
}

/* 公开导航页面 */
.nav-page {
  max-width: 960px;
  margin: 0 auto;
}

.nav-hero {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  border-radius: 16px;
  padding: 48px 32px;
  margin-bottom: 32px;
  color: #fff;
}

.nav-hero-inner h1 {
  font-size: 32px;
  margin-bottom: 8px;
  font-weight: 700;
}

.nav-owner {
  font-size: 15px;
  opacity: 0.8;
}

.nav-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.nav-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: #fff;
  border-radius: 14px;
  text-decoration: none;
  color: #333;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  transition: all 0.2s;
  border: 1px solid transparent;
}

.nav-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(79,70,229,0.12);
  border-color: #4f46e5;
}

.nav-card-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.nav-card-icon img {
  width: 28px;
  height: 28px;
}

.nav-card-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: #4f46e5;
  background: linear-gradient(135deg, #eef2ff, #e0e7ff);
}

.nav-card-info {
  flex: 1;
  min-width: 0;
}

.nav-card-info h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-card-info p {
  font-size: 13px;
  color: #888;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-card-domain {
  font-size: 12px !important;
}

/* 页面头部 */
.page-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.page-header h2 {
  font-size: 22px;
}

.back-btn {
  font-size: 22px;
  color: #666;
  cursor: pointer;
  text-decoration: none;
}

.back-btn:hover {
  color: #4f46e5;
}
