/* ============================================
   joai10 — Modern Glassmorphism Layout
   ============================================ */

/* Reset */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Subtle animated background gradient */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse 80% 50% at 50% -20%, var(--accent-glow), transparent),
              radial-gradient(ellipse 60% 40% at 80% 100%, rgba(94, 187, 255, 0.05), transparent);
  pointer-events: none;
  z-index: 0;
}

/* ===== Auth Gate ===== */
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
}

.auth-gate::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 50% at 50% -10%, var(--accent-glow), transparent);
}

.auth-box {
  position: relative;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  width: 380px;
  max-width: 90vw;
  text-align: center;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  animation: authFadeIn 0.6s var(--transition-normal);
}

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

.auth-box .auth-logo {
  font-size: 48px;
  margin-bottom: var(--space-md);
  filter: drop-shadow(0 4px 12px rgba(124, 108, 240, 0.3));
}

.auth-box h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: var(--space-xs);
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.auth-box p {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: var(--space-lg);
}

.auth-input {
  width: 100%;
  padding: 14px 18px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  text-align: center;
  letter-spacing: 4px;
}

.auth-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.auth-submit {
  width: 100%;
  margin-top: var(--space-md);
  padding: 14px;
  background: var(--accent-gradient);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.auth-submit:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.auth-submit:active {
  transform: translateY(0);
}

.auth-error {
  color: var(--danger);
  font-size: 13px;
  margin-top: var(--space-sm);
  min-height: 20px;
}

/* ===== Header ===== */
.app-header {
  height: calc(54px + env(safe-area-inset-top, 0px));
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: env(safe-area-inset-top, 0px) var(--space-md) 0;
  flex-shrink: 0;
  z-index: 10;
  position: relative;
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.header-left {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.logo {
  font-size: 17px;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.3px;
}

.header-right {
  display: flex;
  gap: 2px;
  align-items: center;
}

/* ===== Main Layout ===== */
.app-main {
  flex: 1;
  display: grid;
  grid-template-columns: 240px 350px 1fr;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

/* ===== Sidebar ===== */
.sidebar {
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  padding: var(--space-sm) 0;
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.sidebar-section {
  margin-bottom: 2px;
}

.sidebar-section-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 14px var(--space-md) 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  transition: color var(--transition-fast);
}

.sidebar-section-title:hover {
  color: var(--text-secondary);
}

.sidebar-section-toggle {
  font-size: 9px;
  transition: transform var(--transition-fast);
  opacity: 0.4;
}

.sidebar-section-title.collapsed .sidebar-section-toggle {
  transform: rotate(-90deg);
}

.sidebar-section-feeds {
  overflow: hidden;
  transition: max-height var(--transition-normal), opacity var(--transition-fast);
  max-height: 600px;
  opacity: 1;
}

.sidebar-section-feeds.collapsed {
  max-height: 0;
  opacity: 0;
}

.sidebar-item {
  display: flex;
  align-items: center;
  padding: 9px var(--space-md);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 13px;
  transition: all var(--transition-fast);
  gap: var(--space-sm);
  border-left: 3px solid transparent;
  position: relative;
}

.sidebar-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.sidebar-item.active {
  background: var(--accent-light);
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 600;
}

.sidebar-item .item-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-item .badge {
  background: var(--accent);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  min-width: 18px;
  text-align: center;
  line-height: 1.4;
}

.sidebar-item .item-icon {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  opacity: 0.7;
}

.sidebar-add-btn {
  display: flex;
  align-items: center;
  padding: 12px var(--space-md);
  cursor: pointer;
  color: var(--accent);
  font-size: 13px;
  gap: var(--space-sm);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  transition: background var(--transition-fast);
}

.sidebar-add-btn:hover {
  background: var(--bg-hover);
}

/* Last updated time */
.last-update-time {
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0.6;
}

/* ===== Article List Panel ===== */
.article-list-panel {
  background: var(--bg-primary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.list-header {
  padding: var(--space-sm) 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.search-wrapper {
  display: flex;
  gap: 6px;
  align-items: center;
}

.search-inner {
  position: relative;
  flex: 1;
  min-width: 0;
}

.sort-toggle {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.sort-toggle:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.sort-toggle.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  box-shadow: 0 2px 8px var(--accent-glow);
}

.search-input {
  width: 100%;
  padding: 9px 32px 9px 14px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  line-height: 1;
}

.search-clear:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.list-status {
  font-size: 11px;
  color: var(--text-muted);
  padding: var(--space-xs) 0 0;
  min-height: 18px;
}

.list-status .loading-dots::after {
  content: '';
  animation: dots 1.2s infinite;
}

@keyframes dots {
  0%, 20% { content: '.'; }
  40% { content: '..'; }
  60%, 100% { content: '...'; }
}

/* Pull-to-refresh */
.pull-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  font-size: 12px;
  color: var(--text-muted);
  overflow: hidden;
  height: 0;
  transition: opacity var(--transition-fast);
  flex-shrink: 0;
}

.pull-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.article-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}

/* Date group sticky headers */
.date-group-header {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 6px var(--space-md);
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.date-group-count {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 400;
  opacity: 0.6;
}

/* ===== Article Card ===== */
.article-card {
  padding: 12px var(--space-md);
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.article-card:hover {
  background: var(--card-hover);
}

.article-card.active {
  background: var(--card-active);
  border-left: 3px solid var(--accent);
  box-shadow: inset 4px 0 12px -4px var(--accent-glow);
}

.article-card.unread .article-title {
  font-weight: 650;
  color: var(--text-primary);
}

.card-inner {
  display: flex;
  gap: 12px;
  position: relative;
  z-index: 1;
  background: transparent;
  transition: transform var(--transition-fast);
}

.article-card:hover .card-inner { background: transparent; }
.article-card.active .card-inner { background: transparent; }

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

.card-thumb {
  width: 72px;
  height: 54px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-tertiary);
  align-self: center;
}

.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--transition-normal);
}

.article-card:hover .card-thumb img {
  transform: scale(1.05);
}

/* Swipe-to-bookmark (mobile) */
.swipe-action {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--warning);
  color: var(--text-inverse);
  opacity: 0;
  transition: opacity var(--transition-fast);
  z-index: 0;
  pointer-events: none;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.swipe-action.triggered { background: var(--accent); }
.swipe-action-icon { font-size: 22px; line-height: 1; }
.swipe-action-text { font-size: 10px; font-weight: 600; margin-top: 2px; }

/* Title row */
.title-row {
  display: flex;
  gap: 6px;
  align-items: flex-start;
}

.unread-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  margin-top: 5px;
  box-shadow: 0 0 6px var(--accent-glow);
  animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
  0%, 100% { box-shadow: 0 0 4px var(--accent-glow); }
  50% { box-shadow: 0 0 10px var(--accent-glow); }
}

.article-title {
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--text-secondary);
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
  transition: color var(--transition-fast);
}

.article-card:hover .article-title {
  color: var(--text-primary);
}

.article-title-en {
  font-size: 11px;
  line-height: 1.3;
  color: var(--text-muted);
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  opacity: 0.5;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.article-meta .feed-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.article-meta .feed-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100px;
}

.article-meta .read-time { color: var(--accent); font-size: 10px; }
.article-meta .note-badge { font-size: 10px; }
.article-meta .time { margin-left: auto; white-space: nowrap; }

.article-card .bookmark-indicator {
  color: var(--bookmark-color);
  font-size: 12px;
  flex-shrink: 0;
}

/* Source pill */
.source-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: var(--radius-full);
  font-size: 10px;
  font-weight: 600;
  background: color-mix(in srgb, var(--pill-color, var(--accent)) 15%, transparent);
  color: var(--pill-color, var(--accent));
  white-space: nowrap;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.2px;
}

.article-snippet {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* AI Summary on card */
.article-snippet.ai-summary {
  color: var(--accent);
  opacity: 0.8;
  padding-left: 16px;
  position: relative;
}

.article-snippet.ai-summary::before {
  content: '✨';
  position: absolute;
  left: 0;
  top: 0;
}

/* Skeleton loading */
.skeleton-card { pointer-events: none; }

.skeleton-line {
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-hover) 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-sm);
}

