/* ========================================
   羊汤动能 · 复盘日记 - 组件样式
   ======================================== */

/* ---- App Quick Access Grid (Dock Style - Horizontal Scroll) ---- */
.app-grid {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 10px 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.app-grid::-webkit-scrollbar {
  height: 6px;
}
.app-grid::-webkit-scrollbar-track {
  background: transparent;
}
.app-grid::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}
.app-icon {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  transition: transform 0.2s ease;
  user-select: none;
  flex-shrink: 0;
  min-width: 90px;
}
.app-icon:hover {
  transform: scale(1.15) translateY(-8px);
}
.app-icon:active {
  transform: scale(0.95);
}
.app-icon-img {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: linear-gradient(135deg, #2a3448 0%, #1a2233 100%);
  box-shadow: 0 4px 12px rgba(0,0,0,0.25), inset 0 1px 0 rgba(255,255,255,0.06);
  transition: all 0.2s ease;
}
.app-icon:hover .app-icon-img {
  box-shadow: 0 8px 24px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.1);
}
.app-icon-label {
  margin-top: 8px;
  font-size: 0.7rem;
  color: var(--text);
  text-align: center;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.9;
}

/* ---- Top Navigation Bar ---- */
.topnav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 0; margin-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  opacity: 0; flex-wrap: wrap; min-width: 0;
}
.topnav-right {
  display: flex; align-items: center; gap: 6px;
  flex: 0 1 auto; min-width: 0;
}
.topnav-brand {
  display: flex; align-items: center; gap: 12px;
  font-size: 1rem; font-weight: 700; color: var(--text);
  text-decoration: none; letter-spacing: -0.3px;
  transition: opacity 0.2s; flex: 0 1 auto; min-width: 0;
}
.topnav-brand:hover { opacity: 0.8; }
.topnav-brand-icon {
  font-size: 1.6rem; width: 40px; height: 40px; display: inline-flex;
  align-items: center; justify-content: center; flex: 0 0 auto;
}
.topnav-brand-title {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: 1.1rem; line-height: 1.1; font-weight: 800; letter-spacing: -0.5px;
}
.topnav-guest { display: flex; align-items: center; gap: 8px; }
.topnav-btn {
  padding: 6px 16px; border-radius: 6px; font-size: 0.8rem; font-weight: 600;
  text-decoration: none; transition: all 0.2s;
  color: var(--muted); border: 1px solid var(--border);
}
.topnav-btn:hover { color: var(--text); border-color: var(--muted); }
.topnav-btn--accent {
  color: #fff; background: var(--accent); border-color: var(--accent);
}
.topnav-btn--accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

/* logged-in user group */
.topnav-user { display: flex; align-items: center; gap: 2px; }
/* avatar */
.topnav-avatar {
  display: flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%; overflow: hidden;
  border: 1px solid var(--border); background: var(--card);
  transition: border-color 0.2s, box-shadow 0.2s; flex-shrink: 0;
}
.topnav-avatar:hover {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79,140,255,0.15);
}
.topnav-avatar img { width: 100%; height: 100%; object-fit: cover; }
.topnav-avatar-fallback {
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); width: 100%; height: 100%;
}
/* user profile container (inherits topnav-link-item base) */
.topnav-user-profile {
  gap: 6px; padding: 4px 8px; border-radius: 8px;
}
.topnav-user-profile:hover .topnav-avatar {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79,140,255,0.15);
}
.topnav-custom-title {
  display: inline-flex; align-items: center; gap: 4px;
}

