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

/* Define variables from tech-specs.md */
:root {
  /* 主色调 - 平静蓝 */
  --primary: #4A90E2;
  --primary-light: #7BB3F1;
  --primary-dark: #2E5B8A;
  
  /* 功能色 */
  --fact: #5BC0DE;      /* 事实 - 蓝色 */
  --interpretation: #F0AD4E; /* 解读 - 橙色 */
  --insight: #5CB85C;   /* 洞察 - 绿色 */
  --action: #9B59B6;    /* 行动 - 紫色 */
  
  /* 情绪色彩 */
  --emotion-positive: #2ECC71;
  --emotion-negative: #E74C3C;
  --emotion-neutral: #95A5A6;
  
  /* 基础色 */
  --background: #FFFFFF;
  --surface: #F8F9FA;
  --text: #2C3E50;
  --text-secondary: #7F8C8D;
  --border: #E9ECEF;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--background);
    color: var(--text);
    line-height: 1.6;
}

#app {
    max-width: 800px;
    margin: 0 auto;
    padding: 0.5rem;
}

/* Basic component styles */
.button {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
}

.button:hover {
    background-color: var(--primary-dark);
}

.card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Header Styles */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: center;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.app-header h1 {
    margin: 0;
    font-size: 1.3rem;
}

/* Navigation Styles */
.app-nav {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.nav-link {
    text-decoration: none;
    color: var(--text-secondary);
    padding: 0.5rem;
    border-radius: 5px;
    transition: all 0.2s ease-in-out;
}

.nav-link:hover {
    background-color: var(--surface);
    color: var(--text);
}

.nav-link.active {
    background-color: var(--primary);
    color: white;
}

/* Entry Form Styles */
.entry-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.entry-textarea {
    width: 100%;
    min-height: 80px;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid var(--border);
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
}

.emotion-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.emotion-button {
    background: none;
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.emotion-button:hover {
    transform: scale(1.1);
}

.emotion-button.selected {
    background-color: var(--primary-light);
    border-color: var(--primary);
}

.button-primary {
    background-color: var(--primary);
    color: white;
    padding: 12px 20px;
    align-self: flex-end;
}

/* Entries List Styles */
.todays-entries h2 {
    margin-bottom: 0.5rem;
}

.entry-item {
    padding: 0.5rem;
}

.entry-item-content {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.entry-item-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.date-header {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid var(--border);
    color: var(--primary-dark);
}

/* Calendar Heatmap Styles */
.cal-heatmap-container, #cal-heatmap {
    width: 100%;
    overflow: visible;
}

#cal-heatmap .graph-rect {
    width: 12px;
    height: 12px;
    rx: 2;
    ry: 2;
    fill: var(--surface);
    stroke: var(--background);
    stroke-width: 1px;
}

#cal-heatmap .q1 { fill: #cce5ff; }
#cal-heatmap .q2 { fill: #99ccff; }
#cal-heatmap .q3 { fill: #66b2ff; }
#cal-heatmap .q4 { fill: #3399ff; }
#cal-heatmap .q5 { fill: #007fff; }

#selected-day-entries {
    margin-top: 1.5rem;
}

