    :root {
      --bg-app: #f0f4f8;
      --bg-sidebar: #ffffff;
      --bg-main: #fafbfc;
      --bg-card: #ffffff;
      --bg-hover: #f5f8fc;
      --bg-active: #e8f0fe;
      --bg-focus: #f0f7ff;
      --border: #e5e7eb;
      --border-light: #f3f4f6;
      --border-focus: #c7d7fe;
      --text-primary: #111827;
      --text-secondary: #4b5563;
      --text-muted: #9ca3af;
      --text-subtle: #d1d5db;
      --accent: #4f6bed;
      --accent-hover: #3d5bdb;
      --accent-light: #e8f0fe;
      --accent-soft: #dbeafe;
      --accent-glow: rgba(79, 107, 237, 0.15);
      --accent-glow-lg: rgba(79, 107, 237, 0.35);
      --accent-glow-xl: rgba(79, 107, 237, 0.45);
      --accent-gradient: linear-gradient(135deg, var(--accent-hover) 0%, var(--accent) 100%);
      --success: #10b981;
      --warning: #f59e0b;
      --danger: #ef4444;
      --danger-hover: #dc2626;
      --danger-dark: #b91c1c;
      --danger-glow: rgba(239, 68, 68, 0.3);
      --danger-glow-lg: rgba(239, 68, 68, 0.4);
      --danger-gradient: linear-gradient(135deg, var(--danger) 0%, var(--danger-hover) 100%);
      --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.06);
      --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08), 0 2px 6px rgba(15, 23, 42, 0.05);
      --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.1), 0 4px 14px rgba(15, 23, 42, 0.07);
      --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
      --shadow-hover: 0 8px 24px rgba(15, 23, 42, 0.1), 0 2px 8px rgba(15, 23, 42, 0.06);
      --radius-sm: 6px;
      --radius-md: 10px;
      --radius-lg: 16px;
      --radius-xl: 20px;
      --radius-full: 9999px;
      --gradient-sidebar: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
      --gradient-accent: linear-gradient(135deg, #4f6bed 0%, #6b85f5 50%, #8196fa 100%);
      --gradient-header: linear-gradient(135deg, rgba(79, 107, 237, 0.08) 0%, rgba(107, 133, 245, 0.04) 100%);
      --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
      --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
      --transition-slow: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

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

    *:focus-visible {
      outline: 2px solid var(--accent);
      outline-offset: 2px;
      border-radius: var(--radius-sm);
    }

    html {
      -webkit-text-size-adjust: 100%;
      text-size-adjust: 100%;
      color-scheme: light;
      scrollbar-width: thin;
      scrollbar-color: #d8dadf transparent;
    }

    *::-webkit-scrollbar {
      width: 6px;
      height: 6px;
    }

    *::-webkit-scrollbar-track {
      background: transparent;
    }

    *::-webkit-scrollbar-thumb {
      background: #d8dadf;
      border-radius: 3px;
      transition: background var(--transition);
    }

    *::-webkit-scrollbar-thumb:hover {
      background: #bdc1c6;
    }

    *::-webkit-scrollbar-thumb:active {
      background: #9ca3af;
    }

    body {
      font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', Roboto, 'Helvetica Neue', Arial, sans-serif;
      background: var(--bg-app);
      background-image:
        radial-gradient(ellipse at 20% 0%, rgba(79, 107, 237, 0.06) 0px, transparent 55%),
        radial-gradient(ellipse at 80% 100%, rgba(107, 133, 245, 0.04) 0px, transparent 55%),
        radial-gradient(ellipse at 100% 20%, rgba(129, 150, 250, 0.03) 0px, transparent 50%);
      background-attachment: fixed;
      height: 100vh;
      overflow: hidden;
      display: flex;
      color: var(--text-primary);
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
      text-rendering: optimizeLegibility;
      letter-spacing: 0.01em;
    }

    input,
    button,
    textarea,
    select {
      font: inherit;
      color: inherit;
    }

    a {
      color: inherit;
      text-decoration: none;
    }

    ::selection {
      background: var(--accent-light);
      color: var(--accent-hover);
    }

    @media (prefers-reduced-motion: reduce) {
      *,
      *::before,
      *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
      }
    }

    .sidebar {
      width: 264px;
      flex-shrink: 0;
      background: var(--bg-card);
      border-right: 1px solid var(--border-light);
      display: flex;
      flex-direction: column;
      box-shadow: 
        6px 0 24px rgba(15, 23, 42, 0.05),
        1px 0 0 rgba(255, 255, 255, 0.5) inset;
      z-index: 2;
      position: relative;
      overflow: hidden;
    }

    .sidebar::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      height: 140px;
      background: transparent;
      pointer-events: none;
    }

    .sidebar::after {
      content: '';
      position: absolute;
      bottom: 0;
      left: 0;
      right: 0;
      height: 60px;
      background: transparent;
      pointer-events: none;
    }

    .sidebar-header {
      height: 52px;
      padding: 0 24px;
      display: flex;
      align-items: center;
      gap: 8px;
      border-bottom: 1px solid var(--border-light);
      background: transparent;
      position: relative;
      z-index: 1;
    }

    .sidebar-header h1 {
      font-size: 22px;
      font-weight: 800;
      color: var(--text-primary);
      letter-spacing: 0.5px;
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .sidebar-header h1 .header-icon {
      width: 30px;
      height: 30px;
      color: var(--accent);
      margin-right: -2px;
      filter: drop-shadow(0 2px 4px rgba(79, 107, 237, 0.2));
    }

    .sidebar-header .back-btn {
      padding: 6px;
      width: 32px;
      height: 32px;
      flex-shrink: 0;
    }

    .calendar-section {
      padding: 16px 14px 14px;
      border-bottom: 1px solid var(--border-light);
      position: relative;
      z-index: 1;
      background: linear-gradient(180deg, #eef4ff 0%, #dbe8ff 100%);
      margin: 12px 14px 0;
      border-radius: var(--radius-lg);
      box-shadow: 0 4px 12px rgba(79, 107, 237, 0.12), 0 2px 4px rgba(15, 23, 42, 0.06), inset 0 0 0 1px rgba(255, 255, 255, 0.5);
    }

    .calendar-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 14px;
      gap: 4px;
    }

    .calendar-header .cal-nav-group {
      display: flex;
      align-items: center;
      gap: 4px;
    }

    .calendar-header .cal-title-group {
      flex: 1;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 2px;
      min-width: 0;
    }

    .calendar-header .cal-month-label {
      font-size: 17px;
      color: var(--text-primary);
      font-weight: 700;
      letter-spacing: 0.5px;
      line-height: 1.2;
    }

    .calendar-header .cal-year-label {
      font-size: 11px;
      color: var(--text-muted);
      font-weight: 600;
      letter-spacing: 0.5px;
      text-transform: uppercase;
    }

    .cal-nav-btn {
      background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
      border: 1px solid var(--border-light);
      color: var(--text-secondary);
      cursor: pointer;
      width: 30px;
      height: 30px;
      border-radius: var(--radius-full);
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all var(--transition-fast);
      flex-shrink: 0;
      box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
      padding: 0;
    }

    .cal-nav-btn svg {
      width: 14px;
      height: 14px;
      stroke-width: 2.2px;
      transition: transform var(--transition-fast);
    }

    .cal-nav-btn:hover {
      background: linear-gradient(180deg, var(--accent-light) 0%, var(--accent-soft) 100%);
      color: var(--accent);
      border-color: var(--accent-soft);
      transform: translateY(-1px);
      box-shadow: 0 4px 10px var(--accent-glow);
    }

    .cal-nav-btn:hover svg {
      transform: translateX(-1px);
    }

    .cal-nav-group:last-child .cal-nav-btn:hover svg {
      transform: translateX(1px);
    }

    .cal-nav-btn:active {
      transform: translateY(0) scale(0.94);
      box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    }

    .cal-today-btn {
      background: var(--gradient-accent);
      border: none;
      color: white;
      font-size: 12px;
      font-weight: 600;
      cursor: pointer;
      padding: 6px 14px;
      border-radius: var(--radius-full);
      transition: all var(--transition-fast);
      flex-shrink: 0;
      line-height: 1;
      box-shadow: 0 2px 8px var(--accent-glow-lg);
    }

    .cal-today-btn:hover {
      background: var(--accent-gradient);
      box-shadow: 0 4px 12px var(--accent-glow-xl);
      transform: translateY(-1px);
    }

    .calendar-grid {
      display: grid;
      grid-template-columns: repeat(7, 1fr);
      gap: 6px 1px;
      padding: 0;
    }

    .calendar-weekday {
      font-size: 10px;
      text-align: center;
      padding: 8px 0 6px;
      color: var(--text-muted);
      font-weight: 700;
      letter-spacing: 0.6px;
      user-select: none;
      text-transform: uppercase;
      opacity: 0.85;
    }

    .calendar-weekday.weekend {
      color: var(--text-muted);
      opacity: 0.6;
    }

    .calendar-day {
      font-size: 12px;
      text-align: center;
      width: 100%;
      aspect-ratio: 1 / 1;
      border-radius: var(--radius-full);
      cursor: pointer;
      color: var(--text-secondary);
      transition: all var(--transition-fast);
      font-weight: 500;
      position: relative;
      user-select: none;
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .calendar-day:hover:not(.selected):not(.other-month) {
      background: var(--accent-light);
      color: var(--accent);
      transform: translateY(-1px);
    }

    .calendar-day:active:not(.selected):not(.other-month) {
      transform: scale(0.94);
    }

    .calendar-day.other-month {
      color: var(--text-subtle);
      cursor: default;
      pointer-events: none;
      opacity: 0.4;
    }

    .calendar-day.weekend {
      color: var(--text-muted);
    }

    .calendar-day.today {
      color: var(--accent);
      font-weight: 700;
    }

    .calendar-day.selected {
      background: var(--gradient-accent);
      color: white;
      font-weight: 700;
      box-shadow: 0 4px 14px var(--accent-glow-lg);
      transform: translateY(-1px);
    }

    .calendar-day.selected:hover {
      transform: translateY(-2px);
      box-shadow: 0 6px 18px var(--accent-glow-xl);
    }

    .calendar-day.selected.today {
      box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.4), 0 4px 14px var(--accent-glow-xl);
    }

    .sidebar-btn {
      padding: 10px 20px;
      background: none;
      border: none;
      text-align: left;
      font-size: 14px;
      color: var(--text-secondary);
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 10px;
      transition: all var(--transition);
      border-radius: 0;
      position: relative;
      font-weight: 500;
    }

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

    .sidebar-btn.active {
      background-color: var(--accent-light);
      color: var(--accent);
      font-weight: 600;
      box-shadow: inset 0 0 0 1px var(--accent-soft);
    }

    .sidebar-btn.active::before {
      content: '';
      position: absolute;
      left: 0;
      top: 50%;
      transform: translateY(-50%);
      width: 3px;
      height: 20px;
      background: var(--gradient-accent);
      border-radius: 0 3px 3px 0;
      box-shadow: 0 0 8px var(--accent-glow-lg);
    }

    .sidebar-btn .icon {
      font-size: 16px;
      width: 20px;
      text-align: center;
    }

    .section-title {
      padding: 10px 14px;
      font-size: 15px;
      color: var(--text-secondary);
      text-transform: uppercase;
      letter-spacing: 1.5px;
      font-weight: 700;
      position: relative;
      z-index: 1;
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin: 12px 0 8px;
      background: linear-gradient(180deg, rgba(79, 107, 237, 0.06) 0%, rgba(79, 107, 237, 0.03) 100%);
      border-radius: var(--radius-md);
      box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05), inset 0 0 0 1px rgba(79, 107, 237, 0.1);
    }

    .section-title .title-content {
      display: flex;
      align-items: center;
      gap: 12px;
    }

    .section-title .section-icon {
      width: 18px;
      height: 18px;
      color: var(--accent);
      flex-shrink: 0;
      filter: drop-shadow(0 2px 4px rgba(79, 107, 237, 0.25));
    }

    .tags-section {
      flex: 1;
      padding: 0 14px 14px;
      overflow-y: auto;
      position: relative;
      z-index: 1;
      scrollbar-width: thin;
      scrollbar-color: var(--border) transparent;
    }

    .sidebar-user {
      display: flex;
      align-items: center;
      gap: 12px;
      padding: 12px 18px;
      border-top: 1px solid var(--border-light);
      background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
      position: relative;
      z-index: 2;
      flex-shrink: 0;
    }

    .sidebar-user .user-avatar {
      width: 36px;
      height: 36px;
      border-radius: var(--radius-full);
      background: var(--gradient-accent);
      display: flex;
      align-items: center;
      justify-content: center;
      color: #fff;
      font-size: 15px;
      font-weight: 700;
      flex-shrink: 0;
      box-shadow: 0 2px 8px rgba(79, 107, 237, 0.25);
      overflow: hidden;
    }

    .sidebar-user .user-avatar svg {
      width: 100%;
      height: 100%;
      display: block;
    }

    .sidebar-user .user-info {
      display: flex;
      flex-direction: column;
      gap: 1px;
      overflow: hidden;
      flex: 1;
    }

    .sidebar-user .user-name {
      font-size: 13px;
      font-weight: 600;
      color: var(--text-primary);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .sidebar-user .user-status {
      font-size: 11px;
      color: var(--text-muted);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      display: flex;
      align-items: center;
      gap: 4px;
    }

    .sidebar-user .user-status::before {
      content: '';
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: var(--success);
      box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
      flex-shrink: 0;
    }

    .sidebar-user .user-logout {
      width: 32px;
      height: 32px;
      flex-shrink: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      background: var(--bg-hover);
      color: var(--text-secondary);
      cursor: pointer;
      transition: all var(--transition);
    }

    .sidebar-user .user-logout:hover {
      background: var(--danger);
      border-color: var(--danger);
      color: #fff;
      box-shadow: 0 4px 12px var(--danger-glow);
      transform: translateY(-1px);
    }

    .sidebar-user .user-logout svg {
      width: 16px;
      height: 16px;
    }



    .tags-section::-webkit-scrollbar {
      width: 4px;
    }

    .tags-section::-webkit-scrollbar-track {
      background: transparent;
    }

    .tags-section::-webkit-scrollbar-thumb {
      background: var(--border);
      border-radius: 2px;
    }

    .tags-section::-webkit-scrollbar-thumb:hover {
      background: var(--text-muted);
    }

    .tag-item {
      padding: 10px 16px;
      margin: 3px 0;
      font-size: 14px;
      color: var(--text-secondary);
      cursor: pointer;
      display: flex;
      align-items: center;
      gap: 12px;
      transition: all var(--transition);
      font-weight: 500;
      position: relative;
      border-radius: var(--radius-sm);
      border-left: 3px solid transparent;
    }

    .tag-item:hover {
      background-color: var(--bg-hover);
      color: var(--text-primary);
      border-left-color: var(--accent-soft);
      transform: translateX(2px);
    }

    .tag-item.active {
      background: linear-gradient(90deg, var(--accent-light) 0%, rgba(79, 107, 237, 0.05) 100%);
      color: var(--accent);
      font-weight: 600;
      border-left-color: var(--accent);
      box-shadow: inset 0 0 0 1px var(--accent-soft);
    }

    .tag-color {
      width: 9px;
      height: 9px;
      border-radius: 50%;
      box-shadow: 
        0 0 0 2px rgba(255, 255, 255, 0.9),
        0 1px 3px rgba(0, 0, 0, 0.12);
      flex-shrink: 0;
      transition: transform var(--transition);
    }

    .tag-item:hover .tag-color,
    .tag-item.active .tag-color {
      transform: scale(1.25);
    }

    .main-content {
      flex: 1;
      display: flex;
      flex-direction: column;
      background-color: var(--bg-main);
      min-width: 0;
      position: relative;
    }

    .toolbar {
      height: 52px;
      padding: 0 28px 0 20px;
      background: rgba(255, 255, 255, 0.92);
      backdrop-filter: saturate(180%) blur(20px);
      -webkit-backdrop-filter: saturate(180%) blur(20px);
      border-bottom: 1px solid var(--border-light);
      display: flex;
      align-items: center;
      position: sticky;
      top: 0;
      z-index: 10;
      box-shadow: 0 1px 4px rgba(15, 23, 42, 0.03);
    }

    .toolbar-btn {
      background: transparent;
      border: none;
      font-size: 16px;
      color: var(--text-secondary);
      cursor: pointer;
      padding: 8px;
      border-radius: var(--radius-md);
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all var(--transition);
      position: relative;
    }

    .toolbar-btn::before {
      content: '';
      position: absolute;
      inset: 0;
      border-radius: var(--radius-md);
      background: var(--accent-glow);
      opacity: 0;
      transition: opacity var(--transition);
    }

    .toolbar-btn:hover {
      background-color: var(--bg-hover);
      color: var(--text-primary);
      transform: translateY(-1px);
    }

    .toolbar-btn:hover::before {
      opacity: 1;
    }

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

    .toolbar-btn.primary {
      background: var(--gradient-accent);
      color: white;
      box-shadow: 
        0 4px 12px var(--accent-glow-lg),
        0 1px 3px var(--accent-glow);
      padding: 6px;
      height: 30px;
      width: 30px;
      box-sizing: border-box;
    }

    .toolbar-btn.primary:hover {
      background: var(--accent-gradient);
      box-shadow: 
        0 6px 20px var(--accent-glow-xl),
        0 2px 6px var(--accent-glow);
      color: white;
      transform: translateY(-2px);
    }

    .toolbar-btn.danger {
      color: var(--danger);
    }

    .toolbar-divider {
      width: 1px;
      height: 16px;
      background: var(--border);
      border-radius: 1px;
    }

    .toolbar-center,
    .editor-toolbar {
      display: flex;
      align-items: center;
      gap: 4px;
    }

    .editor-toolbar .toolbar-btn,
    .toolbar-right .toolbar-btn {
      padding: 6px;
      height: 30px;
      box-sizing: border-box;
      border-radius: var(--radius-sm);
      background: var(--bg-hover);
      border: 1px solid var(--border-light);
      color: var(--text-secondary);
      transition: all var(--transition-fast);
    }

    .editor-toolbar .toolbar-btn:hover,
    .toolbar-right .toolbar-btn:hover {
      background-color: var(--accent-light);
      border-color: var(--accent-soft);
      color: var(--accent);
      transform: translateY(-1px);
      box-shadow: 0 2px 6px var(--accent-glow);
    }

    .editor-toolbar .toolbar-btn:active,
    .toolbar-right .toolbar-btn:active {
      transform: translateY(0) scale(0.96);
      background-color: var(--accent-soft);
    }

    .editor-toolbar .toolbar-btn:focus-visible,
    .toolbar-right .toolbar-btn:focus-visible {
      outline: 2px solid var(--accent);
      outline-offset: 1px;
    }

    .editor-toolbar .toolbar-btn::before,
    .toolbar-right .toolbar-btn::before {
      display: none;
    }

    .editor-toolbar .toolbar-btn.active,
    .editor-toolbar .toolbar-btn[aria-pressed="true"] {
      background-color: var(--accent);
      border-color: var(--accent);
      color: white;
      box-shadow: 0 2px 8px var(--accent-glow);
    }

    .toolbar-right .toolbar-btn.danger {
      background: rgba(239, 68, 68, 0.1);
      border-color: rgba(239, 68, 68, 0.3);
      color: var(--danger);
    }

    .toolbar-right .toolbar-btn.danger:hover {
      background: rgba(239, 68, 68, 0.16);
      border-color: rgba(239, 68, 68, 0.5);
      color: var(--danger-hover);
      box-shadow: 0 2px 8px rgba(239, 68, 68, 0.2);
      transform: translateY(-1px);
    }

    .toolbar-right .toolbar-btn.danger:active,
    .toolbar-right .toolbar-btn.danger.active,
    .toolbar-right .toolbar-btn.danger[aria-pressed="true"] {
      transform: translateY(0) scale(0.96);
      background: rgba(239, 68, 68, 0.22);
      border-color: rgba(239, 68, 68, 0.6);
      color: var(--danger);
      box-shadow: 0 1px 4px rgba(239, 68, 68, 0.25);
    }

    .toolbar-right .toolbar-btn.danger:focus-visible {
      outline: 2px solid var(--danger);
      outline-offset: 1px;
    }

    #btn-sync[aria-expanded="true"] {
      background-color: var(--accent);
      color: white;
    }

    .editor-toolbar {
      box-sizing: border-box;
      flex-shrink: 0;
      margin-left: 20px;
    }

    #btn-new {
      margin-left: auto;
    }

    .editor-toolbar:empty {
      display: none;
    }

    .search-area {
      width: 280px;
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .toolbar-left {
      display: flex;
      align-items: center;
      gap: 10px;
      flex: 1;
      min-width: 0;
    }

    .toolbar-left .page-title {
      font-size: 15px;
      font-weight: 700;
      color: var(--text-primary);
      letter-spacing: 0.2px;
    }

    .toolbar-right {
      margin-left: auto;
      display: flex;
      align-items: center;
      gap: 4px;
    }

    #btn-sync {
      padding: 6px 10px;
      height: 30px;
      box-sizing: border-box;
      gap: 6px;
      font-size: 12px;
      font-weight: 600;
    }

    #btn-sync #sync-status {
      font-size: 12px;
      font-weight: 600;
      color: inherit;
      background: transparent;
      border: none;
      border-radius: 0;
      padding: 0;
    }

    #btn-sync.syncing {
      color: var(--accent);
      pointer-events: none;
    }

    #btn-sync.syncing #sync-status::before {
      content: '';
      display: inline-block;
      width: 10px;
      height: 10px;
      margin-right: 6px;
      border: 2px solid currentColor;
      border-top-color: transparent;
      border-radius: 50%;
      vertical-align: -1px;
      animation: syncSpin 0.7s linear infinite;
    }

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

    #btn-sync.success { color: var(--success); }
    #btn-sync.error { color: var(--danger); }

    .search-box {
      padding: 6px 14px 6px 34px;
      height: 30px;
      box-sizing: border-box;
      border: 1px solid var(--border-light);
      border-radius: var(--radius-sm);
      font-size: 13px;
      width: 200px;
      transition: all var(--transition);
      background-color: var(--bg-hover);
      background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='M21 21l-4.35-4.35'/%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: 11px center;
      color: var(--text-primary);
      font-weight: 500;
    }

    .search-box::placeholder {
      color: var(--text-muted);
      font-weight: 400;
    }

    .search-box:focus {
      outline: none;
      border-color: var(--accent);
      background-color: white;
    }

    .editor-container {
      flex: 1;
      padding: 20px 28px 20px 20px;
      overflow: hidden;
      display: flex;
      flex-direction: column;
    }

    .note-list {
      background-color: var(--bg-card);
      border-radius: var(--radius-lg);
      box-shadow: var(--shadow-card);
      margin-bottom: 18px;
      overflow: hidden;
      border: 1px solid var(--border-light);
      transition: box-shadow var(--transition);
    }

    .note-list:hover {
      box-shadow: var(--shadow-md);
    }

    .note-item {
      padding: 14px 18px;
      border-bottom: 1px solid var(--border-light);
      cursor: pointer;
      display: flex;
      justify-content: space-between;
      align-items: center;
      transition: all var(--transition);
      position: relative;
      box-shadow: inset 4px 0 0 var(--tag-color, transparent);
    }

    .note-item:last-child {
      border-bottom: none;
    }

    .note-item:hover {
      background-color: var(--bg-hover);
      padding-left: 20px;
    }

    .note-item.active {
      background-color: var(--active-bg, var(--accent-light));
      box-shadow: 
        inset 4px 0 0 var(--active-border, var(--accent)),
        0 0 20px var(--active-glow, var(--accent-glow));
      padding-left: 20px;
    }

    .note-title {
      font-size: 14px;
      color: var(--text-primary);
      font-weight: 600;
      letter-spacing: 0.1px;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .note-time {
      font-size: 11px;
      color: var(--text-muted);
      font-variant-numeric: tabular-nums;
      font-weight: 500;
      background: var(--bg-hover);
      padding: 3px 8px;
      border-radius: var(--radius-full);
      transition: all var(--transition);
      flex-shrink: 0;
    }

    .note-item:hover .note-time {
      background: var(--border-light);
    }

    .editor-area {
      background-color: var(--bg-card);
      border-radius: var(--radius-lg);
      box-shadow: var(--shadow-card);
      padding: 28px 40px;
      min-height: 420px;
      border: 1px solid var(--border-light);
      transition: all var(--transition);
      position: relative;
      display: flex;
      flex-direction: column;
    }

    .editor-area::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      height: 3px;
      background: var(--gradient-accent);
      border-radius: var(--radius-lg) var(--radius-lg) 0 0;
      opacity: 0;
      transition: opacity var(--transition);
    }

    .editor-area:focus-within {
      box-shadow: var(--shadow-hover);
      border-color: var(--accent-soft);
    }

    .editor-area:focus-within::before {
      opacity: 1;
    }

    .editor-header {
      display: flex;
      align-items: center;
      gap: 14px;
      margin-bottom: 20px;
      padding-bottom: 18px;
      border-bottom: 1px solid var(--border-light);
      position: relative;
      max-width: 760px;
      width: 100%;
      margin-left: 0;
      margin-right: auto;
    }

    .tag-selector {
      display: flex;
      align-items: center;
      gap: 6px;
      padding: 6px 12px 6px 10px;
      border: 1px solid var(--border);
      border-radius: var(--radius-lg);
      font-size: 12px;
      color: var(--text-secondary);
      cursor: pointer;
      transition: all var(--transition);
      background: var(--bg-hover);
      font-weight: 500;
    }

    .tag-selector:hover {
      border-color: var(--accent);
      background: var(--accent-light);
      color: var(--accent);
      box-shadow: 0 0 12px var(--accent-glow);
    }

    .note-title-input {
      flex: 1;
      border: none;
      font-size: 26px;
      font-weight: 800;
      color: var(--text-primary);
      outline: none;
      background: none;
      letter-spacing: -0.4px;
    }

    .note-title-input::placeholder {
      color: var(--text-subtle);
      font-weight: 600;
    }

    .empty-state {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      height: 100%;
      color: var(--text-muted);
      gap: 6px;
      padding: 40px;
    }

    .empty-state svg {
      width: 64px;
      height: 64px;
      margin-bottom: 16px;
      opacity: 0.3;
      stroke: var(--accent);
      filter: drop-shadow(0 4px 12px rgba(79, 107, 237, 0.1));
    }

    .empty-state p {
      font-size: 15px;
      font-weight: 500;
      color: var(--text-secondary);
    }

    .empty-state .empty-hint {
      font-size: 13px;
      color: var(--text-muted);
      font-weight: 400;
      margin-top: 2px;
    }

    #sync-status {
      font-size: 12px;
      color: var(--text-secondary);
      margin-left: 8px;
      padding: 5px 12px;
      background: var(--bg-hover);
      border-radius: var(--radius-full);
      transition: all var(--transition);
      font-weight: 500;
    }

    .note-content {
      width: 100%;
      max-width: 760px;
      margin: 0 auto 0 0;
      flex: 1;
      min-height: 320px;
      border: none;
      font-size: 15px;
      line-height: 1.85;
      color: var(--text-primary);
      outline: none;
      resize: none;
      font-family: inherit;
      background: none;
      overflow-y: auto;
      word-wrap: break-word;
    }

    .note-content::placeholder {
      color: var(--text-subtle);
    }

    .note-meta-footer {
      width: 100%;
      margin: 16px 0 0 0;
      padding-top: 14px;
      display: flex;
      justify-content: flex-end;
      align-items: center;
      gap: 18px;
      font-size: 12px;
      color: var(--text-muted);
      font-variant-numeric: tabular-nums;
      flex-shrink: 0;
    }

    .note-meta-footer .note-meta-item {
      display: inline-flex;
      align-items: center;
      gap: 5px;
    }

    .note-meta-footer .note-meta-item svg {
      width: 13px;
      height: 13px;
      opacity: 0.7;
      flex-shrink: 0;
    }

    .note-meta-footer .note-meta-item .meta-label {
      color: var(--text-subtle);
      font-weight: 500;
    }

    .note-meta-footer .note-meta-item .meta-value {
      color: var(--text-secondary);
      font-weight: 500;
    }

    .note-content b, .note-content strong { font-weight: 700; }
    .note-content i, .note-content em { font-style: italic; }
    .note-content u { text-decoration: underline; }
    .note-content ul, .note-content ol {
      margin: 8px 0 8px 24px;
      padding: 0;
    }
    .note-content li { margin: 4px 0; }
    .note-content img {
      max-width: 100%;
      border-radius: var(--radius-sm);
      margin: 8px 0;
      box-shadow: var(--shadow-sm);
    }
    .note-content .todo-item {
      display: flex;
      align-items: center;
      gap: 10px;
      margin: 8px 0;
      cursor: pointer;
      padding: 6px 10px;
      border-radius: var(--radius-sm);
      transition: background var(--transition);
    }
    .note-content .todo-item:hover {
      background: var(--bg-hover);
    }
    .note-content .todo-item .todo-delete {
      display: none;
      margin-left: auto;
      width: 20px;
      height: 20px;
      border-radius: 50%;
      color: var(--text-muted);
      cursor: pointer;
      transition: all 0.15s;
      flex-shrink: 0;
      background: none;
      border: none;
      padding: 0;
      align-items: center;
      justify-content: center;
    }
    .note-content .todo-item .todo-delete svg {
      width: 14px;
      height: 14px;
      fill: currentColor;
    }
    .note-content .todo-item:hover .todo-delete {
      display: flex;
    }
    .note-content .todo-item .todo-delete:hover {
      color: var(--danger);
    }
    .note-content .todo-item input[type="checkbox"] {
      flex-shrink: 0;
      accent-color: var(--accent);
      cursor: pointer;
      width: 16px;
      height: 16px;
    }
    .note-content .todo-item > span {
      flex: 1;
      min-width: 0;
    }
    .note-content .todo-item.done > span {
      text-decoration: line-through;
      color: var(--text-muted);
      opacity: 0.6;
    }
    .note-content a {
      color: var(--accent);
      text-decoration: none;
      border-bottom: 1px solid var(--accent-soft);
      transition: all var(--transition);
    }
    .note-content a:hover {
      color: var(--accent-hover);
      border-bottom-color: var(--accent);
    }
    .note-content blockquote {
      border-left: 3px solid var(--accent-soft);
      padding: 4px 16px;
      margin: 12px 0;
      color: var(--text-secondary);
      background: var(--bg-hover);
      border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    }
    .note-content .attach-chip {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      padding: 5px 12px;
      background: var(--bg-hover);
      border: 1px solid var(--border);
      border-radius: var(--radius-full);
      font-size: 13px;
      margin: 4px 4px 4px 0;
      color: var(--text-secondary);
      text-decoration: none;
      transition: all var(--transition);
      font-weight: 500;
    }
    .note-content .attach-chip:hover {
      background: var(--accent-light);
      color: var(--accent);
      border-color: var(--accent-soft);
      box-shadow: 0 2px 8px var(--accent-glow);
      transform: translateY(-1px);
    }

    .dropdown-menu {
      position: absolute;
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      box-shadow: 
        var(--shadow-lg),
        0 0 0 1px rgba(15, 23, 42, 0.03);
      padding: 6px;
      z-index: 100;
      min-width: 130px;
      animation: dropdownIn 0.18s cubic-bezier(0.4, 0, 0.2, 1);
      backdrop-filter: blur(10px);
    }

    @keyframes dropdownIn {
      from { opacity: 0; transform: translateY(-6px) scale(0.98); }
      to { opacity: 1; transform: translateY(0) scale(1); }
    }

    .dropdown-menu .menu-item {
      padding: 8px 14px;
      font-size: 13px;
      color: var(--text-secondary);
      cursor: pointer;
      border-radius: var(--radius-sm);
      transition: all var(--transition);
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .dropdown-menu .menu-item:hover,
    .dropdown-menu .menu-item:focus-visible {
      background: var(--bg-focus);
      color: var(--text-primary);
    }

    .font-color-menu {
      padding: 10px 12px;
    }

    .color-grid {
      display: grid;
      grid-template-columns: repeat(5, 24px);
      gap: 6px;
    }

    .color-swatch {
      width: 24px;
      height: 24px;
      border-radius: 50%;
      cursor: pointer;
      border: 1.5px solid transparent;
      transition: all 0.15s;
      display: block;
    }

    .color-swatch:hover {
      border-color: var(--text-primary);
      transform: scale(1.2);
      box-shadow: 0 0 6px rgba(0,0,0,0.25);
    }

    .dropdown-menu .menu-item:hover {
      background: var(--accent-light);
      color: var(--accent);
    }

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

    .tag-actions {
      display: flex;
      align-items: center;
      gap: 2px;
      opacity: 0;
      transition: opacity var(--transition);
      flex-shrink: 0;
    }

    .tag-item:hover .tag-actions,
    .tag-item.active .tag-actions {
      opacity: 1;
    }

    .tag-act-btn {
      background: none;
      border: none;
      padding: 3px;
      border-radius: var(--radius-full);
      cursor: pointer;
      color: var(--text-muted);
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all var(--transition);
      width: 22px;
      height: 22px;
    }

    .tag-act-btn:hover {
      background: var(--bg-hover);
      color: var(--accent);
      transform: translateY(-1px);
    }

    .tag-act-btn.danger:hover {
      background: #fce8e6;
      color: #d93025;
    }

    .tag-act-btn svg {
      width: 12px;
      height: 12px;
    }

    .tag-dropdown {
      position: absolute;
      top: 100%;
      left: 0;
      margin-top: 6px;
      background: var(--bg-card);
      border: 1px solid var(--border);
      border-radius: var(--radius-md);
      box-shadow: 
        var(--shadow-lg),
        0 0 0 1px rgba(15, 23, 42, 0.03);
      padding: 6px;
      z-index: 50;
      min-width: 160px;
      animation: dropdownIn 0.18s cubic-bezier(0.4, 0, 0.2, 1);
      backdrop-filter: blur(10px);
    }

    .tag-dropdown .menu-item {
      padding: 7px 12px;
      font-size: 13px;
      color: var(--text-secondary);
      cursor: pointer;
      border-radius: var(--radius-sm);
      transition: all var(--transition);
      display: flex;
      align-items: center;
      gap: 8px;
    }

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

    .note-list-wrap {
      display: flex;
      gap: 20px;
      align-items: stretch;
      flex: 1;
      min-height: 0;
    }

    .note-list-wrap .note-list {
      flex: 0 0 280px;
      margin-bottom: 0;
      overflow-y: auto;
      min-height: 0;
      position: relative;
    }

    .note-list-wrap .editor-area {
      flex: 1;
      margin-bottom: 0;
      overflow-y: auto;
      min-height: 0;
    }

    .note-content:empty::before {
      content: attr(data-placeholder);
      color: var(--text-subtle);
      pointer-events: none;
      font-style: italic;
      opacity: 0.7;
    }

    .note-item-meta {
      display: flex;
      flex-direction: column;
      gap: 4px;
      min-width: 0;
      flex: 1;
    }

    .note-item-preview {
      font-size: 12px;
      color: var(--text-muted);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      line-height: 1.4;
    }

    .note-item-tag {
      display: inline-flex;
      align-items: center;
      gap: 5px;
      font-size: 11px;
      color: var(--text-muted);
      margin-top: 3px;
      background: var(--bg-hover);
      padding: 2px 8px;
      border-radius: var(--radius-full);
      transition: all var(--transition);
    }

    .note-item:hover .note-item-tag {
      background: var(--border-light);
    }

    .note-item-tag .tag-color {
      width: 7px;
      height: 7px;
    }

    .empty-list-hint {
      padding: 32px 20px;
      text-align: center;
      color: var(--text-muted);
      font-size: 13px;
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 8px;
    }

    .empty-list-hint::before {
      content: '🔍';
      font-size: 28px;
      opacity: 0.4;
    }

    .calendar-day.has-note {
      position: relative;
    }
    .calendar-day.has-note::after {
      content: '';
      position: absolute;
      bottom: 4px;
      left: 50%;
      transform: translateX(-50%);
      width: 4px;
      height: 4px;
      border-radius: 50%;
      background: var(--accent);
      box-shadow: 0 0 4px var(--accent-glow);
    }
    .calendar-day.today.has-note::after {
      background: var(--accent);
    }
    .calendar-day.selected.has-note::after {
      background: rgba(255, 255, 255, 0.9);
      box-shadow: 0 0 4px rgba(255, 255, 255, 0.5);
    }

    .count-badge {
      font-size: 11px;
      color: var(--text-muted);
      background: var(--bg-hover);
      padding: 2px 8px;
      border-radius: var(--radius-full);
      font-weight: 600;
      font-variant-numeric: tabular-nums;
      min-width: 20px;
      text-align: center;
      transition: all var(--transition);
      flex-shrink: 0;
    }

    .tag-item:hover .count-badge {
      background: var(--border-light);
      color: var(--text-secondary);
    }

    .tag-item.active .count-badge {
      background: var(--accent);
      color: white;
    }




    .modal-overlay {
      position: fixed;
      inset: 0;
      background: rgba(15, 23, 42, 0.5);
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
      z-index: 200;
      display: flex;
      align-items: center;
      justify-content: center;
      animation: modalFadeIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    }

    @keyframes modalFadeIn {
      from { opacity: 0; }
      to { opacity: 1; }
    }

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

    .modal-dialog {
      background: var(--bg-card);
      border-radius: var(--radius-lg);
      box-shadow: 
        0 24px 80px rgba(15, 23, 42, 0.25),
        0 0 0 1px rgba(15, 23, 42, 0.05);
      padding: 30px 32px 26px;
      min-width: 380px;
      max-width: 440px;
      animation: modalSlideIn 0.28s cubic-bezier(0.4, 0, 0.2, 1);
      text-align: center;
    }

    .modal-icon {
      width: 56px;
      height: 56px;
      margin: 0 auto 14px;
      border-radius: var(--radius-full);
      display: flex;
      align-items: center;
      justify-content: center;
      background: var(--accent-light);
      color: var(--accent);
    }

    .modal-icon-danger {
      background: rgba(239, 68, 68, 0.12);
      color: var(--danger);
      animation: iconPulse 1.8s ease-in-out infinite;
    }

    @keyframes iconPulse {
      0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.35); }
      50% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    }

    .modal-icon svg {
      width: 28px;
      height: 28px;
    }

    .modal-title {
      font-size: 17px;
      font-weight: 700;
      color: var(--text-primary);
      margin-bottom: 8px;
    }

    .modal-body {
      font-size: 14px;
      color: var(--text-secondary);
      line-height: 1.6;
      margin-bottom: 20px;
      white-space: pre-wrap;
    }

    .modal-input {
      width: 100%;
      padding: 10px 14px;
      border: 1.5px solid var(--border);
      border-radius: var(--radius-md);
      font-size: 14px;
      color: var(--text-primary);
      outline: none;
      transition: all var(--transition);
      margin-bottom: 22px;
      font-family: inherit;
      background: var(--bg-hover);
    }

    .modal-input:focus {
      border-color: var(--accent);
      background: white;
    }

    .modal-actions {
      display: flex;
      justify-content: center;
      gap: 12px;
    }

    .modal-btn {
      padding: 10px 24px;
      border-radius: var(--radius-md);
      font-size: 14px;
      font-weight: 600;
      cursor: pointer;
      border: none;
      transition: all var(--transition);
      font-family: inherit;
      position: relative;
      min-width: 96px;
    }

    .modal-btn-cancel {
      background: var(--bg-hover);
      color: var(--text-secondary);
    }

    .modal-btn-cancel:hover {
      background: var(--border);
      color: var(--text-primary);
    }

    .modal-btn-primary {
      background: var(--gradient-accent);
      color: white;
      box-shadow: 
        0 4px 12px var(--accent-glow-lg),
        0 1px 3px var(--accent-glow);
    }

    .modal-btn-primary:hover {
      box-shadow: 
        0 6px 20px var(--accent-glow-xl),
        0 2px 6px var(--accent-glow);
      transform: translateY(-2px);
    }

    .modal-btn-danger {
      background: var(--danger-gradient);
      color: white;
      box-shadow: 
        0 4px 12px var(--danger-glow),
        0 1px 3px rgba(239, 68, 68, 0.2);
    }

    .modal-btn-danger:hover {
      background: linear-gradient(135deg, var(--danger-hover) 0%, var(--danger-dark) 100%);
      box-shadow: 
        0 6px 20px var(--danger-glow-lg),
        0 2px 6px rgba(239, 68, 68, 0.25);
      transform: translateY(-2px);
    }

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

    .color-picker {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      margin-bottom: 22px;
    }

    .color-swatch {
      width: 28px;
      height: 28px;
      border-radius: 50%;
      cursor: pointer;
      border: 2px solid transparent;
      transition: all var(--transition);
      box-shadow: 0 1px 3px rgba(15, 23, 42, 0.15);
      flex-shrink: 0;
    }

    .color-swatch:hover {
      transform: scale(1.12);
    }

    .color-swatch.selected {
      border-color: white;
      box-shadow: 0 0 0 2px var(--accent), 0 2px 6px rgba(15, 23, 42, 0.2);
    }