.skeleton-title { width: 80%; height: 14px; }
.skeleton-meta { width: 50%; height: 10px; }
.skeleton-snippet { width: 90%; height: 10px; }

.skeleton-thumb {
  width: 72px;
  height: 54px;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-hover) 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  flex-shrink: 0;
  align-self: center;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Infinite scroll */
.scroll-sentinel { padding: var(--space-md); text-align: center; }

.auto-load-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  font-size: 12px;
  color: var(--text-muted);
  padding: var(--space-sm);
}

/* Quick bookmark button */
.quick-bookmark {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0 2px;
  flex-shrink: 0;
  line-height: 1;
  transition: all var(--transition-fast);
  opacity: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.article-card:hover .quick-bookmark,
.quick-bookmark.active { opacity: 1; }
.quick-bookmark.active { color: var(--bookmark-color); }
.quick-bookmark:hover { transform: scale(1.2); color: var(--bookmark-color); }
.quick-bookmark .bookmark-svg { width: 18px; height: 18px; }

.bookmark-svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

/* Scroll-to-top */
.scroll-top-btn {
  position: absolute;
  bottom: var(--space-md);
  right: var(--space-md);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  border: none;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(10px);
  transition: all var(--transition-normal);
  pointer-events: none;
  z-index: 5;
}

.scroll-top-btn.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.scroll-top-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

.list-footer {
  padding: 12px;
  text-align: center;
  flex-shrink: 0;
}

.load-more-btn {
  width: 100%;
  padding: var(--space-sm);
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 12px;
  font-family: inherit;
  transition: all var(--transition-fast);
}

.load-more-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* ===== Reading Panel ===== */
.reading-panel {
  overflow-y: auto;
  padding: 0;
  position: relative;
  scroll-behavior: smooth;
}

.reading-progress-bar {
  position: sticky;
  top: 0;
  height: 3px;
  background: var(--bg-tertiary);
  z-index: 5;
  flex-shrink: 0;
}

.reading-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-gradient);
  transition: width 0.15s ease-out;
  border-radius: 0 2px 2px 0;
}