/* Make entry links block-level and remove underline */
.entry-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* Reflection View Styles */
.reflection-view {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.original-entry {
    background-color: var(--primary-light);
}

.reflection-controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.reflection-item {
    border-left: 4px solid var(--primary);
}

.reflection-question {
    font-weight: bold;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.history-view h2 {
    margin-bottom: 20px;
}

/* =================================
   Reflection View (New Mockup Styles)
   ================================= */

.reflection-view .back-link {
    display: inline-block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 1em;
}

.reflection-view .back-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.reflection-view .original-entry {
    background-color: #fff;
    border: 1px solid #f0f0f0;
    border-left: 5px solid var(--primary-color);
    margin-bottom: 0 !important;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
}

.reflection-view .original-entry p {
    font-size: 1.05em;
    line-height: 1.6;
}

/* Reflection History "Folder" Container */
.reflection-history {
    background-color: #fff;
    border-left: 1px solid #f0f0f0;
    border-right: 1px solid #f0f0f0;
    box-shadow: none;
    margin-bottom: 0 !important;
    display: flex;
    flex-direction: column;
    border-radius: 0;
    padding-left: 1.5em;
}

/* Individual item inside the "Folder" - Final Compact Layout */
.reflection-history-item {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 6px 10px;
    border-left: 4px solid #ccc;
    border-bottom: 1px solid #f0f0f0;
    gap: 6px;
}

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

.reflection-item-main {
    flex: 1;
    padding-right: 10px;
    display: flex;
    align-items: flex-start;
}

.reflection-history-item-type {
    font-weight: 600;
    font-size: 1em;
    white-space: nowrap;
    margin-right: 8px;
}

.reflection-history-item-time {
    font-size: 0.8em;
    color: var(--text-secondary);
    white-space: nowrap;
    display: inline-block;
    text-align: right;
}



.reflection-history-item-content {
    margin: 0;
    line-height: 1.5;
    font-size: 0.95em;
    color: #444;
    word-break: break-word;
    white-space: pre-wrap;
}

/* New Reflection Input Form - Final Compact Layout */
.new-reflection-form {
    background-color: #fff;
    padding: 8px;
    border: 1px solid #f0f0f0;
    border-top: none;
    border-radius: 0 0 6px 6px;
}

.reflection-prompts {
    margin-bottom: 0.5rem;
    font-size: 0.75em;
    color: #888;
    line-height: 1.3;
}

.reflection-prompts ul {
    list-style-type: none;
    padding-left: 0;
    margin: 0.5rem 0 0;
}

.reflection-prompts li {
    position: relative;
    padding-left: 1em;
    margin-bottom: 0.15rem;
}

.reflection-prompts li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: #aaa;
    font-weight: normal;
}

#new-reflection-content {
    width: 100%;
    min-height: 100px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px;
    font-size: 1em;
    line-height: 1.5;
    resize: vertical;
    margin-bottom: 0.5rem;
}

#new-reflection-content:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

.new-reflection-form .reflection-type-selector {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.new-reflection-form .type-button {
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    background-color: transparent;
    border: 1px solid;
}

.new-reflection-form .type-button.selected {
    color: #fff !important;
    transform: scale(1.05);
}

#save-reflection-btn {
    width: 100%;
    padding: 12px;
    font-size: 1.1em;
}

/* =================================
   Main View (Homepage) Styles
   ================================= */

.main-view {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Quick Entry Form Styles */
.quick-entry-form {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.form-header {
    padding: 1rem 1rem 0.5rem;
    border-bottom: 1px solid var(--border);
    background: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--text);
    font-weight: 600;
}

.form-date {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.entry-input-section {
    padding: 1rem;
}

.emotion-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 0.75rem;
}

.emotion-button {
    background: none;
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.emotion-button:hover {
    transform: scale(1.1);
}

.emotion-button.selected {
    background-color: var(--primary-light);
    border-color: var(--primary);
}



.form-actions {
    padding: 0 1rem 1rem;
}

.form-actions .button {
    width: 100%;
    font-size: 1rem;
    font-weight: 500;
}



/* Today's Entries Section */
.todays-entries-section {
    margin-top: 0.5rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid var(--border);
}

.section-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
}

.entry-count {
    font-size: 0.8rem;
    color: var(--text-secondary);
    background-color: var(--surface);
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    border: 1px solid var(--border);
}

/* Today's Entries List - Compact Style */
.entries-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.entry-link-wrapper {
    text-decoration: none;
    color: inherit;
    display: block;
}

.compact-entry-item {
    background-color: #ffffff;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.entry-link-wrapper:hover .compact-entry-item {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.1);
    transform: translateY(-1px);
}

.entry-main-content {
    padding: 0.6rem;
}

.entry-header-inline {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.4rem;
}

.entry-text {
    font-size: 0.95rem;
    line-height: 1.4;
    color: var(--text);
    font-weight: 500;
    flex: 1;
    white-space: pre-wrap;
}

.entry-time {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
    margin-top: 0.1rem;
}

.entry-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.entry-emotions {
    font-size: 0.95rem;
}

.entry-status-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.entry-status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.entry-status-indicator.pending {
    background-color: #ffd700;
}

.entry-status-indicator.reflected {
    background-color: #10b981;
}

.entry-status {
    font-size: 0.75rem;
}

.status-badge {
    padding: 0.15rem 0.4rem;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 500;
}

.status-badge.pending {
    background-color: #fef3c7;
    color: #d97706;
}

.status-badge.reflected {
    background-color: #d1fae5;
    color: #059669;
}

/* Inline Reflections */
.reflections-section {
    margin-bottom: 0.5rem;
    padding-left: 0.8rem;
    border-left: 3px solid #e5e7eb;
}

.inline-reflection {
    margin-bottom: 0.3rem;
    line-height: 1.3;
}

.inline-reflection:last-child {
    margin-bottom: 0;
}

.reflection-type {
    font-weight: 600;
    font-size: 0.85rem;
}

.reflection-content {
    font-size: 0.85rem;
    color: var(--text);
    margin-left: 0.2rem;
    white-space: pre-wrap;
}



/* Empty State */
.empty-state {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-secondary);
}