/* nickname */
.topnav-nickname {
  font-size: 0.76rem; font-weight: 500; color: var(--text);
  max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* role badge & custom title */
.role-badge {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 1px 6px; border-radius: 3px; font-size: 0.6rem;
  font-weight: 600; white-space: nowrap; line-height: 1.4;
  vertical-align: middle;
}
.custom-title {
  display: inline-flex; align-items: center;
  padding: 1px 6px; border-radius: 3px; font-size: 0.6rem;
  font-weight: 500; white-space: nowrap; line-height: 1.4;
  vertical-align: middle;
  background: rgba(240, 196, 74, 0.12); color: #f0c44a;
  border: 1px solid rgba(240, 196, 74, 0.25);
  transition: all 0.2s;
}
@keyframes title-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}
@keyframes title-shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}
@keyframes title-glow {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.3); }
}
.custom-title.title-anim-pulse { animation: title-pulse 2s ease-in-out infinite; }
.custom-title.title-anim-shimmer { background-size: 200% auto; animation: title-shimmer 3s linear infinite; }
.custom-title.title-anim-glow { animation: title-glow 2s ease-in-out infinite; }

/* icon buttons */
.topnav-icon {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 8px;
  color: var(--muted); background: transparent; border: none;
  cursor: pointer; transition: all 0.2s; text-decoration: none;
}
.topnav-icon:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.topnav-icon--danger:hover { color: var(--red); background: rgba(240,74,110,0.08); }

/* notification dot */
.topnav-dot {
  position: absolute; top: 4px; right: 4px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--red); border: 1.5px solid var(--bg);
}

/* ---- Row 2: 导航链接 ---- */
.topnav-links { display: flex; align-items: center; gap: 4px; }
.topnav-links-guest, .topnav-links-user {
  display: flex; align-items: center; gap: 6px;
}
.topnav-link-item {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 4px 10px; border-radius: 6px; font-size: 0.76rem;
  font-weight: 500; color: var(--muted); background: transparent;
  border: 1px solid transparent; cursor: pointer;
  text-decoration: none; transition: all 0.15s; white-space: nowrap;
  position: relative;
}
.topnav-link-item:hover {
  color: var(--text); background: rgba(255,255,255,0.05);
  border-color: var(--border);
}
.topnav-link-item i { font-size: 0.85rem; }
.topnav-link-text { font-size: 0.72rem; }

/* 应用快捷链接（带渐变 icon） */
.topnav-app-link {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 2px; border-radius: 6px; font-size: 0.8rem;
  font-weight: 500; color: var(--muted); background: transparent;
  border: 1px solid transparent; cursor: pointer;
  text-decoration: none; transition: all 0.15s; white-space: nowrap;
}
.topnav-app-link:hover {
  color: var(--text); background: rgba(255,255,255,0.05);
  border-color: var(--border);
}
.topnav-app-icon {
  display: flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 5px; font-size: 0.75rem;
  color: #fff; flex-shrink: 0;
}
.topnav-app-name { font-size: 0.72rem; }