.reading-title-en {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.4;
  opacity: 0.6;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-muted);
  gap: var(--space-md);
  font-size: 14px;
}

.empty-tips {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.reading-content {
  max-width: 720px;
  margin: 0 auto;
  padding: var(--space-xl) 40px;
  animation: contentFadeIn 0.3s ease;
}

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

.reading-header {
  margin-bottom: var(--space-lg);
}

.reading-title {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--text-primary);
  margin-bottom: 12px;
  letter-spacing: -0.3px;
}

.reading-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.reading-meta .separator { color: var(--text-muted); opacity: 0.5; }

/* Action Toolbar */
.reading-actions {
  display: flex;
  gap: var(--space-sm);
  padding: 12px 0;
  margin-bottom: var(--space-md);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  position: sticky;
  top: 3px;
  z-index: 4;
  background: var(--bg-primary);
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text-secondary);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.action-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-accent);
  box-shadow: 0 2px 8px var(--accent-glow);
}

.action-btn.active {
  color: var(--bookmark-color);
  border-color: var(--bookmark-color);
}

.action-btn.loading { opacity: 0.5; pointer-events: none; }
.action-btn svg { width: 14px; height: 14px; }

/* AI Result Boxes */
.ai-result-box {
  margin-bottom: var(--space-md);
  border-radius: var(--radius-md);
  overflow: hidden;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.ai-result-box.summary {
  background: var(--summary-bg);
  border: 1px solid var(--summary-border);
}

.ai-result-box.translation {
  background: var(--translate-bg);
  border: 1px solid var(--translate-border);
}

.ai-result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.ai-result-box.summary .ai-result-header { color: var(--accent); }
.ai-result-box.translation .ai-result-header { color: var(--success); }

.ai-result-content {
  padding: 0 14px 14px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-primary);
}

.ai-result-content p { margin-bottom: var(--space-sm); }
.ai-result-content p:last-child { margin-bottom: 0; }

.ai-result-toggle {
  transition: transform var(--transition-fast);
  display: inline-block;
}

.ai-result-toggle.collapsed { transform: rotate(-90deg); }

/* Article Body */
.reading-body {
  font-size: 15px;
  line-height: 1.85;
  color: var(--text-primary);
}

.reading-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  margin: var(--space-md) 0;
}

.reading-body a { color: var(--accent); text-decoration: none; }
.reading-body a:hover { text-decoration: underline; }
.reading-body p { margin-bottom: var(--space-md); }
.reading-body h1, .reading-body h2, .reading-body h3 { margin: var(--space-lg) 0 12px; }

.reading-body blockquote {
  border-left: 3px solid var(--accent);
  padding-left: var(--space-md);
  margin: var(--space-md) 0;
  color: var(--text-secondary);
  font-style: italic;
}

.reading-body pre, .reading-body code {
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font-mono);
}

.reading-body pre { padding: 12px; overflow-x: auto; margin: var(--space-md) 0; }
.reading-body code { padding: 2px 4px; }