.empty-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.empty-message {
    font-size: 1rem;
    margin: 0 0 0.3rem;
    color: var(--text);
}

.empty-subtitle {
    font-size: 0.85rem;
    margin: 0;
    color: var(--text-secondary);
}

/* =================================
   History View Styles
   ================================= */

.history-view {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.history-header {
    margin-bottom: 0.5rem;
}

.history-header h2 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text);
}

.calendar-section {
    background-color: #ffffff;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 0.5rem;
}

.history-entries-section {
    margin-top: 0.5rem;
}

/* History Entry Item Styles */
.history-entry-item {
    background-color: #ffffff;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    transition: all 0.2s ease;
}

.entry-link-wrapper:hover .history-entry-item {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.1);
    transform: translateY(-1px);
}

.entry-date-sidebar {
    background-color: var(--surface);
    border-right: 1px solid var(--border);
    padding: 0.6rem;
    min-width: 4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.entry-date {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
    line-height: 1.2;
    margin-bottom: 0.2rem;
}

.history-entry-item .entry-time {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.history-entry-item .entry-main-content {
    flex: 1;
    padding: 0.6rem;
}

.history-entry-item .entry-text {
    font-size: 0.95rem;
    line-height: 1.4;
    color: var(--text);
    margin-bottom: 0.4rem;
    font-weight: 500;
    white-space: pre-wrap;
}

.history-entry-item .entry-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.history-entry-item .entry-emotions {
    font-size: 0.95rem;
}

.history-entry-item .reflections-section {
    margin-bottom: 0;
}

/* History Entry Highlighting */
.history-entry-item.highlighted {
    background-color: #fff9e6;
    border-color: #f5a623;
    box-shadow: 0 2px 8px rgba(245, 166, 35, 0.15);
}

.entry-link-wrapper:hover .history-entry-item.highlighted {
    background-color: #fff6d9;
    border-color: #e8941c;
    box-shadow: 0 3px 12px rgba(245, 166, 35, 0.25);
}

.history-entry-item.highlighted .entry-date-sidebar {
    background-color: #f5a623;
    color: #ffffff;
}

.history-entry-item.highlighted .entry-date-sidebar .entry-date,
.history-entry-item.highlighted .entry-date-sidebar .entry-time {
    color: #ffffff;
}

/* Entry Count Enhancements */
.entry-count {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.total-count {
    font-size: 0.8rem;
    color: var(--text-secondary);
    background-color: var(--surface);
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.highlight-indicator {
    font-size: 0.75rem;
    color: #f5a623;
    background-color: #fff9e6;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    border: 1px solid #f5a623;
    font-weight: 500;
}

/* =================================
   Settings Page Styles
   ================================= */

.settings-view {
    max-width: 600px;
    margin: 0 auto;
}

.settings-header {
    text-align: center;
    margin-bottom: 1rem;
}

.settings-header h2 {
    color: var(--text);
    margin: 0;
}

.settings-section {
    margin-bottom: 1.5rem;
}

.settings-section h3 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    color: var(--primary-dark);
    font-size: 1.1rem;
}

.settings-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.settings-description a {
    color: var(--primary);
    text-decoration: none;
}

.settings-description a:hover {
    text-decoration: underline;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
    color: var(--text);
}

.form-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.9rem;
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.1);
}

.sync-status {
    margin: 0.75rem 0;
    padding: 0.5rem;
    background-color: var(--surface);
    border-radius: 4px;
    border-left: 3px solid var(--border);
}

.sync-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.form-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

.button-secondary {
    background-color: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
}

.button-secondary:hover {
    background-color: var(--border);
    color: var(--text);
}

.button-danger {
    background-color: #dc3545;
    color: white;
    border: 1px solid #dc3545;
}

.button-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

.sync-operations {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.sync-button {
    flex: 1;
    min-width: 140px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
}

.sync-button:disabled {
    background-color: var(--border);
    color: var(--text-secondary);
    cursor: not-allowed;
}

.sync-status-info {
    padding: 0.75rem;
    border-radius: 4px;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.sync-status-info.info {
    background-color: #e3f2fd;
    border-left: 4px solid #2196f3;
    color: #1565c0;
}

.sync-status-info.success {
    background-color: #e8f5e8;
    border-left: 4px solid #4caf50;
    color: #2e7d32;
}

.sync-status-info.error {
    background-color: #ffebee;
    border-left: 4px solid #f44336;
    color: #c62828;
}

.data-operations {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.data-operations .button {
    flex: 1;
    min-width: 120px;
}

.button-warning {
    background-color: #f39c12;
    color: white;
    border: 1px solid #f39c12;
}

.button-warning:hover {
    background-color: #e67e22;
    border-color: #d35400;
}

.database-operations {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.database-operations .button {
    flex: 1;
    min-width: 160px;
}

.about-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

/* Global Mobile Optimizations */
@media (max-width: 768px) {
    /* Header optimizations */
    .app-header {
        text-align: center;
        padding: 0.75rem 0.5rem;
    }
    
    .app-header h1 {
        font-size: 1.2rem;
        margin-bottom: 0.5rem;
    }
    
    .app-nav {
        gap: 0.25rem;
        padding: 0 0.5rem;
    }
    
    .nav-link {
        padding: 0.4rem 0.6rem;
        font-size: 0.9rem;
        border-radius: 4px;
    }
    
    /* General card and button optimizations */
    .card {
        margin: 0.5rem;
        padding: 0.75rem;
    }
    
    .button {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    
    /* Settings page optimizations */
    .settings-view {
        padding: 0 0.5rem;
    }
    
    .form-actions {
        justify-content: stretch;
        gap: 0.5rem;
    }
    
    .form-actions .button {
        flex: 1;
    }
    
    .sync-operations {
        flex-direction: column;
    }
    
    .sync-button {
        min-width: auto;
    }
    
    .data-operations {
        flex-direction: column;
    }
}

/* =================================
   Discoveries Page Styles
   ================================= */

.discoveries-view {
    max-width: 800px;
    margin: 0 auto;
}

.discoveries-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.discoveries-header h2 {
    color: var(--text);
    margin: 0 0 0.5rem;
}

.discoveries-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

/* Discovery Actions Header */
.discovery-actions-header {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.discovery-actions-header .button {
    font-size: 0.9rem;
    padding: 0.6rem 1rem;
    flex: 1;
    max-width: 200px;
}

/* Discoveries Sections */
.discoveries-section {
    margin-bottom: 1.5rem;
}

.discoveries-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--border);
}

.discoveries-section h3 {
    margin: 0;
    color: var(--primary-dark);
}

.discovery-count {
    font-size: 0.8rem;
    color: var(--text-secondary);
    background-color: var(--surface);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.discoveries-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Discovery Cards */
.discovery-card {
    background-color: #ffffff;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.75rem;
    transition: all 0.2s ease;
}

.discovery-card:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.1);
}

.discovery-card.major {
    border-left: 4px solid #f5a623;
    background: linear-gradient(to right, #fffbf0, #ffffff);
}

.discovery-card.general {
    border-left: 4px solid var(--primary);
}

.discovery-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.discovery-left {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    flex: 1;
}

.discovery-right {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    flex-shrink: 0;
}

.discovery-icon {
    font-size: 1.2rem;
    margin-top: 0.1rem;
    flex-shrink: 0;
}

.discovery-title-wrapper {
    position: relative;
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    flex: 1;
}

.discovery-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
    line-height: 1.3;
}

.discovery-title .empty-title {
    color: var(--text-secondary);
    font-style: italic;
    font-weight: 400;
}

.discovery-title-edit {
    font-size: 1rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--primary);
    border-radius: 4px;
    background-color: white;
    width: 100%;
    margin: 0 0 0.25rem;
}

.discovery-title-edit:focus {
    outline: none;
    border-color: var(--primary-dark);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.1);
}

.discovery-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
}

.discovery-actions {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.action-btn {
    background: none;
    border: none;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.action-btn:hover {
    background-color: var(--surface);
}

.discovery-content-wrapper {
    margin-bottom: 0.5rem;
}

.discovery-content {
    color: var(--text);
    line-height: 1.5;
    font-size: 0.9rem;
}

.discovery-content-edit {
    width: 100%;
    min-height: 80px;
    padding: 0.5rem;
    border: 1px solid var(--primary);
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.5;
    resize: vertical;
}

.discovery-content-edit:focus {
    outline: none;
    border-color: var(--primary-dark);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.1);
}

.discovery-tags-wrapper {
    margin-bottom: 0;
}

.discovery-tags-display {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.discovery-tags-display.empty {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-style: italic;
}

.discovery-tags-edit {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--primary);
    border-radius: 4px;
    font-size: 0.85rem;
}

.discovery-tags-edit:focus {
    outline: none;
    border-color: var(--primary-dark);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.1);
}

.discovery-tag {
    background-color: var(--primary);
    color: white;
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-weight: 500;
}

.discovery-related {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.related-entry-link {
    display: inline-block;
    font-size: 0.75rem;
    color: var(--primary);
    text-decoration: none;
    padding: 0.2rem 0.5rem;
    border: 1px solid var(--primary);
    border-radius: 12px;
    margin-left: 0.25rem;
    transition: all 0.2s ease;
}

.related-entry-link:hover {
    background-color: var(--primary);
    color: white;
    text-decoration: none;
}

/* Inline Edit Styles */
.discovery-type-wrapper {
    margin-bottom: 0.5rem;
}

.discovery-type-selector-inline {
    display: flex;
    gap: 1rem;
    padding: 0.5rem;
    background-color: var(--surface);
    border-radius: 4px;
    border: 1px solid var(--border);
}

.discovery-type-selector-inline .type-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.discovery-type-selector-inline .type-option input[type="radio"] {
    margin: 0;
}

.discovery-type-selector-inline .type-label {
    font-size: 0.85rem;
    font-weight: 500;
}

/* Hidden state for inline editing */
.hidden {
    display: none !important;
}

/* Modal Styles for Extract Dialog */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal-content {
    background-color: white;
    border-radius: 8px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    margin: 0;
    color: var(--text);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--text);
}

.modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    max-height: calc(80vh - 80px);
}