/* ---- Announce Panel ---- */
.announce-panel {
  position: fixed; top: 56px; right: 24px; z-index: 1500;
  width: 320px; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  animation: announceIn 0.2s ease;
}
@keyframes announceIn { from { transform: translateY(-8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.announce-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  font-size: 0.85rem; font-weight: 600;
}
.announce-close {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 0.85rem; padding: 2px 4px; border-radius: 4px;
  transition: color 0.2s;
}
.announce-close:hover { color: var(--text); }
.announce-body { padding: 8px 0; max-height: 260px; overflow-y: auto; }
.announce-item {
  padding: 10px 16px; border-bottom: 1px solid rgba(255,255,255,0.03);
}
.announce-item:last-child { border-bottom: none; }
.announce-item p { font-size: 0.82rem; line-height: 1.5; margin: 0 0 4px; }
.announce-item time { font-size: 0.7rem; color: var(--muted); }
.announce-tag {
  display: inline-block; padding: 1px 6px; border-radius: 4px;
  font-size: 0.6rem; font-weight: 700; letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.announce-tag--new { background: rgba(79,140,255,0.15); color: var(--accent); }
.announce-tag--fix { background: rgba(76,175,136,0.15); color: var(--green); }

/* ---- Quotes Panel ---- */
.quotes-panel {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; margin: -6px 0 20px;
}
.quotes-header {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px;
}
.quotes-header h3 { font-size: 0.9rem; font-weight: 650; }
.quotes-meta { color: var(--muted); font-size: 0.75rem; display: flex; align-items: center; gap: 6px; }
.quotes-status-dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--muted); flex-shrink: 0;
  animation: quotesDotBreathe 4s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
  transition: background-color 0.6s ease, box-shadow 0.6s ease;
}
.quotes-status-dot.refreshing {
  background: #f0a030;
  box-shadow: 0 0 4px 1px rgba(240,160,48,0.4);
}
.quotes-status-dot.updated {
  background: var(--green, #2ecc71);
  box-shadow: 0 0 4px 1px rgba(46,204,113,0.35);
}
@keyframes quotesDotBreathe {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}
.quotes-tabs { display: flex; gap: 4px; margin-bottom: 8px; padding: 0 2px; }
.quotes-tab {
  padding: 4px 10px; border-radius: 6px; font-size: 0.72rem; font-weight: 600;
  cursor: pointer; border: 1px solid var(--border); background: transparent;
  color: var(--muted); transition: all 0.15s;
}
.quotes-tab:hover { background: rgba(79,140,255,0.08); color: var(--text); }
.quotes-tab.active { background: rgba(79,140,255,0.15); color: var(--accent); border-color: rgba(79,140,255,0.4); }
.quotes-tab-fav {
  color: #c9a227; border-color: rgba(240,196,74,0.3);
  background: rgba(240,196,74,0.06);
}
.quotes-tab-fav:hover { background: rgba(240,196,74,0.12); color: #f0c44a; }
.quotes-tab-fav.active {
  background: rgba(240,196,74,0.18); color: #f0c44a; border-color: rgba(240,196,74,0.5);
  box-shadow: 0 0 8px rgba(240,196,74,0.15);
}
.quotes-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; overflow: visible; }
.quote-section-header {
  grid-column: 1 / -1;
  font-size: 0.72rem; font-weight: 600; color: var(--muted);
  letter-spacing: 0.08em; padding: 10px 0 2px;
  border-bottom: 1px solid var(--border); margin-bottom: 2px;
}
.quote-section-header:first-child { padding-top: 0; }
.quote-empty { grid-column: 1 / -1; color: var(--muted); font-size: 0.85rem; padding: 12px 0; }
.quote-card {
  border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px;
  background: rgba(255,255,255,0.018);
  color: var(--text); font: inherit; text-align: left;
  cursor: pointer; transition: border-color 0.18s, background 0.18s; min-width: 0;
  position: relative;
}
.quote-card:hover { border-color: var(--accent); background: rgba(255,255,255,0.035); }
.quote-card.active { border-color: rgba(79,140,255,0.65); background: rgba(79,140,255,0.09); }
.quote-card-del {
  position: absolute; top: 4px; right: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  font-size: 0.75rem; line-height: 1; cursor: pointer;
  border: none; background: rgba(255,255,255,0.1); color: var(--muted);
  opacity: 0; transition: opacity 0.15s, background 0.15s, color 0.15s;
  z-index: 1;
}
.quote-card:hover .quote-card-del,
.quote-card.active .quote-card-del { opacity: 0.7; }
.quote-card-del:hover { opacity: 1 !important; background: var(--red); color: #fff; }
.quote-card-row1 { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; min-width: 0; }
.quote-row-name { font-weight: 700; font-size: 0.82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quote-row-code {
  color: var(--muted); font-size: 0.64rem; letter-spacing: 0.4px; text-transform: uppercase;
  flex: 0 0 auto;
}
.quote-card-row2 { display: flex; align-items: baseline; justify-content: space-between; gap: 4px; min-width: 0; margin-top: 2px; }
.quote-card-changes { display: flex; align-items: baseline; gap: 5px; flex: 0 0 auto; }
.quote-price { font-size: 1.1rem; font-weight: 750; line-height: 1.2; }
.quote-change { font-size: 0.66rem; font-weight: 600; line-height: 1.2; letter-spacing: 0.3px; }
.quote-change-abs { font-size: 0.66rem; font-weight: 600; line-height: 1.2; }
.quote-change-up { color: var(--green); }
.quote-change-down { color: var(--red); }
.quote-error-row { color: var(--red); font-size: 0.78rem; padding: 8px; }
.quotes-pagination { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 8px 0 4px; }
.quotes-page-btn {
  padding: 4px 14px; border-radius: 6px; font-size: 0.72rem; font-weight: 600;
  cursor: pointer; border: 1px solid var(--border); background: transparent;
  color: var(--muted); transition: all 0.15s;
}
.quotes-page-btn:hover:not(:disabled) { background: rgba(79,140,255,0.08); color: var(--accent); border-color: rgba(79,140,255,0.4); }
.quotes-page-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.quotes-page-info { font-size: 0.78rem; color: var(--muted); }

/* Price flash animation */
@keyframes flash-up { 0% { background-color: rgba(34,197,94,0.25); } 100% { background-color: transparent; } }
@keyframes flash-down { 0% { background-color: rgba(239,68,68,0.25); } 100% { background-color: transparent; } }
.flash-up { animation: flash-up 0.6s ease-out; }
.flash-down { animation: flash-down 0.6s ease-out; }

/* ---- Plan Tree (mind map) ---- */
.plan-tree { display: flex; flex-direction: column; gap: 2px; }
.plan-tree-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 640px) { .plan-tree-2col { grid-template-columns: 1fr; } }
.plan-branch { margin-bottom: 4px; }
.plan-branch-card {
  border: 1px solid var(--border); border-radius: 7px; overflow: hidden;
  background: rgba(0,0,0,0.18);
}
.plan-branch-card .plan-branch-label {
  background: rgba(79,140,255,0.06); padding: 5px 10px;
  font-weight: 600; font-size: 0.72rem; color: var(--accent); margin-bottom: 0;
  border-bottom: 1px solid var(--border); display: flex; align-items: center;
  letter-spacing: 0.3px;
}
.plan-branch-card .plan-branch-body { padding: 7px 10px; gap: 3px; }
.plan-add-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 17px; height: 24px; border-radius: 4px;
  font-size: 0.75rem; line-height: 1; cursor: pointer;
  border: 1px solid var(--border); background: transparent; color: var(--accent);
  transition: all 0.15s; margin-left: 6px; padding: 0 8px;
}
.plan-add-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.plan-add-btn:empty {
  width: 17px; height: 17px; border-radius: 50%; padding: 0;
}
.plan-del-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%;
  font-size: 0.65rem; line-height: 1; cursor: pointer;
  border: none; background: transparent; color: var(--muted);
  transition: all 0.15s; margin-left: 4px; opacity: 0;
}
.plan-branch:hover .plan-del-btn { opacity: 0.6; }
.plan-del-btn:hover { opacity: 1 !important; background: var(--red); color: #fff; }
.plan-branch-label { font-weight: 600; font-size: 0.72rem; color: var(--accent); margin-bottom: 3px; }
.plan-branch-body { display: flex; flex-direction: column; gap: 3px; }
.plan-input {
  width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 4px;
  padding: 4px 8px; color: var(--text); font-size: 0.68rem; outline: none;
}
.plan-input::placeholder { font-size: 0.68rem; color: var(--muted); opacity: 0.6; }
.plan-input:focus { border-color: var(--accent); }
.plan-select {
  width: 100%; background: var(--bg); border: 1px solid var(--border); border-radius: 4px;
  padding: 4px 8px; color: var(--text); font-size: 0.68rem; outline: none; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b8fa3' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 6px center; padding-right: 20px;
}
.plan-select:focus { border-color: var(--accent); }
.plan-custom-input {
  display: none; width: 100%; background: var(--bg); border: 1px solid var(--accent); border-radius: 4px;
  padding: 4px 8px; color: var(--text); font-size: 0.68rem; outline: none; margin-top: 3px;
}
.plan-custom-input.visible { display: block; }
.plan-custom-input::placeholder { font-size: 0.68rem; color: var(--muted); opacity: 0.6; }
.plan-custom-input:focus { border-color: var(--accent-hover); }
.plan-sub { display: flex; align-items: center; gap: 6px; margin-left: 6px; }
.plan-sub-label { font-size: 0.68rem; color: var(--muted); white-space: nowrap; }
.plan-num {
  width: 72px; background: var(--bg); border: 1px solid var(--border); border-radius: 4px;
  padding: 3px 6px; color: var(--text); font-size: 0.68rem; outline: none; text-align: right;
}
.plan-num::placeholder { font-size: 0.68rem; color: var(--muted); opacity: 0.6; }
.plan-num:focus { border-color: var(--accent); }

/* ---- Inline Quote Display ---- */
.quote-inline {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  margin: 6px 0 8px 0;
  background: linear-gradient(90deg, rgba(79, 140, 255, 0.08) 0%, rgba(76, 175, 80, 0.05) 50%, transparent 100%);
  border-left: 4px solid var(--accent);
  border-radius: 0 6px 6px 0;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
.quote-inline::before {
  content: '"';
  position: absolute;
  left: 8px;
  top: -2px;
  font-size: 2rem;
  color: var(--accent);
  opacity: 0.15;
  font-family: Georgia, 'Times New Roman', serif;
  line-height: 1;
  pointer-events: none;
}
.quote-inline:hover {
  background: linear-gradient(90deg, rgba(79, 140, 255, 0.15) 0%, rgba(76, 175, 80, 0.1) 50%, transparent 100%);
  border-left-color: var(--accent-hover);
  transform: translateX(2px);
  box-shadow: 0 2px 8px rgba(79, 140, 255, 0.1);
}
.quote-inline-text {
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text);
  font-style: italic;
  flex: 1;
  position: relative;
  z-index: 1;
  letter-spacing: 0.01em;
}
.quote-inline-author {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  position: relative;
  z-index: 1;
  font-weight: 500;
}
.quote-inline-timer {
  font-size: 0.68rem;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  opacity: 0.8;
  background: rgba(79, 140, 255, 0.1);
  padding: 2px 6px;
  border-radius: 3px;
  position: relative;
  z-index: 1;
}

/* ---- 形态笔记 ---- */
.notes-panel { margin-top: 2px; }
.notes-list { display: flex; flex-direction: column; gap: 10px; max-height: 520px; overflow-y: auto; padding-right: 2px; }
.notes-list::-webkit-scrollbar { width: 4px; }
.notes-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.notes-empty { text-align: center; color: var(--muted); font-size: 0.8rem; padding: 32px 0; }

.note-card {
  background: var(--bg); border: 1px solid var(--border); border-radius: 10px;
  padding: 0; transition: all 0.2s; cursor: default; overflow: hidden;
  border-left: 3px solid var(--accent);
}
.note-card:hover { border-color: var(--accent); box-shadow: 0 2px 16px rgba(0,0,0,0.2); }
.note-card-inner { display: flex; gap: 14px; padding: 14px; align-items: flex-start; }

/* 左侧缩略图 */
.note-card-thumb {
  width: 110px; height: auto; min-height: 70px; max-height: 120px; border-radius: 6px; object-fit: cover;
  border: 1px solid var(--border); flex-shrink: 0; background: var(--bg);
}
.note-card-thumb-placeholder {
  width: 110px; min-height: 70px; height: 100%; border-radius: 6px; flex-shrink: 0;
  background: linear-gradient(135deg, rgba(79,140,255,0.06), rgba(79,140,255,0.02));
  border: 1px dashed color-mix(in srgb, var(--accent) 20%, transparent);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; color: var(--accent); opacity: 0.3;
}

/* 右侧内容区 */
.note-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* 顶部行：资产标签 + 日期 + 操作按钮 */
.note-card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.note-card-asset {
  font-size: 0.68rem; font-weight: 700; color: var(--accent); letter-spacing: 0.3px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  padding: 2px 8px; border-radius: 4px; white-space: nowrap;
}
.note-card-date { font-size: 0.68rem; color: var(--muted); margin-left: auto; white-space: nowrap; }
.note-card-actions {
  display: flex; gap: 2px; opacity: 0; transition: opacity 0.15s;
}
.note-card:hover .note-card-actions { opacity: 1; }
.note-card-actions .note-act-btn {
  width: 26px; height: 26px; border: none; border-radius: 6px;
  background: transparent; color: var(--muted); font-size: 0.82rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.15s; padding: 0;
}
.note-card-actions .note-act-btn:hover { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); }
.note-card-actions .note-act-btn.del:hover { background: color-mix(in srgb, var(--red) 15%, transparent); color: var(--red); }

/* 标题 */
.note-card-title {
  font-size: 0.88rem; font-weight: 600; color: var(--text); margin-bottom: 6px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  display: flex; align-items: center; gap: 8px;
}
.note-card-title-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-card-badge { font-size: 0.6rem; padding: 2px 6px; border-radius: 4px; white-space: nowrap; flex-shrink: 0; border: none; cursor: pointer; transition: opacity .15s; }
.note-card-badge:hover { opacity: .7; }
.note-card-badge.public { color: var(--green); background: color-mix(in srgb, var(--green) 12%, transparent); }
.note-card-badge.private { color: var(--muted); background: color-mix(in srgb, var(--muted) 12%, transparent); }

/* 标签 */
.note-card-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.note-tag {
  font-size: 0.62rem; padding: 1px 6px; border-radius: 3px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
}

/* 内容预览 */
.note-card-content {
  font-size: 0.76rem; color: var(--muted); line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-bottom: 6px; cursor: pointer; transition: color .15s;
}
.note-card-content:hover { color: var(--text); }

/* Note modal (new large card design) */
.note-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.note-modal-overlay.active { opacity: 1; pointer-events: auto; }

.note-card-large {
  background: var(--card); border: 2px solid var(--border); border-radius: 20px;
  width: 700px; max-width: 92vw; max-height: 85vh; overflow-y: auto;
  padding: 32px; box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

/* Header */
.note-header-text { text-align: center; margin-bottom: 32px; }
.note-header-text h1 { font-size: 1.4rem; font-weight: 600; color: var(--text); }

/* Content Area */
.note-content-box {
  background: var(--bg); border: 1px solid var(--border); border-radius: 12px;
  padding: 24px; margin-bottom: 24px; min-height: 200px;
}
.note-content-textarea {
  width: 100%; min-height: 160px; background: transparent; border: none;
  color: var(--text); font-size: 1rem; resize: vertical; outline: none;
  font-family: inherit; line-height: 1.7;
}
.note-content-textarea::placeholder { color: var(--muted); }

/* Images Preview Area */
.images-preview-area {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px;
}
.note-img-item {
  position: relative; width: 100px; height: 70px; border-radius: 8px;
  overflow: hidden; border: 1px solid var(--border); flex-shrink: 0;
}
.note-img-item img { width: 100%; height: 100%; object-fit: cover; cursor: pointer; }
.note-img-remove {
  position: absolute; top: 4px; right: 4px;
  width: 20px; height: 20px; border-radius: 50%; border: none;
  background: rgba(0,0,0,0.7); color: #fff; font-size: 0.65rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.15s;
}
.note-img-item:hover .note-img-remove { opacity: 1; }

/* Action Bar */
.note-action-bar {
  display: flex; align-items: center; gap: 12px; margin-bottom: 24px;
}
.btn-upload-note {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 18px; background: var(--bg); border: 1px dashed var(--border);
  border-radius: 8px; color: var(--muted); font-size: 0.85rem;
  cursor: pointer; transition: all 0.2s;
}
.btn-upload-note:hover { border-color: var(--accent); color: var(--accent); }
.btn-upload-note i { font-size: 1.1rem; }

.note-asset-select-bar {
  padding: 10px 16px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: 0.85rem;
  cursor: pointer; outline: none; transition: border-color 0.2s;
}
.note-asset-select-bar:focus { border-color: var(--accent); }

.btn-publish-note {
  margin-left: auto; padding: 10px 28px; background: var(--accent);
  border: none; border-radius: 8px; color: #fff; font-size: 0.9rem;
  font-weight: 600; cursor: pointer; transition: opacity 0.2s;
}
.btn-publish-note:hover { opacity: 0.85; }

/* Tags Bar */
.note-tags-bar {
  background: rgba(42, 45, 58, 0.5); border-radius: 8px;
  padding: 12px 16px; margin-bottom: 24px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.note-tag-item {
  font-size: 0.78rem; padding: 6px 14px; border-radius: 6px;
  cursor: pointer; background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  transition: all 0.15s; user-select: none;
}
.note-tag-item.selected { background: var(--accent); color: #fff; border-color: var(--accent); }
.note-tag-item:hover { opacity: 0.85; }
.note-add-tag-btn {
  font-size: 0.78rem; padding: 6px 14px; border-radius: 6px;
  cursor: pointer; background: transparent; color: var(--muted);
  border: 1px dashed var(--border); white-space: nowrap;
  display: inline-flex; align-items: center; gap: 4px; transition: all 0.2s;
}
.note-add-tag-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Footer Bar */
.note-footer-bar {
  display: flex; align-items: center; justify-content: space-between;
}
.note-public-check-bar {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.88rem; color: var(--text); cursor: pointer;
}
.note-public-check-bar input[type="checkbox"] { accent-color: var(--accent); width: 18px; height: 18px; }
.btn-cancel-note {
  padding: 8px 20px; background: transparent; border: 1px solid var(--border);
  border-radius: 8px; color: var(--muted); font-size: 0.85rem;
  cursor: pointer; transition: all 0.2s;
}
.btn-cancel-note:hover { border-color: var(--accent); color: var(--accent); }

/* ---- Note View Modal ---- */
.note-view-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.65); z-index: 2100;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.note-view-overlay.active { opacity: 1; pointer-events: auto; }
.note-view-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  width: 600px; max-width: 92vw; max-height: 80vh; overflow-y: auto;
  padding: 24px; box-shadow: 0 8px 32px rgba(0,0,0,0.35);
}
.note-view-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
}
.note-view-header .note-card-badge { font-size: 0.65rem; padding: 3px 8px; }
.note-view-asset {
  font-size: 0.72rem; font-weight: 700; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  padding: 2px 8px; border-radius: 4px;
}
.note-view-date { font-size: 0.72rem; color: var(--muted); }
.note-view-actions { margin-left: auto; display: flex; gap: 6px; }
.note-view-actions button {
  padding: 6px 14px; border-radius: 6px; font-size: 0.75rem; font-weight: 600;
  cursor: pointer; border: 1px solid var(--border); background: transparent;
  color: var(--text); transition: all 0.15s; display: flex; align-items: center; gap: 4px;
}
.note-view-actions button:hover { border-color: var(--accent); color: var(--accent); }
.note-view-actions .note-view-share-btn.public { color: var(--green); border-color: color-mix(in srgb, var(--green) 30%, transparent); }
.note-view-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 14px; }
.note-view-body {
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
  padding: 16px; font-size: 0.88rem; color: var(--text); line-height: 1.75;
  white-space: pre-wrap; word-break: break-word; margin-bottom: 14px;
}
.note-view-images { display: flex; flex-wrap: wrap; gap: 8px; }
.note-view-images img {
  width: 120px; height: 85px; object-fit: cover; border-radius: 6px;
  border: 1px solid var(--border); cursor: pointer; transition: opacity .15s;
}
.note-view-images img:hover { opacity: .8; }
.note-view-close {
  position: absolute; top: 16px; right: 16px; width: 32px; height: 32px;
  border: none; border-radius: 50%; background: rgba(0,0,0,0.5);
  color: #fff; font-size: 1rem; cursor: pointer; display: flex;
  align-items: center; justify-content: center; transition: background .15s;
}
.note-view-close:hover { background: rgba(0,0,0,0.7); }