/* Open Original CTA */
.reading-cta {
  margin: var(--space-lg) 0;
  text-align: center;
  padding: var(--space-lg);
  background: var(--glass-bg);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.cta-open-original {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 14px 32px;
  background: var(--accent-gradient);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 16px var(--accent-glow);
}

.cta-open-original:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: 0 6px 24px var(--accent-glow);
}

.cta-hint {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
}

/* Bookmark filter */
#btn-bookmark-filter.active {
  color: var(--bookmark-color);
  background: rgba(251, 191, 36, 0.12);
}

#btn-bookmark-filter.active svg { fill: var(--bookmark-color); }

/* Category chips */
.category-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid var(--border);
  background: var(--glass-bg);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.category-chip:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.category-chip.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  box-shadow: 0 2px 10px var(--accent-glow);
}

/* Keyboard shortcuts overlay */
.shortcuts-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.shortcuts-overlay.show { display: flex; }

.shortcuts-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg) var(--space-xl);
  max-width: 420px;
  width: 90vw;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.shortcuts-panel h2 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: var(--space-md);
  color: var(--text-primary);
}

.shortcuts-grid {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: var(--space-sm) 12px;
  align-items: center;
}

.shortcut-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 8px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text-primary);
  min-width: 28px;
}

.shortcut-desc { font-size: 13px; color: var(--text-secondary); }

.empty-tips .shortcut-key {
  padding: 2px 6px;
  font-size: 11px;
  min-width: 20px;
}

/* Notes section */
.reading-notes {
  margin-top: var(--space-xl);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
}

.reading-notes h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.note-item {
  background: var(--glass-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: var(--space-sm);
  font-size: 13px;
  line-height: 1.6;
  position: relative;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.note-item .note-date { font-size: 11px; color: var(--text-muted); margin-top: var(--space-sm); }

.note-item .note-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.note-item:hover .note-actions { opacity: 1; }

/* Reading time badge */
.reading-time-badge { color: var(--accent); font-weight: 500; }

/* Font size controls */
.font-size-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.font-size-btn {
  width: 30px;
  height: 30px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--glass-bg);
  color: var(--text-secondary);
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  transition: all var(--transition-fast);
}

.font-size-btn:hover { background: var(--bg-hover); color: var(--text-primary); }

.font-size-label {
  font-size: 11px;
  color: var(--text-muted);
  min-width: 28px;
  text-align: center;
}

/* Article navigation */
.article-nav {
  display: flex;
  gap: 12px;
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
}

.article-nav-btn {
  flex: 1;
  padding: 14px var(--space-md);
  background: var(--glass-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text-secondary);
  font-size: 12px;
  font-family: inherit;
  transition: all var(--transition-fast);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.article-nav-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow);
}

.article-nav-btn.next { text-align: right; }

.article-nav-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.article-nav-title {
  font-size: 13px;
  font-weight: 500;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-nav-btn:disabled { opacity: 0.3; cursor: default; pointer-events: none; }

/* ===== Scrollbars ===== */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* Spinner */
.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--text-muted);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

.refreshing svg { animation: spin 1s linear infinite; }

/* ===== Analytics Dashboard ===== */
.analytics-panel {
  padding: var(--space-lg);
  max-width: 900px;
  margin: 0 auto;
  animation: contentFadeIn 0.3s ease;
}

.analytics-panel h2 {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: var(--space-lg);
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.stat-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg) var(--space-md);
  text-align: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all var(--transition-fast);
}

.stat-card:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.stat-value {
  font-size: 32px;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
}

.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: var(--space-xs);
  font-weight: 500;
}

.analytics-section {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.analytics-section h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: var(--space-md);
  color: var(--text-primary);
}

.feed-stat-row {
  display: flex;
  align-items: center;
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border-light);
  gap: var(--space-sm);
}

.feed-stat-row:last-child { border-bottom: none; }

.feed-stat-name {
  flex: 1;
  font-size: 13px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-stat-bar {
  width: 100px;
  height: 6px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.feed-stat-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

.feed-stat-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 36px;
  text-align: right;
}

/* Timeline chart */
.timeline-chart {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 100px;
  padding-top: var(--space-sm);
}

.timeline-bar {
  flex: 1;
  min-width: 4px;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
  opacity: 0.7;
  transition: opacity var(--transition-fast), height var(--transition-slow);
  cursor: pointer;
  position: relative;
}

.timeline-bar:hover { opacity: 1; }

/* ===== Mobile Elements ===== */
.mobile-back { display: none; }

.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 4px;
  margin-right: var(--space-sm);
}