.extract-entries-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.extract-entry-item {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1rem;
    background-color: var(--surface);
}

.entry-summary {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.entry-summary .entry-content {
    flex: 1;
    font-weight: 500;
    color: var(--text);
}

.entry-summary .entry-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-left: 1rem;
}

.entry-reflections {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.entry-reflections .reflection-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 4px;
    background-color: white;
    border: 1px solid var(--border);
}

.entry-reflections .reflection-type {
    font-weight: 600;
    font-size: 0.8rem;
    white-space: nowrap;
}

.entry-reflections .reflection-content {
    flex: 1;
    font-size: 0.85rem;
    line-height: 1.4;
}

.extract-reflection-btn {
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    white-space: nowrap;
}

.extract-reflection-btn:hover {
    background-color: var(--primary-dark);
}

/* Empty State */
.empty-discoveries {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-secondary);
}

.empty-discoveries .empty-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.empty-discoveries .empty-message {
    font-size: 1rem;
    margin: 0 0 0.25rem;
    color: var(--text);
}

.empty-discoveries .empty-subtitle {
    font-size: 0.85rem;
    margin: 0;
}



/* Mobile responsiveness for discoveries */
@media (max-width: 768px) {
    .discoveries-view {
        padding: 0 0.5rem;
    }
    
    .discoveries-header {
        text-align: center;
        margin-bottom: 1rem;
    }
    
    .discoveries-header h2 {
        font-size: 1.5rem;
        margin: 0 0 0.5rem;
    }
    
    .discoveries-subtitle {
        font-size: 0.85rem;
    }
    
    .discovery-actions-header {
        flex-direction: row;
        gap: 0.5rem;
        align-items: center;
        margin-bottom: 1rem;
        justify-content: center;
    }
    
    .discovery-actions-header .button {
        flex: 1;
        max-width: 180px;
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
    }
    
    .discoveries-section {
        margin-bottom: 1rem;
    }
    
    .discoveries-section .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
        margin-bottom: 0.5rem;
    }
    
    .discoveries-section h3 {
        font-size: 1.1rem;
    }
    
    .discovery-count {
        align-self: flex-start;
    }
    
    .discovery-card {
        padding: 0.5rem;
        margin-bottom: 0.5rem;
        border-radius: 4px;
    }
    
    .discovery-header {
        flex-direction: column;
        gap: 0.5rem;
        margin-bottom: 0.5rem;
    }
    
    .discovery-left {
        gap: 0.5rem;
        width: 100%;
    }
    
    .discovery-right {
        width: 100%;
        justify-content: space-between;
        align-items: center;
        flex-direction: row;
        gap: 0.5rem;
    }
    
    .discovery-title {
        font-size: 0.95rem;
        line-height: 1.4;
    }
    
    .discovery-content {
        font-size: 0.85rem;
        line-height: 1.4;
    }
    
    .discovery-date {
        font-size: 0.75rem;
    }
    
    .discovery-actions {
        flex-direction: row;
        gap: 0.25rem;
        flex-wrap: wrap;
    }
    
    .action-btn {
        font-size: 0.8rem;
        padding: 0.3rem 0.5rem;
        min-width: 32px;
        height: 32px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .discovery-type-selector-inline {
        flex-direction: row;
        gap: 0.5rem;
        flex-wrap: wrap;
    }
    
    .discovery-type-selector-inline .type-option {
        flex: 1;
        min-width: 60px;
    }
    
    .discovery-type-selector-inline .type-label {
        font-size: 0.8rem;
        padding: 0.3rem 0.5rem;
    }
    
    .discovery-tags-display {
        gap: 0.25rem;
    }
    
    .discovery-tag {
        font-size: 0.7rem;
        padding: 0.15rem 0.4rem;
    }
    
    .related-entry-link {
        font-size: 0.7rem;
        padding: 0.15rem 0.4rem;
    }
    
    .modal-content {
        margin: 0.5rem;
        max-height: 90vh;
        padding: 1rem;
    }
    
    .entry-summary {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .entry-summary .entry-date {
        margin-left: 0;
        font-size: 0.8rem;
    }
    
    .entry-reflections .reflection-item {
        margin-bottom: 0.5rem;
        padding: 0.5rem;
    }
    
    .extract-discovery-btn,
    .extract-action-btn {
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
        min-width: auto;
    }
}

/* Discovery indicator for entries */
.discovery-indicator {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 32px;
    justify-content: center;
    text-decoration: none;
}

/* Action indicator for entries */
.action-indicator {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 32px;
    justify-content: center;
    text-decoration: none;
}

.discovery-indicator:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
    color: white;
}