/* ---- Auto-save status ---- */
.autosave-status {
  position: fixed; bottom: 0; left: 0; right: 0;
  text-align: center; font-size: 0.72rem; padding: 4px 0;
  pointer-events: none; z-index: 999;
  transition: opacity 0.3s;
  opacity: 0;
}
.autosave-status:empty { opacity: 0; }
.autosave-status:not(:empty) { opacity: 1; }
.autosave-pending { color: var(--muted); }
.autosave-saving { color: var(--accent); }
.autosave-done { color: var(--green); }
.autosave-error { color: var(--red); }

/* ---- All Reviews Button ---- */
.all-reviews-btn {
  background: transparent; border: 1px solid var(--border); border-radius: 6px;
  padding: 3px 8px; color: var(--muted); cursor: pointer; font-size: 0.88rem;
  transition: all 0.2s; display: flex; align-items: center; margin-left: 4px;
}
.all-reviews-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ---- All Reviews Modal ---- */
.ar-modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.65); display: flex; align-items: center; justify-content: center;
  z-index: 10000;
}
.ar-modal {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  width: 92%; max-width: 500px; max-height: 80vh;
  display: flex; flex-direction: column;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
}
.ar-modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 20px 14px; border-bottom: 1px solid var(--border);
}
.ar-modal-title { font-size: 1rem; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.ar-modal-title i { color: var(--accent); }
.ar-modal-close { background: none; border: none; color: var(--muted); font-size: 1.2rem; cursor: pointer; padding: 4px; }
.ar-modal-close:hover { color: var(--text); }

.ar-modal-filter { padding: 12px 20px 8px; display: flex; gap: 8px; }
.ar-filter-input {
  flex: 1; background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 12px; font-size: 0.8rem; color: var(--text); outline: none;
}
.ar-filter-input:focus { border-color: var(--accent); }
.ar-filter-input::placeholder { color: var(--muted); }
.ar-filter-select {
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 28px 8px 10px; font-size: 0.78rem; color: var(--text);
  outline: none; cursor: pointer; appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b8fa3' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center;
}
.ar-filter-select:focus { border-color: var(--accent); }

.ar-modal-body { flex: 1; overflow-y: auto; padding: 8px 20px; }
.ar-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; margin-bottom: 6px;
  background: rgba(255,255,255,0.02); border: 1px solid var(--border);
  border-radius: 10px; transition: border-color 0.15s;
}
.ar-item:hover { border-color: var(--accent); }
.ar-item-asset {
  font-size: 0.85rem; font-weight: 600; color: var(--text);
}
.ar-item-time { font-weight: 400; font-size: 0.72rem; color: var(--muted); }
.ar-item-actions { display: flex; align-items: center; gap: 8px; }
.ar-action-btn {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 6px;
  border: 1px solid var(--border); background: transparent;
  color: var(--muted); cursor: pointer; transition: all 0.2s;
  font-size: 0.85rem;
}
.ar-action-btn:hover { color: var(--text); border-color: var(--muted); }
.ar-del-btn:hover { color: var(--red); border-color: var(--red); }

.ar-empty { text-align: center; padding: 32px 0; color: var(--muted); font-size: 0.85rem; }

.ar-modal-footer {
  padding: 12px 20px 16px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.ar-page-info { font-size: 0.75rem; color: var(--muted); }
.ar-page-btns { display: flex; gap: 4px; }
.ar-page-btn {
  width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border);
  background: transparent; color: var(--muted); font-size: 0.78rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.ar-page-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.ar-page-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.ar-page-btn:disabled { opacity: 0.3; cursor: not-allowed; }