/* Sidebar backdrop */
.sidebar-backdrop { display: none; }

/* Bottom nav */
.bottom-nav { display: none; }

/* ===== Mobile Responsive ===== */
@media (max-width: 768px) {
  body::before { opacity: 0.5; }

  .app-main {
    grid-template-columns: 1fr;
    position: relative;
  }

  .sidebar,
  .article-list-panel,
  .reading-panel {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: var(--bg-primary);
  }

  .sidebar { display: none; }
  .article-list-panel { display: flex; z-index: 2; }
  .reading-panel { display: none; z-index: 3; }

  .app-main.show-sidebar .sidebar {
    display: block;
    z-index: 5;
    overflow-y: auto;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    -webkit-overflow-scrolling: touch;
  }

  .sidebar-item {
    padding: 12px var(--space-md);
    min-height: 44px;
  }

  .sidebar-section-title {
    padding: 14px var(--space-md) 8px;
    min-height: 44px;
  }

  .sidebar-add-btn {
    padding: 14px var(--space-md);
    min-height: 44px;
  }

  .app-main.show-reading .reading-panel { display: flex; z-index: 5; }

  .mobile-back {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: none;
    border-bottom: 1px solid var(--border);
    color: var(--accent);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    width: 100%;
    flex-shrink: 0;
  }

  .mobile-back:hover { background: var(--bg-hover); }

  .logo { font-size: 15px !important; }

  .app-header {
    height: calc(46px + env(safe-area-inset-top, 0px));
    padding: env(safe-area-inset-top, 0px) 10px 0;
  }

  .list-header { padding: var(--space-sm) 10px; }

  .search-input {
    padding: 8px 28px 8px 12px;
    font-size: 13px;
  }

  .article-card { padding: 12px 14px; }

  .article-title {
    -webkit-line-clamp: 3;
    font-size: 14px;
  }

  .card-thumb { width: 64px; height: 48px; }

  .reading-panel {
    padding: 0 !important;
    flex-direction: column;
  }

  .reading-content { padding: 20px var(--space-md); }
  .reading-title { font-size: 20px !important; }

  .reading-actions {
    flex-wrap: wrap;
    gap: 6px;
  }

  .action-btn {
    padding: 10px var(--space-md);
    font-size: 13px;
    border-radius: var(--radius-md);
  }

  .action-btn svg { width: 16px; height: 16px; }
  .mobile-menu-btn { display: flex; }
  .quick-bookmark { opacity: 1; font-size: 18px; }

  .reading-panel { transition: transform 0.3s ease; }
  .scroll-top-btn { bottom: 20px; right: 12px; }

  /* Bottom Navigation */
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(58px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border-top: 1px solid var(--glass-border);
    z-index: 10;
    justify-content: space-around;
    align-items: center;
    transition: background-color var(--transition-normal), border-color var(--transition-normal);
  }

  .bottom-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 10px;
    cursor: pointer;
    padding: 6px 14px;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
    font-family: inherit;
  }

  .bottom-nav-btn:active { transform: scale(0.92); }
  .bottom-nav-btn.active { color: var(--accent); }
  .bottom-nav-btn svg { width: 22px; height: 22px; }

  .app-main {
    flex: none;
    height: calc(100vh - calc(46px + env(safe-area-inset-top, 0px)) - calc(58px + env(safe-area-inset-bottom, 0px)));
  }

  .sidebar-backdrop {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 4;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }

  .app-main.show-sidebar .sidebar-backdrop { display: block; }

  .toast-container { bottom: calc(66px + env(safe-area-inset-bottom, 0px)) !important; }
  .scroll-top-btn { bottom: calc(74px + env(safe-area-inset-bottom, 0px)) !important; }

  .header-right #btn-refresh,
  .header-right #btn-bookmark-filter,
  .header-right #btn-theme,
  .header-right #btn-settings { display: none; }

  .mobile-menu-btn { display: none !important; }

  .article-nav {
    flex-direction: column;
    gap: var(--space-sm);
  }

  /* Analytics responsive */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
  }

  .stat-card { padding: var(--space-md); }
  .stat-value { font-size: 24px; }
  .analytics-panel { padding: var(--space-md); }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
  .app-main { grid-template-columns: 200px 290px 1fr; }
}