.action-indicator:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(240, 147, 251, 0.4);
    color: white;
}

.discovery-indicator .discovery-icon {
    font-size: 14px;
}

.discovery-indicator .discovery-count {
    font-size: 11px;
    font-weight: 600;
    min-width: 14px;
    text-align: center;
}

.action-indicator .action-icon {
    font-size: 14px;
}

.action-indicator .action-count {
    font-size: 11px;
    font-weight: 600;
    min-width: 14px;
    text-align: center;
}

/* History page discovery indicator positioning */
.history-discovery {
    margin-top: 4px;
}

/* History page action indicator positioning */
.history-action {
    margin-top: 4px;
}

/* Reflection page discovery indicator positioning */
.reflection-discovery {
    margin-left: 8px;
    flex-shrink: 0;
}

/* Reflection page action indicator positioning */
.reflection-action {
    margin-left: 8px;
    flex-shrink: 0;
}

/* Reflection item meta container */
.reflection-item-meta {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    width: 100%;
    align-self: flex-end;
}

.reflection-item-meta-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.reflection-item-meta-actions .discovery-indicator,
.reflection-item-meta-actions .action-indicator {
    padding: 2px 6px;
    font-size: 10px;
    min-width: auto;
    border-radius: 10px;
}

.reflection-item-meta-actions .discovery-icon,
.reflection-item-meta-actions .action-icon {
    font-size: 12px;
}

.reflection-item-meta-actions .discovery-count,
.reflection-item-meta-actions .action-count {
    font-size: 10px;
}

/* Discovery card highlight animation */
.discovery-card.highlight {
    animation: highlightPulse 2s ease-out;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.6);
}

/* Action card highlight animation */
.action-card.highlight {
    animation: actionHighlightPulse 2s ease-out;
    box-shadow: 0 0 20px rgba(240, 147, 251, 0.6);
}

@keyframes highlightPulse {
    0% {
        background-color: rgba(102, 126, 234, 0.2);
        transform: scale(1.02);
    }
    50% {
        background-color: rgba(102, 126, 234, 0.1);
        transform: scale(1.01);
    }
    100% {
        background-color: transparent;
        transform: scale(1);
    }
}

@keyframes actionHighlightPulse {
    0% {
        background-color: rgba(240, 147, 251, 0.2);
        transform: scale(1.02);
    }
    50% {
        background-color: rgba(240, 147, 251, 0.1);
        transform: scale(1.01);
    }
    100% {
        background-color: transparent;
        transform: scale(1);
    }
}

/* ===== ACTIONS PAGE STYLES ===== */

.actions-view {
    max-width: 800px;
    margin: 0 auto;
}

.actions-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.actions-header h2 {
    color: var(--text);
    margin: 0 0 0.5rem;
}

.actions-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0;
}

.action-actions-header {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.action-actions-header .button {
    font-size: 0.9rem;
    padding: 0.6rem 1rem;
    flex: 1;
    max-width: 200px;
}

.actions-section {
    margin-bottom: 1.5rem;
}

.actions-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--border);
}

.actions-section h3 {
    margin: 0;
    color: var(--primary-dark);
}

.action-count {
    font-size: 0.8rem;
    color: var(--text-secondary);
    background-color: var(--surface);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.actions-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.action-card {
    background-color: #ffffff;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.75rem;
    transition: all 0.2s ease;
}

.action-card:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.1);
}

.action-card.pending {
    border-left: 4px solid #ffc107;
}

.action-card.in-progress {
    border-left: 4px solid #007bff;
}

.action-card.completed {
    border-left: 4px solid #28a745;
    background-color: #f8fff9;
}

.action-card.long-term {
    border-left: 4px solid #6f42c1;
}

.action-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.action-left {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.action-right {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    flex-shrink: 0;
}

.action-status-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.action-title-wrapper {
    flex: 1;
    min-width: 0;
}

.action-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin: 0;
    line-height: 1.3;
}

.action-title .empty-title {
    color: var(--text-secondary);
    font-style: italic;
    font-weight: 400;
}

.action-title-edit {
    font-size: 1rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--primary);
    border-radius: 4px;
    background-color: white;
    width: 100%;
    margin: 0 0 0.25rem;
}

.action-title-edit:focus {
    outline: none;
    border-color: var(--primary-dark);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.1);
}

.action-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.action-due-date {
    font-size: 0.8rem;
    color: #dc3545;
    background-color: #fff5f5;
    padding: 2px 6px;
    border-radius: 4px;
    flex-shrink: 0;
}

.action-priority {
    display: flex;
    align-items: center;
}

.priority-icon {
    font-size: 1rem;
    cursor: help;
}

.action-related {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.related-entry-link {
    font-size: 0.8rem;
    color: var(--primary);
    text-decoration: none;
    background-color: var(--primary-light);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--primary);
}

.related-entry-link:hover {
    background-color: var(--primary);
    color: white;
    text-decoration: none;
}

.action-actions {
    display: flex;
    gap: 0.25rem;
}

.action-btn {
    background: none;
    border: none;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.action-btn:hover {
    background-color: var(--surface);
}

.action-content-wrapper {
    margin-bottom: 0.5rem;
}

.action-content {
    color: var(--text);
    line-height: 1.5;
    font-size: 0.9rem;
}

.action-content .empty-content {
    color: var(--text-secondary);
    font-style: italic;
}

.action-content-edit {
    width: 100%;
    min-height: 80px;
    padding: 0.5rem;
    border: 1px solid var(--primary);
    border-radius: 4px;
    background-color: white;
    font-family: inherit;
    font-size: 0.9rem;
    line-height: 1.5;
    resize: vertical;
}

.action-content-edit:focus {
    outline: none;
    border-color: var(--primary-dark);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.1);
}

.action-controls-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.action-status-selector {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.action-priority-selector {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.status-option,
.priority-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    transition: all 0.2s;
}

.status-option:hover,
.priority-option:hover {
    background-color: var(--surface);
    border-color: var(--primary);
}

.status-option input[type="radio"],
.priority-option input[type="radio"] {
    margin-right: 0.5rem;
}

.status-label,
.priority-label {
    font-size: 0.9rem;
    color: var(--text);
}

.action-due-date-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.action-due-date-wrapper label {
    font-size: 0.9rem;
    color: var(--text);
}

.action-due-date-edit {
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.9rem;
}

.action-due-date-edit:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

/* Empty State for Actions */
.empty-actions {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--text-secondary);
}

.empty-actions .empty-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.empty-actions .empty-message {
    font-size: 1rem;
    margin: 0 0 0.25rem;
    color: var(--text);
}

.empty-actions .empty-subtitle {
    font-size: 0.85rem;
    margin: 0;
}

/* 标签功能样式 */
.tag-selector-block { margin-top: 12px; }
.tag-selector-header { font-size: 13px; color: #555; margin-bottom:4px; display:flex; gap:8px; align-items:center; }
.no-tags-tip { font-size:12px; color:#4A90E2; text-decoration:underline; }
.tag-selector { display:flex; flex-wrap:wrap; gap:6px; }
.tag-pill { padding:4px 10px; background:#f1f3f5; border:1px solid #d0d5da; border-radius:16px; font-size:12px; cursor:pointer; transition:.15s; }
.tag-pill.active { background:#4A90E2; color:#fff; border-color:#4A90E2; }
.tag-pill:hover { background:#e2e6ea; }

/* 历史过滤条 */
.tag-filter-bar { margin-top:12px; border:1px solid #e2e2e2; background:#fafafa; padding:8px 12px; border-radius:8px; }
.tag-filter-inner { display:flex; flex-wrap:wrap; align-items:center; gap:8px; }
.filter-label { font-size:12px; color:#555; }
.filter-tags { display:flex; flex-wrap:wrap; gap:6px; }
.filter-tag-btn { padding:4px 10px; background:#f5f5f5; border:1px solid #ddd; border-radius:14px; font-size:12px; cursor:pointer; }
.filter-tag-btn.active { background:#357abd; color:#fff; border-color:#357abd; }
.filter-clear-btn { background:#fff; border:1px solid #ccc; padding:4px 10px; border-radius:14px; font-size:12px; cursor:pointer; }
.filter-clear-btn:hover { background:#f1f1f1; }

/* 设置页标签管理 */
.tag-management { display:flex; flex-direction:column; gap:12px; }
.tag-list { display:flex; flex-wrap:wrap; gap:8px; }
.tag-chip { background:#f0f4f8; border:1px solid #d4d9de; padding:4px 8px; border-radius:16px; font-size:12px; display:inline-flex; align-items:center; gap:4px; }
.tag-chip .tag-remove { background:transparent; border:none; cursor:pointer; font-size:12px; line-height:1; color:#666; padding:0 2px; }
.tag-chip .tag-remove:hover { color:#e74c3c; }
.tag-empty { font-size:12px; color:#888; }
.tag-editor { display:flex; gap:8px; }
.tag-editor input { flex:1; }
.tag-tips { font-size:11px; color:#777; }

/* 记录与列表中的标签展示 */
.entry-tags { margin-top:4px; display:flex; flex-wrap:wrap; gap:4px; }
.entry-tag { background:#eef3f8; color:#4a5b6a; border:1px solid #d2dae2; padding:2px 6px; border-radius:12px; font-size:11px; }

/* 让标签在 entry-meta 下显示支持 */
.compact-entry-item .entry-meta, .history-entry-item .entry-meta { flex-wrap:wrap; }

/* 反思页标签编辑 */
.entry-tags-row { display:flex; align-items:center; gap:12px; margin-top:6px; flex-wrap:wrap; }
.tiny-btn { padding:4px 8px; font-size:12px; }
.tag-edit-panel { margin-top:10px; border:1px solid #e0e5ea; background:#f9fbfc; padding:10px; border-radius:6px; }
.tag-edit-panel.hidden { display:none; }
.tag-edit-existing { display:flex; flex-wrap:wrap; gap:6px; margin-bottom:8px; }
.tag-edit-chip { padding:4px 10px; background:#f1f4f6; border:1px solid #ccd3d9; border-radius:14px; font-size:12px; cursor:pointer; }
.tag-edit-chip.active { background:#4A90E2; color:#fff; border-color:#4A90E2; }
.tag-edit-add-row { display:flex; gap:8px; margin-bottom:8px; }
.tag-edit-add-row input { flex:1; }
.tag-edit-actions { display:flex; gap:8px; }
.no-tags { font-size:12px; color:#777; }
